inBandMetadataDispatchType should use capital hex digits
The standard specifies uppercase ASCII hex digits should be used for MPEG2 text track dispatch types.
Showing
2 changed files
with
4 additions
and
4 deletions
... | @@ -97,9 +97,9 @@ videojs.Hls.prototype.src = function(src) { | ... | @@ -97,9 +97,9 @@ videojs.Hls.prototype.src = function(src) { |
97 | 97 | ||
98 | // build the dispatch type from the stream descriptor | 98 | // build the dispatch type from the stream descriptor |
99 | // https://html.spec.whatwg.org/multipage/embedded-content.html#steps-to-expose-a-media-resource-specific-text-track | 99 | // https://html.spec.whatwg.org/multipage/embedded-content.html#steps-to-expose-a-media-resource-specific-text-track |
100 | textTrack.inBandMetadataTrackDispatchType = videojs.Hls.SegmentParser.STREAM_TYPES.metadata.toString(16); | 100 | textTrack.inBandMetadataTrackDispatchType = videojs.Hls.SegmentParser.STREAM_TYPES.metadata.toString(16).toUpperCase(); |
101 | for (i = 0; i < metadataStream.descriptor.length; i++) { | 101 | for (i = 0; i < metadataStream.descriptor.length; i++) { |
102 | hexDigit = ('00' + metadataStream.descriptor[i].toString(16)).slice(-2); | 102 | hexDigit = ('00' + metadataStream.descriptor[i].toString(16).toUpperCase()).slice(-2); |
103 | textTrack.inBandMetadataTrackDispatchType += hexDigit; | 103 | textTrack.inBandMetadataTrackDispatchType += hexDigit; |
104 | } | 104 | } |
105 | } | 105 | } | ... | ... |
... | @@ -927,7 +927,7 @@ test('exposes in-band metadata events as cues', function() { | ... | @@ -927,7 +927,7 @@ test('exposes in-band metadata events as cues', function() { |
927 | player.hls.segmentParser_.parseSegmentBinaryData = function() { | 927 | player.hls.segmentParser_.parseSegmentBinaryData = function() { |
928 | // fake out a descriptor | 928 | // fake out a descriptor |
929 | player.hls.segmentParser_.metadataStream.descriptor = new Uint8Array([ | 929 | player.hls.segmentParser_.metadataStream.descriptor = new Uint8Array([ |
930 | 1, 2, 3 | 930 | 1, 2, 3, 0xbb |
931 | ]); | 931 | ]); |
932 | // trigger a metadata event | 932 | // trigger a metadata event |
933 | player.hls.segmentParser_.metadataStream.trigger('data', { | 933 | player.hls.segmentParser_.metadataStream.trigger('data', { |
... | @@ -949,7 +949,7 @@ test('exposes in-band metadata events as cues', function() { | ... | @@ -949,7 +949,7 @@ test('exposes in-band metadata events as cues', function() { |
949 | equal(player.textTracks().length, 1, 'created a text track'); | 949 | equal(player.textTracks().length, 1, 'created a text track'); |
950 | track = player.textTracks()[0]; | 950 | track = player.textTracks()[0]; |
951 | equal(track.kind, 'metadata', 'kind is metadata'); | 951 | equal(track.kind, 'metadata', 'kind is metadata'); |
952 | equal(track.inBandMetadataTrackDispatchType, '15010203', 'set the dispatch type'); | 952 | equal(track.inBandMetadataTrackDispatchType, '15010203BB', 'set the dispatch type'); |
953 | equal(track.cues.length, 2, 'created two cues'); | 953 | equal(track.cues.length, 2, 'created two cues'); |
954 | equal(track.cues[0].startTime, 2, 'cue starts at 2 seconds'); | 954 | equal(track.cues[0].startTime, 2, 'cue starts at 2 seconds'); |
955 | equal(track.cues[0].endTime, 2, 'cue ends at 2 seconds'); | 955 | equal(track.cues[0].endTime, 2, 'cue ends at 2 seconds'); | ... | ... |
-
Please register or sign in to post a comment