Re:A Simple Explanation: VLC.js
by grenoire on Tuesday December 06, 2016 @06:00AM
(#13113706)
You can even get subtitles on top of HTML5 videos with simple positioned elements with text shadows for borders. I can't say I understand the motive of the project either, other than "see, everything can be done in JavaScript!"
[ Parent
| on HN ]
Much harder than it sounds if you care about live streaming, video playlists, and cross-browser support. Don't forget to mention the 3 big subtitles formats (608/708/VTT) and some smaller ones (SRT/DFXP).
Also, here's a fun quirk of the subtitles track element: you cannot remove a track once added.
Another obstacle for full FCC compliance: styling. You must allow users to style your captions. Captions are put in the shadow DOM - Firefox does not allow you to style the shadow dom.
Don't forget to add IE into the mix!
Re:A Simple Explanation: VLC.js
by danielsamuels on Tuesday December 06, 2016 @06:40AM
(#13113862)
Or just use a `<track kind="subtitles">` and reference a vtt file?
Which doesn't allow SRT subtitles, or XML subtitles (hello German public broadcasters!), or ASS subtitles (hello anime fandub groups!)
Doing this natively in JS via canvas allows you exactly that - rendering these things natively, in real time, with all the support for rare features you could ever need.