I would like to manipulate the pseudo element: "::cue" through jquery. Let's say that I have a video like this:
<video id="my_video">
<source src="my_video.mp4" type="video/mp4">
<track src="my_subtitles.vtt" kind="subtitles" srclang="en" label="English">
</video>
How can I dynamically change the color of its subtitles with jquery?
I tried this:
$('#my_video::cue').css({
'color': '#ff0000 !important'
});
But it is not working. The only thing I got working was:
$('#captions_style').remove();
$('head').append(
'<style id="captions_style">#my_video::cue{color: #ff0000 !important}</style>'
);
But I find this not elegant. Is there any other way?
Thanks & best regards Josef