stormcloud-video-player 0.7.13 → 0.7.16
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 +371 -49
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +12 -0
- package/lib/index.d.ts +12 -0
- package/lib/index.js +372 -50
- package/lib/index.js.map +1 -1
- package/lib/player/StormcloudVideoPlayer.cjs +38 -10
- package/lib/player/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/player/StormcloudVideoPlayer.d.cts +4 -0
- package/lib/players/FilePlayer.cjs.map +1 -1
- package/lib/players/HlsPlayer.cjs +38 -10
- package/lib/players/HlsPlayer.cjs.map +1 -1
- package/lib/players/index.cjs +38 -10
- package/lib/players/index.cjs.map +1 -1
- package/lib/sdk/adstormPlayer.cjs.map +1 -1
- package/lib/sdk/vastParser.cjs.map +1 -1
- package/lib/ui/OverlayRenderer.cjs +408 -37
- package/lib/ui/OverlayRenderer.cjs.map +1 -1
- package/lib/ui/StormcloudVideoPlayer.cjs +371 -49
- package/lib/ui/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/utils/browserCompat.cjs.map +1 -1
- package/lib/utils/overlays.d.cts +8 -0
- package/lib/utils/polyfills.cjs.map +1 -1
- package/lib/utils/tracking.cjs.map +1 -1
- package/package.json +1 -1
|
@@ -2715,6 +2715,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
2715
2715
|
this.maxTotalAdRequestsPerBreak = 20;
|
|
2716
2716
|
this.pendingAdBreak = null;
|
|
2717
2717
|
this.savedMutedStateBeforeAd = null;
|
|
2718
|
+
this.adLayerInitialized = false;
|
|
2718
2719
|
this.consecutiveFailures = 0;
|
|
2719
2720
|
this.maxConsecutiveFailures = 5;
|
|
2720
2721
|
this.lastAdRequestTime = 0;
|
|
@@ -3363,12 +3364,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
3363
3364
|
this.video.autoplay = !!this.config.autoplay;
|
|
3364
3365
|
this.video.muted = !!this.config.muted;
|
|
3365
3366
|
if (!this.config.disableAds) {
|
|
3366
|
-
this.
|
|
3367
|
-
if (!this.config.disableFiller) {
|
|
3368
|
-
this.ensureFillerVideo();
|
|
3369
|
-
}
|
|
3370
|
-
this.adLayer.updateOriginalMutedState(this.video.muted, this.video.volume);
|
|
3371
|
-
this.attachAdLayerEventListeners();
|
|
3367
|
+
this.initializeAdLayer();
|
|
3372
3368
|
}
|
|
3373
3369
|
this.timeUpdateHandler = function() {
|
|
3374
3370
|
_this.onTimeUpdate(_this.video.currentTime);
|
|
@@ -3469,6 +3465,31 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
3469
3465
|
return this.showAds;
|
|
3470
3466
|
}
|
|
3471
3467
|
},
|
|
3468
|
+
{
|
|
3469
|
+
key: "initializeAdLayer",
|
|
3470
|
+
value: function initializeAdLayer() {
|
|
3471
|
+
if (this.adLayerInitialized) return;
|
|
3472
|
+
this.adLayer.initialize();
|
|
3473
|
+
if (!this.config.disableFiller) {
|
|
3474
|
+
this.ensureFillerVideo();
|
|
3475
|
+
}
|
|
3476
|
+
this.adLayer.updateOriginalMutedState(this.video.muted, this.video.volume);
|
|
3477
|
+
this.attachAdLayerEventListeners();
|
|
3478
|
+
this.adLayerInitialized = true;
|
|
3479
|
+
}
|
|
3480
|
+
},
|
|
3481
|
+
{
|
|
3482
|
+
key: "setDisableAds",
|
|
3483
|
+
value: function setDisableAds(disabled) {
|
|
3484
|
+
this.config.disableAds = disabled;
|
|
3485
|
+
if (!disabled && this.attached) {
|
|
3486
|
+
this.initializeAdLayer();
|
|
3487
|
+
}
|
|
3488
|
+
if (this.config.debugAdTiming) {
|
|
3489
|
+
console.log("[StormcloudVideoPlayer] setDisableAds:", disabled);
|
|
3490
|
+
}
|
|
3491
|
+
}
|
|
3492
|
+
},
|
|
3472
3493
|
{
|
|
3473
3494
|
key: "syncMainContentAudioWhenVisible",
|
|
3474
3495
|
value: function syncMainContentAudioWhenVisible() {
|
|
@@ -3993,14 +4014,21 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
3993
4014
|
}
|
|
3994
4015
|
}
|
|
3995
4016
|
},
|
|
4017
|
+
{
|
|
4018
|
+
key: "extractTsFilename",
|
|
4019
|
+
value: function extractTsFilename(url) {
|
|
4020
|
+
var _parts_;
|
|
4021
|
+
var clean = url.includes("?") ? url.slice(0, url.indexOf("?")) : url;
|
|
4022
|
+
var parts = clean.split("/");
|
|
4023
|
+
return (_parts_ = parts[parts.length - 1]) !== null && _parts_ !== void 0 ? _parts_ : clean;
|
|
4024
|
+
}
|
|
4025
|
+
},
|
|
3996
4026
|
{
|
|
3997
4027
|
key: "fragmentMatchesSegment",
|
|
3998
4028
|
value: function fragmentMatchesSegment(frag, segmentName) {
|
|
3999
|
-
var _rawUrl_split_;
|
|
4000
4029
|
var rawUrl = (frag === null || frag === void 0 ? void 0 : frag.url) || (frag === null || frag === void 0 ? void 0 : frag.relurl) || "";
|
|
4001
|
-
|
|
4002
|
-
|
|
4003
|
-
return url.endsWith(name) || url.includes(name);
|
|
4030
|
+
if (!rawUrl) return false;
|
|
4031
|
+
return this.extractTsFilename(rawUrl) === this.extractTsFilename(segmentName);
|
|
4004
4032
|
}
|
|
4005
4033
|
},
|
|
4006
4034
|
{
|