stormcloud-video-player 0.3.61 → 0.3.62
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/sdk/ima.d.cts +1 -1
- package/lib/{types-XKUJJhlG.d.cts → types-BJPNhfLV.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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Component } from 'react';
|
|
2
|
-
import { S as StormcloudVideoPlayerConfig } from '../types-
|
|
2
|
+
import { S as StormcloudVideoPlayerConfig } from '../types-BJPNhfLV.cjs';
|
|
3
3
|
|
|
4
4
|
interface HlsPlayerProps extends StormcloudVideoPlayerConfig {
|
|
5
5
|
onMount?: (player: any) => void;
|
package/lib/players/index.cjs
CHANGED
|
@@ -3425,7 +3425,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
3425
3425
|
key: "load",
|
|
3426
3426
|
value: function load() {
|
|
3427
3427
|
return _async_to_generator(function() {
|
|
3428
|
-
var _this, error, _this_config_lowLatencyMode, _this_video_play;
|
|
3428
|
+
var _this, error, _this_config_isLiveStream, _this_config_lowLatencyMode, _this_video_play;
|
|
3429
3429
|
return _ts_generator(this, function(_state) {
|
|
3430
3430
|
switch(_state.label){
|
|
3431
3431
|
case 0:
|
|
@@ -3469,7 +3469,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
3469
3469
|
this.nativeHlsMode = true;
|
|
3470
3470
|
this.videoSrcProtection = this.config.src;
|
|
3471
3471
|
this.video.src = this.config.src;
|
|
3472
|
-
this.isLiveStream = (_this_config_lowLatencyMode = this.config.lowLatencyMode) !== null && _this_config_lowLatencyMode !== void 0 ? _this_config_lowLatencyMode : false;
|
|
3472
|
+
this.isLiveStream = (_this_config_isLiveStream = this.config.isLiveStream) !== null && _this_config_isLiveStream !== void 0 ? _this_config_isLiveStream : (_this_config_lowLatencyMode = this.config.lowLatencyMode) !== null && _this_config_lowLatencyMode !== void 0 ? _this_config_lowLatencyMode : false;
|
|
3473
3473
|
if (this.config.debugAdTiming) {
|
|
3474
3474
|
console.log("[StormcloudVideoPlayer] Using native HLS playback - VOD mode:", {
|
|
3475
3475
|
isLive: this.isLiveStream,
|
|
@@ -3520,19 +3520,28 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
3520
3520
|
});
|
|
3521
3521
|
this.hls.on(import_hls2.default.Events.MANIFEST_PARSED, function(_, data) {
|
|
3522
3522
|
return _async_to_generator(function() {
|
|
3523
|
-
var
|
|
3523
|
+
var _this_config_isLiveStream, _ref, _this_config_minSegmentsBeforePlay, _this_hls_levels, _this_hls, prerollKey, adBehavior, minSegments, _this_video_play;
|
|
3524
3524
|
return _ts_generator(this, function(_state) {
|
|
3525
3525
|
switch(_state.label){
|
|
3526
3526
|
case 0:
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
|
|
3532
|
-
|
|
3533
|
-
|
|
3534
|
-
|
|
3535
|
-
|
|
3527
|
+
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) {
|
|
3528
|
+
var _level_details, _level_details1;
|
|
3529
|
+
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";
|
|
3530
|
+
})) !== null && _ref !== void 0 ? _ref : false;
|
|
3531
|
+
if (!this.isLiveStream && this.vmapBreaks.length === 0 && this.apiVastTagUrl) {
|
|
3532
|
+
prerollKey = "synthetic-vod-preroll";
|
|
3533
|
+
if (!this.consumedVmapBreakIds.has(prerollKey)) {
|
|
3534
|
+
this.vmapBreaks = [
|
|
3535
|
+
{
|
|
3536
|
+
id: prerollKey,
|
|
3537
|
+
startTimeMs: 0,
|
|
3538
|
+
vastTagUrl: this.apiVastTagUrl
|
|
3539
|
+
}
|
|
3540
|
+
];
|
|
3541
|
+
if (this.config.debugAdTiming) {
|
|
3542
|
+
console.log("[StormcloudVideoPlayer] Injected synthetic VOD preroll from apiVastTagUrl");
|
|
3543
|
+
}
|
|
3544
|
+
}
|
|
3536
3545
|
}
|
|
3537
3546
|
if (this.config.debugAdTiming) {
|
|
3538
3547
|
adBehavior = this.shouldContinueLiveStreamDuringAds() ? "live (main video continues muted during ads)" : "vod (main video pauses during ads)";
|
|
@@ -7970,7 +7979,8 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
7970
7979
|
continue;
|
|
7971
7980
|
}
|
|
7972
7981
|
var end = breakStartMs + (b.durationMs || 0);
|
|
7973
|
-
|
|
7982
|
+
var effectiveTol = breakStartMs === 0 ? Math.max(tol, 3e4) : tol;
|
|
7983
|
+
if (nowMs >= breakStartMs && (b.durationMs ? nowMs < end : nowMs <= breakStartMs + effectiveTol)) {
|
|
7974
7984
|
return b;
|
|
7975
7985
|
}
|
|
7976
7986
|
}
|