concatAndAppendSegments_(segmentObj, destinationBuffer) {
    let offset = 0;
    let tempBuffer;

    if (segmentObj.bytes) {
      tempBuffer = new Uint8Array(segmentObj.bytes);

      // Combine the individual segments into one large typed-array
      segmentObj.segments.forEach(function(segment) {
        tempBuffer.set(segment, offset);
        offset += segment.byteLength;
      });

      try {
        destinationBuffer.updating = true;
        destinationBuffer.appendBuffer(tempBuffer);
      } catch (error) {
        if (this.mediaSource_.player_) {
          this.mediaSource_.player_.error({
            code: -3,
            type: 'APPEND_BUFFER_ERR',
            message: error.message,
            originalError: error
          });
        }
      }
    }
  }
/**
   * Combine all segments into a single Uint8Array and then append them
   * to the destination buffer
   *
   * @param {Object} segmentObj
   * @param {SourceBuffer} destinationBuffer native source buffer to append data to
   * @private
   */
Combine all segments into a single Uint8Array and then append them
to the destination buffer

@param {Object} segmentObj
@param {SourceBuffer} destinationBuffer native source buffer to append data to
@private
Combine all segments into a single Uint8Array and then append them to the destination buffer @param { Object } segmentObj @param { SourceBuffer } destinationBuffer native source buffer to append data to @private
concatAndAppendSegments_(segmentObj, destinationBuffer) {
    let offset = 0;
    let tempBuffer;
    if (segmentObj.bytes) {
      tempBuffer = new Uint8Array(segmentObj.bytes);
      segmentObj.segments.forEach(function(segment) {
        tempBuffer.set(segment, offset);
        offset += segment.byteLength;
      });
      try {
        destinationBuffer.updating = true;
        destinationBuffer.appendBuffer(tempBuffer);
      } catch (error) {
        if (this.mediaSource_.player_) {
          this.mediaSource_.player_.error({
            code: -3,
            type: 'APPEND_BUFFER_ERR',
            message: error.message,
            originalError: error
          });
        }
      }
    }
  }
concatAndAppendSegments_ ( segmentObj , destinationBuffer ) { let offset = 0 ; let tempBuffer ; if ( segmentObj . bytes ) { tempBuffer = new Uint8Array ( segmentObj . bytes ) ; segmentObj . segments . forEach ( function ( segment ) { tempBuffer . set ( segment , offset ) ; offset += segment . byteLength ; } ) ; try { destinationBuffer . updating = true ; destinationBuffer . appendBuffer ( tempBuffer ) ; } catch ( error ) { if ( this . mediaSource_ . player_ ) { this . mediaSource_ . player_ . error ( { code : - 3 , type : 'APPEND_BUFFER_ERR' , message : error . message , originalError : error } ) ; } } } }
Combine all segments into a single Uint8Array and then append them
 to the destination buffer
Combine all segments into a single Uint8Array and then append them to the destination buffer
// Combine the individual segments into one large typed-array