@amazon/vinyl 3.1.0 → 3.2.0

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.
Files changed (51) hide show
  1. package/dist/index.cjs +207 -164
  2. package/dist/index.cjs.map +4 -4
  3. package/dist/index.js +195 -151
  4. package/dist/index.js.map +4 -4
  5. package/dist/test/integ.es5.js +201 -199
  6. package/dist/test/integ.js +417 -222
  7. package/dist/test/integ.js.map +4 -4
  8. package/dist/types/current/drm/DrmControllerImpl.d.ts +17 -1
  9. package/dist/types/current/drm/DrmControllerImpl.d.ts.map +1 -1
  10. package/dist/types/current/drm/DrmControllerImpl.js +45 -10
  11. package/dist/types/current/streaming/LoadMetric.d.ts +15 -1
  12. package/dist/types/current/streaming/LoadMetric.d.ts.map +1 -1
  13. package/dist/types/current/streaming/mediaTimelineFilter.d.ts +4 -2
  14. package/dist/types/current/streaming/mediaTimelineFilter.d.ts.map +1 -1
  15. package/dist/types/current/streaming/mediaTimelineFilter.js +23 -8
  16. package/dist/types/current/track/filters/sampleRateFilter.d.ts +8 -4
  17. package/dist/types/current/track/filters/sampleRateFilter.d.ts.map +1 -1
  18. package/dist/types/current/track/filters/sampleRateFilter.js +31 -21
  19. package/dist/types/current/track/mse/MseTrack.d.ts +0 -9
  20. package/dist/types/current/track/mse/MseTrack.d.ts.map +1 -1
  21. package/dist/types/current/track/mse/MseTrack.js +2 -29
  22. package/dist/types/current/tsconfig.tsbuildinfo +1 -1
  23. package/dist/types/current/vinyl/VinylPlayer.d.ts +5 -0
  24. package/dist/types/current/vinyl/VinylPlayer.d.ts.map +1 -1
  25. package/dist/types/current/vinyl/VinylPlayer.js +23 -1
  26. package/dist/types/ts3.7/drm/DrmControllerImpl.d.ts +17 -1
  27. package/dist/types/ts3.7/streaming/LoadMetric.d.ts +15 -1
  28. package/dist/types/ts3.7/streaming/mediaTimelineFilter.d.ts +4 -2
  29. package/dist/types/ts3.7/track/filters/sampleRateFilter.d.ts +8 -4
  30. package/dist/types/ts3.7/track/mse/MseTrack.d.ts +0 -9
  31. package/dist/types/ts3.7/vinyl/VinylPlayer.d.ts +5 -0
  32. package/dist/types/ts4.1/drm/DrmControllerImpl.d.ts +17 -1
  33. package/dist/types/ts4.1/streaming/LoadMetric.d.ts +15 -1
  34. package/dist/types/ts4.1/streaming/mediaTimelineFilter.d.ts +4 -2
  35. package/dist/types/ts4.1/track/filters/sampleRateFilter.d.ts +8 -4
  36. package/dist/types/ts4.1/track/mse/MseTrack.d.ts +0 -9
  37. package/dist/types/ts4.1/vinyl/VinylPlayer.d.ts +5 -0
  38. package/dist/types/ts4.7/drm/DrmControllerImpl.d.ts +17 -1
  39. package/dist/types/ts4.7/streaming/LoadMetric.d.ts +15 -1
  40. package/dist/types/ts4.7/streaming/mediaTimelineFilter.d.ts +4 -2
  41. package/dist/types/ts4.7/track/filters/sampleRateFilter.d.ts +8 -4
  42. package/dist/types/ts4.7/track/mse/MseTrack.d.ts +0 -9
  43. package/dist/types/ts4.7/vinyl/VinylPlayer.d.ts +5 -0
  44. package/dist/unit/types/current/drm/DrmControllerImpl.test.js +53 -9
  45. package/dist/unit/types/current/streaming/MseTrack.test.js +11 -8
  46. package/dist/unit/types/current/streaming/mediaTimelineFilter.test.js +60 -54
  47. package/dist/unit/types/current/track/filters/sampleRateFilter.test.js +75 -0
  48. package/dist/unit/types/current/tsconfig.tsbuildinfo +1 -1
  49. package/dist/unit/types/current/vinyl/VinylPlayer.test.js +33 -2
  50. package/dist/vinylTestUtil/types/current/tsconfig.tsbuildinfo +1 -1
  51. 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,EAIb,KAAK,cAAc,EACnB,KAAK,WAAW,EAGnB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAEH,KAAK,SAAS,EACd,KAAK,qBAAqB,EAC7B,MAAM,kBAAkB,CAAA;AAEzB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAA;AACxE,OAAO,EAEH,KAAK,0BAA0B,EAC/B,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EAC1B,MAAM,wCAAwC,CAAA;AAC/C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAA;AAC/E,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAClE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AACnD,OAAO,EAEH,KAAK,eAAe,EACpB,KAAK,uBAAuB,EAC/B,MAAM,0BAA0B,CAAA;AACjC,OAAO,KAAK,EACR,2BAA2B,EAC3B,gBAAgB,EACnB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,KAAK,EACR,qBAAqB,EACrB,gCAAgC,EAChC,sBAAsB,EACzB,MAAM,wBAAwB,CAAA;AAE/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAE1D,OAAO,EAEH,KAAK,WAAW,EAChB,KAAK,oBAAoB,EAC5B,MAAM,mCAAmC,CAAA;AAC1C,O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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)));
