I'm trying to see if I need to import a VTT parser or if it's possible for me to get HTML from <track src="transcript.vtt" />
. It seems like the browser support exists already for parsing HTML to show atop a video but I can't find a way to access it outside of a video.
how could I achieve something like this:
<div>
<random-video-player></random-video-player>
<track src="transcript.vtt" />
<div id="transcript" >
// show my VTT cues
</div>
</div>
@ViewChild('track') track: HTMLTrackElement;
track.cues.foreach(cue => {
var cueHtmlSpecial = addSpecialAttributes(cue);
document.getElementById("transcript").appendChild(cueHtmlSpecial)
});
I found a package that more or less should work as I need but wondered if a package was actually necessary. https://github.com/plussub/srt-vtt-parser