3 ms·
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 proj
by grenoire 10y ago
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!"
- danielsamuels 10y agoOr just use a `<track kind="subtitles">` and reference a vtt file?
- fridek 10y agoWhich is a format you need to convert to rather than use existing srt or anything else really.
- kuschku 10y agoWhich 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.
- vdnkh 10y agoMuch 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!