stormcloud-video-player 0.3.66 → 0.3.68
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 +198 -54
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +8 -0
- package/lib/index.d.ts +8 -0
- package/lib/index.js +199 -55
- package/lib/index.js.map +1 -1
- package/lib/player/StormcloudVideoPlayer.cjs +136 -50
- package/lib/player/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/player/StormcloudVideoPlayer.d.cts +8 -0
- package/lib/players/HlsPlayer.cjs +136 -50
- package/lib/players/HlsPlayer.cjs.map +1 -1
- package/lib/players/index.cjs +136 -50
- package/lib/players/index.cjs.map +1 -1
- package/lib/sdk/hlsAdPlayer.cjs +11 -3
- package/lib/sdk/hlsAdPlayer.cjs.map +1 -1
- package/lib/ui/StormcloudVideoPlayer.cjs +198 -54
- package/lib/ui/StormcloudVideoPlayer.cjs.map +1 -1
- package/package.json +1 -1
|
@@ -1769,7 +1769,7 @@ function createHlsAdPlayer(contentVideo, options) {
|
|
|
1769
1769
|
}
|
|
1770
1770
|
var adElement = xmlDoc.querySelector("Ad");
|
|
1771
1771
|
if (!adElement) {
|
|
1772
|
-
console.warn("[HlsAdPlayer] No Ad element found in VAST XML");
|
|
1772
|
+
console.warn("[HlsAdPlayer] No Ad element found in VAST XML (no fill). Content (first 2000 chars):", xmlString.substring(0, 2e3));
|
|
1773
1773
|
return null;
|
|
1774
1774
|
}
|
|
1775
1775
|
var adId = adElement.getAttribute("id") || "unknown";
|
|
@@ -1865,7 +1865,7 @@ function createHlsAdPlayer(contentVideo, options) {
|
|
|
1865
1865
|
}
|
|
1866
1866
|
function fetchAndParseVastAd(vastTagUrl) {
|
|
1867
1867
|
return _async_to_generator(function() {
|
|
1868
|
-
var response, vastXml;
|
|
1868
|
+
var response, vastXml, trimmedXml;
|
|
1869
1869
|
return _ts_generator(this, function(_state) {
|
|
1870
1870
|
switch(_state.label){
|
|
1871
1871
|
case 0:
|
|
@@ -1891,8 +1891,16 @@ function createHlsAdPlayer(contentVideo, options) {
|
|
|
1891
1891
|
];
|
|
1892
1892
|
case 2:
|
|
1893
1893
|
vastXml = _state.sent();
|
|
1894
|
-
console.log("[HlsAdPlayer] VAST XML received");
|
|
1894
|
+
console.log("[HlsAdPlayer] VAST XML received (length=".concat(vastXml.length, ")"));
|
|
1895
1895
|
console.log("[HlsAdPlayer] VAST XML content (first 2000 chars):", vastXml.substring(0, 2e3));
|
|
1896
|
+
trimmedXml = vastXml.trim();
|
|
1897
|
+
if (trimmedXml.length === 0) {
|
|
1898
|
+
console.warn("[HlsAdPlayer] VAST response body is empty (no fill)");
|
|
1899
|
+
return [
|
|
1900
|
+
2,
|
|
1901
|
+
null
|
|
1902
|
+
];
|
|
1903
|
+
}
|
|
1896
1904
|
return [
|
|
1897
1905
|
2,
|
|
1898
1906
|
parseVastXml(vastXml)
|
|
@@ -3332,6 +3340,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
3332
3340
|
this.preloadPoolActive = false;
|
|
3333
3341
|
this.preloadPoolLoopRunning = false;
|
|
3334
3342
|
this.adDetectSentForCurrentBreak = false;
|
|
3343
|
+
this.latencyProfileApplied = false;
|
|
3335
3344
|
this.continuousFetchLoopRunning = false;
|
|
3336
3345
|
initializePolyfills();
|
|
3337
3346
|
var browserOverrides = getBrowserConfigOverrides();
|
|
@@ -3448,24 +3457,21 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
3448
3457
|
2
|
|
3449
3458
|
];
|
|
3450
3459
|
case 7:
|
|
3451
|
-
this.hls = new import_hls2.default(
|
|
3460
|
+
this.hls = new import_hls2.default({
|
|
3452
3461
|
enableWorker: true,
|
|
3453
3462
|
backBufferLength: 30,
|
|
3454
3463
|
liveDurationInfinity: true,
|
|
3455
3464
|
lowLatencyMode: !!this.config.lowLatencyMode,
|
|
3456
|
-
maxLiveSyncPlaybackRate:
|
|
3457
|
-
}, this.config.lowLatencyMode ? {
|
|
3458
|
-
liveSyncDuration: 2
|
|
3459
|
-
} : {}), {
|
|
3465
|
+
maxLiveSyncPlaybackRate: 1.1,
|
|
3460
3466
|
maxBufferLength: 30,
|
|
3461
3467
|
maxMaxBufferLength: 600,
|
|
3462
3468
|
maxBufferSize: 60 * 1e3 * 1e3,
|
|
3463
|
-
maxBufferHole:
|
|
3469
|
+
maxBufferHole: 1,
|
|
3464
3470
|
highBufferWatchdogPeriod: 2,
|
|
3465
|
-
nudgeOffset: 0.
|
|
3466
|
-
nudgeMaxRetry:
|
|
3471
|
+
nudgeOffset: 0.2,
|
|
3472
|
+
nudgeMaxRetry: 5,
|
|
3467
3473
|
startPosition: -1
|
|
3468
|
-
})
|
|
3474
|
+
});
|
|
3469
3475
|
this.hls.on(import_hls2.default.Events.MEDIA_ATTACHED, function() {
|
|
3470
3476
|
var _this_hls;
|
|
3471
3477
|
(_this_hls = _this.hls) === null || _this_hls === void 0 ? void 0 : _this_hls.loadSource(_this.config.src);
|
|
@@ -3509,6 +3515,8 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
3509
3515
|
this.bufferedSegmentsCount = 0;
|
|
3510
3516
|
this.hasInitialBufferCompleted = false;
|
|
3511
3517
|
this.shouldAutoplayAfterBuffering = !!this.config.autoplay;
|
|
3518
|
+
this.latencyProfileApplied = false;
|
|
3519
|
+
this.detectedLowLatencyStream = void 0;
|
|
3512
3520
|
minSegments = (_this_config_minSegmentsBeforePlay = this.config.minSegmentsBeforePlay) !== null && _this_config_minSegmentsBeforePlay !== void 0 ? _this_config_minSegmentsBeforePlay : 2;
|
|
3513
3521
|
if (this.config.debugAdTiming) {
|
|
3514
3522
|
console.log("[StormcloudVideoPlayer] Waiting for", minSegments, "segments to buffer before playback");
|
|
@@ -3538,6 +3546,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
3538
3546
|
}).call(_this);
|
|
3539
3547
|
});
|
|
3540
3548
|
this.hls.on(import_hls2.default.Events.LEVEL_LOADED, function(_evt, data) {
|
|
3549
|
+
_this.applyStreamLatencyProfile(data === null || data === void 0 ? void 0 : data.details);
|
|
3541
3550
|
if (_this.inAdBreak || _this.pendingAdBreak) {
|
|
3542
3551
|
return;
|
|
3543
3552
|
}
|
|
@@ -3817,6 +3826,64 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
3817
3826
|
}).call(this);
|
|
3818
3827
|
}
|
|
3819
3828
|
},
|
|
3829
|
+
{
|
|
3830
|
+
key: "applyStreamLatencyProfile",
|
|
3831
|
+
value: function applyStreamLatencyProfile(details) {
|
|
3832
|
+
if (this.latencyProfileApplied || !this.hls) {
|
|
3833
|
+
return;
|
|
3834
|
+
}
|
|
3835
|
+
if (!details) {
|
|
3836
|
+
return;
|
|
3837
|
+
}
|
|
3838
|
+
if (details.live !== true) {
|
|
3839
|
+
this.latencyProfileApplied = true;
|
|
3840
|
+
this.detectedLowLatencyStream = false;
|
|
3841
|
+
return;
|
|
3842
|
+
}
|
|
3843
|
+
var isLowLatencyManifest = this.isLowLatencyManifest(details);
|
|
3844
|
+
var useLowLatency = isLowLatencyManifest && !!this.config.lowLatencyMode;
|
|
3845
|
+
this.detectedLowLatencyStream = useLowLatency;
|
|
3846
|
+
this.latencyProfileApplied = true;
|
|
3847
|
+
var cfg = this.hls.config;
|
|
3848
|
+
if (useLowLatency) {
|
|
3849
|
+
cfg.maxLiveSyncPlaybackRate = 1.5;
|
|
3850
|
+
cfg.maxBufferHole = 0.5;
|
|
3851
|
+
delete cfg.liveSyncDuration;
|
|
3852
|
+
} else {
|
|
3853
|
+
cfg.maxLiveSyncPlaybackRate = 1.1;
|
|
3854
|
+
cfg.maxBufferHole = 1;
|
|
3855
|
+
delete cfg.liveSyncDuration;
|
|
3856
|
+
cfg.liveSyncDurationCount = 3;
|
|
3857
|
+
}
|
|
3858
|
+
if (this.config.debugAdTiming) {
|
|
3859
|
+
var _details_targetduration;
|
|
3860
|
+
console.log("[StormcloudVideoPlayer] Live latency profile: ".concat(useLowLatency ? "LL-HLS (low latency)" : "standard live (stability)"), {
|
|
3861
|
+
isLowLatencyManifest: isLowLatencyManifest,
|
|
3862
|
+
lowLatencyModeRequested: !!this.config.lowLatencyMode,
|
|
3863
|
+
canBlockReload: details.canBlockReload,
|
|
3864
|
+
partTarget: details.partTarget,
|
|
3865
|
+
partHoldBack: details.partHoldBack,
|
|
3866
|
+
partListLength: Array.isArray(details.partList) ? details.partList.length : 0,
|
|
3867
|
+
targetDuration: (_details_targetduration = details.targetduration) !== null && _details_targetduration !== void 0 ? _details_targetduration : details.targetDuration,
|
|
3868
|
+
maxLiveSyncPlaybackRate: cfg.maxLiveSyncPlaybackRate,
|
|
3869
|
+
maxBufferHole: cfg.maxBufferHole
|
|
3870
|
+
});
|
|
3871
|
+
}
|
|
3872
|
+
}
|
|
3873
|
+
},
|
|
3874
|
+
{
|
|
3875
|
+
key: "isLowLatencyManifest",
|
|
3876
|
+
value: function isLowLatencyManifest(details) {
|
|
3877
|
+
if (!details) {
|
|
3878
|
+
return false;
|
|
3879
|
+
}
|
|
3880
|
+
var hasParts = Array.isArray(details.partList) && details.partList.length > 0;
|
|
3881
|
+
var hasPartTarget = typeof details.partTarget === "number" && details.partTarget > 0;
|
|
3882
|
+
var hasPartHoldBack = typeof details.partHoldBack === "number" && details.partHoldBack > 0;
|
|
3883
|
+
var canBlockReload = details.canBlockReload === true;
|
|
3884
|
+
return hasParts || hasPartTarget || hasPartHoldBack || canBlockReload;
|
|
3885
|
+
}
|
|
3886
|
+
},
|
|
3820
3887
|
{
|
|
3821
3888
|
key: "attachImaEventListeners",
|
|
3822
3889
|
value: function attachImaEventListeners() {
|
|
@@ -3873,10 +3940,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
3873
3940
|
console.log("[StormcloudVideoPlayer] Starting ad break timer on content_pause (first ad starting)");
|
|
3874
3941
|
}
|
|
3875
3942
|
}
|
|
3876
|
-
|
|
3877
|
-
var currentVolume = _this.video.volume;
|
|
3878
|
-
var adVolume = currentMuted ? 0 : currentVolume;
|
|
3879
|
-
_this.ima.setAdVolume(adVolume);
|
|
3943
|
+
_this.ima.setAdVolume(_this.getPreAdBreakAdVolume());
|
|
3880
3944
|
if (_this.isShowingPlaceholder) {
|
|
3881
3945
|
if (_this.config.debugAdTiming) {
|
|
3882
3946
|
console.log("[StormcloudVideoPlayer] Hiding placeholder - new ads starting");
|
|
@@ -4630,6 +4694,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
4630
4694
|
{
|
|
4631
4695
|
key: "startScte35AdBreak",
|
|
4632
4696
|
value: function startScte35AdBreak(marker, cueKey, durationMs) {
|
|
4697
|
+
this.capturePreAdBreakAudio();
|
|
4633
4698
|
if (!this.video.muted) {
|
|
4634
4699
|
this.video.muted = true;
|
|
4635
4700
|
this.video.volume = 0;
|
|
@@ -5807,6 +5872,12 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
5807
5872
|
return !!(this.config.allowNativeHls && !((_this_config_showCustomControls = this.config.showCustomControls) !== null && _this_config_showCustomControls !== void 0 ? _this_config_showCustomControls : false));
|
|
5808
5873
|
}
|
|
5809
5874
|
},
|
|
5875
|
+
{
|
|
5876
|
+
key: "isLowLatencyStream",
|
|
5877
|
+
value: function isLowLatencyStream() {
|
|
5878
|
+
return this.detectedLowLatencyStream;
|
|
5879
|
+
}
|
|
5880
|
+
},
|
|
5810
5881
|
{
|
|
5811
5882
|
key: "shouldContinueLiveStreamDuringAds",
|
|
5812
5883
|
value: function shouldContinueLiveStreamDuringAds() {
|
|
@@ -6311,9 +6382,9 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6311
6382
|
this.continuousFetchingActive = true;
|
|
6312
6383
|
this.isShowingPlaceholder = false;
|
|
6313
6384
|
this.totalAdRequestsInBreak = 0;
|
|
6314
|
-
|
|
6315
|
-
|
|
6316
|
-
this.
|
|
6385
|
+
this.capturePreAdBreakAudio();
|
|
6386
|
+
currentMuted = this.preAdBreakAudio.muted;
|
|
6387
|
+
currentVolume = this.preAdBreakAudio.volume;
|
|
6317
6388
|
if (!this.video.muted) {
|
|
6318
6389
|
this.video.muted = true;
|
|
6319
6390
|
this.video.volume = 0;
|
|
@@ -6788,7 +6859,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6788
6859
|
value: function tryNextAvailableAd() {
|
|
6789
6860
|
var retryCount = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
|
|
6790
6861
|
return _async_to_generator(function() {
|
|
6791
|
-
var remaining, preloaded,
|
|
6862
|
+
var remaining, preloaded, error, _ref, _ref1, _this_preAdBreakAudio, _this_preAdBreakAudio1, nextAdUrl, error1, errorMessage, maxRetries;
|
|
6792
6863
|
return _ts_generator(this, function(_state) {
|
|
6793
6864
|
switch(_state.label){
|
|
6794
6865
|
case 0:
|
|
@@ -6860,10 +6931,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6860
6931
|
if (this.expectedAdBreakDurationMs != null && this.adStopTimerId == null) {
|
|
6861
6932
|
this.scheduleAdStopAtBreakBoundary();
|
|
6862
6933
|
}
|
|
6863
|
-
|
|
6864
|
-
currentVolume = this.video.volume;
|
|
6865
|
-
adVolume = currentMuted ? 0 : currentVolume;
|
|
6866
|
-
this.ima.setAdVolume(adVolume);
|
|
6934
|
+
this.ima.setAdVolume(this.getPreAdBreakAdVolume());
|
|
6867
6935
|
this.consecutiveFailures = 0;
|
|
6868
6936
|
return [
|
|
6869
6937
|
2
|
|
@@ -6910,9 +6978,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
6910
6978
|
if (this.config.debugAdTiming) {
|
|
6911
6979
|
console.log("[CONTINUOUS-FETCH] \uD83C\uDFAC Requesting next ad via IMA SDK (".concat(this.currentAdIndex + 1, "/").concat(this.totalAdsInBreak, ", ").concat(this.adRequestQueue.length, " remaining in queue)"));
|
|
6912
6980
|
}
|
|
6913
|
-
|
|
6914
|
-
currentVolume1 = this.video.volume;
|
|
6915
|
-
this.ima.updateOriginalMutedState(currentMuted1, currentVolume1);
|
|
6981
|
+
this.ima.updateOriginalMutedState((_ref = (_this_preAdBreakAudio = this.preAdBreakAudio) === null || _this_preAdBreakAudio === void 0 ? void 0 : _this_preAdBreakAudio.muted) !== null && _ref !== void 0 ? _ref : this.video.muted, (_ref1 = (_this_preAdBreakAudio1 = this.preAdBreakAudio) === null || _this_preAdBreakAudio1 === void 0 ? void 0 : _this_preAdBreakAudio1.volume) !== null && _ref1 !== void 0 ? _ref1 : this.video.volume);
|
|
6916
6982
|
this.currentAdIndex++;
|
|
6917
6983
|
this.totalAdRequestsInBreak++;
|
|
6918
6984
|
this.lastAdRequestTime = Date.now();
|
|
@@ -7005,7 +7071,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
7005
7071
|
key: "showPlaceholderAndWaitForAds",
|
|
7006
7072
|
value: function showPlaceholderAndWaitForAds() {
|
|
7007
7073
|
return _async_to_generator(function() {
|
|
7008
|
-
var remaining, waitTime, checkInterval, maxChecks, i,
|
|
7074
|
+
var remaining, waitTime, checkInterval, maxChecks, i, _ref, _ref1, _this_preAdBreakAudio, _this_preAdBreakAudio1, nextAdUrl, error, errorMessage;
|
|
7009
7075
|
return _ts_generator(this, function(_state) {
|
|
7010
7076
|
switch(_state.label){
|
|
7011
7077
|
case 0:
|
|
@@ -7101,9 +7167,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
7101
7167
|
}
|
|
7102
7168
|
this.isShowingPlaceholder = false;
|
|
7103
7169
|
this.ima.hidePlaceholder();
|
|
7104
|
-
|
|
7105
|
-
currentVolume = this.video.volume;
|
|
7106
|
-
this.ima.updateOriginalMutedState(currentMuted, currentVolume);
|
|
7170
|
+
this.ima.updateOriginalMutedState((_ref = (_this_preAdBreakAudio = this.preAdBreakAudio) === null || _this_preAdBreakAudio === void 0 ? void 0 : _this_preAdBreakAudio.muted) !== null && _ref !== void 0 ? _ref : this.video.muted, (_ref1 = (_this_preAdBreakAudio1 = this.preAdBreakAudio) === null || _this_preAdBreakAudio1 === void 0 ? void 0 : _this_preAdBreakAudio1.volume) !== null && _ref1 !== void 0 ? _ref1 : this.video.volume);
|
|
7107
7171
|
this.currentAdIndex++;
|
|
7108
7172
|
this.totalAdRequestsInBreak++;
|
|
7109
7173
|
this.lastAdRequestTime = Date.now();
|
|
@@ -7285,7 +7349,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
7285
7349
|
first = tags[0];
|
|
7286
7350
|
rest = tags.slice(1);
|
|
7287
7351
|
this.adPodQueue = rest;
|
|
7288
|
-
this.
|
|
7352
|
+
this.capturePreAdBreakAudio();
|
|
7289
7353
|
this.showAds = true;
|
|
7290
7354
|
this.inAdBreak = true;
|
|
7291
7355
|
this.currentAdBreakStartWallClockMs = Date.now();
|
|
@@ -7312,12 +7376,10 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
7312
7376
|
];
|
|
7313
7377
|
case 3:
|
|
7314
7378
|
error = _state.sent();
|
|
7315
|
-
this.adPodQueue = [];
|
|
7316
|
-
this.inAdBreak = false;
|
|
7317
|
-
this.showAds = false;
|
|
7318
7379
|
if (this.config.debugAdTiming) {
|
|
7319
7380
|
console.warn("[StormcloudVideoPlayer] VMAP ad request failed:", error);
|
|
7320
7381
|
}
|
|
7382
|
+
this.handleAdPodComplete();
|
|
7321
7383
|
return [
|
|
7322
7384
|
3,
|
|
7323
7385
|
4
|
|
@@ -7548,7 +7610,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
7548
7610
|
key: "playSingleAd",
|
|
7549
7611
|
value: function playSingleAd(vastTagUrl) {
|
|
7550
7612
|
return _async_to_generator(function() {
|
|
7551
|
-
var requestToken,
|
|
7613
|
+
var requestToken, playError, preloadedFallback, fallbackError, error, errorMessage, preloadedFallback1, fallbackError1;
|
|
7552
7614
|
return _ts_generator(this, function(_state) {
|
|
7553
7615
|
switch(_state.label){
|
|
7554
7616
|
case 0:
|
|
@@ -7635,10 +7697,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
7635
7697
|
if (this.expectedAdBreakDurationMs != null && this.adStopTimerId == null) {
|
|
7636
7698
|
this.scheduleAdStopAtBreakBoundary();
|
|
7637
7699
|
}
|
|
7638
|
-
|
|
7639
|
-
currentVolume = this.video.volume;
|
|
7640
|
-
adVolume = currentMuted ? 0 : currentVolume;
|
|
7641
|
-
this.ima.setAdVolume(adVolume);
|
|
7700
|
+
this.ima.setAdVolume(this.getPreAdBreakAdVolume());
|
|
7642
7701
|
this.consecutiveFailures = 0;
|
|
7643
7702
|
this.temporaryFailureUrls.delete(vastTagUrl);
|
|
7644
7703
|
return [
|
|
@@ -7685,10 +7744,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
7685
7744
|
if (this.expectedAdBreakDurationMs != null && this.adStopTimerId == null) {
|
|
7686
7745
|
this.scheduleAdStopAtBreakBoundary();
|
|
7687
7746
|
}
|
|
7688
|
-
|
|
7689
|
-
currentVolume1 = this.video.volume;
|
|
7690
|
-
adVolume1 = currentMuted1 ? 0 : currentVolume1;
|
|
7691
|
-
this.ima.setAdVolume(adVolume1);
|
|
7747
|
+
this.ima.setAdVolume(this.getPreAdBreakAdVolume());
|
|
7692
7748
|
return [
|
|
7693
7749
|
2
|
|
7694
7750
|
];
|
|
@@ -7762,10 +7818,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
7762
7818
|
];
|
|
7763
7819
|
case 14:
|
|
7764
7820
|
_state.sent();
|
|
7765
|
-
|
|
7766
|
-
currentVolume2 = this.video.volume;
|
|
7767
|
-
adVolume2 = currentMuted2 ? 0 : currentVolume2;
|
|
7768
|
-
this.ima.setAdVolume(adVolume2);
|
|
7821
|
+
this.ima.setAdVolume(this.getPreAdBreakAdVolume());
|
|
7769
7822
|
return [
|
|
7770
7823
|
2
|
|
7771
7824
|
];
|
|
@@ -7805,6 +7858,33 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
7805
7858
|
}).call(this);
|
|
7806
7859
|
}
|
|
7807
7860
|
},
|
|
7861
|
+
{
|
|
7862
|
+
key: "capturePreAdBreakAudio",
|
|
7863
|
+
value: function capturePreAdBreakAudio() {
|
|
7864
|
+
if (this.preAdBreakAudio) {
|
|
7865
|
+
return;
|
|
7866
|
+
}
|
|
7867
|
+
var captured = {
|
|
7868
|
+
muted: this.video.muted,
|
|
7869
|
+
volume: typeof this.video.volume === "number" && !Number.isNaN(this.video.volume) ? Math.max(0, Math.min(1, this.video.volume)) : 1
|
|
7870
|
+
};
|
|
7871
|
+
this.preAdBreakAudio = captured;
|
|
7872
|
+
this.ima.updateOriginalMutedState(captured.muted, captured.volume);
|
|
7873
|
+
if (this.config.debugAdTiming) {
|
|
7874
|
+
console.log("[StormcloudVideoPlayer] Captured pre-ad-break audio state: muted=".concat(captured.muted, ", volume=").concat(captured.volume));
|
|
7875
|
+
}
|
|
7876
|
+
}
|
|
7877
|
+
},
|
|
7878
|
+
{
|
|
7879
|
+
key: "getPreAdBreakAdVolume",
|
|
7880
|
+
value: function getPreAdBreakAdVolume() {
|
|
7881
|
+
var state = this.preAdBreakAudio;
|
|
7882
|
+
if (state) {
|
|
7883
|
+
return state.muted ? 0 : state.volume;
|
|
7884
|
+
}
|
|
7885
|
+
return this.ima.getOriginalMutedState() ? 0 : this.ima.getOriginalVolume();
|
|
7886
|
+
}
|
|
7887
|
+
},
|
|
7808
7888
|
{
|
|
7809
7889
|
key: "handleAdPodComplete",
|
|
7810
7890
|
value: function handleAdPodComplete() {
|
|
@@ -7838,14 +7918,19 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
7838
7918
|
this.consecutiveFailures = 0;
|
|
7839
7919
|
this.globalConsecutiveNoFills = 0;
|
|
7840
7920
|
this.ima.stop().catch(function() {});
|
|
7841
|
-
var restoredMuted = this.ima.getOriginalMutedState();
|
|
7842
|
-
var restoredVolume = this.ima.getOriginalVolume();
|
|
7921
|
+
var restoredMuted = this.preAdBreakAudio ? this.preAdBreakAudio.muted : this.ima.getOriginalMutedState();
|
|
7922
|
+
var restoredVolume = this.preAdBreakAudio ? this.preAdBreakAudio.volume : this.ima.getOriginalVolume();
|
|
7923
|
+
this.ima.updateOriginalMutedState(restoredMuted, restoredVolume);
|
|
7843
7924
|
if (this.video.muted !== restoredMuted) {
|
|
7844
7925
|
this.video.muted = restoredMuted;
|
|
7845
7926
|
}
|
|
7846
7927
|
if (Math.abs(this.video.volume - restoredVolume) > 0.01) {
|
|
7847
7928
|
this.video.volume = restoredVolume;
|
|
7848
7929
|
}
|
|
7930
|
+
this.preAdBreakAudio = void 0;
|
|
7931
|
+
if (this.config.debugAdTiming) {
|
|
7932
|
+
console.log("[StormcloudVideoPlayer] Restored post-ad-break audio state: muted=".concat(restoredMuted, ", volume=").concat(restoredVolume));
|
|
7933
|
+
}
|
|
7849
7934
|
if (this.shouldContinueLiveStreamDuringAds()) {
|
|
7850
7935
|
if (this.video.paused) {
|
|
7851
7936
|
var _this_video_play;
|
|
@@ -8255,6 +8340,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
8255
8340
|
this.clearAdFailsafeTimer();
|
|
8256
8341
|
this.clearAdRequestWatchdog();
|
|
8257
8342
|
this.clearPendingAdBreak();
|
|
8343
|
+
this.preAdBreakAudio = void 0;
|
|
8258
8344
|
if (this.placeholderContainer) {
|
|
8259
8345
|
if (this.placeholderContainer.parentElement) {
|
|
8260
8346
|
this.placeholderContainer.parentElement.removeChild(this.placeholderContainer);
|
|
@@ -8289,6 +8375,64 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
8289
8375
|
// src/ui/StormcloudVideoPlayer.tsx
|
|
8290
8376
|
var import_fa = require("react-icons/fa");
|
|
8291
8377
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
8378
|
+
var ExpandIcon = function ExpandIcon(param) {
|
|
8379
|
+
var _param_size = param.size, size = _param_size === void 0 ? 18 : _param_size;
|
|
8380
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", {
|
|
8381
|
+
width: size,
|
|
8382
|
+
height: size,
|
|
8383
|
+
viewBox: "0 0 24 24",
|
|
8384
|
+
fill: "none",
|
|
8385
|
+
stroke: "currentColor",
|
|
8386
|
+
strokeWidth: 2,
|
|
8387
|
+
strokeLinecap: "round",
|
|
8388
|
+
strokeLinejoin: "round",
|
|
8389
|
+
"aria-hidden": "true",
|
|
8390
|
+
focusable: "false",
|
|
8391
|
+
children: [
|
|
8392
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", {
|
|
8393
|
+
d: "M9 4H4v5"
|
|
8394
|
+
}),
|
|
8395
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", {
|
|
8396
|
+
d: "M20 9V4h-5"
|
|
8397
|
+
}),
|
|
8398
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", {
|
|
8399
|
+
d: "M15 20h5v-5"
|
|
8400
|
+
}),
|
|
8401
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", {
|
|
8402
|
+
d: "M4 15v5h5"
|
|
8403
|
+
})
|
|
8404
|
+
]
|
|
8405
|
+
});
|
|
8406
|
+
};
|
|
8407
|
+
var CompressIcon = function CompressIcon(param) {
|
|
8408
|
+
var _param_size = param.size, size = _param_size === void 0 ? 18 : _param_size;
|
|
8409
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", {
|
|
8410
|
+
width: size,
|
|
8411
|
+
height: size,
|
|
8412
|
+
viewBox: "0 0 24 24",
|
|
8413
|
+
fill: "none",
|
|
8414
|
+
stroke: "currentColor",
|
|
8415
|
+
strokeWidth: 2,
|
|
8416
|
+
strokeLinecap: "round",
|
|
8417
|
+
strokeLinejoin: "round",
|
|
8418
|
+
"aria-hidden": "true",
|
|
8419
|
+
focusable: "false",
|
|
8420
|
+
children: [
|
|
8421
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", {
|
|
8422
|
+
d: "M4 9h5V4"
|
|
8423
|
+
}),
|
|
8424
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", {
|
|
8425
|
+
d: "M15 4v5h5"
|
|
8426
|
+
}),
|
|
8427
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", {
|
|
8428
|
+
d: "M20 15h-5v5"
|
|
8429
|
+
}),
|
|
8430
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", {
|
|
8431
|
+
d: "M9 20v-5H4"
|
|
8432
|
+
})
|
|
8433
|
+
]
|
|
8434
|
+
});
|
|
8435
|
+
};
|
|
8292
8436
|
var CRITICAL_PROPS = [
|
|
8293
8437
|
"src",
|
|
8294
8438
|
"allowNativeHls",
|
|
@@ -9339,9 +9483,9 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
9339
9483
|
minHeight: "".concat(36 * responsiveScale, "px")
|
|
9340
9484
|
},
|
|
9341
9485
|
title: isFullscreen ? "Exit Fullscreen" : "Enter Fullscreen",
|
|
9342
|
-
children: isFullscreen ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
9486
|
+
children: isFullscreen ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CompressIcon, {
|
|
9343
9487
|
size: Math.max(14, 18 * responsiveScale)
|
|
9344
|
-
}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
9488
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ExpandIcon, {
|
|
9345
9489
|
size: Math.max(14, 18 * responsiveScale)
|
|
9346
9490
|
})
|
|
9347
9491
|
})
|
|
@@ -9539,9 +9683,9 @@ var StormcloudVideoPlayerComponent = import_react.default.memo(function(props) {
|
|
|
9539
9683
|
background: "rgba(0, 0, 0, 0.6)"
|
|
9540
9684
|
},
|
|
9541
9685
|
title: isFullscreen ? "Exit Fullscreen" : "Enter Fullscreen",
|
|
9542
|
-
children: isFullscreen ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
9686
|
+
children: isFullscreen ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CompressIcon, {
|
|
9543
9687
|
size: Math.max(14, 18 * responsiveScale)
|
|
9544
|
-
}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
9688
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ExpandIcon, {
|
|
9545
9689
|
size: Math.max(14, 18 * responsiveScale)
|
|
9546
9690
|
})
|
|
9547
9691
|
})
|