@amazon/vinyl 3.1.0 → 3.2.1
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 +236 -187
- package/dist/index.cjs.map +4 -4
- package/dist/index.js +224 -174
- package/dist/index.js.map +4 -4
- package/dist/test/integ.es5.js +245 -231
- package/dist/test/integ.js +676 -271
- package/dist/test/integ.js.map +4 -4
- 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 +17 -1
- package/dist/types/current/drm/DrmControllerImpl.d.ts.map +1 -1
- package/dist/types/current/drm/DrmControllerImpl.js +45 -10
- package/dist/types/current/playback/createStallMonitor.d.ts.map +1 -1
- package/dist/types/current/playback/createStallMonitor.js +19 -14
- package/dist/types/current/streaming/LoadMetric.d.ts +15 -1
- package/dist/types/current/streaming/LoadMetric.d.ts.map +1 -1
- package/dist/types/current/streaming/mediaTimelineFilter.d.ts +4 -2
- package/dist/types/current/streaming/mediaTimelineFilter.d.ts.map +1 -1
- package/dist/types/current/streaming/mediaTimelineFilter.js +23 -8
- package/dist/types/current/track/filters/sampleRateFilter.d.ts +8 -4
- package/dist/types/current/track/filters/sampleRateFilter.d.ts.map +1 -1
- package/dist/types/current/track/filters/sampleRateFilter.js +31 -21
- package/dist/types/current/track/mse/MseTrack.d.ts +0 -9
- package/dist/types/current/track/mse/MseTrack.d.ts.map +1 -1
- package/dist/types/current/track/mse/MseTrack.js +2 -29
- package/dist/types/current/tsconfig.tsbuildinfo +1 -1
- package/dist/types/current/vinyl/VinylPlayer.d.ts +5 -0
- package/dist/types/current/vinyl/VinylPlayer.d.ts.map +1 -1
- package/dist/types/current/vinyl/VinylPlayer.js +23 -1
- package/dist/types/ts3.7/ad/AdControllerImpl.d.ts +18 -2
- package/dist/types/ts3.7/drm/DrmControllerImpl.d.ts +17 -1
- package/dist/types/ts3.7/streaming/LoadMetric.d.ts +15 -1
- package/dist/types/ts3.7/streaming/mediaTimelineFilter.d.ts +4 -2
- package/dist/types/ts3.7/track/filters/sampleRateFilter.d.ts +8 -4
- package/dist/types/ts3.7/track/mse/MseTrack.d.ts +0 -9
- package/dist/types/ts3.7/vinyl/VinylPlayer.d.ts +5 -0
- package/dist/types/ts4.1/ad/AdControllerImpl.d.ts +18 -2
- package/dist/types/ts4.1/drm/DrmControllerImpl.d.ts +17 -1
- package/dist/types/ts4.1/streaming/LoadMetric.d.ts +15 -1
- package/dist/types/ts4.1/streaming/mediaTimelineFilter.d.ts +4 -2
- package/dist/types/ts4.1/track/filters/sampleRateFilter.d.ts +8 -4
- package/dist/types/ts4.1/track/mse/MseTrack.d.ts +0 -9
- package/dist/types/ts4.1/vinyl/VinylPlayer.d.ts +5 -0
- package/dist/types/ts4.7/ad/AdControllerImpl.d.ts +18 -2
- package/dist/types/ts4.7/drm/DrmControllerImpl.d.ts +17 -1
- package/dist/types/ts4.7/streaming/LoadMetric.d.ts +15 -1
- package/dist/types/ts4.7/streaming/mediaTimelineFilter.d.ts +4 -2
- package/dist/types/ts4.7/track/filters/sampleRateFilter.d.ts +8 -4
- package/dist/types/ts4.7/track/mse/MseTrack.d.ts +0 -9
- package/dist/types/ts4.7/vinyl/VinylPlayer.d.ts +5 -0
- package/dist/unit/types/current/ad/AdControllerImpl.test.js +110 -4
- package/dist/unit/types/current/drm/DrmControllerImpl.test.js +53 -9
- package/dist/unit/types/current/playback/createStallMonitor.test.js +38 -0
- package/dist/unit/types/current/streaming/MseTrack.test.js +11 -8
- package/dist/unit/types/current/streaming/mediaTimelineFilter.test.js +60 -54
- package/dist/unit/types/current/track/filters/sampleRateFilter.test.js +75 -0
- package/dist/unit/types/current/tsconfig.tsbuildinfo +1 -1
- package/dist/unit/types/current/vinyl/VinylPlayer.test.js +33 -2
- 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
|
@@ -66,6 +66,11 @@ export declare class VinylPlayer<TrackLoadOptionsType extends TrackLoadOptions =
|
|
|
66
66
|
* @see createVinylPlayer
|
|
67
67
|
*/
|
|
68
68
|
protected constructor(factories: Factories<VinylDeps<TrackLoadOptionsType, OptionsType>>);
|
|
69
|
+
/**
|
|
70
|
+
* Logs each republished load span once at the verbose level, formatting its
|
|
71
|
+
* bounds as ISO date strings and its duration in milliseconds.
|
|
72
|
+
*/
|
|
73
|
+
protected initializeLoadSpanLogging(): void;
|
|
69
74
|
protected redispatchSubControllerEvents(): void;
|
|
70
75
|
/**
|
|
71
76
|
* Certain track events are redispatched on the player for the current track.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VinylPlayer.d.ts","sourceRoot":"","sources":["../../../../src/vinyl/VinylPlayer.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,EACH,KAAK,SAAS,EAEd,KAAK,UAAU,EAGf,aAAa,
|
|
1
|
+
{"version":3,"file":"VinylPlayer.d.ts","sourceRoot":"","sources":["../../../../src/vinyl/VinylPlayer.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,EACH,KAAK,SAAS,EAEd,KAAK,UAAU,EAGf,aAA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nB;;OAEG;IACH,IAAI,QAAQ,IAAI,OAAO,CAEtB;IAED;;OAEG;IACH,OAAO,IAAI,IAAI;CAMlB;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC7B,uBAAuB,SAAS,SAAS,GAAG,SAAS,EAErD,OAAO,EAAE,sBAAsB,EAC/B,gBAAgB,CAAC,EAAE,qBAAqB,CACpC,SAAS,CAAC,GAAG,EAAE,SAAS,CAAC,EACzB,qBAAqB,EACrB,uBAAuB,CAC1B,GACF,WAAW,CAEV,2BAA2B,CACvB,gCAAgC,CAC5B,OAAO,CAAC,uBAAuB,CAAC,EAChC,cAAc,CACjB,CACJ,EAED,wBAAwB,CACpB,gCAAgC,CAC5B,OAAO,CAAC,uBAAuB,CAAC,EAChC,SAAS,CACZ,CACJ,CACJ,CAOA"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
|
-
import { createDisposer, emptyRanges, equalDeep, EventHostImpl, logDebug, logInfo, logWarn, redispatchEvents, } from '@amazon/vinyl-util';
|
|
5
|
+
import { createDisposer, emptyRanges, equalDeep, EventHostImpl, getLogLevel, logDebug, logInfo, LogLevel, logVerbose, logWarn, redispatchEvents, } from '@amazon/vinyl-util';
|
|
6
6
|
import { createContainer, } from '@amazon/vinyl-di';
|
|
7
7
|
import { playerRegistryRef } from '../global/PlayerRegistry';
|
|
8
8
|
import { ALL_PLAYBACK_STATE_EVENTS, } from '../playback/ReadonlyPlaybackController';
|
|
@@ -60,8 +60,30 @@ export class VinylPlayer extends EventHostImpl {
|
|
|
60
60
|
playerRegistryRef.value.addPlayer(this);
|
|
61
61
|
this.redispatchSubControllerEvents();
|
|
62
62
|
this.redispatchCurrentTrackEvents();
|
|
63
|
+
this.initializeLoadSpanLogging();
|
|
63
64
|
this.initializeAutoResetHandling();
|
|
64
65
|
}
|
|
66
|
+
/**
|
|
67
|
+
* Logs each republished load span once at the verbose level, formatting its
|
|
68
|
+
* bounds as ISO date strings and its duration in milliseconds.
|
|
69
|
+
*/
|
|
70
|
+
initializeLoadSpanLogging() {
|
|
71
|
+
this.disposer.add(this.on('loadSpan', (span) => {
|
|
72
|
+
// logVerbose would drop the record when verbose is off, but the
|
|
73
|
+
// date/duration formatting below would still run; guard it.
|
|
74
|
+
if (getLogLevel() > LogLevel.VERBOSE)
|
|
75
|
+
return;
|
|
76
|
+
logVerbose(this, 'loadSpan', {
|
|
77
|
+
kind: span.kind,
|
|
78
|
+
trackUri: span.trackUri,
|
|
79
|
+
mimeType: span.mimeType,
|
|
80
|
+
contentType: span.contentType,
|
|
81
|
+
startTime: new Date(span.startTime).toISOString(),
|
|
82
|
+
endTime: new Date(span.endTime).toISOString(),
|
|
83
|
+
durationMs: (span.endTime - span.startTime).toFixed(2),
|
|
84
|
+
});
|
|
85
|
+
}));
|
|
86
|
+
}
|
|
65
87
|
redispatchSubControllerEvents() {
|
|
66
88
|
const add = this.disposer.add;
|
|
67
89
|
add(redispatchEvents(this, this.playbackController, ALL_PLAYBACK_STATE_EVENTS.filter(notResetEvent)));
|
|
@@ -7,6 +7,15 @@ import { AdsProvider } from './AdsProvider';
|
|
|
7
7
|
* The % playhead start tolerance for playback progress when emitting ad progress events.
|
|
8
8
|
*/
|
|
9
9
|
export declare const AD_START_TOLERANCE = 0.05;
|
|
10
|
+
/**
|
|
11
|
+
* When a break's X-PLAYOUT-LIMIT budget is reached, an ad whose real media end is
|
|
12
|
+
* within this many seconds is allowed to finish on its own `ended` rather than
|
|
13
|
+
* being cut. The limit is a coarse, often whole-second budget while the media's
|
|
14
|
+
* true length is fractional, so without this grace an ad effectively as long as
|
|
15
|
+
* its budget would be clipped a fraction short. The tolerance is measured against
|
|
16
|
+
* the playback-reported (media) duration, not the ad's declared duration.
|
|
17
|
+
*/
|
|
18
|
+
export declare const PLAYOUT_LIMIT_TOLERANCE = 1;
|
|
10
19
|
export interface AdControllerImplDeps {
|
|
11
20
|
readonly playbackController: ReadonlyPlaybackController;
|
|
12
21
|
}
|
|
@@ -129,8 +138,15 @@ export declare class AdControllerImpl extends EventHostImpl<AdEventMap> implemen
|
|
|
129
138
|
private emitAdProgressEvents;
|
|
130
139
|
private emitTimeUpdate;
|
|
131
140
|
/**
|
|
132
|
-
*
|
|
133
|
-
*
|
|
141
|
+
* Enforces the break-level playout limit (X-PLAYOUT-LIMIT): a budget shared
|
|
142
|
+
* across all of the break's ads. When cumulative playout reaches it, the
|
|
143
|
+
* whole break ends, dropping any ads that have not started.
|
|
144
|
+
*
|
|
145
|
+
* This is deliberately NOT a per-ad cap. Each ad asset is its own source and
|
|
146
|
+
* ends on its media `ended` (see the 'ended' handler), which is what advances
|
|
147
|
+
* a multi-ad break. Ending an ad at its declared per-ad DURATION instead would
|
|
148
|
+
* truncate the real asset whenever a packager under-declares it — e.g. rounds
|
|
149
|
+
* a 6.732s asset down to a whole-second 6 — cutting off the fractional tail.
|
|
134
150
|
*/
|
|
135
151
|
private enforcePlayoutLimits;
|
|
136
152
|
private setPendingBreaks;
|
|
@@ -2,7 +2,7 @@ import { EventHostImpl, Maybe } from '@amazon/vinyl-util';
|
|
|
2
2
|
import { DrmOptions } from './DrmOptions';
|
|
3
3
|
import { DrmController, DrmControllerEventMap, DrmKeySystemSupport, DrmPlaybackOptions } from './DrmController';
|
|
4
4
|
import { CommonEme, CommonMediaKeyMessageEvent, CommonMediaKeys, CommonMediaKeySession } from './commonEme/CommonEme';
|
|
5
|
-
import { MediaFormatMetadata } from '../streaming/MediaQualityMetadata';
|
|
5
|
+
import { ContentType, MediaFormatMetadata } from '../streaming/MediaQualityMetadata';
|
|
6
6
|
import { TrackUri } from '../track/Track';
|
|
7
7
|
/**
|
|
8
8
|
* The number of seconds a license request will be allowed before timing out.
|
|
@@ -30,6 +30,13 @@ export interface DrmControllerMessageProps {
|
|
|
30
30
|
* to their own track.
|
|
31
31
|
*/
|
|
32
32
|
readonly trackUri: TrackUri | null;
|
|
33
|
+
/**
|
|
34
|
+
* The MIME and content type of the session's content, captured at creation
|
|
35
|
+
* so the license span can distinguish the certificate exchange from the
|
|
36
|
+
* per-content-type license exchanges.
|
|
37
|
+
*/
|
|
38
|
+
readonly mimeType: string;
|
|
39
|
+
readonly contentType: ContentType | null;
|
|
33
40
|
}
|
|
34
41
|
export declare class DrmControllerImpl extends EventHostImpl<DrmControllerEventMap> implements DrmController {
|
|
35
42
|
private readonly deps;
|
|
@@ -44,6 +51,8 @@ export declare class DrmControllerImpl extends EventHostImpl<DrmControllerEventM
|
|
|
44
51
|
private bufferingTrackUri;
|
|
45
52
|
private sessionAbort;
|
|
46
53
|
private pendingMessageProps;
|
|
54
|
+
private keySetupSpanArmed;
|
|
55
|
+
private keySetupSpanStart;
|
|
47
56
|
private readonly disposer;
|
|
48
57
|
constructor(deps: DrmControllerImplDeps, options?: Maybe<Partial<DrmOptions>>);
|
|
49
58
|
configure(options: Maybe<Partial<DrmOptions>>): void;
|
|
@@ -64,6 +73,13 @@ export declare class DrmControllerImpl extends EventHostImpl<DrmControllerEventM
|
|
|
64
73
|
* The new session will be added to the current sessions list.
|
|
65
74
|
*/
|
|
66
75
|
private maybeCreateSession;
|
|
76
|
+
/**
|
|
77
|
+
* Captures the key-setup span start at the top of the session-creation path
|
|
78
|
+
* (before media keys are attached), latching so only the first session of
|
|
79
|
+
* the current track load is measured.
|
|
80
|
+
*/
|
|
81
|
+
private markKeySetupStart;
|
|
82
|
+
private dispatchLoadSpan;
|
|
67
83
|
initializeForPlayback(drmInfo: MediaFormatMetadata | null, options?: DrmPlaybackOptions): void;
|
|
68
84
|
/** True when the manifest carried pssh (sessions come from it, not events). */
|
|
69
85
|
private manifestProvidesInitData;
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import { Timestamp } from '@amazon/vinyl-util';
|
|
2
2
|
import { TrackUri } from '../track/Track';
|
|
3
|
+
import { ContentType } from './MediaQualityMetadata';
|
|
3
4
|
/**
|
|
4
5
|
* The stage of the track-load journey a {@link LoadSpanMeasurement} describes.
|
|
5
6
|
*
|
|
6
7
|
* - `manifest`: fetching and parsing the DASH/HLS manifest.
|
|
8
|
+
* - `keySetup`: the EME/CDM setup, from session creation to the CDM's first
|
|
9
|
+
* license message. Precedes and is contiguous with `license`.
|
|
7
10
|
* - `license`: the DRM license request/response exchange.
|
|
8
11
|
* - `initSegment`: fetching the initialization segment.
|
|
9
12
|
* - `firstSegment`: fetching the first media segment.
|
|
10
13
|
*/
|
|
11
|
-
export type LoadSpanKind = 'manifest' | 'license' | 'initSegment' | 'firstSegment';
|
|
14
|
+
export type LoadSpanKind = 'manifest' | 'keySetup' | 'license' | 'initSegment' | 'firstSegment';
|
|
12
15
|
/**
|
|
13
16
|
* A timed span for one stage of a track load.
|
|
14
17
|
*
|
|
@@ -35,6 +38,17 @@ export interface LoadSpanMeasurement {
|
|
|
35
38
|
* buffering DRM info is set).
|
|
36
39
|
*/
|
|
37
40
|
readonly trackUri?: TrackUri;
|
|
41
|
+
/**
|
|
42
|
+
* The MIME type of the content this span was measured for, when known. Set
|
|
43
|
+
* for DRM `license` spans so a certificate exchange and the per-content-type
|
|
44
|
+
* license exchanges are distinguishable.
|
|
45
|
+
*/
|
|
46
|
+
readonly mimeType?: string;
|
|
47
|
+
/**
|
|
48
|
+
* The content type this span was measured for, when known. Set alongside
|
|
49
|
+
* {@link mimeType} for DRM `license` spans.
|
|
50
|
+
*/
|
|
51
|
+
readonly contentType?: ContentType;
|
|
38
52
|
}
|
|
39
53
|
/**
|
|
40
54
|
* A {@link LoadSpanMeasurement} attributed to the track it was measured for.
|
|
@@ -3,12 +3,14 @@ import { MediaQualityMetadata } from './MediaQualityMetadata';
|
|
|
3
3
|
import { FilterPredicate, FilterPredicateAsync, Maybe } from '@amazon/vinyl-util';
|
|
4
4
|
/**
|
|
5
5
|
* Filters qualities in a MediaTimeline using a synchronous predicate.
|
|
6
|
-
* If filtering
|
|
6
|
+
* If filtering drops an audio or video stream to zero in any period, throws via
|
|
7
|
+
* `throwError`.
|
|
7
8
|
*/
|
|
8
9
|
export declare function filterTimelineQualities(filter: Maybe<FilterPredicate<MediaQualityMetadata>>, throwError: () => never, timeline: MediaTimeline): MediaTimeline;
|
|
9
10
|
/**
|
|
10
11
|
* Filters qualities in a MediaTimeline using an asynchronous predicate.
|
|
11
|
-
* If filtering
|
|
12
|
+
* If filtering drops an audio or video stream to zero in any period, throws via
|
|
13
|
+
* `throwError`.
|
|
12
14
|
*/
|
|
13
15
|
export declare function filterTimelineQualitiesAsync(filter: FilterPredicateAsync<MediaQualityMetadata>, throwError: () => never, timeline: MediaTimeline): Promise<MediaTimeline>;
|
|
14
16
|
/**
|
|
@@ -18,10 +18,14 @@ export interface AudioSampleRateRangeOptions {
|
|
|
18
18
|
* The upper bound is `maxSampleRate` when set, otherwise the platform's
|
|
19
19
|
* `AudioContext`-reported output rate (Firefox is hard-capped at 48kHz, which it
|
|
20
20
|
* cannot decode beyond via MSE). The optional lower bound is `minSampleRate`.
|
|
21
|
-
* Both bounds are soft
|
|
22
|
-
*
|
|
23
|
-
* playback is never stranded
|
|
24
|
-
*
|
|
21
|
+
* Both bounds are soft, and soft *together*: when no audio rendition sits in the
|
|
22
|
+
* acceptable `[minSampleRate, maxSampleRate]` band, a single fallback is kept so
|
|
23
|
+
* playback is never stranded — the highest rate the ceiling can decode, or, when
|
|
24
|
+
* every rate is above the ceiling, the lowest. This holds even when renditions
|
|
25
|
+
* straddle an empty band (some below the floor, some above the ceiling). Only
|
|
26
|
+
* audio renditions count toward the fallback — a co-present video quality (no
|
|
27
|
+
* audio rate) never influences it. Firefox is the exception: its 48kHz cap is
|
|
28
|
+
* hard, with no fallback.
|
|
25
29
|
*/
|
|
26
30
|
export declare function withinAudioSampleRateRange(options: AudioSampleRateRangeOptions, metadata: MediaQualityMetadata, _index: number, array: ArrayLike<MediaQualityMetadata>): boolean;
|
|
27
31
|
//# sourceMappingURL=sampleRateFilter.d.ts.map
|
|
@@ -71,15 +71,6 @@ export declare class MseTrack extends TrackBase {
|
|
|
71
71
|
* Updates the cached qualities list from the transformed timeline for the current period.
|
|
72
72
|
*/
|
|
73
73
|
private updateQualities;
|
|
74
|
-
/**
|
|
75
|
-
* Fails fast when a media content type the manifest declared (audio/video)
|
|
76
|
-
* has no playable qualities left after timeline filtering. Its stream can
|
|
77
|
-
* never create a source buffer, so without this the track waits forever for
|
|
78
|
-
* a source buffer that never arrives, surfacing only as an opaque
|
|
79
|
-
* `readyToAppend` timeout. Runs once both the required content types and the
|
|
80
|
-
* filtered timeline qualities are known (either order).
|
|
81
|
-
*/
|
|
82
|
-
private validateRequiredContentTypesPlayable;
|
|
83
74
|
getAds(): Promise<TrackAds>;
|
|
84
75
|
/**
|
|
85
76
|
* Updates the cached unfiltered qualities list from the raw timeline for the current period.
|
|
@@ -66,6 +66,11 @@ export declare class VinylPlayer<TrackLoadOptionsType extends TrackLoadOptions =
|
|
|
66
66
|
* @see createVinylPlayer
|
|
67
67
|
*/
|
|
68
68
|
protected constructor(factories: Factories<VinylDeps<TrackLoadOptionsType, OptionsType>>);
|
|
69
|
+
/**
|
|
70
|
+
* Logs each republished load span once at the verbose level, formatting its
|
|
71
|
+
* bounds as ISO date strings and its duration in milliseconds.
|
|
72
|
+
*/
|
|
73
|
+
protected initializeLoadSpanLogging(): void;
|
|
69
74
|
protected redispatchSubControllerEvents(): void;
|
|
70
75
|
/**
|
|
71
76
|
* Certain track events are redispatched on the player for the current track.
|
|
@@ -7,6 +7,15 @@ import type { AdsProvider } from './AdsProvider';
|
|
|
7
7
|
* The % playhead start tolerance for playback progress when emitting ad progress events.
|
|
8
8
|
*/
|
|
9
9
|
export declare const AD_START_TOLERANCE = 0.05;
|
|
10
|
+
/**
|
|
11
|
+
* When a break's X-PLAYOUT-LIMIT budget is reached, an ad whose real media end is
|
|
12
|
+
* within this many seconds is allowed to finish on its own `ended` rather than
|
|
13
|
+
* being cut. The limit is a coarse, often whole-second budget while the media's
|
|
14
|
+
* true length is fractional, so without this grace an ad effectively as long as
|
|
15
|
+
* its budget would be clipped a fraction short. The tolerance is measured against
|
|
16
|
+
* the playback-reported (media) duration, not the ad's declared duration.
|
|
17
|
+
*/
|
|
18
|
+
export declare const PLAYOUT_LIMIT_TOLERANCE = 1;
|
|
10
19
|
export interface AdControllerImplDeps {
|
|
11
20
|
readonly playbackController: ReadonlyPlaybackController;
|
|
12
21
|
}
|
|
@@ -129,8 +138,15 @@ export declare class AdControllerImpl extends EventHostImpl<AdEventMap> implemen
|
|
|
129
138
|
private emitAdProgressEvents;
|
|
130
139
|
private emitTimeUpdate;
|
|
131
140
|
/**
|
|
132
|
-
*
|
|
133
|
-
*
|
|
141
|
+
* Enforces the break-level playout limit (X-PLAYOUT-LIMIT): a budget shared
|
|
142
|
+
* across all of the break's ads. When cumulative playout reaches it, the
|
|
143
|
+
* whole break ends, dropping any ads that have not started.
|
|
144
|
+
*
|
|
145
|
+
* This is deliberately NOT a per-ad cap. Each ad asset is its own source and
|
|
146
|
+
* ends on its media `ended` (see the 'ended' handler), which is what advances
|
|
147
|
+
* a multi-ad break. Ending an ad at its declared per-ad DURATION instead would
|
|
148
|
+
* truncate the real asset whenever a packager under-declares it — e.g. rounds
|
|
149
|
+
* a 6.732s asset down to a whole-second 6 — cutting off the fractional tail.
|
|
134
150
|
*/
|
|
135
151
|
private enforcePlayoutLimits;
|
|
136
152
|
private setPendingBreaks;
|
|
@@ -3,7 +3,7 @@ import { EventHostImpl } from '@amazon/vinyl-util';
|
|
|
3
3
|
import type { DrmOptions } from './DrmOptions';
|
|
4
4
|
import type { DrmController, DrmControllerEventMap, DrmKeySystemSupport, DrmPlaybackOptions } from './DrmController';
|
|
5
5
|
import type { CommonEme, CommonMediaKeyMessageEvent, CommonMediaKeys, CommonMediaKeySession } from './commonEme/CommonEme';
|
|
6
|
-
import type { MediaFormatMetadata } from '../streaming/MediaQualityMetadata';
|
|
6
|
+
import type { ContentType, MediaFormatMetadata } from '../streaming/MediaQualityMetadata';
|
|
7
7
|
import type { TrackUri } from '../track/Track';
|
|
8
8
|
/**
|
|
9
9
|
* The number of seconds a license request will be allowed before timing out.
|
|
@@ -31,6 +31,13 @@ export interface DrmControllerMessageProps {
|
|
|
31
31
|
* to their own track.
|
|
32
32
|
*/
|
|
33
33
|
readonly trackUri: TrackUri | null;
|
|
34
|
+
/**
|
|
35
|
+
* The MIME and content type of the session's content, captured at creation
|
|
36
|
+
* so the license span can distinguish the certificate exchange from the
|
|
37
|
+
* per-content-type license exchanges.
|
|
38
|
+
*/
|
|
39
|
+
readonly mimeType: string;
|
|
40
|
+
readonly contentType: ContentType | null;
|
|
34
41
|
}
|
|
35
42
|
export declare class DrmControllerImpl extends EventHostImpl<DrmControllerEventMap> implements DrmController {
|
|
36
43
|
private readonly deps;
|
|
@@ -45,6 +52,8 @@ export declare class DrmControllerImpl extends EventHostImpl<DrmControllerEventM
|
|
|
45
52
|
private bufferingTrackUri;
|
|
46
53
|
private sessionAbort;
|
|
47
54
|
private pendingMessageProps;
|
|
55
|
+
private keySetupSpanArmed;
|
|
56
|
+
private keySetupSpanStart;
|
|
48
57
|
private readonly disposer;
|
|
49
58
|
constructor(deps: DrmControllerImplDeps, options?: Maybe<Partial<DrmOptions>>);
|
|
50
59
|
configure(options: Maybe<Partial<DrmOptions>>): void;
|
|
@@ -65,6 +74,13 @@ export declare class DrmControllerImpl extends EventHostImpl<DrmControllerEventM
|
|
|
65
74
|
* The new session will be added to the current sessions list.
|
|
66
75
|
*/
|
|
67
76
|
private maybeCreateSession;
|
|
77
|
+
/**
|
|
78
|
+
* Captures the key-setup span start at the top of the session-creation path
|
|
79
|
+
* (before media keys are attached), latching so only the first session of
|
|
80
|
+
* the current track load is measured.
|
|
81
|
+
*/
|
|
82
|
+
private markKeySetupStart;
|
|
83
|
+
private dispatchLoadSpan;
|
|
68
84
|
initializeForPlayback(drmInfo: MediaFormatMetadata | null, options?: DrmPlaybackOptions): void;
|
|
69
85
|
/** True when the manifest carried pssh (sessions come from it, not events). */
|
|
70
86
|
private manifestProvidesInitData;
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import type { Timestamp } from '@amazon/vinyl-util';
|
|
2
2
|
import type { TrackUri } from '../track/Track';
|
|
3
|
+
import type { ContentType } from './MediaQualityMetadata';
|
|
3
4
|
/**
|
|
4
5
|
* The stage of the track-load journey a {@link LoadSpanMeasurement} describes.
|
|
5
6
|
*
|
|
6
7
|
* - `manifest`: fetching and parsing the DASH/HLS manifest.
|
|
8
|
+
* - `keySetup`: the EME/CDM setup, from session creation to the CDM's first
|
|
9
|
+
* license message. Precedes and is contiguous with `license`.
|
|
7
10
|
* - `license`: the DRM license request/response exchange.
|
|
8
11
|
* - `initSegment`: fetching the initialization segment.
|
|
9
12
|
* - `firstSegment`: fetching the first media segment.
|
|
10
13
|
*/
|
|
11
|
-
export type LoadSpanKind = 'manifest' | 'license' | 'initSegment' | 'firstSegment';
|
|
14
|
+
export type LoadSpanKind = 'manifest' | 'keySetup' | 'license' | 'initSegment' | 'firstSegment';
|
|
12
15
|
/**
|
|
13
16
|
* A timed span for one stage of a track load.
|
|
14
17
|
*
|
|
@@ -35,6 +38,17 @@ export interface LoadSpanMeasurement {
|
|
|
35
38
|
* buffering DRM info is set).
|
|
36
39
|
*/
|
|
37
40
|
readonly trackUri?: TrackUri;
|
|
41
|
+
/**
|
|
42
|
+
* The MIME type of the content this span was measured for, when known. Set
|
|
43
|
+
* for DRM `license` spans so a certificate exchange and the per-content-type
|
|
44
|
+
* license exchanges are distinguishable.
|
|
45
|
+
*/
|
|
46
|
+
readonly mimeType?: string;
|
|
47
|
+
/**
|
|
48
|
+
* The content type this span was measured for, when known. Set alongside
|
|
49
|
+
* {@link mimeType} for DRM `license` spans.
|
|
50
|
+
*/
|
|
51
|
+
readonly contentType?: ContentType;
|
|
38
52
|
}
|
|
39
53
|
/**
|
|
40
54
|
* A {@link LoadSpanMeasurement} attributed to the track it was measured for.
|
|
@@ -3,12 +3,14 @@ import type { MediaQualityMetadata } from './MediaQualityMetadata';
|
|
|
3
3
|
import type { FilterPredicate, FilterPredicateAsync, Maybe } from '@amazon/vinyl-util';
|
|
4
4
|
/**
|
|
5
5
|
* Filters qualities in a MediaTimeline using a synchronous predicate.
|
|
6
|
-
* If filtering
|
|
6
|
+
* If filtering drops an audio or video stream to zero in any period, throws via
|
|
7
|
+
* `throwError`.
|
|
7
8
|
*/
|
|
8
9
|
export declare function filterTimelineQualities(filter: Maybe<FilterPredicate<MediaQualityMetadata>>, throwError: () => never, timeline: MediaTimeline): MediaTimeline;
|
|
9
10
|
/**
|
|
10
11
|
* Filters qualities in a MediaTimeline using an asynchronous predicate.
|
|
11
|
-
* If filtering
|
|
12
|
+
* If filtering drops an audio or video stream to zero in any period, throws via
|
|
13
|
+
* `throwError`.
|
|
12
14
|
*/
|
|
13
15
|
export declare function filterTimelineQualitiesAsync(filter: FilterPredicateAsync<MediaQualityMetadata>, throwError: () => never, timeline: MediaTimeline): Promise<MediaTimeline>;
|
|
14
16
|
/**
|
|
@@ -18,10 +18,14 @@ export interface AudioSampleRateRangeOptions {
|
|
|
18
18
|
* The upper bound is `maxSampleRate` when set, otherwise the platform's
|
|
19
19
|
* `AudioContext`-reported output rate (Firefox is hard-capped at 48kHz, which it
|
|
20
20
|
* cannot decode beyond via MSE). The optional lower bound is `minSampleRate`.
|
|
21
|
-
* Both bounds are soft
|
|
22
|
-
*
|
|
23
|
-
* playback is never stranded
|
|
24
|
-
*
|
|
21
|
+
* Both bounds are soft, and soft *together*: when no audio rendition sits in the
|
|
22
|
+
* acceptable `[minSampleRate, maxSampleRate]` band, a single fallback is kept so
|
|
23
|
+
* playback is never stranded — the highest rate the ceiling can decode, or, when
|
|
24
|
+
* every rate is above the ceiling, the lowest. This holds even when renditions
|
|
25
|
+
* straddle an empty band (some below the floor, some above the ceiling). Only
|
|
26
|
+
* audio renditions count toward the fallback — a co-present video quality (no
|
|
27
|
+
* audio rate) never influences it. Firefox is the exception: its 48kHz cap is
|
|
28
|
+
* hard, with no fallback.
|
|
25
29
|
*/
|
|
26
30
|
export declare function withinAudioSampleRateRange(options: AudioSampleRateRangeOptions, metadata: MediaQualityMetadata, _index: number, array: ArrayLike<MediaQualityMetadata>): boolean;
|
|
27
31
|
//# sourceMappingURL=sampleRateFilter.d.ts.map
|
|
@@ -72,15 +72,6 @@ export declare class MseTrack extends TrackBase {
|
|
|
72
72
|
* Updates the cached qualities list from the transformed timeline for the current period.
|
|
73
73
|
*/
|
|
74
74
|
private updateQualities;
|
|
75
|
-
/**
|
|
76
|
-
* Fails fast when a media content type the manifest declared (audio/video)
|
|
77
|
-
* has no playable qualities left after timeline filtering. Its stream can
|
|
78
|
-
* never create a source buffer, so without this the track waits forever for
|
|
79
|
-
* a source buffer that never arrives, surfacing only as an opaque
|
|
80
|
-
* `readyToAppend` timeout. Runs once both the required content types and the
|
|
81
|
-
* filtered timeline qualities are known (either order).
|
|
82
|
-
*/
|
|
83
|
-
private validateRequiredContentTypesPlayable;
|
|
84
75
|
getAds(): Promise<TrackAds>;
|
|
85
76
|
/**
|
|
86
77
|
* Updates the cached unfiltered qualities list from the raw timeline for the current period.
|
|
@@ -67,6 +67,11 @@ export declare class VinylPlayer<TrackLoadOptionsType extends TrackLoadOptions =
|
|
|
67
67
|
* @see createVinylPlayer
|
|
68
68
|
*/
|
|
69
69
|
protected constructor(factories: Factories<VinylDeps<TrackLoadOptionsType, OptionsType>>);
|
|
70
|
+
/**
|
|
71
|
+
* Logs each republished load span once at the verbose level, formatting its
|
|
72
|
+
* bounds as ISO date strings and its duration in milliseconds.
|
|
73
|
+
*/
|
|
74
|
+
protected initializeLoadSpanLogging(): void;
|
|
70
75
|
protected redispatchSubControllerEvents(): void;
|
|
71
76
|
/**
|
|
72
77
|
* Certain track events are redispatched on the player for the current track.
|
|
@@ -7,6 +7,15 @@ import type { AdsProvider } from './AdsProvider';
|
|
|
7
7
|
* The % playhead start tolerance for playback progress when emitting ad progress events.
|
|
8
8
|
*/
|
|
9
9
|
export declare const AD_START_TOLERANCE = 0.05;
|
|
10
|
+
/**
|
|
11
|
+
* When a break's X-PLAYOUT-LIMIT budget is reached, an ad whose real media end is
|
|
12
|
+
* within this many seconds is allowed to finish on its own `ended` rather than
|
|
13
|
+
* being cut. The limit is a coarse, often whole-second budget while the media's
|
|
14
|
+
* true length is fractional, so without this grace an ad effectively as long as
|
|
15
|
+
* its budget would be clipped a fraction short. The tolerance is measured against
|
|
16
|
+
* the playback-reported (media) duration, not the ad's declared duration.
|
|
17
|
+
*/
|
|
18
|
+
export declare const PLAYOUT_LIMIT_TOLERANCE = 1;
|
|
10
19
|
export interface AdControllerImplDeps {
|
|
11
20
|
readonly playbackController: ReadonlyPlaybackController;
|
|
12
21
|
}
|
|
@@ -129,8 +138,15 @@ export declare class AdControllerImpl extends EventHostImpl<AdEventMap> implemen
|
|
|
129
138
|
private emitAdProgressEvents;
|
|
130
139
|
private emitTimeUpdate;
|
|
131
140
|
/**
|
|
132
|
-
*
|
|
133
|
-
*
|
|
141
|
+
* Enforces the break-level playout limit (X-PLAYOUT-LIMIT): a budget shared
|
|
142
|
+
* across all of the break's ads. When cumulative playout reaches it, the
|
|
143
|
+
* whole break ends, dropping any ads that have not started.
|
|
144
|
+
*
|
|
145
|
+
* This is deliberately NOT a per-ad cap. Each ad asset is its own source and
|
|
146
|
+
* ends on its media `ended` (see the 'ended' handler), which is what advances
|
|
147
|
+
* a multi-ad break. Ending an ad at its declared per-ad DURATION instead would
|
|
148
|
+
* truncate the real asset whenever a packager under-declares it — e.g. rounds
|
|
149
|
+
* a 6.732s asset down to a whole-second 6 — cutting off the fractional tail.
|
|
134
150
|
*/
|
|
135
151
|
private enforcePlayoutLimits;
|
|
136
152
|
private setPendingBreaks;
|
|
@@ -2,7 +2,7 @@ import { EventHostImpl, type Maybe } from '@amazon/vinyl-util';
|
|
|
2
2
|
import { type DrmOptions } from './DrmOptions';
|
|
3
3
|
import type { DrmController, DrmControllerEventMap, DrmKeySystemSupport, DrmPlaybackOptions } from './DrmController';
|
|
4
4
|
import type { CommonEme, CommonMediaKeyMessageEvent, CommonMediaKeys, CommonMediaKeySession } from './commonEme/CommonEme';
|
|
5
|
-
import type { MediaFormatMetadata } from '../streaming/MediaQualityMetadata';
|
|
5
|
+
import type { ContentType, MediaFormatMetadata } from '../streaming/MediaQualityMetadata';
|
|
6
6
|
import type { TrackUri } from '../track/Track';
|
|
7
7
|
/**
|
|
8
8
|
* The number of seconds a license request will be allowed before timing out.
|
|
@@ -30,6 +30,13 @@ export interface DrmControllerMessageProps {
|
|
|
30
30
|
* to their own track.
|
|
31
31
|
*/
|
|
32
32
|
readonly trackUri: TrackUri | null;
|
|
33
|
+
/**
|
|
34
|
+
* The MIME and content type of the session's content, captured at creation
|
|
35
|
+
* so the license span can distinguish the certificate exchange from the
|
|
36
|
+
* per-content-type license exchanges.
|
|
37
|
+
*/
|
|
38
|
+
readonly mimeType: string;
|
|
39
|
+
readonly contentType: ContentType | null;
|
|
33
40
|
}
|
|
34
41
|
export declare class DrmControllerImpl extends EventHostImpl<DrmControllerEventMap> implements DrmController {
|
|
35
42
|
private readonly deps;
|
|
@@ -44,6 +51,8 @@ export declare class DrmControllerImpl extends EventHostImpl<DrmControllerEventM
|
|
|
44
51
|
private bufferingTrackUri;
|
|
45
52
|
private sessionAbort;
|
|
46
53
|
private pendingMessageProps;
|
|
54
|
+
private keySetupSpanArmed;
|
|
55
|
+
private keySetupSpanStart;
|
|
47
56
|
private readonly disposer;
|
|
48
57
|
constructor(deps: DrmControllerImplDeps, options?: Maybe<Partial<DrmOptions>>);
|
|
49
58
|
configure(options: Maybe<Partial<DrmOptions>>): void;
|
|
@@ -64,6 +73,13 @@ export declare class DrmControllerImpl extends EventHostImpl<DrmControllerEventM
|
|
|
64
73
|
* The new session will be added to the current sessions list.
|
|
65
74
|
*/
|
|
66
75
|
private maybeCreateSession;
|
|
76
|
+
/**
|
|
77
|
+
* Captures the key-setup span start at the top of the session-creation path
|
|
78
|
+
* (before media keys are attached), latching so only the first session of
|
|
79
|
+
* the current track load is measured.
|
|
80
|
+
*/
|
|
81
|
+
private markKeySetupStart;
|
|
82
|
+
private dispatchLoadSpan;
|
|
67
83
|
initializeForPlayback(drmInfo: MediaFormatMetadata | null, options?: DrmPlaybackOptions): void;
|
|
68
84
|
/** True when the manifest carried pssh (sessions come from it, not events). */
|
|
69
85
|
private manifestProvidesInitData;
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import type { Timestamp } from '@amazon/vinyl-util';
|
|
2
2
|
import type { TrackUri } from '../track/Track';
|
|
3
|
+
import type { ContentType } from './MediaQualityMetadata';
|
|
3
4
|
/**
|
|
4
5
|
* The stage of the track-load journey a {@link LoadSpanMeasurement} describes.
|
|
5
6
|
*
|
|
6
7
|
* - `manifest`: fetching and parsing the DASH/HLS manifest.
|
|
8
|
+
* - `keySetup`: the EME/CDM setup, from session creation to the CDM's first
|
|
9
|
+
* license message. Precedes and is contiguous with `license`.
|
|
7
10
|
* - `license`: the DRM license request/response exchange.
|
|
8
11
|
* - `initSegment`: fetching the initialization segment.
|
|
9
12
|
* - `firstSegment`: fetching the first media segment.
|
|
10
13
|
*/
|
|
11
|
-
export type LoadSpanKind = 'manifest' | 'license' | 'initSegment' | 'firstSegment';
|
|
14
|
+
export type LoadSpanKind = 'manifest' | 'keySetup' | 'license' | 'initSegment' | 'firstSegment';
|
|
12
15
|
/**
|
|
13
16
|
* A timed span for one stage of a track load.
|
|
14
17
|
*
|
|
@@ -35,6 +38,17 @@ export interface LoadSpanMeasurement {
|
|
|
35
38
|
* buffering DRM info is set).
|
|
36
39
|
*/
|
|
37
40
|
readonly trackUri?: TrackUri;
|
|
41
|
+
/**
|
|
42
|
+
* The MIME type of the content this span was measured for, when known. Set
|
|
43
|
+
* for DRM `license` spans so a certificate exchange and the per-content-type
|
|
44
|
+
* license exchanges are distinguishable.
|
|
45
|
+
*/
|
|
46
|
+
readonly mimeType?: string;
|
|
47
|
+
/**
|
|
48
|
+
* The content type this span was measured for, when known. Set alongside
|
|
49
|
+
* {@link mimeType} for DRM `license` spans.
|
|
50
|
+
*/
|
|
51
|
+
readonly contentType?: ContentType;
|
|
38
52
|
}
|
|
39
53
|
/**
|
|
40
54
|
* A {@link LoadSpanMeasurement} attributed to the track it was measured for.
|
|
@@ -3,12 +3,14 @@ import type { MediaQualityMetadata } from './MediaQualityMetadata';
|
|
|
3
3
|
import type { FilterPredicate, FilterPredicateAsync, Maybe } from '@amazon/vinyl-util';
|
|
4
4
|
/**
|
|
5
5
|
* Filters qualities in a MediaTimeline using a synchronous predicate.
|
|
6
|
-
* If filtering
|
|
6
|
+
* If filtering drops an audio or video stream to zero in any period, throws via
|
|
7
|
+
* `throwError`.
|
|
7
8
|
*/
|
|
8
9
|
export declare function filterTimelineQualities(filter: Maybe<FilterPredicate<MediaQualityMetadata>>, throwError: () => never, timeline: MediaTimeline): MediaTimeline;
|
|
9
10
|
/**
|
|
10
11
|
* Filters qualities in a MediaTimeline using an asynchronous predicate.
|
|
11
|
-
* If filtering
|
|
12
|
+
* If filtering drops an audio or video stream to zero in any period, throws via
|
|
13
|
+
* `throwError`.
|
|
12
14
|
*/
|
|
13
15
|
export declare function filterTimelineQualitiesAsync(filter: FilterPredicateAsync<MediaQualityMetadata>, throwError: () => never, timeline: MediaTimeline): Promise<MediaTimeline>;
|
|
14
16
|
/**
|
|
@@ -18,10 +18,14 @@ export interface AudioSampleRateRangeOptions {
|
|
|
18
18
|
* The upper bound is `maxSampleRate` when set, otherwise the platform's
|
|
19
19
|
* `AudioContext`-reported output rate (Firefox is hard-capped at 48kHz, which it
|
|
20
20
|
* cannot decode beyond via MSE). The optional lower bound is `minSampleRate`.
|
|
21
|
-
* Both bounds are soft
|
|
22
|
-
*
|
|
23
|
-
* playback is never stranded
|
|
24
|
-
*
|
|
21
|
+
* Both bounds are soft, and soft *together*: when no audio rendition sits in the
|
|
22
|
+
* acceptable `[minSampleRate, maxSampleRate]` band, a single fallback is kept so
|
|
23
|
+
* playback is never stranded — the highest rate the ceiling can decode, or, when
|
|
24
|
+
* every rate is above the ceiling, the lowest. This holds even when renditions
|
|
25
|
+
* straddle an empty band (some below the floor, some above the ceiling). Only
|
|
26
|
+
* audio renditions count toward the fallback — a co-present video quality (no
|
|
27
|
+
* audio rate) never influences it. Firefox is the exception: its 48kHz cap is
|
|
28
|
+
* hard, with no fallback.
|
|
25
29
|
*/
|
|
26
30
|
export declare function withinAudioSampleRateRange(options: AudioSampleRateRangeOptions, metadata: MediaQualityMetadata, _index: number, array: ArrayLike<MediaQualityMetadata>): boolean;
|
|
27
31
|
//# sourceMappingURL=sampleRateFilter.d.ts.map
|
|
@@ -71,15 +71,6 @@ export declare class MseTrack extends TrackBase {
|
|
|
71
71
|
* Updates the cached qualities list from the transformed timeline for the current period.
|
|
72
72
|
*/
|
|
73
73
|
private updateQualities;
|
|
74
|
-
/**
|
|
75
|
-
* Fails fast when a media content type the manifest declared (audio/video)
|
|
76
|
-
* has no playable qualities left after timeline filtering. Its stream can
|
|
77
|
-
* never create a source buffer, so without this the track waits forever for
|
|
78
|
-
* a source buffer that never arrives, surfacing only as an opaque
|
|
79
|
-
* `readyToAppend` timeout. Runs once both the required content types and the
|
|
80
|
-
* filtered timeline qualities are known (either order).
|
|
81
|
-
*/
|
|
82
|
-
private validateRequiredContentTypesPlayable;
|
|
83
74
|
getAds(): Promise<TrackAds>;
|
|
84
75
|
/**
|
|
85
76
|
* Updates the cached unfiltered qualities list from the raw timeline for the current period.
|