stormcloud-video-player 0.8.1 → 0.8.3
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 +203 -148
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +203 -148
- package/lib/index.js.map +1 -1
- package/lib/player/StormcloudVideoPlayer.cjs +23 -13
- package/lib/player/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/player/StormcloudVideoPlayer.d.cts +1 -1
- package/lib/players/HlsPlayer.cjs +23 -13
- package/lib/players/HlsPlayer.cjs.map +1 -1
- package/lib/players/HlsPlayer.d.cts +1 -1
- package/lib/players/index.cjs +23 -13
- package/lib/players/index.cjs.map +1 -1
- package/lib/sdk/hlsAdPlayer.d.cts +1 -1
- package/lib/{types-DDwAfBLt.d.cts → types-DWVgdqF-.d.cts} +1 -0
- package/lib/ui/StormcloudVideoPlayer.cjs +203 -148
- package/lib/ui/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/ui/StormcloudVideoPlayer.d.cts +1 -1
- package/lib/utils/tracking.d.cts +1 -1
- package/package.json +1 -1
|
@@ -2495,7 +2495,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
2495
2495
|
key: "load",
|
|
2496
2496
|
value: function load() {
|
|
2497
2497
|
return _async_to_generator(function() {
|
|
2498
|
-
var _this, _this_config_lowLatencyMode, error, _this_config_lowLatencyMode1, _this_video_play;
|
|
2498
|
+
var _this, _this_config_lowLatencyMode, error, _this_config_isLiveStream, _this_config_lowLatencyMode1, _this_video_play;
|
|
2499
2499
|
return _ts_generator(this, function(_state) {
|
|
2500
2500
|
switch(_state.label){
|
|
2501
2501
|
case 0:
|
|
@@ -2546,7 +2546,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
2546
2546
|
this.nativeHlsMode = true;
|
|
2547
2547
|
this.videoSrcProtection = this.config.src;
|
|
2548
2548
|
this.video.src = this.config.src;
|
|
2549
|
-
this.isLiveStream = (_this_config_lowLatencyMode1 = this.config.lowLatencyMode) !== null && _this_config_lowLatencyMode1 !== void 0 ? _this_config_lowLatencyMode1 : false;
|
|
2549
|
+
this.isLiveStream = (_this_config_isLiveStream = this.config.isLiveStream) !== null && _this_config_isLiveStream !== void 0 ? _this_config_isLiveStream : (_this_config_lowLatencyMode1 = this.config.lowLatencyMode) !== null && _this_config_lowLatencyMode1 !== void 0 ? _this_config_lowLatencyMode1 : false;
|
|
2550
2550
|
if (this.config.debugAdTiming) {
|
|
2551
2551
|
console.log("[StormcloudVideoPlayer] Using native HLS playback - VOD mode:", {
|
|
2552
2552
|
isLive: this.isLiveStream,
|
|
@@ -2597,19 +2597,28 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
2597
2597
|
});
|
|
2598
2598
|
this.hls.on(import_hls2.default.Events.MANIFEST_PARSED, function(_, data) {
|
|
2599
2599
|
return _async_to_generator(function() {
|
|
2600
|
-
var
|
|
2600
|
+
var _this_config_isLiveStream, _ref, _this_config_minSegmentsBeforePlay, _this_hls_levels, _this_hls, prerollKey, adBehavior, minSegments, _this_video_play;
|
|
2601
2601
|
return _ts_generator(this, function(_state) {
|
|
2602
2602
|
switch(_state.label){
|
|
2603
2603
|
case 0:
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2604
|
+
this.isLiveStream = (_this_config_isLiveStream = this.config.isLiveStream) !== null && _this_config_isLiveStream !== void 0 ? _this_config_isLiveStream : (_ref = (_this_hls = this.hls) === null || _this_hls === void 0 ? void 0 : (_this_hls_levels = _this_hls.levels) === null || _this_hls_levels === void 0 ? void 0 : _this_hls_levels.some(function(level) {
|
|
2605
|
+
var _level_details, _level_details1;
|
|
2606
|
+
return (level === null || level === void 0 ? void 0 : (_level_details = level.details) === null || _level_details === void 0 ? void 0 : _level_details.live) === true || (level === null || level === void 0 ? void 0 : (_level_details1 = level.details) === null || _level_details1 === void 0 ? void 0 : _level_details1.type) === "LIVE";
|
|
2607
|
+
})) !== null && _ref !== void 0 ? _ref : false;
|
|
2608
|
+
if (!this.isLiveStream && this.vmapBreaks.length === 0 && this.apiVastTagUrl) {
|
|
2609
|
+
prerollKey = "synthetic-vod-preroll";
|
|
2610
|
+
if (!this.consumedVmapBreakIds.has(prerollKey)) {
|
|
2611
|
+
this.vmapBreaks = [
|
|
2612
|
+
{
|
|
2613
|
+
id: prerollKey,
|
|
2614
|
+
startTimeMs: 0,
|
|
2615
|
+
vastTagUrl: this.apiVastTagUrl
|
|
2616
|
+
}
|
|
2617
|
+
];
|
|
2618
|
+
if (this.config.debugAdTiming) {
|
|
2619
|
+
console.log("[StormcloudVideoPlayer] Injected synthetic VOD preroll from apiVastTagUrl");
|
|
2620
|
+
}
|
|
2621
|
+
}
|
|
2613
2622
|
}
|
|
2614
2623
|
if (this.config.debugAdTiming) {
|
|
2615
2624
|
adBehavior = this.shouldContinueLiveStreamDuringAds() ? "live (main video continues muted during ads)" : "vod (main video pauses during ads)";
|
|
@@ -7065,7 +7074,8 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
7065
7074
|
continue;
|
|
7066
7075
|
}
|
|
7067
7076
|
var end = breakStartMs + (b.durationMs || 0);
|
|
7068
|
-
|
|
7077
|
+
var effectiveTol = breakStartMs === 0 ? Math.max(tol, 3e4) : tol;
|
|
7078
|
+
if (nowMs >= breakStartMs && (b.durationMs ? nowMs < end : nowMs <= breakStartMs + effectiveTol)) {
|
|
7069
7079
|
return b;
|
|
7070
7080
|
}
|
|
7071
7081
|
}
|