Eric J.
Eric J.

Reputation: 150208

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.

Upvotes: 5

Views: 11532

Answers (2)

Galen
Galen

Reputation: 30170

html5 video has an onended attribute

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

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

Upvotes: 12

Mitch Dempsey
Mitch Dempsey

Reputation: 39939

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

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

Upvotes: 1

Related Questions