Quantcast
Channel: Internet Explorer Web Development forum
Viewing all articles
Browse latest Browse all 3527

Why can't I add a new VTTCue to a TextTrack I created via JavaScript?

$
0
0

I have this structure       

    <audio id='my-audio-element' preload="metadata" crossorigin="anonymous">
     <track id="my-track-element" label="My Audio Track" kind="metadata" src="..." srclang="en" default />
    </audio>

I have the following;

    var audioElement = document.getElementById('my-audio-element');
    var syntheticTextTrack = audioElement.addTextTrack('metadata', 'synthetic', 'en');

when I do;
    var textTrackCue = new window.TextTrackCue(1, 2, 'test');
    textTrack.addCue(textTrackCue);

that succeeds with no issues, but if I do;
    var textTrackCue = new window.VTTCue(1, 2, 'test');
    textTrack.addCue(textTrackCue);

that fails with
    Invalid Cue


This is on Windows 8.1 with IE11

Viewing all articles
Browse latest Browse all 3527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>