8fbb05f0 by David LaPalomento

Merge pull request #28 from videojs/smallerrors

Small errors
2 parents b2716ec2 917f9ac5
......@@ -20,7 +20,7 @@
window.setTimeout(process, 0);
q.running = true;
}
},
}
},
process = function() {
var task;
......
......@@ -3,28 +3,7 @@
window.videojs = window.videojs || {};
window.videojs.hls = window.videojs.hls || {};
var
hls = window.videojs.hls,
// commonly used metadata properties
widthBytes = new Uint8Array('width'.length),
heightBytes = new Uint8Array('height'.length),
videocodecidBytes = new Uint8Array('videocodecid'.length),
i;
// calculating the bytes of common metadata names ahead of time makes the
// corresponding writes faster because we don't have to loop over the
// characters
// re-test with test/perf.html if you're planning on changing this
for (i in 'width') {
widthBytes[i] = 'width'.charCodeAt(i);
}
for (i in 'height') {
heightBytes[i] = 'height'.charCodeAt(i);
}
for (i in 'videocodecid') {
videocodecidBytes[i] = 'videocodecid'.charCodeAt(i);
}
var hls = window.videojs.hls;
// (type:uint, extraData:Boolean = false) extends ByteArray
hls.FlvTag = function(type, extraData) {
......@@ -49,7 +28,33 @@ hls.FlvTag = function(type, extraData) {
bytes.set(flv.bytes.subarray(0, flv.position), 0);
flv.bytes = bytes;
flv.view = new DataView(flv.bytes.buffer);
};
},
// commonly used metadata properties
widthBytes = hls.FlvTag.widthBytes || new Uint8Array('width'.length),
heightBytes = hls.FlvTag.heightBytes || new Uint8Array('height'.length),
videocodecidBytes = hls.FlvTag.videocodecidBytes || new Uint8Array('videocodecid'.length),
i;
if (!hls.FlvTag.widthBytes) {
// calculating the bytes of common metadata names ahead of time makes the
// corresponding writes faster because we don't have to loop over the
// characters
// re-test with test/perf.html if you're planning on changing this
for (i in 'width') {
widthBytes[i] = 'width'.charCodeAt(i);
}
for (i in 'height') {
heightBytes[i] = 'height'.charCodeAt(i);
}
for (i in 'videocodecid') {
videocodecidBytes[i] = 'videocodecid'.charCodeAt(i);
}
hls.FlvTag.widthBytes = widthBytes;
hls.FlvTag.heightBytes = heightBytes;
hls.FlvTag.videocodecidBytes = videocodecidBytes;
}
this.keyFrame = false; // :Boolean
......
......@@ -591,6 +591,10 @@ var
};
videojs.plugin('hls', function() {
if (typeof Uint8Array === 'undefined') {
return;
}
var initialize = function() {
return function() {
this.hls = initialize();
......