Android HTML5 video is not shutdown after destroyi

2020-07-29 09:17发布

问题:

I've got an issue with WebView on Android 3.1 and higher. I have a WebView with the <video> tag in my activity and it plays without any problems. When the activity onDestroy() is called I'm calling destroy() on the WebView to stop the video. Everything works fine.

The issue occurs when I press play, then switch into fullscreen, exit fullscreen and press play again. Then I destroy the Activity and WebView, but the video is still running—why?

I call the callback from onShowCustomView(View view, CustomViewCallback callback) when I return from fullscreen.

The video sound stops when I open the same or other video.

How can I shutdown everything when I'm done with the current Activity?

回答1:

Loading blank page when destroying activity works.