cprcrack / VideoEnabledWebView

Android's WebView and WebChromeClient class extensions that enable fully working HTML5 video support
MIT License
1.05k stars 289 forks source link

Javascript notifyVideoEnd #1

Closed kminhtri closed 9 years ago

kminhtri commented 10 years ago

Hi,

I really like your lib to play video in full screen (like youtube, vimeo or dailymotion !!!).

But when my videos ended, they didn't close... I try to put some Log.d in the function "notifyVideoEnd" in the Javascript Interface, but it's never call :(

It's a problem from the Javascript set in the WebView or the JavascriptInterface?

Thanks a lot for your answer and your work ! :)

cprcrack commented 10 years ago

Have you checked the Common issues check-list, specially the last point? https://github.com/cprcrack/VideoEnabledWebView#common-issues-check-list

Try to put something like an alert('hi') in the injected Javascript code to verify if the injection is working okay. If it's working, put another alert to verify if the ended event is being fired in the Javascript side.

kminhtri commented 10 years ago

In deed, my first alert has been call (at the begin of the javascript) but the second in the listener of the ended video hasn't been called :'(

Edit : "var _ytrp_html5_video = document.getElementsByTagName('video')[0];" return undefined, find the problem :p

Edit2 : it seems that my video Player (Dailymotion) use flash :'(

But I try with Youtube now to see!