Skip to content

Commit

Permalink
Merge pull request #25 from tmm1/caption-fix-rebase
Browse files Browse the repository at this point in the history
Fix caption integration
  • Loading branch information
mrbar42 authored May 8, 2017
2 parents e065694 + 936c731 commit 664847d
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.apply(tech, arguments)
}
}

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

0 comments on commit 664847d

Please sign in to comment.