+ this.timeToSamples[i] = [sampleCount, sampleDuration];
+ ++i;
+ }
+}
+
+var SampleSizeAtom = function (buffer, offset) {
+ this.super(SampleSizeAtom).constructor.call(this, buffer, offset);
+}
+
+SampleSizeAtom.prototype = Object.create(VersionFlagsAtom.prototype);
+
+SampleSizeAtom.prototype.setDefaults = function () {
+ this.super(SampleSizeAtom).setDefaults.call(this);
+
+ this.description = "Sample Size Atom";
+ this.sampleSize = 0;
+ this.entries = 0;
+
+ Object.defineProperty(this, "sampleSizes", {
+ value: null,
+ writable: true,
+ enumerable: false,
+ configurable: true,
+ });
+}
+
+SampleSizeAtom.prototype.parse = function (buffer, offset) {
+ var headerOffset = this.super(SampleSizeAtom).parse.call(this, buffer, offset);
+ var view = new DataView(buffer, offset);
+
+ this.sampleSize = view.getUint32(headerOffset);
+ headerOffset += 4;
+
+ this.entries = view.getUint32(headerOffset);
+ headerOffset += 4;
+
+ this.sampleSizes = new Uint32Array(this.entries);
+ var i = 0;
+
+ while (headerOffset < this.size) {
+ this.sampleSizes[i] = view.getUint32(headerOffset);
+ headerOffset += 4;
+ ++i;
+ }
+}
+
+var TrackExtendsAtom = function (buffer, offset) {
+ this.super(TrackExtendsAtom).constructor.call(this, buffer, offset);
+}
+
+TrackExtendsAtom.prototype = Object.create(VersionFlagsAtom.prototype);
+
+TrackExtendsAtom.prototype.setDefaults = function () {
+ this.super(TrackExtendsAtom).setDefaults.call(this);
+
+ this.description = "Track Extends Atom";
+ this.trackID = 0;
+ this.default_sample_description_index = 0;
+ this.default_sample_duration = 0;
+ this.default_sample_size = 0;
+ this.default_sample_flags = 0;
+}
+
+TrackExtendsAtom.prototype.parse = function (buffer, offset) {
+ var headerOffset = this.super(TrackExtendsAtom).parse.call(this, buffer, offset);
+ var view = new DataView(buffer, offset);
+
+ this.trackID = view.getUint32(headerOffset);
+ headerOffset += 4;
+
+ this.default_sample_description_index = view.getUint32(headerOffset);
+ headerOffset += 4;
+
+ this.default_sample_duration = view.getUint32(headerOffset);
+ headerOffset += 4;
+
+ this.default_sample_size = view.getUint32(headerOffset);
+ headerOffset += 4;
+
+ this.default_sample_flags = view.getUint32(headerOffset);
+ headerOffset += 4;
+}
+
+var OriginalFormatBox = function (buffer, offset) {
+ this.super(OriginalFormatBox).constructor.call(this, buffer, offset);
+}
+
+OriginalFormatBox.prototype = Object.create(Atom.prototype);
+
+OriginalFormatBox.prototype.setDefaults = function () {
+ this.super(OriginalFormatBox).setDefaults.call(this);
+
+ this.description = "Original Format Box";
+ this.dataFormat = 0;
+}
+
+OriginalFormatBox.prototype.parse = function (buffer, offset) {
+ var headerOffset = this.super(OriginalFormatBox).parse.call(this, buffer, offset);
+ var view = new DataView(buffer, offset);
+
+ this.dataFormat = view.getUint32(headerOffset);
+ headerOffset += 4;
+}
+
+var SchemeTypeBox = function (buffer, offset) {
+ this.super(SchemeTypeBox).constructor.call(this, buffer, offset);
+}
+
+SchemeTypeBox.prototype = Object.create(VersionFlagsAtom.prototype);
+
+SchemeTypeBox.prototype.setDefaults = function () {
+ this.super(SchemeTypeBox).setDefaults.call(this);
+
+ this.description = "Scheme Type Box";
+ this.schemeType = 0;
+ this.schemeVersion = 0;
+ this.schemeURL = 0;
+}
+
+SchemeTypeBox.prototype.parse = function (buffer, offset) {
+ var headerOffset = this.super(SchemeTypeBox).parse.call(this, buffer, offset);
+ var view = new DataView(buffer, offset);
+
+ this.schemeType = view.getUint32(headerOffset);
+ headerOffset += 4;
+ this.schemeVersion = view.getUint32(headerOffset);
+ headerOffset += 4;
+ if (this.flags & 0x1) {
+ var array = new Uint8Array(buffer, headerOffset, this.size - headerOffset);
+ this.schemeURL = String.fromCharCode.apply(null, array);