开发者

Detect End of Video Playback in Web Page

开发者 https://www.devze.com 2022-12-30 18:17 出处:网络
Is there 开发者_StackOverflowa 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?

Is there 开发者_StackOverflowa 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.


html5 video has an onended attribute

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

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


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

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

0

精彩评论

暂无评论...
验证码 换一张
取 消