@@ -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 would remove all qualities from any period, throws via `throwError`.
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 would remove all qualities from any period, throws via `throwError`.
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: if every audio rendition is above the max the lowest is
22
- * kept, and if every audio rendition is below the min the highest is kept, so
23
- * playback is never stranded. Only audio renditions count toward those
24
- * fallbacks — a co-present video quality (no audio rate) never influences them.
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.
@@ -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 would remove all qualities from any period, throws via `throwError`.
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 would remove all qualities from any period, throws via `throwError`.
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: if every audio rendition is above the max the lowest is
22
- * kept, and if every audio rendition is below the min the highest is kept, so
23
- * playback is never stranded. Only audio renditions count toward those
24
- * fallbacks — a co-present video quality (no audio rate) never influences them.
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.
@@ -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 would remove all qualities from any period, throws via `throwError`.
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 would remove all qualities from any period, throws via `throwError`.
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: if every audio rendition is above the max the lowest is
22
- * kept, and if every audio rendition is below the min the highest is kept, so
23
- * playback is never stranded. Only audio renditions count toward those
24
- * fallbacks — a co-present video quality (no audio rate) never influences them.
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.
@@ -950,28 +950,70 @@ describe('DrmControllerImpl', () => {
950
950
  drmController.setBufferingDrmInfo(drmInfo);
951
951
  await emitEncrypted(new Uint8Array([1, 2, 3]), 'cenc');
952
952
  await emitMessage(0, new ArrayBuffer(1));
953
- expect(spy).toHaveBeenCalledOnceWith(objectContaining({
953
+ expect(spy).toHaveBeenCalledWith(objectContaining({
954
954
  kind: 'license',
955
955
  startTime: any(Number),
956
956
  endTime: any(Number),
957
957
  }));
958
958
  });
959
+ it('measures the key setup, contiguous with and before the license', async () => {
960
+ licenseProvider.and.resolveTo(new Uint8Array([1]).buffer);
961
+ const spy = createEventSpy(drmController, 'loadSpanMeasured');
962
+ drmController.setBufferingDrmInfo(drmInfo, { trackUri: 'track-a' });
963
+ await emitEncrypted(new Uint8Array([1, 2, 3]), 'cenc');
964
+ await emitMessage(0, new ArrayBuffer(1));
965
+ const spans = spy.calls.all().map((call) => call.args[0]);
966
+ expect(spans.map((span) => span.kind)).toEqual([
967
+ 'keySetup',
968
+ 'license',
969
+ ]);
970
+ const [keySetup, license] = spans;
971
+ expect(keySetup.trackUri).toEqual('track-a');
972
+ expect(keySetup.endTime).toEqual(license.startTime);
973
+ });
974
+ it('carries the content mime and content type on the license span', async () => {
975
+ licenseProvider.and.resolveTo(new Uint8Array([1]).buffer);
976
+ const spy = createEventSpy(drmController, 'loadSpanMeasured');
977
+ drmController.setBufferingDrmInfo(drmInfo);
978
+ await emitEncrypted(new Uint8Array([1, 2, 3]), 'cenc');
979
+ await emitMessage(0, new ArrayBuffer(1));
980
+ expect(spy).toHaveBeenCalledWith(objectContaining({
981
+ kind: 'license',
982
+ mimeType: 'audio/mp4',
983
+ contentType: 'audio',
984
+ }));
985
+ });
959
986
  it('does not measure a failed license exchange', async () => {
960
987
  licenseProvider.and.rejectWith(new Error('license failed'));
961
988
  const spy = createEventSpy(drmController, 'loadSpanMeasured');
962
989
  drmController.setBufferingDrmInfo(drmInfo);
963
990
  await emitEncrypted(new Uint8Array([1, 2, 3]), 'cenc');
964
991
  await emitMessage(0, new ArrayBuffer(1));
965
- expect(spy).not.toHaveBeenCalled();
992
+ // Setup completed at the message, so keySetup is still measured.
993
+ expect(spy).not.toHaveBeenCalledWith(objectContaining({ kind: 'license' }));
966
994
  errorSpy.calls.reset();
967
995
  });
996
+ it('measures key setup only for the first session of a track load', async () => {
997
+ licenseProvider.and.resolveTo(new Uint8Array([1]).buffer);
998
+ const spy = createEventSpy(drmController, 'loadSpanMeasured');
999
+ drmController.setBufferingDrmInfo(drmInfo, { trackUri: 'track-a' });
1000
+ await emitEncrypted(new Uint8Array([1]), 'cenc');
1001
+ await emitEncrypted(new Uint8Array([2]), 'cenc');
1002
+ expect(mediaKeys.createSession).toHaveBeenCalledTimes(2);
1003
+ await emitMessage(0, new ArrayBuffer(1));
1004
+ await emitMessage(1, new ArrayBuffer(1));
1005
+ const keySetupSpans = spy.calls
1006
+ .all()
1007
+ .filter((call) => call.args[0].kind === 'keySetup');
1008
+ expect(keySetupSpans.length).toEqual(1);
1009
+ });
968
1010
  it('attributes the license span to the buffering track uri', async () => {
969
1011
  licenseProvider.and.resolveTo(new Uint8Array([1]).buffer);
970
1012
  const spy = createEventSpy(drmController, 'loadSpanMeasured');
971
1013
  drmController.setBufferingDrmInfo(drmInfo, { trackUri: 'track-a' });
972
1014
  await emitEncrypted(new Uint8Array([1, 2, 3]), 'cenc');
973
1015
  await emitMessage(0, new ArrayBuffer(1));
974
- expect(spy).toHaveBeenCalledOnceWith(objectContaining({
1016
+ expect(spy).toHaveBeenCalledWith(objectContaining({
975
1017
  kind: 'license',
976
1018
  trackUri: 'track-a',
977
1019
  }));
@@ -1005,12 +1047,14 @@ describe('DrmControllerImpl', () => {
1005
1047
  // on the controller's current buffering track.
1006
1048
  await emitMessage(1, new ArrayBuffer(1));
1007
1049
  await emitMessage(0, new ArrayBuffer(1));
1008
- expect(spy).toHaveBeenCalledTimes(2);
1009
- expect(spy).toHaveBeenCalledWith(objectContaining({
1010
- kind: 'license',
1011
- trackUri: 'track-preloaded',
1012
- }));
1013
- expect(spy).toHaveBeenCalledWith(objectContaining({ kind: 'license', trackUri: 'track-active' }));
1050
+ const licenseTrackUris = spy.calls
1051
+ .all()
1052
+ .map((call) => call.args[0])
1053
+ .filter((span) => span.kind === 'license')
1054
+ .map((span) => span.trackUri);
1055
+ expect(licenseTrackUris.length).toEqual(2);
1056
+ expect(licenseTrackUris).toContain('track-preloaded');
1057
+ expect(licenseTrackUris).toContain('track-active');
1014
1058
  });
1015
1059
  });
1016
1060
  describe('serverCertificate', () => {