Subtitles for with , how to display the subtitles

I’ve tested this out without jquery — as taylor-newton mentioned, you’ll need to create a tag for your text to appear in.

document.getElementById('my-audio-player').textTracks[0].addEventListener('cuechange', function() {
    document.getElementById('my-subtitle-display').innerText = this.activeCues[0].text;
});

This does work with subtitles from audio tags too and using kind="subtitles" in your track tag works with audio as well.

Leave a Comment

tech