@amazon/vinyl 3.2.0 → 3.2.2
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/index.cjs +65 -45
- package/dist/index.cjs.map +2 -2
- package/dist/index.js +90 -69
- package/dist/index.js.map +3 -3
- package/dist/test/integ.es5.js +303 -287
- package/dist/test/integ.js +328 -71
- package/dist/test/integ.js.map +2 -2
- package/dist/types/current/ad/AdControllerImpl.d.ts +18 -2
- package/dist/types/current/ad/AdControllerImpl.d.ts.map +1 -1
- package/dist/types/current/ad/AdControllerImpl.js +42 -20
- package/dist/types/current/drm/DrmControllerImpl.d.ts +6 -0
- package/dist/types/current/drm/DrmControllerImpl.d.ts.map +1 -1
- package/dist/types/current/drm/DrmControllerImpl.js +11 -1
- package/dist/types/current/playback/PlaybackControllerImpl.d.ts +8 -2
- package/dist/types/current/playback/PlaybackControllerImpl.d.ts.map +1 -1
- package/dist/types/current/playback/PlaybackControllerImpl.js +38 -33
- package/dist/types/current/playback/createStallMonitor.d.ts.map +1 -1
- package/dist/types/current/playback/createStallMonitor.js +19 -14
- package/dist/types/current/track/mse/MseTrack.d.ts +0 -1
- package/dist/types/current/track/mse/MseTrack.d.ts.map +1 -1
- package/dist/types/current/track/mse/MseTrack.js +5 -6
- package/dist/types/current/tsconfig.tsbuildinfo +1 -1
- package/dist/types/ts3.7/ad/AdControllerImpl.d.ts +18 -2
- package/dist/types/ts3.7/drm/DrmControllerImpl.d.ts +6 -0
- package/dist/types/ts3.7/playback/PlaybackControllerImpl.d.ts +8 -2
- package/dist/types/ts3.7/track/mse/MseTrack.d.ts +0 -1
- package/dist/types/ts4.1/ad/AdControllerImpl.d.ts +18 -2
- package/dist/types/ts4.1/drm/DrmControllerImpl.d.ts +6 -0
- package/dist/types/ts4.1/playback/PlaybackControllerImpl.d.ts +8 -2
- package/dist/types/ts4.1/track/mse/MseTrack.d.ts +0 -1
- package/dist/types/ts4.7/ad/AdControllerImpl.d.ts +18 -2
- package/dist/types/ts4.7/drm/DrmControllerImpl.d.ts +6 -0
- package/dist/types/ts4.7/playback/PlaybackControllerImpl.d.ts +8 -2
- package/dist/types/ts4.7/track/mse/MseTrack.d.ts +0 -1
- package/dist/unit/types/current/ad/AdControllerImpl.test.js +110 -4
- package/dist/unit/types/current/drm/DrmControllerImpl.test.js +19 -1
- package/dist/unit/types/current/playback/PlaybackControllerImpl.test.js +15 -0
- package/dist/unit/types/current/playback/createStallMonitor.test.js +38 -0
- package/dist/unit/types/current/streaming/MseTrack.test.js +15 -0
- package/dist/unit/types/current/tsconfig.tsbuildinfo +1 -1
- package/dist/vinylTestUtil/index.js +10 -1
- package/dist/vinylTestUtil/index.js.map +2 -2
- package/dist/vinylTestUtil/types/current/assets/vinylTestAssets.d.ts +5 -0
- package/dist/vinylTestUtil/types/current/assets/vinylTestAssets.d.ts.map +1 -1
- package/dist/vinylTestUtil/types/current/assets/vinylTestAssets.js +9 -0
- package/dist/vinylTestUtil/types/current/tsconfig.tsbuildinfo +1 -1
- package/dist/vinylTestUtil/types/ts3.7/assets/vinylTestAssets.d.ts +5 -0
- package/dist/vinylTestUtil/types/ts4.1/assets/vinylTestAssets.d.ts +5 -0
- package/dist/vinylTestUtil/types/ts4.7/assets/vinylTestAssets.d.ts +5 -0
- package/package.json +10 -10
package/dist/index.js
CHANGED
|
@@ -68,6 +68,7 @@ var AdError = class _AdError extends ReportableError {
|
|
|
68
68
|
|
|
69
69
|
// src/ad/AdControllerImpl.ts
|
|
70
70
|
var AD_START_TOLERANCE = 0.05;
|
|
71
|
+
var PLAYOUT_LIMIT_TOLERANCE = 1;
|
|
71
72
|
var defaultAdControllerImplOptions = {
|
|
72
73
|
adLoadTimeout: 15,
|
|
73
74
|
preloadAheadTime: 10
|
|
@@ -558,23 +559,29 @@ var AdControllerImpl = class extends EventHostImpl {
|
|
|
558
559
|
});
|
|
559
560
|
}
|
|
560
561
|
/**
|
|
561
|
-
*
|
|
562
|
-
*
|
|
562
|
+
* Enforces the break-level playout limit (X-PLAYOUT-LIMIT): a budget shared
|
|
563
|
+
* across all of the break's ads. When cumulative playout reaches it, the
|
|
564
|
+
* whole break ends, dropping any ads that have not started.
|
|
565
|
+
*
|
|
566
|
+
* This is deliberately NOT a per-ad cap. Each ad asset is its own source and
|
|
567
|
+
* ends on its media `ended` (see the 'ended' handler), which is what advances
|
|
568
|
+
* a multi-ad break. Ending an ad at its declared per-ad DURATION instead would
|
|
569
|
+
* truncate the real asset whenever a packager under-declares it — e.g. rounds
|
|
570
|
+
* a 6.732s asset down to a whole-second 6 — cutting off the fractional tail.
|
|
563
571
|
*/
|
|
564
572
|
enforcePlayoutLimits(adState) {
|
|
573
|
+
if (!adState.started) return;
|
|
574
|
+
const { parentBreak } = adState;
|
|
575
|
+
const limit = parentBreak.adBreak.playoutLimit;
|
|
576
|
+
if (limit == null) return;
|
|
565
577
|
const pC = this.deps.playbackController;
|
|
566
|
-
const
|
|
567
|
-
if (
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
const limit = adBreak.playoutLimit;
|
|
571
|
-
if (limit != null && parentBreak.playoutElapsed + elapsed >= limit) {
|
|
572
|
-
parentBreak.clear();
|
|
573
|
-
this.endAd(adState);
|
|
574
|
-
} else if (ad.duration != null && elapsed >= ad.duration) {
|
|
575
|
-
this.endAd(adState);
|
|
576
|
-
}
|
|
578
|
+
const elapsed = Math.max(0, pC.currentTime - adState.timeStart);
|
|
579
|
+
if (parentBreak.playoutElapsed + elapsed < limit) return;
|
|
580
|
+
if (isFinite(pC.duration) && pC.duration > 0 && pC.duration - pC.currentTime <= PLAYOUT_LIMIT_TOLERANCE) {
|
|
581
|
+
return;
|
|
577
582
|
}
|
|
583
|
+
parentBreak.clear();
|
|
584
|
+
this.endAd(adState);
|
|
578
585
|
}
|
|
579
586
|
setPendingBreaks(newPending) {
|
|
580
587
|
this.pendingAdBreaks = newPending.filter(
|
|
@@ -1629,6 +1636,7 @@ import {
|
|
|
1629
1636
|
logDebug as logDebug3,
|
|
1630
1637
|
logError as logError2,
|
|
1631
1638
|
logVerbose as logVerbose2,
|
|
1639
|
+
logWarn,
|
|
1632
1640
|
memoize as memoize4,
|
|
1633
1641
|
noop as noop3,
|
|
1634
1642
|
normalizeHeadersInit,
|
|
@@ -1878,6 +1886,7 @@ function createFairPlaySessionInitData(initData, contentId, certificateData) {
|
|
|
1878
1886
|
// src/drm/DrmControllerImpl.ts
|
|
1879
1887
|
var LICENSE_TIMEOUT = 90;
|
|
1880
1888
|
var LICENSE_TIMEOUT_MESSAGE = "License provider timed out after {time}s";
|
|
1889
|
+
var EXCESSIVE_SESSION_COUNT = 20;
|
|
1881
1890
|
var DrmControllerImpl = class extends EventHostImpl5 {
|
|
1882
1891
|
constructor(deps, options) {
|
|
1883
1892
|
super();
|
|
@@ -2094,6 +2103,13 @@ var DrmControllerImpl = class extends EventHostImpl5 {
|
|
|
2094
2103
|
trackUri
|
|
2095
2104
|
});
|
|
2096
2105
|
this.sessions.push(newSession);
|
|
2106
|
+
logVerbose2(this, `total sessions: ${this.sessions.length}`);
|
|
2107
|
+
if (this.sessions.length === EXCESSIVE_SESSION_COUNT + 1) {
|
|
2108
|
+
logWarn(
|
|
2109
|
+
this,
|
|
2110
|
+
`${this.sessions.length} open key sessions exceeds ${EXCESSIVE_SESSION_COUNT}; sessions may be leaking (not closing on track deactivation)`
|
|
2111
|
+
);
|
|
2112
|
+
}
|
|
2097
2113
|
this.dispatch("sessionCreate", {
|
|
2098
2114
|
initDataType: newSession.initDataType,
|
|
2099
2115
|
mimeType: newSession.mimeType
|
|
@@ -2523,7 +2539,7 @@ import {
|
|
|
2523
2539
|
globalRef as globalRef3,
|
|
2524
2540
|
globalTarget,
|
|
2525
2541
|
IllegalStateError,
|
|
2526
|
-
logWarn,
|
|
2542
|
+
logWarn as logWarn2,
|
|
2527
2543
|
remove as remove2,
|
|
2528
2544
|
substitute
|
|
2529
2545
|
} from "@amazon/vinyl-util";
|
|
@@ -2545,7 +2561,7 @@ var PlayerRegistryImpl = class {
|
|
|
2545
2561
|
const n = this._players.length;
|
|
2546
2562
|
if (n > this.maxPlayersWarning && !this.gaveMaxPlayersWarning) {
|
|
2547
2563
|
this.gaveMaxPlayersWarning = true;
|
|
2548
|
-
|
|
2564
|
+
logWarn2(
|
|
2549
2565
|
globalTarget,
|
|
2550
2566
|
substitute(locale.maxPlayersWarning, { count: n })
|
|
2551
2567
|
);
|
|
@@ -2621,7 +2637,7 @@ function configureVinylGlobal(options) {
|
|
|
2621
2637
|
import { parseVersion } from "@amazon/vinyl-util";
|
|
2622
2638
|
var vinylVersion = /* @__PURE__ */ parseVersion(
|
|
2623
2639
|
/* istanbul ignore next */
|
|
2624
|
-
"3.2.
|
|
2640
|
+
"3.2.2"
|
|
2625
2641
|
);
|
|
2626
2642
|
|
|
2627
2643
|
// src/global/globalRef.ts
|
|
@@ -2826,6 +2842,7 @@ var PlaybackNetworkState = /* @__PURE__ */ ((PlaybackNetworkState2) => {
|
|
|
2826
2842
|
})(PlaybackNetworkState || {});
|
|
2827
2843
|
|
|
2828
2844
|
// src/playback/createStallMonitor.ts
|
|
2845
|
+
var PROGRESS_EPSILON = 1e-6;
|
|
2829
2846
|
function createStallMonitor(controller, callbacks, options = {}) {
|
|
2830
2847
|
var _a, _b;
|
|
2831
2848
|
const stallThresholdMs = ((_a = options.stallThreshold) != null ? _a : 1) * 1e3;
|
|
@@ -2834,6 +2851,7 @@ function createStallMonitor(controller, callbacks, options = {}) {
|
|
|
2834
2851
|
let lastProgressAt = Date.now();
|
|
2835
2852
|
let inStall = false;
|
|
2836
2853
|
let pollId = null;
|
|
2854
|
+
const { add, dispose } = createDisposer3();
|
|
2837
2855
|
const endStall = (reason) => {
|
|
2838
2856
|
if (!inStall) return;
|
|
2839
2857
|
inStall = false;
|
|
@@ -2850,6 +2868,7 @@ function createStallMonitor(controller, callbacks, options = {}) {
|
|
|
2850
2868
|
clearInterval(pollId);
|
|
2851
2869
|
pollId = null;
|
|
2852
2870
|
};
|
|
2871
|
+
add(stopPoll);
|
|
2853
2872
|
const startPoll = () => {
|
|
2854
2873
|
if (pollId != null) return;
|
|
2855
2874
|
pollId = setInterval(() => {
|
|
@@ -2865,17 +2884,18 @@ function createStallMonitor(controller, callbacks, options = {}) {
|
|
|
2865
2884
|
observedPlaying = false;
|
|
2866
2885
|
stopPoll();
|
|
2867
2886
|
};
|
|
2868
|
-
const { add, dispose } = createDisposer3();
|
|
2869
2887
|
add(
|
|
2870
2888
|
controller.on("playing", () => {
|
|
2871
2889
|
if (inStall) endStall("playing" /* PLAYING */);
|
|
2872
|
-
|
|
2890
|
+
lastProgressAt = Date.now();
|
|
2873
2891
|
observedPlaying = true;
|
|
2874
2892
|
startPoll();
|
|
2875
2893
|
})
|
|
2876
2894
|
);
|
|
2877
2895
|
add(
|
|
2878
|
-
controller.on("timeUpdate", () => {
|
|
2896
|
+
controller.on("timeUpdate", ({ previous, current }) => {
|
|
2897
|
+
if (previous != null && current - previous <= PROGRESS_EPSILON)
|
|
2898
|
+
return;
|
|
2879
2899
|
if (inStall) endStall("playing" /* PLAYING */);
|
|
2880
2900
|
lastProgressAt = Date.now();
|
|
2881
2901
|
})
|
|
@@ -2883,13 +2903,7 @@ function createStallMonitor(controller, callbacks, options = {}) {
|
|
|
2883
2903
|
add(controller.on("pause", () => suspend("pause" /* PAUSE */)));
|
|
2884
2904
|
add(controller.on("seeking", () => suspend("seeking" /* SEEKING */)));
|
|
2885
2905
|
add(controller.on("emptied", () => suspend("emptied" /* EMPTIED */)));
|
|
2886
|
-
|
|
2887
|
-
return () => {
|
|
2888
|
-
if (stopped) return;
|
|
2889
|
-
stopped = true;
|
|
2890
|
-
stopPoll();
|
|
2891
|
-
dispose();
|
|
2892
|
-
};
|
|
2906
|
+
return dispose;
|
|
2893
2907
|
}
|
|
2894
2908
|
|
|
2895
2909
|
// src/playback/error/InvalidSeekError.ts
|
|
@@ -3171,6 +3185,7 @@ var LIVE_DURATION = 4294967296;
|
|
|
3171
3185
|
import {
|
|
3172
3186
|
Abort,
|
|
3173
3187
|
AbortError as AbortError2,
|
|
3188
|
+
createAbortSlot,
|
|
3174
3189
|
Browser,
|
|
3175
3190
|
clamp,
|
|
3176
3191
|
closeTo as closeTo2,
|
|
@@ -3183,7 +3198,7 @@ import {
|
|
|
3183
3198
|
hasBrowser,
|
|
3184
3199
|
logDebug as logDebug6,
|
|
3185
3200
|
logInfo,
|
|
3186
|
-
logWarn as
|
|
3201
|
+
logWarn as logWarn3,
|
|
3187
3202
|
nextEventAsPromise as nextEventAsPromise2,
|
|
3188
3203
|
noop as noop4,
|
|
3189
3204
|
onAny,
|
|
@@ -3217,15 +3232,13 @@ var PlaybackControllerImpl = class extends EventHostImpl7 {
|
|
|
3217
3232
|
__publicField(this, "_playing", false);
|
|
3218
3233
|
__publicField(this, "_seeking", false);
|
|
3219
3234
|
__publicField(this, "_waiting", false);
|
|
3220
|
-
|
|
3221
|
-
__publicField(this, "_seekId", 0);
|
|
3235
|
+
__publicField(this, "seekAbortSlot", /* @__PURE__ */ createAbortSlot());
|
|
3222
3236
|
// Stops the stall detector started after the last seek, if any.
|
|
3223
3237
|
__publicField(this, "stopStallDetection", null);
|
|
3224
3238
|
// default user volume (0.0 to 1.0 scale)
|
|
3225
3239
|
__publicField(this, "userVolume", 1);
|
|
3226
3240
|
__publicField(this, "_pendingPlay", null);
|
|
3227
3241
|
__publicField(this, "playAbort", null);
|
|
3228
|
-
__publicField(this, "disposeAbort", /* @__PURE__ */ new Abort());
|
|
3229
3242
|
__publicField(this, "options");
|
|
3230
3243
|
this.options = __spreadValues(__spreadProps(__spreadValues({}, defaultPlaybackControllerImplOptions), {
|
|
3231
3244
|
minSeekableBuffer: getMinSeekableBufferDefault()
|
|
@@ -3236,8 +3249,7 @@ var PlaybackControllerImpl = class extends EventHostImpl7 {
|
|
|
3236
3249
|
const { add } = this.disposer;
|
|
3237
3250
|
add(() => {
|
|
3238
3251
|
var _a;
|
|
3239
|
-
this.
|
|
3240
|
-
this.disposeAbort.dispose();
|
|
3252
|
+
this.seekAbortSlot.abort();
|
|
3241
3253
|
(_a = this.stopStallDetection) == null ? void 0 : _a.call(this);
|
|
3242
3254
|
});
|
|
3243
3255
|
this.domEvents = add(
|
|
@@ -3650,14 +3662,10 @@ var PlaybackControllerImpl = class extends EventHostImpl7 {
|
|
|
3650
3662
|
async seekTo(time, tolerance = 0.5) {
|
|
3651
3663
|
var _a;
|
|
3652
3664
|
logDebug6(this, `seekTo: ${time}`);
|
|
3653
|
-
const seekId = ++this._seekId;
|
|
3654
3665
|
(_a = this.stopStallDetection) == null ? void 0 : _a.call(this);
|
|
3655
3666
|
this.stopStallDetection = null;
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
logDebug6(this, `seekTo: ${time} superseded by a newer seek`);
|
|
3659
|
-
return true;
|
|
3660
|
-
};
|
|
3667
|
+
this.seekAbortSlot.abort();
|
|
3668
|
+
const seekAbort = this.seekAbortSlot.value;
|
|
3661
3669
|
const nextEvent = (type, options) => {
|
|
3662
3670
|
var _a2;
|
|
3663
3671
|
return nextEventAsPromise2(this, type, {
|
|
@@ -3665,12 +3673,25 @@ var PlaybackControllerImpl = class extends EventHostImpl7 {
|
|
|
3665
3673
|
timeoutMessage: `seek timed out on ${type} event after {time}s`,
|
|
3666
3674
|
timeoutOrigin: ErrorOrigin12.INTERNAL,
|
|
3667
3675
|
timeoutLevel: ErrorLevel7.WARN,
|
|
3668
|
-
abort:
|
|
3676
|
+
abort: seekAbort
|
|
3669
3677
|
});
|
|
3670
3678
|
};
|
|
3679
|
+
try {
|
|
3680
|
+
await this.doSeek(time, tolerance, seekAbort, nextEvent);
|
|
3681
|
+
} catch (error) {
|
|
3682
|
+
if (seekAbort.aborted() && !this.disposed) return;
|
|
3683
|
+
throw error;
|
|
3684
|
+
}
|
|
3685
|
+
}
|
|
3686
|
+
/**
|
|
3687
|
+
* The body of a single {@link seekTo} attempt. Extracted so {@link seekTo}
|
|
3688
|
+
* can wrap it with per-seek abort/supersession handling. `seekAbort` is
|
|
3689
|
+
* aborted when a newer seek supersedes this one (or on dispose).
|
|
3690
|
+
* @private
|
|
3691
|
+
*/
|
|
3692
|
+
async doSeek(time, tolerance, seekAbort, nextEvent) {
|
|
3671
3693
|
if (!this.hasMetadata) {
|
|
3672
3694
|
await nextEvent("loadedMetadata");
|
|
3673
|
-
if (superseded()) return;
|
|
3674
3695
|
}
|
|
3675
3696
|
const seekable = this.seekable;
|
|
3676
3697
|
const range = seekable.getRangeAt(
|
|
@@ -3678,7 +3699,7 @@ var PlaybackControllerImpl = class extends EventHostImpl7 {
|
|
|
3678
3699
|
tolerance
|
|
3679
3700
|
);
|
|
3680
3701
|
if (range == null) {
|
|
3681
|
-
|
|
3702
|
+
logWarn3(
|
|
3682
3703
|
this,
|
|
3683
3704
|
`seekTo: seek outside of seekable ranges, seek ignored`,
|
|
3684
3705
|
seekable.ranges
|
|
@@ -3701,7 +3722,7 @@ var PlaybackControllerImpl = class extends EventHostImpl7 {
|
|
|
3701
3722
|
);
|
|
3702
3723
|
} else {
|
|
3703
3724
|
const nullIfStuck = (error) => {
|
|
3704
|
-
if (this.
|
|
3725
|
+
if (this.disposed) throw error;
|
|
3705
3726
|
return null;
|
|
3706
3727
|
};
|
|
3707
3728
|
const seekOnce = async (reSeeking) => {
|
|
@@ -3715,7 +3736,7 @@ var PlaybackControllerImpl = class extends EventHostImpl7 {
|
|
|
3715
3736
|
}).catch(nullIfStuck);
|
|
3716
3737
|
};
|
|
3717
3738
|
let seekedEvent = await seekOnce(false);
|
|
3718
|
-
for (let attempt = 0; !
|
|
3739
|
+
for (let attempt = 0; !seekAbort.aborted() && attempt < SEEK_RETRY_LIMIT && (seekedEvent === null || seekedEvent.reason === "seeked" && !closeTo2(clampedTime, this.currentTime, tolerance)); attempt++) {
|
|
3719
3740
|
if (seekedEvent === null) void this.media.play().catch(noop4);
|
|
3720
3741
|
logDebug6(this, `seekTo: re-seeking to ${clampedTime}`);
|
|
3721
3742
|
seekedEvent = await seekOnce(true);
|
|
@@ -3723,7 +3744,7 @@ var PlaybackControllerImpl = class extends EventHostImpl7 {
|
|
|
3723
3744
|
if ((seekedEvent == null ? void 0 : seekedEvent.reason) === "emptied") {
|
|
3724
3745
|
throw new AbortError2();
|
|
3725
3746
|
}
|
|
3726
|
-
if (!this.paused) this.startStallDetection();
|
|
3747
|
+
if (!this.paused && !seekAbort.aborted()) this.startStallDetection();
|
|
3727
3748
|
}
|
|
3728
3749
|
}
|
|
3729
3750
|
/**
|
|
@@ -3975,7 +3996,7 @@ var audioOptionsValidator = /* @__PURE__ */ object7({
|
|
|
3975
3996
|
|
|
3976
3997
|
// src/streaming/buffering/BufferingController.ts
|
|
3977
3998
|
import {
|
|
3978
|
-
createAbortSlot,
|
|
3999
|
+
createAbortSlot as createAbortSlot2,
|
|
3979
4000
|
createDisposer as createDisposer8,
|
|
3980
4001
|
createLogPrefix as createLogPrefix5,
|
|
3981
4002
|
createTaskQueue,
|
|
@@ -3986,7 +4007,7 @@ import {
|
|
|
3986
4007
|
logDebug as logDebug7,
|
|
3987
4008
|
LogLevel as LogLevel2,
|
|
3988
4009
|
logVerbose as logVerbose3,
|
|
3989
|
-
logWarn as
|
|
4010
|
+
logWarn as logWarn4,
|
|
3990
4011
|
throttle as throttle2
|
|
3991
4012
|
} from "@amazon/vinyl-util";
|
|
3992
4013
|
|
|
@@ -4095,7 +4116,7 @@ var BufferingControllerImpl = class extends EventHostImpl8 {
|
|
|
4095
4116
|
__publicField(this, "disposer", /* @__PURE__ */ createDisposer8());
|
|
4096
4117
|
__publicField(this, "_active", false);
|
|
4097
4118
|
__publicField(this, "activateDisposer", null);
|
|
4098
|
-
__publicField(this, "segmentAbort", /* @__PURE__ */
|
|
4119
|
+
__publicField(this, "segmentAbort", /* @__PURE__ */ createAbortSlot2());
|
|
4099
4120
|
/**
|
|
4100
4121
|
* Resets the throttle and polls the buffer on the next frame.
|
|
4101
4122
|
*/
|
|
@@ -4146,7 +4167,7 @@ var BufferingControllerImpl = class extends EventHostImpl8 {
|
|
|
4146
4167
|
const newAppendSize = this.getMaxAppendSize(contentType2) * QUOTA_REACHED_SCALE;
|
|
4147
4168
|
if (newAppendSize >= MIN_APPEND_SIZE) {
|
|
4148
4169
|
sourceBufferQuotas.set(contentType2, newAppendSize);
|
|
4149
|
-
|
|
4170
|
+
logWarn4(
|
|
4150
4171
|
this,
|
|
4151
4172
|
"QuotaExceededError, new source buffer limit:",
|
|
4152
4173
|
(newAppendSize / 1024 / 1024).toFixed(1) + " MiB"
|
|
@@ -4442,7 +4463,7 @@ var BufferingControllerImpl = class extends EventHostImpl8 {
|
|
|
4442
4463
|
const contentType2 = quality == null ? void 0 : quality.contentType;
|
|
4443
4464
|
if (!mimeType || !contentType2) return false;
|
|
4444
4465
|
if (!denylistCodecsFromMimeType(mimeType)) return false;
|
|
4445
|
-
|
|
4466
|
+
logWarn4(
|
|
4446
4467
|
this,
|
|
4447
4468
|
"SourceBuffer append failed; denylisting codec and requesting reload:",
|
|
4448
4469
|
mimeType
|
|
@@ -4518,7 +4539,7 @@ import {
|
|
|
4518
4539
|
IllegalStateError as IllegalStateError2,
|
|
4519
4540
|
isSilentError as isSilentError3,
|
|
4520
4541
|
logDebug as logDebug8,
|
|
4521
|
-
logWarn as
|
|
4542
|
+
logWarn as logWarn5,
|
|
4522
4543
|
ReportableError as ReportableError8,
|
|
4523
4544
|
toJson as toJson2,
|
|
4524
4545
|
toLowerCase as toLowerCase2
|
|
@@ -4641,7 +4662,7 @@ var MediaSourceControllerImpl = class extends EventHostImpl9 {
|
|
|
4641
4662
|
try {
|
|
4642
4663
|
URL.revokeObjectURL(this.objectUrl);
|
|
4643
4664
|
} catch (error) {
|
|
4644
|
-
|
|
4665
|
+
logWarn5(this, "error revoking object url", error);
|
|
4645
4666
|
}
|
|
4646
4667
|
}
|
|
4647
4668
|
get sourceBufferCount() {
|
|
@@ -5679,7 +5700,7 @@ function createDefaultMediaTimelineTransformer(deps) {
|
|
|
5679
5700
|
// src/streaming/ManifestControllerImpl.ts
|
|
5680
5701
|
import { data } from "@amazon/vinyl-observable";
|
|
5681
5702
|
import {
|
|
5682
|
-
createAbortSlot as
|
|
5703
|
+
createAbortSlot as createAbortSlot3,
|
|
5683
5704
|
createDisposer as createDisposer11,
|
|
5684
5705
|
EventHostImpl as EventHostImpl11,
|
|
5685
5706
|
logDebug as logDebug11
|
|
@@ -5689,7 +5710,7 @@ var ManifestControllerImpl = class {
|
|
|
5689
5710
|
__publicField(this, "deps", deps);
|
|
5690
5711
|
__publicField(this, "_data");
|
|
5691
5712
|
__publicField(this, "_error", null);
|
|
5692
|
-
__publicField(this, "abortSlot", /* @__PURE__ */
|
|
5713
|
+
__publicField(this, "abortSlot", /* @__PURE__ */ createAbortSlot3());
|
|
5693
5714
|
__publicField(this, "disposer", /* @__PURE__ */ createDisposer11());
|
|
5694
5715
|
__publicField(this, "events", /* @__PURE__ */ new EventHostImpl11());
|
|
5695
5716
|
__publicField(this, "manifestSpanArmed", true);
|
|
@@ -5815,7 +5836,7 @@ import {
|
|
|
5815
5836
|
|
|
5816
5837
|
// src/streaming/SegmentDataSlot.ts
|
|
5817
5838
|
import {
|
|
5818
|
-
createAbortSlot as
|
|
5839
|
+
createAbortSlot as createAbortSlot4,
|
|
5819
5840
|
isSilentError as isSilentError4
|
|
5820
5841
|
} from "@amazon/vinyl-util";
|
|
5821
5842
|
var SegmentStatus = /* @__PURE__ */ ((SegmentStatus2) => {
|
|
@@ -5833,7 +5854,7 @@ var SegmentDataSlot = class {
|
|
|
5833
5854
|
*/
|
|
5834
5855
|
__publicField(this, "onStatusChange", null);
|
|
5835
5856
|
__publicField(this, "_status", "inactive" /* INACTIVE */);
|
|
5836
|
-
__publicField(this, "abortSlot", /* @__PURE__ */
|
|
5857
|
+
__publicField(this, "abortSlot", /* @__PURE__ */ createAbortSlot4());
|
|
5837
5858
|
__publicField(this, "bufferPromise", null);
|
|
5838
5859
|
}
|
|
5839
5860
|
/**
|
|
@@ -6982,7 +7003,7 @@ function scoreTextTrack(track, prefs) {
|
|
|
6982
7003
|
|
|
6983
7004
|
// src/text/SidecarTextTrackController.ts
|
|
6984
7005
|
import {
|
|
6985
|
-
createAbortSlot as
|
|
7006
|
+
createAbortSlot as createAbortSlot5,
|
|
6986
7007
|
createDisposer as createDisposer13,
|
|
6987
7008
|
equalDeep,
|
|
6988
7009
|
EventHostImpl as EventHostImpl13,
|
|
@@ -7163,7 +7184,7 @@ var SidecarTextTrackController = class extends EventHostImpl13 {
|
|
|
7163
7184
|
// The DOM text track currently rendering cues, or null when hidden. Owned by
|
|
7164
7185
|
// the provider (never created/removed here).
|
|
7165
7186
|
__publicField(this, "_ref", null);
|
|
7166
|
-
__publicField(this, "loadAbort", /* @__PURE__ */
|
|
7187
|
+
__publicField(this, "loadAbort", /* @__PURE__ */ createAbortSlot5());
|
|
7167
7188
|
__publicField(this, "disposer", /* @__PURE__ */ createDisposer13());
|
|
7168
7189
|
const { add } = this.disposer;
|
|
7169
7190
|
add(deps.options.onData(() => this.refreshSelection()));
|
|
@@ -7557,7 +7578,7 @@ import { func as func2, isOneOf as isOneOf7 } from "@amazon/vinyl-validation";
|
|
|
7557
7578
|
|
|
7558
7579
|
// src/track/TrackBase.ts
|
|
7559
7580
|
import {
|
|
7560
|
-
createAbortSlot as
|
|
7581
|
+
createAbortSlot as createAbortSlot6,
|
|
7561
7582
|
createDisposer as createDisposer15,
|
|
7562
7583
|
emptyRanges as emptyRanges2,
|
|
7563
7584
|
equalDeep as equalDeep2,
|
|
@@ -7587,7 +7608,7 @@ var TrackBase = class extends EventHostImpl15 {
|
|
|
7587
7608
|
}
|
|
7588
7609
|
});
|
|
7589
7610
|
__publicField(this, "disposer", /* @__PURE__ */ createDisposer15());
|
|
7590
|
-
__publicField(this, "drmSessionAbort", /* @__PURE__ */
|
|
7611
|
+
__publicField(this, "drmSessionAbort", /* @__PURE__ */ createAbortSlot6());
|
|
7591
7612
|
/**
|
|
7592
7613
|
* Sets on handleError, cleared on 'reset'.
|
|
7593
7614
|
*/
|
|
@@ -7996,7 +8017,6 @@ import {
|
|
|
7996
8017
|
|
|
7997
8018
|
// src/track/mse/MseTrack.ts
|
|
7998
8019
|
import {
|
|
7999
|
-
Abort as Abort3,
|
|
8000
8020
|
equalDeep as equalDeep3,
|
|
8001
8021
|
first as first2,
|
|
8002
8022
|
IntersectionRanges,
|
|
@@ -8010,7 +8030,6 @@ var MseTrack = class extends TrackBase {
|
|
|
8010
8030
|
const deps = depsContainer.dependencies;
|
|
8011
8031
|
super(uri, type, deps);
|
|
8012
8032
|
__publicField(this, "streams", []);
|
|
8013
|
-
__publicField(this, "disposeAbort", /* @__PURE__ */ new Abort3());
|
|
8014
8033
|
__publicField(this, "lastPreloadOptions", null);
|
|
8015
8034
|
__publicField(this, "allFetchedRanges", []);
|
|
8016
8035
|
__publicField(this, "_fetchedRanges", /* @__PURE__ */ new IntersectionRanges(
|
|
@@ -8035,7 +8054,7 @@ var MseTrack = class extends TrackBase {
|
|
|
8035
8054
|
if (this.active) {
|
|
8036
8055
|
this.deps.drmController.initializeForPlayback(event.current, {
|
|
8037
8056
|
trackUri: this.uri,
|
|
8038
|
-
abort: this.
|
|
8057
|
+
abort: this.drmSessionAbort.value
|
|
8039
8058
|
});
|
|
8040
8059
|
}
|
|
8041
8060
|
});
|
|
@@ -8043,7 +8062,7 @@ var MseTrack = class extends TrackBase {
|
|
|
8043
8062
|
if (event.current == null) return;
|
|
8044
8063
|
this.deps.drmController.setBufferingDrmInfo(event.current, {
|
|
8045
8064
|
trackUri: this.uri,
|
|
8046
|
-
abort: this.
|
|
8065
|
+
abort: this.drmSessionAbort.value
|
|
8047
8066
|
});
|
|
8048
8067
|
});
|
|
8049
8068
|
add(
|
|
@@ -8281,7 +8300,7 @@ var MseTrack = class extends TrackBase {
|
|
|
8281
8300
|
this.streams.forEach((stream) => {
|
|
8282
8301
|
this.deps.drmController.initializeForPlayback(
|
|
8283
8302
|
stream.streamingQuality,
|
|
8284
|
-
{ trackUri: this.uri, abort: this.
|
|
8303
|
+
{ trackUri: this.uri, abort: this.drmSessionAbort.value }
|
|
8285
8304
|
);
|
|
8286
8305
|
});
|
|
8287
8306
|
this.deps.playbackSource.src = this.deps.mediaSourceController.activate();
|
|
@@ -8307,7 +8326,7 @@ var MseTrack = class extends TrackBase {
|
|
|
8307
8326
|
this.callOnStreams("deactivate");
|
|
8308
8327
|
this.deps.drmController.setBufferingDrmInfo(null, {
|
|
8309
8328
|
trackUri: this.uri,
|
|
8310
|
-
abort: this.
|
|
8329
|
+
abort: this.drmSessionAbort.value
|
|
8311
8330
|
});
|
|
8312
8331
|
(_b = this.deps.textTrackController) == null ? void 0 : _b.deactivate();
|
|
8313
8332
|
this.deps.playbackSource.src = null;
|
|
@@ -9914,7 +9933,7 @@ import {
|
|
|
9914
9933
|
logError as logError5,
|
|
9915
9934
|
logInfo as logInfo2,
|
|
9916
9935
|
logVerbose as logVerbose4,
|
|
9917
|
-
logWarn as
|
|
9936
|
+
logWarn as logWarn6,
|
|
9918
9937
|
LruCache,
|
|
9919
9938
|
noop as noop8,
|
|
9920
9939
|
resolveValueProvider as resolveValueProvider3
|
|
@@ -9966,7 +9985,7 @@ var TrackControllerImpl = class extends EventHostImpl17 {
|
|
|
9966
9985
|
if (this.currentTrackIsAdTrack) return;
|
|
9967
9986
|
const track = this._current;
|
|
9968
9987
|
if (!track) {
|
|
9969
|
-
|
|
9988
|
+
logWarn6(this, "an ended event was received with no current track");
|
|
9970
9989
|
return;
|
|
9971
9990
|
}
|
|
9972
9991
|
const interrupted = this.getQueueInterrupted();
|
|
@@ -10575,7 +10594,7 @@ import {
|
|
|
10575
10594
|
logInfo as logInfo3,
|
|
10576
10595
|
LogLevel as LogLevel3,
|
|
10577
10596
|
logVerbose as logVerbose5,
|
|
10578
|
-
logWarn as
|
|
10597
|
+
logWarn as logWarn7,
|
|
10579
10598
|
redispatchEvents as redispatchEvents4
|
|
10580
10599
|
} from "@amazon/vinyl-util";
|
|
10581
10600
|
import {
|
|
@@ -10677,7 +10696,7 @@ var VinylPlayer = class extends EventHostImpl18 {
|
|
|
10677
10696
|
add(
|
|
10678
10697
|
this.on("codecUnsupported", (event) => {
|
|
10679
10698
|
if (this.deps.adController.currentAdBreak) return;
|
|
10680
|
-
|
|
10699
|
+
logWarn7(
|
|
10681
10700
|
this,
|
|
10682
10701
|
"codec unsupported, reloading track:",
|
|
10683
10702
|
event.mimeType
|
|
@@ -11248,6 +11267,7 @@ export {
|
|
|
11248
11267
|
DrmError,
|
|
11249
11268
|
DrmKeySystem,
|
|
11250
11269
|
DrmRobustness,
|
|
11270
|
+
EXCESSIVE_SESSION_COUNT,
|
|
11251
11271
|
FAIR_PLAY_KEY_SYSTEMS,
|
|
11252
11272
|
FixedPlaybackQuality,
|
|
11253
11273
|
HtmlTextTrackRenderer,
|
|
@@ -11265,6 +11285,7 @@ export {
|
|
|
11265
11285
|
MsCommonMediaKeySystemAccess,
|
|
11266
11286
|
MsCommonMediaKeys,
|
|
11267
11287
|
MseTrack,
|
|
11288
|
+
PLAYOUT_LIMIT_TOLERANCE,
|
|
11268
11289
|
PLAY_READY_KEY_SYSTEMS,
|
|
11269
11290
|
POLL_BUFFER_THROTTLE,
|
|
11270
11291
|
PREFETCH_POLL_THROTTLE,
|