Web view audio dispose

mrazamerchant

Member
Licensed User
Longtime User
Hi,

I have a webview in which I am calling a html page from a website. Webpage has jwplayer with audio & video stream. Everything works well but when I click the back button on device the audio is still playing and then when I reopen the webview, another instance of audio starts.

So the question is, how to dispose the webview when user clicks on back button on device?
 

warwound

Expert
Licensed User
Longtime User
Try loading a blank web page into the WebView when you need to force it to unload the jwplayer:

B4X:
MyWebView.LoadHtml("<html><head></head><body></body></html>")

You could do that in Activity_Pause i think - no need to listen for the Back button being pressed.

Martin.
 
Upvote 0

dian

Member
Licensed User
Longtime User
jwplayer

Hi,

I have a webview in which I am calling a html page from a website. Webpage has jwplayer with audio & video stream. Everything works well but when I click the back button on device the audio is still playing and then when I reopen the webview, another instance of audio starts.

So the question is, how to dispose the webview when user clicks on back button on device?

hi mrazamerchant, wouldyou please share your webview code for openning html with jwplayer, thanks in advance.
 
Upvote 0
Top