Don't expose metadata tracks to old video.js
Feature detect support for addTextTrack so HLS remains functional with older video.js versions.
Showing
1 changed file
with
6 additions
and
0 deletions
... | @@ -81,6 +81,12 @@ videojs.Hls.prototype.src = function(src) { | ... | @@ -81,6 +81,12 @@ videojs.Hls.prototype.src = function(src) { |
81 | metadataStream = tech.segmentParser_.metadataStream, | 81 | metadataStream = tech.segmentParser_.metadataStream, |
82 | textTrack; | 82 | textTrack; |
83 | 83 | ||
84 | // only expose metadata tracks to video.js versions that support | ||
85 | // dynamic text tracks (4.12+) | ||
86 | if (!tech.player().addTextTrack) { | ||
87 | return; | ||
88 | } | ||
89 | |||
84 | metadataStream.on('data', function(metadata) { | 90 | metadataStream.on('data', function(metadata) { |
85 | var i, frame, time, hexDigit; | 91 | var i, frame, time, hexDigit; |
86 | 92 | ... | ... |
-
Please register or sign in to post a comment