Skip to content

Commit

Permalink
Fix caption integration
Browse files Browse the repository at this point in the history
  • Loading branch information
Will Kelleher authored and tmm1 committed May 2, 2017
1 parent 1ca2fc1 commit 3e06426
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/videojs5.hlsjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,18 @@ function Html5HlsJS(source, tech) {
});
});

// Intercept native TextTrack calls and route to video.js directly only
// if native text tracks are not supported on this browser.
if (!tech.featuresNativeTextTracks) {
Object.defineProperty(el, 'textTracks', {
value: tech.textTracks,
writable: false
});
el.addTextTrack = function() {
return tech.addTextTrack(arguments);
}
}

// attach hlsjs to videotag
hls.attachMedia(el);
hls.loadSource(source.src);
Expand Down

0 comments on commit 3e06426

Please sign in to comment.