Is there a way of detecting when a Youtube Video has finished playing from JavaScript?
log("video is playing"); //DO SOMETHING... } You can use the . paused() method in javascript to check whether a video is playing or not. It will return true if the video is playing and return false if the video is not playing.
Normal use of YouTube involves use of nonfree software. In the HTML5 mode, it involves running a nonfree JavaScript program. For some videos, it also requires the nonfree Adobe DRM software that has been incorporated into proprietary browsers and Firefox, but not into the GNU browsers including IceCat.
The IFrame player API lets you embed a YouTube video player on your website and control the player using JavaScript. Using the API's JavaScript functions, you can queue videos for playback; play, pause, or stop those videos; adjust the player volume; or retrieve information about the video being played.
Sure can - using the javascript API for youtube
You should be able listen to the onStateChange event.
Check out the API Reference
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With