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
package/lib/players/index.cjs
CHANGED
|
@@ -2803,6 +2803,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
2803
2803
|
this.maxTotalAdRequestsPerBreak = 20;
|
|
2804
2804
|
this.pendingAdBreak = null;
|
|
2805
2805
|
this.savedMutedStateBeforeAd = null;
|
|
2806
|
+
this.adLayerInitialized = false;
|
|
2806
2807
|
this.consecutiveFailures = 0;
|
|
2807
2808
|
this.maxConsecutiveFailures = 5;
|
|
2808
2809
|
this.lastAdRequestTime = 0;
|
|
@@ -3451,12 +3452,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
3451
3452
|
this.video.autoplay = !!this.config.autoplay;
|
|
3452
3453
|
this.video.muted = !!this.config.muted;
|
|
3453
3454
|
if (!this.config.disableAds) {
|
|
3454
|
-
this.
|
|
3455
|
-
if (!this.config.disableFiller) {
|
|
3456
|
-
this.ensureFillerVideo();
|
|
3457
|
-
}
|
|
3458
|
-
this.adLayer.updateOriginalMutedState(this.video.muted, this.video.volume);
|
|
3459
|
-
this.attachAdLayerEventListeners();
|
|
3455
|
+
this.initializeAdLayer();
|
|
3460
3456
|
}
|
|
3461
3457
|
this.timeUpdateHandler = function() {
|
|
3462
3458
|
_this.onTimeUpdate(_this.video.currentTime);
|
|
@@ -3557,6 +3553,31 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
3557
3553
|
return this.showAds;
|
|
3558
3554
|
}
|
|
3559
3555
|
},
|
|
3556
|
+
{
|
|
3557
|
+
key: "initializeAdLayer",
|
|
3558
|
+
value: function initializeAdLayer() {
|
|
3559
|
+
if (this.adLayerInitialized) return;
|
|
3560
|
+
this.adLayer.initialize();
|
|
3561
|
+
if (!this.config.disableFiller) {
|
|
3562
|
+
this.ensureFillerVideo();
|
|
3563
|
+
}
|
|
3564
|
+
this.adLayer.updateOriginalMutedState(this.video.muted, this.video.volume);
|
|
3565
|
+
this.attachAdLayerEventListeners();
|
|
3566
|
+
this.adLayerInitialized = true;
|
|
3567
|
+
}
|
|
3568
|
+
},
|
|
3569
|
+
{
|
|
3570
|
+
key: "setDisableAds",
|
|
3571
|
+
value: function setDisableAds(disabled) {
|
|
3572
|
+
this.config.disableAds = disabled;
|
|
3573
|
+
if (!disabled && this.attached) {
|
|
3574
|
+
this.initializeAdLayer();
|
|
3575
|
+
}
|
|
3576
|
+
if (this.config.debugAdTiming) {
|
|
3577
|
+
console.log("[StormcloudVideoPlayer] setDisableAds:", disabled);
|
|
3578
|
+
}
|
|
3579
|
+
}
|
|
3580
|
+
},
|
|
3560
3581
|
{
|
|
3561
3582
|
key: "syncMainContentAudioWhenVisible",
|
|
3562
3583
|
value: function syncMainContentAudioWhenVisible() {
|
|
@@ -4081,14 +4102,21 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
4081
4102
|
}
|
|
4082
4103
|
}
|
|
4083
4104
|
},
|
|
4105
|
+
{
|
|
4106
|
+
key: "extractTsFilename",
|
|
4107
|
+
value: function extractTsFilename(url) {
|
|
4108
|
+
var _parts_;
|
|
4109
|
+
var clean = url.includes("?") ? url.slice(0, url.indexOf("?")) : url;
|
|
4110
|
+
var parts = clean.split("/");
|
|
4111
|
+
return (_parts_ = parts[parts.length - 1]) !== null && _parts_ !== void 0 ? _parts_ : clean;
|
|
4112
|
+
}
|
|
4113
|
+
},
|
|
4084
4114
|
{
|
|
4085
4115
|
key: "fragmentMatchesSegment",
|
|
4086
4116
|
value: function fragmentMatchesSegment(frag, segmentName) {
|
|
4087
|
-
var _rawUrl_split_;
|
|
4088
4117
|
var rawUrl = (frag === null || frag === void 0 ? void 0 : frag.url) || (frag === null || frag === void 0 ? void 0 : frag.relurl) || "";
|
|
4089
|
-
|
|
4090
|
-
|
|
4091
|
-
return url.endsWith(name) || url.includes(name);
|
|
4118
|
+
if (!rawUrl) return false;
|
|
4119
|
+
return this.extractTsFilename(rawUrl) === this.extractTsFilename(segmentName);
|
|
4092
4120
|
}
|
|
4093
4121
|
},
|
|
4094
4122
|
{
|