static parseTRUN(reader, version, flags) {
    const sampleCount = reader.readUint32();
    const sampleData = [];
    let dataOffset = null;

    // "data_offset"
    if (flags & 0x000001) {
      dataOffset = reader.readInt32();
    }

    // Skip "first_sample_flags" if present.
    if (flags & 0x000004) {
      reader.skip(4);
    }

    for (let i = 0; i < sampleCount; i++) {
      /** @type {shaka.util.ParsedTRUNSample} */
      const sample = {
        sampleDuration: null,
        sampleSize: null,
        sampleCompositionTimeOffset: null,
      };

      // Read "sample duration" if present.
      if (flags & 0x000100) {
        sample.sampleDuration = reader.readUint32();
      }

      // Read "sample_size" if present.
      if (flags & 0x000200) {
        sample.sampleSize = reader.readUint32();
      }

      // Skip "sample_flags" if present.
      if (flags & 0x000400) {
        reader.skip(4);
      }

      // Read "sample_time_offset" if present.
      if (flags & 0x000800) {
        sample.sampleCompositionTimeOffset = version == 0 ?
              reader.readUint32() :
              reader.readInt32();
      }

      sampleData.push(sample);
    }

    return {
      sampleCount,
      sampleData,
      dataOffset,
    };
  }
Parses a TRUN Box.
@param {!shaka.util.DataViewReader} reader
@param {number} version
@param {number} flags
@return {!shaka.util.ParsedTRUNBox}