stormcloud-video-player 0.6.4 → 0.6.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/stormcloud-vp.min.js +1 -1
- package/lib/index.cjs +21 -8
- package/lib/index.cjs.map +1 -1
- package/lib/index.js +21 -8
- package/lib/index.js.map +1 -1
- package/lib/player/StormcloudVideoPlayer.cjs +21 -8
- package/lib/player/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/players/HlsPlayer.cjs +21 -8
- package/lib/players/HlsPlayer.cjs.map +1 -1
- package/lib/players/index.cjs +21 -8
- package/lib/players/index.cjs.map +1 -1
- package/lib/sdk/vastAdLayer.cjs +8 -0
- package/lib/sdk/vastAdLayer.cjs.map +1 -1
- package/lib/ui/StormcloudVideoPlayer.cjs +21 -8
- package/lib/ui/StormcloudVideoPlayer.cjs.map +1 -1
- package/package.json +1 -1
|
@@ -1015,6 +1015,14 @@ function createVastAdLayer(contentVideo, options) {
|
|
|
1015
1015
|
} else if (debug) {
|
|
1016
1016
|
console.warn("".concat(LOG, " forceMP4Ads: no MP4 files available, falling back to all media files"));
|
|
1017
1017
|
}
|
|
1018
|
+
} else {
|
|
1019
|
+
var mp4Only1 = candidates.filter(function(f) {
|
|
1020
|
+
return !isHlsMediaFile(f);
|
|
1021
|
+
});
|
|
1022
|
+
if (mp4Only1.length > 0) {
|
|
1023
|
+
candidates = mp4Only1;
|
|
1024
|
+
if (debug) console.log("".concat(LOG, " Preferring ").concat(mp4Only1.length, " MP4 file(s) over HLS (mp4-first)"));
|
|
1025
|
+
}
|
|
1018
1026
|
}
|
|
1019
1027
|
var firstFile = candidates[0];
|
|
1020
1028
|
if (candidates.length === 1) return firstFile;
|
|
@@ -3950,12 +3958,17 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
3950
3958
|
}
|
|
3951
3959
|
}
|
|
3952
3960
|
if (this.inAdBreak) {
|
|
3953
|
-
if (
|
|
3954
|
-
|
|
3955
|
-
if (this.
|
|
3956
|
-
|
|
3961
|
+
if (marker.durationSeconds != null) {
|
|
3962
|
+
var newDurationMs = marker.durationSeconds * 1e3;
|
|
3963
|
+
if (this.expectedAdBreakDurationMs == null || newDurationMs > this.expectedAdBreakDurationMs) {
|
|
3964
|
+
this.expectedAdBreakDurationMs = newDurationMs;
|
|
3965
|
+
var elapsedMs = this.currentAdBreakStartWallClockMs != null ? Date.now() - this.currentAdBreakStartWallClockMs : 0;
|
|
3966
|
+
var remainingMs = Math.max(0, newDurationMs - elapsedMs);
|
|
3967
|
+
this.scheduleAdStopCountdown(remainingMs);
|
|
3968
|
+
if (this.config.debugAdTiming) {
|
|
3969
|
+
console.log("[StormcloudVideoPlayer] Updated ad break duration from subsequent marker: ".concat(newDurationMs, "ms, remaining: ").concat(remainingMs, "ms"));
|
|
3970
|
+
}
|
|
3957
3971
|
}
|
|
3958
|
-
this.scheduleAdStopCountdown(this.expectedAdBreakDurationMs);
|
|
3959
3972
|
}
|
|
3960
3973
|
return;
|
|
3961
3974
|
}
|
|
@@ -4036,9 +4049,9 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
4036
4049
|
this.expectedAdBreakDurationMs = marker.durationSeconds * 1e3;
|
|
4037
4050
|
}
|
|
4038
4051
|
if (this.expectedAdBreakDurationMs != null && this.currentAdBreakStartWallClockMs != null) {
|
|
4039
|
-
var
|
|
4040
|
-
var
|
|
4041
|
-
this.scheduleAdStopCountdown(
|
|
4052
|
+
var elapsedMs1 = Date.now() - this.currentAdBreakStartWallClockMs;
|
|
4053
|
+
var remainingMs1 = Math.max(0, this.expectedAdBreakDurationMs - elapsedMs1);
|
|
4054
|
+
this.scheduleAdStopCountdown(remainingMs1);
|
|
4042
4055
|
}
|
|
4043
4056
|
if (!this.adLayer.isAdPlaying() && this.pendingNextAdBids != null && this.pendingNextAdBids.length > 0) {
|
|
4044
4057
|
var bids = this.pendingNextAdBids;
|