This sounds user-friendly.
> insight into video events
If "insight" means "tracking", this sounds very user-friendly.
I personally would like advertisers and content producers to know at which point it is that users tend to bail on watching their video, or will click through to the content. That might allow business users to receive useful feedback and actually optimize their funnel, instead of wasting my time with a shotgun, best guess approach.
What about a slideshow which has a video of the speaker, and changes the slides for particular timestamps.
At the moment you'll have to detect the playback event and just hope that the video is playing back at the "correct" speed, and change the slides based on a JavaScript clock.
While that works most of the time, it isn't what I'd describe as reliable.
Alternatives exist, like making the slides part of the video too, but now text cannot be copied out, links cannot be clicked, and so on...
[1] https://developer.mozilla.org/en-US/docs/Web/Events/timeupda...
[2] https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaEl...
Edit: Added links for quick reference.
- Does the pause event fire?
- Does the seeking event fire? Or does it only fire when you move the mouse to drag the thumb to a new time?
- Does the seekend event fire? Does it fire every time you move the thumb to a new position without releasing the mouse button? Or does it only fire when you release the mouse button?
- Does the timeupdate event fire? Does it fire once? Or repeatedly for the same position where the thumb is?
Every browser has different answers.
As for the timeupdate event, it only fires once every 250ms, which is painfully slow for applications that need to synchronize something with the video (slides, subtitles, etc.)
And even if you decided to ignore all the events and write a requestAnimationFrame-powered loop to query only the changes in the currentTime property, there's a bug in Chrome on Android where the video.currentTime property becomes out-of-sync with the video if any long-running JS or complicated animation blocks the event loop for a few seconds - https://code.google.com/p/chromium/issues/detail?id=509010
Sure, if you just want to play your free videos from a site where each page is basically just a wrapper around the video element, and you don’t need any configuration for quality settings and the like, then custom control and events might not be particularly interesting. However, HTML5 media elements should let us do much more than that.
Are you going to tell me view counters are evil too?
In case of hls.js used by the NYT, you actually need to transmux the mpeg-ts content used in HLS into fMP4 to make it playable by the Media Source Extensions API used by the browsers.