src/source-updater.js
/**
   * Queue an update to append an ArrayBuffer.
   *
   * @param {ArrayBuffer} bytes
   * @param {Function} done the function to call when done
   * @see http://www.w3.org/TR/media-source/#widl-SourceBuffer-appendBuffer-void-ArrayBuffer-data
   */
Queue an update to append an ArrayBuffer.
Queue an update to append an ArrayBuffer .
appendBuffer(config, done) {
    this.processedAppend_ = true;
    this.queueCallback_(() => {
      if (config.videoSegmentTimingInfoCallback) {
        this.sourceBuffer_.addEventListener(
          'videoSegmentTimingInfo', config.videoSegmentTimingInfoCallback);
      }
      this.sourceBuffer_.appendBuffer(config.bytes);
    }, () => {
      if (config.videoSegmentTimingInfoCallback) {
        this.sourceBuffer_.removeEventListener(
          'videoSegmentTimingInfo', config.videoSegmentTimingInfoCallback);
      }
      done();
    });
  }
appendBuffer ( config , done ) { this . processedAppend_ = true ; this . queueCallback_ ( ( ) => { if ( config . videoSegmentTimingInfoCallback ) { this . sourceBuffer_ . addEventListener ( 'videoSegmentTimingInfo' , config . videoSegmentTimingInfoCallback ) ; } this . sourceBuffer_ . appendBuffer ( config . bytes ) ; } , ( ) => { if ( config . videoSegmentTimingInfoCallback ) { this . sourceBuffer_ . removeEventListener ( 'videoSegmentTimingInfo' , config . videoSegmentTimingInfoCallback ) ; } done ( ) ; } ) ; }
Queue an update to append an ArrayBuffer.
Queue an update to append an ArrayBuffer .