I have a string like this
var subtitle = `WEBVTT
00:01.000 --> 00:04.000
- Never drink liquid nitrogen.
00:05.000 --> 00:09.000
- It will perforate your stomach.
- You could die.`
Now i want to dynamically load it to VideoJS from that variable without request to WebVTT file.
How to do this or it impossible? Thanks
You can add it as a data uri:
player.addRemoteTextTrack({
src: `data:text/vtt;base64,${btoa(subtitle)}`,
kind: 'subtitles',
srclang: 'en'
});