@give-tech/ec-player 0.0.1-beta.3 → 0.0.1-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -2734,8 +2734,8 @@ class FLVPlayer extends BasePlayer {
2734
2734
  * 开始播放(覆盖基类方法)
2735
2735
  */
2736
2736
  async play() {
2737
- const MIN_BUFFER_SIZE = this.dynamicMinBufferSize;
2738
- const MAX_WAIT_TIME = 1e4;
2737
+ const MIN_BUFFER_SIZE = this.config.isLive ? 3 : this.dynamicMinBufferSize;
2738
+ const MAX_WAIT_TIME = this.config.isLive ? 3e3 : 1e4;
2739
2739
  const startTime = Date.now();
2740
2740
  console.log(`[FLVPlayer] Waiting for buffer (target: ${MIN_BUFFER_SIZE} frames)...`);
2741
2741
  let aggressiveDecodeCount = 0;
@@ -2766,11 +2766,11 @@ class FLVPlayer extends BasePlayer {
2766
2766
  }
2767
2767
  console.log("[FLVPlayer] Buffer ready, frames:", this._timedFrameBuffer.length, "queue:", this._videoTagQueue.length);
2768
2768
  if (this._timedFrameBuffer.length > 0) {
2769
- if (this.config.isLive && this._timedFrameBuffer.length > 15) {
2770
- const droppedCount = this._timedFrameBuffer.length - 5;
2771
- this._timedFrameBuffer = this._timedFrameBuffer.slice(-5);
2769
+ if (this.config.isLive && this._timedFrameBuffer.length > 60) {
2770
+ const droppedCount = this._timedFrameBuffer.length - 30;
2771
+ this._timedFrameBuffer = this._timedFrameBuffer.slice(-30);
2772
2772
  this.droppedFrames += droppedCount;
2773
- console.log("[FLVPlayer] Live resume: dropped", droppedCount, "old frames, keeping latest 5");
2773
+ console.log("[FLVPlayer] Live resume: dropped", droppedCount, "old frames, keeping latest 30");
2774
2774
  }
2775
2775
  this.firstFrameDts = this._timedFrameBuffer[0].dts;
2776
2776
  this.playStartTime = performance.now();
@@ -2794,8 +2794,7 @@ class FLVPlayer extends BasePlayer {
2794
2794
  this.prefetcher.stop();
2795
2795
  }
2796
2796
  if (this.config.isLive) {
2797
- console.log("[FLVPlayer] Pausing live stream, stopping download");
2798
- this.stopLiveDownload();
2797
+ console.log("[FLVPlayer] Pausing live stream, keeping download running");
2799
2798
  }
2800
2799
  }
2801
2800
  /**