Other B4A: stopping webview video

drgottjr

Expert
Licensed User
Longtime User
i normally use vitamio to watch videos from my playlist. sometimes it's not worth the effort or even possible to know the url of a given stream, so if i have the url of a site that has something i want to stream, i simply load the site's url into a webview and let the site to the work. essentially no problem watching.

the problem comes if i want to stop the stream. with vitamio i just stop it (i hit the back key and consume the touch by stopping vitamio). with the webview, i hit the back key but i can't seem to kill the webview. i tried loading "about:blank" to force the webview away from the stream. i even tried removing the view from the activity. it just keeps playing the stream!

full disclosure: the webview video player does have a little pause button, and if i remember to touch it, the stream will, in fact, stop. i can then hit the back key, resetting the webview's visibility and continue with either vitamio streams or more webview streams. (whether or not the webview is still there i don't care; at least it's not visible and making noise.) but if i forget to touch the video player's little pause button, i basically lose control of the app since i can't stop the stream.

so i need either:
1) to know if the pause button has been touched and not allow myself to leave the webview until it has.
2) a way to cause the pause button to be touched (presumably from jsinterface) when i hit the back key.
3) a simple way to kill the webview (and its connection). i would have thought that removing the view from the activity would have been enough to tear everything down. but the video keeps on playing.

I was following some older links in the forum about video issues with webview and a reference to webviewsettings v2, but the link to that library doesn't work. so i don't know if that library might help me to exercise some control over the webview's video features.

thanks in advance for any suggestions.

-go
 
Top