0

I would like to ask if there is a way to dynamically add styling cues with the addTextTrack API. Something along the lines of:

 tempTrack.addCue(new VTTCue((sentence.data.start / 1000).toFixed(3), (sentence.data.end / 1000).toFixed(3), `<c.red.background-yellow>${sentence.data.text}</c>`));

but instead of passing in some text for the subtitle, passing in a styling cue? But not using predefined ::cue classes.

What I want to do is have a user select any color, for background or text color, and then pass that into the textTrack dynamically.

I would be grateful for any tips.

  • You can also manipulate css style definitions with javascript. Maybe this would be your way to go? – Marcel Aug 07 '23 at 12:16

0 Answers0