Android WebView not stopping after user presses back

后端 未结 6 1710
傲寒
傲寒 2021-01-31 03:18

I am playing a YouTube video inside a WebView. I am able to play it, but when the person leaves the screen, I am not able to stop the audio from playing.

I tried various

6条回答
  •  孤独总比滥情好
    2021-01-31 03:49

    You should call:

    webView.loadUrl("about:blank");
    

    It will destroy all audio/video as well as Javasript objects and stop all running functions on webview

提交回复
热议问题