How to get position change events in Javascript for <video> in Mobile Safari?

I want to execute a JavaScript function every second, or whenever the time position changes on a Mobile Safari video player during playback.

Is there an event listener or some way of achieving this? I see how to do it on-demand here:

  • ended event videojs not working
  • Change HTML5 video’s quality from JavaScript
  • HTML5 video in portrait in fullscreen mode in cordova app is stretched on Android devices
  • how to make getUserMedia() work on all browsers
  • How to prevent event bubbling when clicking on HTML5 video controls in Firefox
  • Is it possible to play HTML5 video in reverse?
  • In Safari for iPad, how can I get the current video position via Javascript?

    However, I’m looking for a way to fire the function automatically instead of requiring user interaction to trigger getting the position. Can this be done?

  • HTML5 Video in ajax call
  • volume off does not work in html5 video ipad 2
  • Unable to change source of video tag via JavaScript on IE9
  • Autoplay HTML5 audio/video in iOS5
  • Accessing HTML 5 Video Progress Event with jQuery
  • how to make getUserMedia() work on all browsers
  • One Solution collect form web for “How to get position change events in Javascript for <video> in Mobile Safari?”

    There’s a ton of events you can hook into with HTML5 video. Not all will be supported by every browser, but Mobile Safari should do a pretty good job with what you need for this, which is the “timeupdate” event.

    video.addEventListener('timeupdate', function() {
      console.log('video time: ' + video.currentTime);
    });
    

    You can see a demonstrator for the events here:
    http://www.w3.org/2010/05/video/mediaevents.html