HTML5 track subtitles and property cue and ActiveCue is empty in IE (internet explorer)

899 views Asked by At

I try to add subtitles to audio track. All browsers is work fine, but not IE10 and less. This is my code:

<audio preload="none" class="js-audio">
  <source src="TRACK_SRC" type="audio/mp4">
  <track kind="captions" src="SUBTITLES_SRC.vtt" srclang="se" default />
</audio>

Then i try to get some cues from this track:

var trackIE = $('track')[0];
var textTrack = trackIE.track;
textTrack.mode = 'hidden';
var cues = textTrack.cues;

In IE I get empty object. Please, help me with this problem.

1

There are 1 answers

3
Ian Devlin On

For IE you need to set up the MIME type otherwise it ignores VTT completely.

Add the following to a .htaccess file in the same directory as your HTML file:

AddType text/vtt .vtt