stormcloud-video-player 0.7.22 → 0.7.24
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 +13 -9
- package/lib/index.cjs.map +1 -1
- package/lib/index.js +13 -9
- package/lib/index.js.map +1 -1
- package/lib/player/StormcloudVideoPlayer.cjs +11 -8
- package/lib/player/StormcloudVideoPlayer.cjs.map +1 -1
- package/lib/players/HlsPlayer.cjs +11 -8
- package/lib/players/HlsPlayer.cjs.map +1 -1
- package/lib/players/index.cjs +11 -8
- package/lib/players/index.cjs.map +1 -1
- package/lib/ui/StormcloudVideoPlayer.cjs +13 -9
- package/lib/ui/StormcloudVideoPlayer.cjs.map +1 -1
- package/package.json +1 -1
|
@@ -2992,31 +2992,34 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
2992
2992
|
this.hls.on(import_hls.default.Events.FRAG_CHANGED, function(_evt, data) {
|
|
2993
2993
|
var frag = data === null || data === void 0 ? void 0 : data.frag;
|
|
2994
2994
|
if (!frag) return;
|
|
2995
|
-
if (_this.lastAdInsertionPoint && !_this.inAdBreak &&
|
|
2995
|
+
if (_this.lastAdInsertionPoint && !_this.inAdBreak && _this.lastAdInsertionPoint.updated_at !== _this.processedAdInsertionUpdatedAt) {
|
|
2996
2996
|
var segmentName = _this.lastAdInsertionPoint.segment_ts_name;
|
|
2997
2997
|
if (_this.fragmentMatchesSegment(frag, segmentName)) {
|
|
2998
|
-
var _ref;
|
|
2998
|
+
var _ref, _ref1;
|
|
2999
|
+
var _this_pendingAdBreak;
|
|
2999
3000
|
_this.processedAdInsertionUpdatedAt = _this.lastAdInsertionPoint.updated_at;
|
|
3000
3001
|
var offsetMs = (_this.lastAdInsertionPoint.offset_seconds || 0) * 1e3;
|
|
3002
|
+
var durationSeconds = (_ref = (_this_pendingAdBreak = _this.pendingAdBreak) === null || _this_pendingAdBreak === void 0 ? void 0 : _this_pendingAdBreak.durationSeconds) !== null && _ref !== void 0 ? _ref : 60;
|
|
3003
|
+
var withPrefetch = _this.pendingAdBreak != null;
|
|
3001
3004
|
_this.pushAdInsertionDebug("segment_playing", segmentName, {
|
|
3002
3005
|
offsetSeconds: _this.lastAdInsertionPoint.offset_seconds,
|
|
3003
|
-
detail: "sn=".concat((
|
|
3006
|
+
detail: "sn=".concat((_ref1 = frag === null || frag === void 0 ? void 0 : frag.sn) !== null && _ref1 !== void 0 ? _ref1 : "?").concat(withPrefetch ? " (prefetch active)" : "")
|
|
3004
3007
|
});
|
|
3005
3008
|
if (_this.config.debugAdTiming) {
|
|
3006
|
-
console.log('[StormcloudVideoPlayer] Ad insertion segment "'.concat(segmentName, '" now playing — scheduling ad start in ').concat(offsetMs, "ms"));
|
|
3009
|
+
console.log('[StormcloudVideoPlayer] Ad insertion segment "'.concat(segmentName, '" now playing — scheduling ad start in ').concat(offsetMs, "ms") + (withPrefetch ? " (prefetch was active, preloaded tokens will be used)" : ""));
|
|
3007
3010
|
}
|
|
3008
3011
|
_this.pushAdInsertionDebug("ad_scheduled", segmentName, {
|
|
3009
3012
|
offsetSeconds: _this.lastAdInsertionPoint.offset_seconds,
|
|
3010
|
-
detail: "in ".concat(offsetMs, "ms, dur=
|
|
3013
|
+
detail: "in ".concat(offsetMs, "ms, dur=").concat(durationSeconds, "s").concat(withPrefetch ? " (with prefetch)" : "")
|
|
3011
3014
|
});
|
|
3012
3015
|
_this.clearAdInsertionOffsetTimer();
|
|
3013
3016
|
_this.adInsertionOffsetTimerId = window.setTimeout(function() {
|
|
3014
3017
|
_this.adInsertionOffsetTimerId = void 0;
|
|
3015
3018
|
if (_this.inAdBreak) return;
|
|
3016
3019
|
_this.pushAdInsertionDebug("ad_triggered", segmentName, {
|
|
3017
|
-
detail: "ad break started (
|
|
3020
|
+
detail: "ad break started (".concat(durationSeconds, "s").concat(withPrefetch ? ", with prefetch" : "", ")")
|
|
3018
3021
|
});
|
|
3019
|
-
void _this.handleAdStart(
|
|
3022
|
+
void _this.handleAdStart(durationSeconds);
|
|
3020
3023
|
}, offsetMs);
|
|
3021
3024
|
}
|
|
3022
3025
|
}
|
|
@@ -3884,7 +3887,7 @@ var StormcloudVideoPlayer = /*#__PURE__*/ function() {
|
|
|
3884
3887
|
this.pushAdInsertionDebug("api_response", data.segment_ts_name, {
|
|
3885
3888
|
offsetSeconds: data.offset_seconds,
|
|
3886
3889
|
updatedAt: data.updated_at,
|
|
3887
|
-
detail: "ch=".concat(data.channel_id
|
|
3890
|
+
detail: "ch=".concat(data.channel_id)
|
|
3888
3891
|
});
|
|
3889
3892
|
if (segmentChanged && (this.pendingAdBreak || this.adInsertionOffsetTimerId != null)) {
|
|
3890
3893
|
this.clearAdInsertionOffsetTimer();
|