Skip to content

Commit

Permalink
Revert "Use wrapper function"
Browse files Browse the repository at this point in the history
This reverts commit 2306a46.
  • Loading branch information
John Bartos committed Jun 15, 2018
1 parent 3630bf9 commit 9b5d520
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/remux/mp4-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
*/

// import Hex from '../utils/hex';
import { makeArrayFromArrayLike } from '../utils/make-array-from-array-like';

const UINT32_MAX = Math.pow(2, 32) - 1;

Expand Down Expand Up @@ -335,7 +334,13 @@ class MP4 {
len = data.byteLength;
sps.push((len >>> 8) & 0xFF);
sps.push((len & 0xFF));
sps = sps.concat(makeArrayFromArrayLike(data)); // SPS

// SPS
if (typeof Array.from === 'function') {
sps = sps.concat(Array.from(data));
} else {
sps = sps.concat(Array.prototype.slice.call(data));
}
}

// assemble the PPSs
Expand All @@ -344,7 +349,12 @@ class MP4 {
len = data.byteLength;
pps.push((len >>> 8) & 0xFF);
pps.push((len & 0xFF));
pps = pps.concat(makeArrayFromArrayLike(data));

if (typeof Array.from === 'function') {
pps = pps.concat(Array.from(data));
} else {
pps = pps.concat(Array.prototype.slice.call(data));
}
}

let avcc = MP4.box(MP4.types.avcC, new Uint8Array([
Expand Down

0 comments on commit 9b5d520

Please sign in to comment.