Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detect End of Video Playback in Web Page

Is there a widely supported video playback technology for web pages that provides an event/hook that can be captured from Javascript when playback reaches the end of the stream?

My goal is to provide a web page that plays a video and then asks the user a question about the video once playback is complete. The question would be hidden or disabled until they have actually viewed the video.

like image 204
Eric J. Avatar asked May 19 '10 23:05

Eric J.


2 Answers

html5 video has an onended attribute

video.onended = function(e) {
  // do stuff
}

you can fallback to the JW flash player that has an api

like image 119
Galen Avatar answered Sep 28 '22 16:09

Galen


I know that JWPlayer can fire a Javascript event when playback has completed.

Source: http://developer.longtailvideo.com/trac/wiki/Player5Events

like image 42
Mitch Dempsey Avatar answered Sep 28 '22 15:09

Mitch Dempsey