@give-tech/ec-player 0.0.1-beta.14 → 0.0.1-beta.15
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 +16 -6
- package/dist/index.js.map +1 -1
- package/dist/player/HLSPlayer.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1592,7 +1592,9 @@ class HLSPlayer extends BasePlayer {
|
|
|
1592
1592
|
}
|
|
1593
1593
|
} else {
|
|
1594
1594
|
if (this.playStartTime !== 0) {
|
|
1595
|
+
const oldPlayStartTime = this.playStartTime;
|
|
1595
1596
|
this.playStartTime = now - this.accumulatedMediaTime;
|
|
1597
|
+
console.log("[renderLoop] No frames, adjusting playStartTime from", oldPlayStartTime, "to", this.playStartTime, "accumulated=", this.accumulatedMediaTime);
|
|
1596
1598
|
}
|
|
1597
1599
|
}
|
|
1598
1600
|
this.frameTimer = requestAnimationFrame(this.renderLoop);
|
|
@@ -1716,6 +1718,10 @@ class HLSPlayer extends BasePlayer {
|
|
|
1716
1718
|
let batchCount = 0;
|
|
1717
1719
|
while (this.isPlaying && !this.decodeLoopAbort) {
|
|
1718
1720
|
this.prefetcher?.processQueue();
|
|
1721
|
+
if (!this.config.isLive && this.frameBuffer.length >= this.config.targetBufferSize) {
|
|
1722
|
+
await this.sleep(10);
|
|
1723
|
+
continue;
|
|
1724
|
+
}
|
|
1719
1725
|
const batchSize = this.config.decodeBatchSize;
|
|
1720
1726
|
let decodedInBatch = 0;
|
|
1721
1727
|
if (this.isFMP4) {
|
|
@@ -1730,9 +1736,11 @@ class HLSPlayer extends BasePlayer {
|
|
|
1730
1736
|
if (frame) {
|
|
1731
1737
|
this.frameBuffer.push(frame);
|
|
1732
1738
|
decodedInBatch++;
|
|
1733
|
-
|
|
1734
|
-
this.frameBuffer.
|
|
1735
|
-
|
|
1739
|
+
if (this.config.isLive) {
|
|
1740
|
+
while (this.frameBuffer.length > this.config.targetBufferSize) {
|
|
1741
|
+
this.frameBuffer.shift();
|
|
1742
|
+
this.droppedFrames++;
|
|
1743
|
+
}
|
|
1736
1744
|
}
|
|
1737
1745
|
}
|
|
1738
1746
|
}
|
|
@@ -1748,9 +1756,11 @@ class HLSPlayer extends BasePlayer {
|
|
|
1748
1756
|
if (frame) {
|
|
1749
1757
|
this.frameBuffer.push(frame);
|
|
1750
1758
|
decodedInBatch++;
|
|
1751
|
-
|
|
1752
|
-
this.frameBuffer.
|
|
1753
|
-
|
|
1759
|
+
if (this.config.isLive) {
|
|
1760
|
+
while (this.frameBuffer.length > this.config.targetBufferSize) {
|
|
1761
|
+
this.frameBuffer.shift();
|
|
1762
|
+
this.droppedFrames++;
|
|
1763
|
+
}
|
|
1754
1764
|
}
|
|
1755
1765
|
}
|
|
1756
1766
|
}
|