Capturing a "play video" event in Android WebView

in my android app i have a WebView with basic browsing features. My problem is that I want to get a notification somehow if the user starts playing the flash movie. I tried installing WebViewClient in my web browser and tracking the urls in the onLoadResource method, but it does not work. My question is this: is it possible to catch such an event, and if so, how?

Thanks.

+6
source share
1 answer

wv.setOnTouchListener (new View.OnTouchListener () {

  public boolean onTouch(View v, MotionEvent event) { WebView.HitTestResult hr = ((WebView)v).getHitTestResult(); return false; } }); 

Would it not be possible to detect a click on the video play button using the html element id? In onTouchListener

How is the video displayed? instant playback or a button to start playback?

+1
source

Source: https://habr.com/ru/post/956250/


All Articles