8000 fix: emsg ie11 test failures · videojs/mux.js@528e9ed · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Commit 528e9ed

Browse files
committed
fix: emsg ie11 test failures
1 parent a8146c7 commit 528e9ed

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

lib/mp4/emsg.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
const { getUint64 } = require('../utils/numbers.js');
2+
13
var uint8ToCString = require('../utils/string.js').uint8ToCString;
24

35
/**
@@ -40,7 +42,7 @@ var parseEmsgBox = function(boxData) {
4042
var dv = new DataView(boxData.buffer);
4143
timescale = dv.getUint32(offset);
4244
offset += 4;
43-
presentation_time = Number(dv.getBigUint64(offset));
45+
presentation_time = getUint64(boxData.subarray(offset));
4446
offset += 8;
4547
event_duration = dv.getUint32(offset);
4648
offset += 4;

test/mp4-probe.test.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ QUnit.test('can get ID3 data from a v0 EMSG box', function(assert) {
151151
);
152152

153153
var v0EmsgId3Data = mp4Helpers.generateEmsgBoxData(0, id3Data);
154-
var emsgId3Box = new Uint8Array(box('emsg', Array.from(v0EmsgId3Data)));
154+
var emsgId3Box = new Uint8Array(box('emsg', [].slice.call(v0EmsgId3Data)));
155155
var emsgBoxes = probe.getEmsgID3(emsgId3Box, 10);
156156
assert.equal(emsgBoxes[0].cueTime, 20, 'got correct emsg cueTime value from v0 emsg');
157157
assert.equal(emsgBoxes[0].duration, 0, 'got correct emsg duration value from v0 emsg');
@@ -169,7 +169,7 @@ QUnit.test('can get ID3 data from a v1 EMSG box', function(assert) {
169169
);
170170

171171
var v1EmsgId3Data = mp4Helpers.generateEmsgBoxData(1, id3Data);
172-
var emsgId3Box = new Uint8Array(box('emsg', Array.from(v1EmsgId3Data)));
172+
var emsgId3Box = new Uint8Array(box('emsg', [].slice.call(v1EmsgId3Data)));
173173
var emsgBoxes = probe.getEmsgID3(emsgId3Box);
174174
assert.equal(emsgBoxes[0].cueTime, 100, 'got correct emsg cueTime value from v1 emsg');
175175
assert.equal(emsgBoxes[0].duration, 0.01, 'got correct emsg duration value from v1 emsg');
@@ -192,10 +192,10 @@ QUnit.test('can get ID3 data from multiple EMSG boxes', function(assert) {
192192
);
193193

194194
var v1EmsgId3Data = mp4Helpers.generateEmsgBoxData(1, v1id3Data);
195-
var v1emsgId3Box = new Uint8Array(box('emsg', Array.from(v1EmsgId3Data)));
195+
var v1emsgId3Box = new Uint8Array(box('emsg', [].slice.call(v1EmsgId3Data)));
196196

197197
var v0EmsgId3Data = mp4Helpers.generateEmsgBoxData(0, v0id3Data);
198-
var v0emsgId3Box = new Uint8Array(box('emsg', Array.from(v0EmsgId3Data)));
198+
var v0emsgId3Box = new Uint8Array(box('emsg', [].slice.call(v0EmsgId3Data)));
199199

200200
var multiBoxData = new Uint8Array(v1emsgId3Box.length + v0emsgId3Box.length);
201201
multiBoxData.set(v1emsgId3Box);

0 commit comments

Comments
 (0)
0