streamit-player 1.0.0 → 1.0.2
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/CHANGELOG.md +12 -2
- package/dist/{Player-YpukGRGt.js → Player-CqgNV9Pd.js} +1 -1
- package/dist/{Player-BfmqCREY.cjs → Player-DrKG8tPQ.cjs} +1 -1
- package/dist/{PlayerController-Bt7Po42U.cjs → PlayerController-BaQ27TT9.cjs} +39 -19
- package/dist/{PlayerController-CW0pxrIt.js → PlayerController-D68pc3mj.js} +39 -19
- package/dist/core/index.cjs +1 -1
- package/dist/core/index.js +1 -1
- package/dist/core/src/SourceManager.d.ts +10 -3
- package/dist/core/src/SourceManager.d.ts.map +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.js +2 -2
- package/dist/streamit-player.esm.js +39 -19
- package/dist/streamit-player.esm.min.js +32 -17
- package/dist/streamit-player.iife.js +39 -19
- package/dist/streamit-player.iife.min.js +1 -1
- package/dist/web-components/index.cjs +1 -1
- package/dist/web-components/index.js +1 -1
- package/package.json +1 -1
|
@@ -4848,7 +4848,7 @@ var StreamitPlayer = function(exports) {
|
|
|
4848
4848
|
if (this.hls) {
|
|
4849
4849
|
this.isAutoMode = index === 0;
|
|
4850
4850
|
const levelIndex = index - 1;
|
|
4851
|
-
this.hls.
|
|
4851
|
+
this.hls.nextLevel = levelIndex;
|
|
4852
4852
|
if (levelIndex === -1) {
|
|
4853
4853
|
this.lastLevelIndex = -1;
|
|
4854
4854
|
} else {
|
|
@@ -4908,17 +4908,12 @@ var StreamitPlayer = function(exports) {
|
|
|
4908
4908
|
} catch {
|
|
4909
4909
|
}
|
|
4910
4910
|
};
|
|
4911
|
-
this.
|
|
4912
|
-
|
|
4913
|
-
|
|
4914
|
-
|
|
4915
|
-
|
|
4916
|
-
|
|
4917
|
-
if (target == null || this.video.currentTime <= 0) return;
|
|
4918
|
-
this.followingLive = target - this.video.currentTime <= LOW_LATENCY_LIVE_EDGE_SECONDS;
|
|
4919
|
-
this.syncLiveCatchup();
|
|
4920
|
-
} catch {
|
|
4921
|
-
}
|
|
4911
|
+
this.handleResume = () => {
|
|
4912
|
+
if (this.video) this.recordViewerPosition(this.video.currentTime);
|
|
4913
|
+
};
|
|
4914
|
+
this.handleLiveEdgeSync = () => {
|
|
4915
|
+
this.followingLive = true;
|
|
4916
|
+
this.syncLiveCatchup();
|
|
4922
4917
|
};
|
|
4923
4918
|
this.handleTrackChangeRendered = (e2) => {
|
|
4924
4919
|
if (!this.player || !this.controller) return;
|
|
@@ -5216,6 +5211,22 @@ var StreamitPlayer = function(exports) {
|
|
|
5216
5211
|
}
|
|
5217
5212
|
}
|
|
5218
5213
|
}
|
|
5214
|
+
/**
|
|
5215
|
+
* Records whether the viewer is following the live edge, given a position they chose.
|
|
5216
|
+
* Only viewer actions call this: seeks made by dash.js itself must not count.
|
|
5217
|
+
*/
|
|
5218
|
+
recordViewerPosition(position) {
|
|
5219
|
+
var _a2;
|
|
5220
|
+
if (!this.player) return;
|
|
5221
|
+
try {
|
|
5222
|
+
if (!this.player.isDynamic()) return;
|
|
5223
|
+
const target = (_a2 = this.getRawLiveInfo()) == null ? void 0 : _a2.liveEdgeTarget;
|
|
5224
|
+
if (target == null || position <= 0) return;
|
|
5225
|
+
this.followingLive = target - position <= LOW_LATENCY_LIVE_EDGE_SECONDS;
|
|
5226
|
+
this.syncLiveCatchup();
|
|
5227
|
+
} catch {
|
|
5228
|
+
}
|
|
5229
|
+
}
|
|
5219
5230
|
normalizeQualityIndex(value) {
|
|
5220
5231
|
return typeof value === "number" && Number.isInteger(value) && value >= 0 ? value : -1;
|
|
5221
5232
|
}
|
|
@@ -5246,9 +5257,9 @@ var StreamitPlayer = function(exports) {
|
|
|
5246
5257
|
this.dashRetryCount = 0;
|
|
5247
5258
|
this.followingLive = true;
|
|
5248
5259
|
this.catchupEnabled = null;
|
|
5249
|
-
video.addEventListener("
|
|
5250
|
-
video.addEventListener("play", this.handleLivePositionChange);
|
|
5260
|
+
video.addEventListener("play", this.handleResume);
|
|
5251
5261
|
video.addEventListener("timeupdate", this.syncLiveCatchup);
|
|
5262
|
+
controller.addEventListener("live-edge-sync", this.handleLiveEdgeSync);
|
|
5252
5263
|
loadDashjs().then((dashjsModule) => {
|
|
5253
5264
|
var _a2;
|
|
5254
5265
|
if (this.controller !== controller) {
|
|
@@ -5602,11 +5613,12 @@ var StreamitPlayer = function(exports) {
|
|
|
5602
5613
|
this.controller.updateStatePublic({ activeQuality });
|
|
5603
5614
|
}
|
|
5604
5615
|
destroy() {
|
|
5616
|
+
var _a2;
|
|
5605
5617
|
if (this.video) {
|
|
5606
|
-
this.video.removeEventListener("
|
|
5607
|
-
this.video.removeEventListener("play", this.handleLivePositionChange);
|
|
5618
|
+
this.video.removeEventListener("play", this.handleResume);
|
|
5608
5619
|
this.video.removeEventListener("timeupdate", this.syncLiveCatchup);
|
|
5609
5620
|
}
|
|
5621
|
+
(_a2 = this.controller) == null ? void 0 : _a2.removeEventListener("live-edge-sync", this.handleLiveEdgeSync);
|
|
5610
5622
|
if (this.player) {
|
|
5611
5623
|
try {
|
|
5612
5624
|
if (this.eventNames.trackChangeRendered)
|
|
@@ -5642,8 +5654,16 @@ var StreamitPlayer = function(exports) {
|
|
|
5642
5654
|
this.videoRepresentations = [];
|
|
5643
5655
|
this.uniqueAudioTracks = [];
|
|
5644
5656
|
}
|
|
5645
|
-
seek(
|
|
5646
|
-
|
|
5657
|
+
seek(time) {
|
|
5658
|
+
this.recordViewerPosition(time);
|
|
5659
|
+
if (!this.player) return false;
|
|
5660
|
+
try {
|
|
5661
|
+
if (!this.player.isDynamic()) return false;
|
|
5662
|
+
this.player.seekToPresentationTime(time);
|
|
5663
|
+
return true;
|
|
5664
|
+
} catch {
|
|
5665
|
+
return false;
|
|
5666
|
+
}
|
|
5647
5667
|
}
|
|
5648
5668
|
setQuality(index) {
|
|
5649
5669
|
if (this.player) {
|
|
@@ -5672,7 +5692,7 @@ var StreamitPlayer = function(exports) {
|
|
|
5672
5692
|
if (playerWithABR.setRepresentationForTypeById) {
|
|
5673
5693
|
playerWithABR.setRepresentationForTypeById("video", targetRep.id);
|
|
5674
5694
|
} else if (playerWithABR.setQualityFor) {
|
|
5675
|
-
playerWithABR.setQualityFor("video", levelIndex,
|
|
5695
|
+
playerWithABR.setQualityFor("video", levelIndex, false);
|
|
5676
5696
|
}
|
|
5677
5697
|
this.lastQualityIndex = levelIndex;
|
|
5678
5698
|
}
|