Detection of the end of video playback in a 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 the video, and then asks the user a question about the video after the playback ends. The question will be hidden or disabled until they watch the video.

+5
source share
2 answers

html5 video has a built-in attribute

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

you can go back to jw player which has api

+12
source

All Articles