metastream
metastream copied to clipboard
External subtitle support
It would be nice to add .srt or other subtitle formats as soft subtitles via external direct urls.
Ideally I'd like to outsource these kinds of features to a web video player that supports this already. Do you know of any that do support the feature you're requesting?
Well I'm not that very aware how these things works but usually jwplayer supports this kind of subtitles right?
I was about to create a new issue for this feature request, then I found this one. So I will list my thoughts here!
Currently (in HTML5), video tag supports subtitles in modern browsers through track tag, and maybe supporting modern browsers is quite enough for this feature which would keep the implementation simple and native.
I tried it with a local HTML, video, and .srt files. And it worked! I did clone the repo but seems like it will take me some time to get to know the codebase. So, I thought about sharing my idea here at a glance.
Here is my suggestion on how it can be achieved:
- A new
ButtonListItem
labelled "Load Subtitle", in theMoreButton
- Clicking it asks for SRT file (file input)
- Parse the SRT, convert it to WebVTT (done here and here, and seems to be very few string manipulations and prepending)
- Convert/Encode the WebVTT file to data URL (sample online tool)
- Locate the
<video>
tag (which obviously already happening in the app) - Append to children
<track>
tag with the subtitle data URL insrc
attribute<track default kind="subtitle" src="VTT_DATA_URL" />
Looking forward to what you think! @samuelmaddock
any hack for now?
any hack for now?
I use this extension for now https://chrome.google.com/webstore/detail/substital-add-subtitles-t/kkkbiiikppgjdiebcabomlbidfodipjg?hl=en