O
O
Oleg Dolgih2014-02-07 11:54:24
Android
Oleg Dolgih, 2014-02-07 11:54:24

How to stop audio playback in WebView?

The problem is this, I load the video into a WebView, and minimize it (or close it, or switch to another activity), and the sound continues to play. In onStop() I call webView.stopLoading(), but the part of the video that had time to load produces sound. Tried calling webView.onDestroy() but doesn't help. Loading a blank page in onStop()/onPause() doesn't work either, since I'm restoring the previous state of the webView (webView.restoreState()).

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
snackovich, 2014-02-10
@olegvarmy

try to remove the WebView from the activity (layout.remove(webview)),
or even better, move the playback from WebView to VideoView
HTML5 version of the player on androids is not very stable.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question