Currently I'm using the new iframe API to embed a YouTube video inside the uiwebview on the iPad and I've been able to make it auto play without user interactions. In the iframe API it is described how to use the onstatechange event but in my application it doesn't seem to work and unfortunately I can't see any debug in uiwebview.
I just want to able able to detect when the video ends, have you got any advice on it? Has anyone got it to work?
It may be connected with autoplay-policy in your browser (it's disabled by default in mobile browsers).
If your browser is chrome you can start it with additional commandline flag
--autoplay-policy=no-user-gesture-required
- it worked for me.Have you tried (from the documentation) to assign an integer to the event of a movie ending?:
So, something like:
To detect when the video ends then the video has the state of 0 or YT.PlayerState.ENDED
Here's a link to jsfiddle a link!
you need to make use of JavaScript for that.
Refer this link : https://developers.google.com/youtube/js_api_reference
May this http://code.google.com/apis/youtube/js_api_reference.html#SubscribingEvents can help you