@amazon/vinyl 2.0.4 → 3.0.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 +624 -338
- package/dist/index.cjs.map +4 -4
- package/dist/index.js +643 -350
- package/dist/index.js.map +4 -4
- package/dist/test/benchmark.es5.js +8 -5
- package/dist/test/benchmark.js +228 -0
- package/dist/test/benchmark.js.map +4 -4
- package/dist/test/integ.es5.js +183 -157
- package/dist/test/integ.js +1966 -817
- package/dist/test/integ.js.map +4 -4
- package/dist/types/current/index.d.ts +4 -0
- package/dist/types/current/index.d.ts.map +1 -1
- package/dist/types/current/index.js +4 -0
- package/dist/types/current/streaming/AudioOptions.d.ts +39 -0
- package/dist/types/current/streaming/AudioOptions.d.ts.map +1 -0
- package/dist/types/current/streaming/AudioOptions.js +15 -0
- package/dist/types/current/streaming/createDefaultMediaTimelineTransformer.d.ts +2 -2
- package/dist/types/current/streaming/createDefaultMediaTimelineTransformer.d.ts.map +1 -1
- package/dist/types/current/streaming/createDefaultMediaTimelineTransformer.js +5 -5
- package/dist/types/current/text/HtmlTextTrackRenderer.d.ts +60 -0
- package/dist/types/current/text/HtmlTextTrackRenderer.d.ts.map +1 -0
- package/dist/types/current/text/HtmlTextTrackRenderer.js +231 -0
- package/dist/types/current/text/SidecarTextTrackController.d.ts +65 -53
- package/dist/types/current/text/SidecarTextTrackController.d.ts.map +1 -1
- package/dist/types/current/text/SidecarTextTrackController.js +167 -154
- package/dist/types/current/text/SidecarTextTrackLoader.d.ts +5 -0
- package/dist/types/current/text/SidecarTextTrackLoader.d.ts.map +1 -1
- package/dist/types/current/text/SidecarTextTrackLoader.js +13 -7
- package/dist/types/current/text/TextTrack.d.ts +74 -20
- package/dist/types/current/text/TextTrack.d.ts.map +1 -1
- package/dist/types/current/text/TextTrack.js +20 -0
- package/dist/types/current/text/TextTrackRenderer.d.ts +24 -0
- package/dist/types/current/text/TextTrackRenderer.d.ts.map +1 -0
- package/dist/types/current/text/TextTrackRenderer.js +5 -0
- package/dist/types/current/text/mediaTextTrackProvider.d.ts +34 -0
- package/dist/types/current/text/mediaTextTrackProvider.d.ts.map +1 -0
- package/dist/types/current/text/mediaTextTrackProvider.js +42 -0
- package/dist/types/current/text/parseWebVtt.d.ts +16 -2
- package/dist/types/current/text/parseWebVtt.d.ts.map +1 -1
- package/dist/types/current/text/parseWebVtt.js +176 -48
- package/dist/types/current/text/pickPreferredTextTrack.d.ts +2 -1
- package/dist/types/current/text/pickPreferredTextTrack.d.ts.map +1 -1
- package/dist/types/current/text/pickPreferredTextTrack.js +6 -3
- package/dist/types/current/track/Track.d.ts +1 -1
- package/dist/types/current/track/TrackController.d.ts.map +1 -1
- package/dist/types/current/track/TrackController.js +30 -30
- package/dist/types/current/track/dash/createDashFactories.d.ts +21 -10
- package/dist/types/current/track/dash/createDashFactories.d.ts.map +1 -1
- package/dist/types/current/track/dash/createDashFactories.js +9 -21
- package/dist/types/current/track/hls/createHlsFactories.d.ts +21 -10
- package/dist/types/current/track/hls/createHlsFactories.d.ts.map +1 -1
- package/dist/types/current/track/hls/createHlsFactories.js +9 -21
- package/dist/types/current/track/mse/MseTrack.d.ts +1 -2
- package/dist/types/current/track/mse/MseTrack.d.ts.map +1 -1
- package/dist/types/current/track/mse/MseTrack.js +3 -7
- package/dist/types/current/tsconfig.tsbuildinfo +1 -1
- package/dist/types/current/vinyl/VinylOptions.d.ts +18 -40
- package/dist/types/current/vinyl/VinylOptions.d.ts.map +1 -1
- package/dist/types/current/vinyl/VinylOptions.js +12 -11
- package/dist/types/current/vinyl/VinylPlayer.d.ts +0 -6
- package/dist/types/current/vinyl/VinylPlayer.d.ts.map +1 -1
- package/dist/types/current/vinyl/VinylPlayer.js +2 -23
- package/dist/types/current/vinyl/createVinylFactories.d.ts +32 -18
- package/dist/types/current/vinyl/createVinylFactories.d.ts.map +1 -1
- package/dist/types/current/vinyl/createVinylFactories.js +6 -0
- package/dist/types/ts3.7/index.d.ts +4 -0
- package/dist/types/ts3.7/streaming/AudioOptions.d.ts +39 -0
- package/dist/types/ts3.7/streaming/createDefaultMediaTimelineTransformer.d.ts +2 -2
- package/dist/types/ts3.7/text/HtmlTextTrackRenderer.d.ts +60 -0
- package/dist/types/ts3.7/text/SidecarTextTrackController.d.ts +65 -53
- package/dist/types/ts3.7/text/SidecarTextTrackLoader.d.ts +5 -0
- package/dist/types/ts3.7/text/TextTrack.d.ts +74 -20
- package/dist/types/ts3.7/text/TextTrackRenderer.d.ts +24 -0
- package/dist/types/ts3.7/text/mediaTextTrackProvider.d.ts +34 -0
- package/dist/types/ts3.7/text/parseWebVtt.d.ts +16 -2
- package/dist/types/ts3.7/text/pickPreferredTextTrack.d.ts +2 -1
- package/dist/types/ts3.7/track/Track.d.ts +1 -1
- package/dist/types/ts3.7/track/dash/createDashFactories.d.ts +21 -10
- package/dist/types/ts3.7/track/hls/createHlsFactories.d.ts +21 -10
- package/dist/types/ts3.7/track/mse/MseTrack.d.ts +1 -2
- package/dist/types/ts3.7/vinyl/VinylOptions.d.ts +18 -40
- package/dist/types/ts3.7/vinyl/VinylPlayer.d.ts +0 -6
- package/dist/types/ts3.7/vinyl/createVinylFactories.d.ts +32 -18
- package/dist/types/ts4.1/index.d.ts +4 -0
- package/dist/types/ts4.1/streaming/AudioOptions.d.ts +39 -0
- package/dist/types/ts4.1/streaming/createDefaultMediaTimelineTransformer.d.ts +2 -2
- package/dist/types/ts4.1/text/HtmlTextTrackRenderer.d.ts +60 -0
- package/dist/types/ts4.1/text/SidecarTextTrackController.d.ts +65 -53
- package/dist/types/ts4.1/text/SidecarTextTrackLoader.d.ts +5 -0
- package/dist/types/ts4.1/text/TextTrack.d.ts +74 -20
- package/dist/types/ts4.1/text/TextTrackRenderer.d.ts +24 -0
- package/dist/types/ts4.1/text/mediaTextTrackProvider.d.ts +34 -0
- package/dist/types/ts4.1/text/parseWebVtt.d.ts +16 -2
- package/dist/types/ts4.1/text/pickPreferredTextTrack.d.ts +2 -1
- package/dist/types/ts4.1/track/Track.d.ts +1 -1
- package/dist/types/ts4.1/track/dash/createDashFactories.d.ts +21 -10
- package/dist/types/ts4.1/track/hls/createHlsFactories.d.ts +21 -10
- package/dist/types/ts4.1/track/mse/MseTrack.d.ts +1 -2
- package/dist/types/ts4.1/vinyl/VinylOptions.d.ts +18 -40
- package/dist/types/ts4.1/vinyl/VinylPlayer.d.ts +0 -6
- package/dist/types/ts4.1/vinyl/createVinylFactories.d.ts +32 -18
- package/dist/types/ts4.7/index.d.ts +4 -0
- package/dist/types/ts4.7/streaming/AudioOptions.d.ts +39 -0
- package/dist/types/ts4.7/streaming/createDefaultMediaTimelineTransformer.d.ts +2 -2
- package/dist/types/ts4.7/text/HtmlTextTrackRenderer.d.ts +60 -0
- package/dist/types/ts4.7/text/SidecarTextTrackController.d.ts +65 -53
- package/dist/types/ts4.7/text/SidecarTextTrackLoader.d.ts +5 -0
- package/dist/types/ts4.7/text/TextTrack.d.ts +74 -20
- package/dist/types/ts4.7/text/TextTrackRenderer.d.ts +24 -0
- package/dist/types/ts4.7/text/mediaTextTrackProvider.d.ts +34 -0
- package/dist/types/ts4.7/text/parseWebVtt.d.ts +16 -2
- package/dist/types/ts4.7/text/pickPreferredTextTrack.d.ts +2 -1
- package/dist/types/ts4.7/track/Track.d.ts +1 -1
- package/dist/types/ts4.7/track/dash/createDashFactories.d.ts +21 -10
- package/dist/types/ts4.7/track/hls/createHlsFactories.d.ts +21 -10
- package/dist/types/ts4.7/track/mse/MseTrack.d.ts +1 -2
- package/dist/types/ts4.7/vinyl/VinylOptions.d.ts +18 -40
- package/dist/types/ts4.7/vinyl/VinylPlayer.d.ts +0 -6
- package/dist/types/ts4.7/vinyl/createVinylFactories.d.ts +32 -18
- package/dist/unit/types/current/index.d.ts +2 -0
- package/dist/unit/types/current/index.d.ts.map +1 -1
- package/dist/unit/types/current/index.js +2 -0
- package/dist/unit/types/current/streaming/MseTrack.test.js +13 -7
- package/dist/unit/types/current/streaming/createDefaultMediaTimelineTransformer.test.js +8 -4
- package/dist/unit/types/current/text/HtmlTextTrackRenderer.test.d.ts +2 -0
- package/dist/unit/types/current/text/HtmlTextTrackRenderer.test.d.ts.map +1 -0
- package/dist/unit/types/current/text/HtmlTextTrackRenderer.test.js +231 -0
- package/dist/unit/types/current/text/SidecarTextTrackController.test.js +432 -333
- package/dist/unit/types/current/text/SidecarTextTrackLoader.test.js +29 -0
- package/dist/unit/types/current/text/mediaTextTrackProvider.test.d.ts +2 -0
- package/dist/unit/types/current/text/mediaTextTrackProvider.test.d.ts.map +1 -0
- package/dist/unit/types/current/text/mediaTextTrackProvider.test.js +86 -0
- package/dist/unit/types/current/text/parseWebVtt.test.js +187 -6
- package/dist/unit/types/current/text/pickPreferredTextTrack.test.js +12 -1
- package/dist/unit/types/current/track/TrackController.test.js +36 -0
- package/dist/unit/types/current/track/dash/createDashFactories.test.js +1 -2
- package/dist/unit/types/current/track/hls/buildHlsMediaTimeline.test.js +1 -2
- package/dist/unit/types/current/track/hls/createHlsFactories.test.js +1 -2
- package/dist/unit/types/current/tsconfig.tsbuildinfo +1 -1
- package/dist/unit/types/current/vinyl/VinylPlayerTextTracks.test.js +102 -177
- package/dist/unit/types/current/vinyl/createVinylFactories.test.js +2 -0
- package/dist/vinylTestUtil/index.js +14 -8
- package/dist/vinylTestUtil/index.js.map +2 -2
- package/dist/vinylTestUtil/types/current/mock/player/MockVinylPlayerDependencies.d.ts +3 -2
- package/dist/vinylTestUtil/types/current/mock/player/MockVinylPlayerDependencies.d.ts.map +1 -1
- package/dist/vinylTestUtil/types/current/mock/player/MockVinylPlayerDependencies.js +5 -2
- package/dist/vinylTestUtil/types/current/mock/text/MockTextTrackController.d.ts +3 -3
- package/dist/vinylTestUtil/types/current/mock/text/MockTextTrackController.d.ts.map +1 -1
- package/dist/vinylTestUtil/types/current/mock/text/MockTextTrackController.js +3 -3
- package/dist/vinylTestUtil/types/current/mock/track/dash/createMockDashDependencies.d.ts +1 -2
- package/dist/vinylTestUtil/types/current/mock/track/dash/createMockDashDependencies.d.ts.map +1 -1
- package/dist/vinylTestUtil/types/current/mock/track/dash/createMockDashDependencies.js +3 -2
- package/dist/vinylTestUtil/types/current/mock/track/hls/createMockHlsDependencies.d.ts +1 -2
- package/dist/vinylTestUtil/types/current/mock/track/hls/createMockHlsDependencies.d.ts.map +1 -1
- package/dist/vinylTestUtil/types/current/mock/track/hls/createMockHlsDependencies.js +3 -2
- package/dist/vinylTestUtil/types/current/tsconfig.tsbuildinfo +1 -1
- package/dist/vinylTestUtil/types/ts3.7/mock/player/MockVinylPlayerDependencies.d.ts +3 -2
- package/dist/vinylTestUtil/types/ts3.7/mock/text/MockTextTrackController.d.ts +3 -3
- package/dist/vinylTestUtil/types/ts3.7/mock/track/dash/createMockDashDependencies.d.ts +1 -2
- package/dist/vinylTestUtil/types/ts3.7/mock/track/hls/createMockHlsDependencies.d.ts +1 -2
- package/dist/vinylTestUtil/types/ts4.1/mock/player/MockVinylPlayerDependencies.d.ts +3 -2
- package/dist/vinylTestUtil/types/ts4.1/mock/text/MockTextTrackController.d.ts +3 -3
- package/dist/vinylTestUtil/types/ts4.1/mock/track/dash/createMockDashDependencies.d.ts +1 -2
- package/dist/vinylTestUtil/types/ts4.1/mock/track/hls/createMockHlsDependencies.d.ts +1 -2
- package/dist/vinylTestUtil/types/ts4.7/mock/player/MockVinylPlayerDependencies.d.ts +3 -2
- package/dist/vinylTestUtil/types/ts4.7/mock/text/MockTextTrackController.d.ts +3 -3
- package/dist/vinylTestUtil/types/ts4.7/mock/track/dash/createMockDashDependencies.d.ts +1 -2
- package/dist/vinylTestUtil/types/ts4.7/mock/track/hls/createMockHlsDependencies.d.ts +1 -2
- package/docs/USAGE.md +82 -31
- package/package.json +9 -9
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ChangeEvent } from '../event/ChangeEvent';
|
|
2
2
|
import type { ReadonlyEventHost } from '@amazon/vinyl-util';
|
|
3
|
+
import type { ObjectSchema } from '@amazon/vinyl-validation';
|
|
3
4
|
/**
|
|
4
5
|
* Categorizes the role of a text track. Mirrors HTMLMediaElement.TextTrackKind.
|
|
5
6
|
*/
|
|
@@ -79,6 +80,64 @@ export interface TextTrackErrorEvent {
|
|
|
79
80
|
readonly track: TextTrackInfo;
|
|
80
81
|
readonly error: Error;
|
|
81
82
|
}
|
|
83
|
+
/**
|
|
84
|
+
* Which captions render:
|
|
85
|
+
* - `'off'` — nothing renders (not even forced narrative captions).
|
|
86
|
+
* - `'forced'` — only forced (narrative) tracks, so nothing shows unless the
|
|
87
|
+
* content carries a forced track for the preferred language.
|
|
88
|
+
* - `'on'` — the full (non-forced) subtitle track for the preferred language.
|
|
89
|
+
*/
|
|
90
|
+
export type CaptionMode = 'on' | 'off' | 'forced';
|
|
91
|
+
/**
|
|
92
|
+
* Criteria used to pick which text track to render. Applied in priority order:
|
|
93
|
+
* an explicit {@link id} wins; otherwise the best {@link language} match is
|
|
94
|
+
* chosen among tracks filtered by {@link kind} and by forced-ness (from
|
|
95
|
+
* {@link forced} when set, else from the controller's
|
|
96
|
+
* {@link TextTrackControllerOptions.enabled} mode).
|
|
97
|
+
*/
|
|
98
|
+
export interface TextTrackSelection {
|
|
99
|
+
/**
|
|
100
|
+
* Selects the text track with this exact identifier, ignoring the other
|
|
101
|
+
* criteria (but still gated by the `'off'` mode). If no track has this id,
|
|
102
|
+
* nothing is selected.
|
|
103
|
+
*/
|
|
104
|
+
readonly id?: string | null;
|
|
105
|
+
/**
|
|
106
|
+
* Restricts selection to tracks of this kind (e.g. `'captions'`). Unset
|
|
107
|
+
* considers all kinds.
|
|
108
|
+
*/
|
|
109
|
+
readonly kind?: TextTrackKind | null;
|
|
110
|
+
/**
|
|
111
|
+
* Preferred caption language(s), most-preferred first, as RFC 5646 tags.
|
|
112
|
+
* When unset (or empty) selection falls back to the platform's
|
|
113
|
+
* `navigator.languages`.
|
|
114
|
+
*/
|
|
115
|
+
readonly language?: string | readonly string[] | null;
|
|
116
|
+
/**
|
|
117
|
+
* Explicit forced-ness filter. When set, only tracks whose `forced` flag
|
|
118
|
+
* equals this value are considered, overriding the forced/full split
|
|
119
|
+
* implied by the `enabled` mode. Unset means the mode decides.
|
|
120
|
+
*/
|
|
121
|
+
readonly forced?: boolean | null;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Declarative configuration for a {@link TextTrackController}. Rendering is
|
|
125
|
+
* driven entirely by this value (via `VinylOptions.text`); there is no
|
|
126
|
+
* imperative track-select call.
|
|
127
|
+
*/
|
|
128
|
+
export interface TextTrackControllerOptions {
|
|
129
|
+
/**
|
|
130
|
+
* Which captions render (see {@link CaptionMode}). Unset defaults to
|
|
131
|
+
* `'forced'`.
|
|
132
|
+
*/
|
|
133
|
+
readonly enabled?: CaptionMode | null;
|
|
134
|
+
/**
|
|
135
|
+
* The selection criteria (language / id / kind). When unset, the preferred
|
|
136
|
+
* languages fall back to the platform's `navigator.languages`.
|
|
137
|
+
*/
|
|
138
|
+
readonly selection?: TextTrackSelection | null;
|
|
139
|
+
}
|
|
140
|
+
export declare const textTrackControllerOptionsValidator: ObjectSchema<TextTrackControllerOptions>;
|
|
82
141
|
export declare const ALL_TEXT_TRACK_EVENTS: readonly [
|
|
83
142
|
"textTracksChange",
|
|
84
143
|
"activeTextTrackChange",
|
|
@@ -96,34 +155,29 @@ export interface ReadonlyTextTrackController extends ReadonlyEventHost<TextTrack
|
|
|
96
155
|
* The currently active text track, or null if none is active.
|
|
97
156
|
*/
|
|
98
157
|
readonly activeTextTrack: TextTrackInfo | null;
|
|
158
|
+
/*
|
|
159
|
+
* Returns true if this text track controller is active.
|
|
160
|
+
*/
|
|
161
|
+
readonly active: boolean;
|
|
99
162
|
}
|
|
100
163
|
/**
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
* Selection is persisted across track changes only when applications choose
|
|
105
|
-
* to call {@link setActiveTextTrack} again on the new track. This matches
|
|
106
|
-
* how audio tracks are typically driven.
|
|
164
|
+
* Full controller for the current media's text tracks. Selection is driven
|
|
165
|
+
* declaratively through the controller's options (`VinylOptions.text`); this
|
|
166
|
+
* interface only adds the render lifecycle used by the owning media track.
|
|
107
167
|
*/
|
|
108
168
|
export interface TextTrackController extends ReadonlyTextTrackController {
|
|
109
|
-
/**
|
|
110
|
-
* Selects the text track with the given id, or clears the active text
|
|
111
|
-
* track when called with null. No-op if the id does not match a known
|
|
112
|
-
* text track.
|
|
113
|
-
*/
|
|
114
|
-
setActiveTextTrack(id: string | null): void;
|
|
115
169
|
/**
|
|
116
170
|
* Suspends cue rendering without changing the active selection: cancels any
|
|
117
|
-
* in-flight load and
|
|
118
|
-
*
|
|
119
|
-
*
|
|
171
|
+
* in-flight load and hides the DOM text track (so its cues stop showing).
|
|
172
|
+
* Called when the owning media track is deactivated — e.g. while an ad
|
|
173
|
+
* plays over the suspended content. {@link activate} rebuilds it.
|
|
120
174
|
*/
|
|
121
|
-
|
|
175
|
+
deactivate(): void;
|
|
122
176
|
/**
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
*
|
|
177
|
+
* Resumes rendering the active selection after a {@link deactivate},
|
|
178
|
+
* reloading its cues. No-op when nothing is selected or already rendering.
|
|
179
|
+
* Called when the owning media track is reactivated.
|
|
126
180
|
*/
|
|
127
|
-
|
|
181
|
+
activate(): void;
|
|
128
182
|
}
|
|
129
183
|
//# sourceMappingURL=TextTrack.d.ts.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Renders a text track's cues. Injected into the player so an application can
|
|
3
|
+
* paint captions itself (as HTML) instead of relying on the browser's native
|
|
4
|
+
* `TextTrack` rendering — giving full control over styling and placement.
|
|
5
|
+
*
|
|
6
|
+
* The controller hands the renderer the DOM `TextTrack` (set to `'hidden'`, so
|
|
7
|
+
* the browser tracks cue timing but does not paint); the renderer listens for
|
|
8
|
+
* the track's active cues and draws them. See {@link HtmlTextTrackRenderer} for
|
|
9
|
+
* the built-in HTML implementation.
|
|
10
|
+
*/
|
|
11
|
+
export interface TextTrackRenderer {
|
|
12
|
+
/**
|
|
13
|
+
* Renders the active cues of `track`, listening for cue changes. Passing
|
|
14
|
+
* `null` clears anything rendered and detaches from the previous track.
|
|
15
|
+
*/
|
|
16
|
+
setTextTrack(track: TextTrack | null): void;
|
|
17
|
+
/**
|
|
18
|
+
* Supplies the CSS bodies of the track's WebVTT `STYLE` blocks (which carry
|
|
19
|
+
* `::cue` rules), so the renderer can style cue classes. Optional — a
|
|
20
|
+
* renderer may ignore authored styles.
|
|
21
|
+
*/
|
|
22
|
+
setStyles?(styles: readonly string[]): void;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=TextTrackRenderer.d.ts.map
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { TextTrackKind } from './TextTrack';
|
|
2
|
+
/**
|
|
3
|
+
* A handle to a DOM {@link TextTrack} created on the media element, plus a way
|
|
4
|
+
* to clear its cues.
|
|
5
|
+
*/
|
|
6
|
+
export interface TextTrackRef {
|
|
7
|
+
readonly track: TextTrack;
|
|
8
|
+
/**
|
|
9
|
+
* Removes all cues from the track. Must be called while the track is not
|
|
10
|
+
* `disabled` — `TextTrack.cues` reads null in the disabled state, so
|
|
11
|
+
* clearing a disabled track silently leaves its cues attached.
|
|
12
|
+
*/
|
|
13
|
+
clear(): void;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Creates and hands out DOM text tracks for a media element, memoized per
|
|
17
|
+
* `(kind, label, language)`.
|
|
18
|
+
*
|
|
19
|
+
* `HTMLMediaElement.addTextTrack` tracks can never be removed, so creating a
|
|
20
|
+
* fresh one per activation would accumulate tracks — and any left in `showing`
|
|
21
|
+
* mode renders alongside the active one (captions "bleed through"). Reusing one
|
|
22
|
+
* track per key keeps exactly one track per distinct rendition.
|
|
23
|
+
*/
|
|
24
|
+
export interface MediaTextTrackProvider {
|
|
25
|
+
getOrCreate(kind: TextTrackKind, label?: string, language?: string): TextTrackRef;
|
|
26
|
+
}
|
|
27
|
+
export declare function createMediaTextTrackProvider(deps: {
|
|
28
|
+
/**
|
|
29
|
+
* The HTML media element on which to attach the in-band TextTrack
|
|
30
|
+
* representation.
|
|
31
|
+
*/
|
|
32
|
+
readonly media: HTMLMediaElement;
|
|
33
|
+
}): MediaTextTrackProvider;
|
|
34
|
+
//# sourceMappingURL=mediaTextTrackProvider.d.ts.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { VttCueStyle } from './VttCueStyle';
|
|
1
2
|
/**
|
|
2
3
|
* A single WebVTT cue.
|
|
3
4
|
*
|
|
@@ -20,6 +21,12 @@ export interface WebVttCue {
|
|
|
20
21
|
* The cue text payload, with line breaks preserved as `\n`.
|
|
21
22
|
*/
|
|
22
23
|
readonly text: string;
|
|
24
|
+
/**
|
|
25
|
+
* The authored cue settings from the timing line (position/line/size/
|
|
26
|
+
* align/vertical), when any were present. Preserved so a renderer can
|
|
27
|
+
* position the cue faithfully. Absent when the cue declared no settings.
|
|
28
|
+
*/
|
|
29
|
+
readonly settings?: VttCueStyle;
|
|
23
30
|
}
|
|
24
31
|
/**
|
|
25
32
|
* The result of parsing a WebVTT document.
|
|
@@ -29,18 +36,25 @@ export interface WebVttDocument {
|
|
|
29
36
|
* Parsed cues in document order.
|
|
30
37
|
*/
|
|
31
38
|
readonly cues: readonly WebVttCue[];
|
|
39
|
+
/**
|
|
40
|
+
* The raw CSS body of each `STYLE` block, in document order. These carry
|
|
41
|
+
* `::cue` rules (e.g. `::cue(.loud) { font-weight: bold }`) an HTML renderer
|
|
42
|
+
* can apply. Empty when the document declared no styles.
|
|
43
|
+
*/
|
|
44
|
+
readonly styles: readonly string[];
|
|
32
45
|
}
|
|
33
46
|
/**
|
|
34
47
|
* Parses a WebVTT document into a list of cues.
|
|
35
48
|
*
|
|
36
49
|
* Implements a forgiving subset of the WebVTT 1.0 specification: header
|
|
37
50
|
* detection, comment blocks (lines starting with `NOTE`), styling/region
|
|
38
|
-
* blocks (skipped), cue identifiers, and
|
|
39
|
-
*
|
|
51
|
+
* blocks (STYLE bodies are captured, REGION skipped), cue identifiers, and
|
|
52
|
+
* HH:MM:SS.mmm or MM:SS.mmm timestamps with optional cue settings.
|
|
40
53
|
*
|
|
41
54
|
* @param input The raw WebVTT document text. Both LF and CRLF line endings
|
|
42
55
|
* are supported, and a leading BOM is stripped if present.
|
|
43
56
|
* @throws ValidationError if the input is missing the WEBVTT header.
|
|
57
|
+
* @see https://www.w3.org/TR/webvtt1/#webvtt-timestamp
|
|
44
58
|
*/
|
|
45
59
|
export declare function parseWebVtt(input: string): WebVttDocument;
|
|
46
60
|
//# sourceMappingURL=parseWebVtt.d.ts.map
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { TextTrackInfo } from './TextTrack';
|
|
2
|
+
import type { Maybe } from '@amazon/vinyl-util';
|
|
2
3
|
/**
|
|
3
4
|
* Chooses the text track that best matches the preferred language(s), or null
|
|
4
5
|
* when none relate (or there is no preference / no tracks).
|
|
@@ -10,5 +11,5 @@ import type { TextTrackInfo } from './TextTrack';
|
|
|
10
11
|
* forced foreign-dialogue cues), and a manifest-default track breaks any
|
|
11
12
|
* remaining tie.
|
|
12
13
|
*/
|
|
13
|
-
export declare function pickPreferredTextTrack(tracks: readonly TextTrackInfo[], preferred: string | readonly string[]
|
|
14
|
+
export declare function pickPreferredTextTrack(tracks: readonly TextTrackInfo[], preferred: Maybe<string | readonly string[]>): TextTrackInfo | null;
|
|
14
15
|
//# sourceMappingURL=pickPreferredTextTrack.d.ts.map
|
|
@@ -133,7 +133,7 @@ export interface ReadonlyTrack extends ReadonlyEventHost<TrackEventMap>, Readonl
|
|
|
133
133
|
*/
|
|
134
134
|
readonly error: Error | null;
|
|
135
135
|
/**
|
|
136
|
-
* Controller for
|
|
136
|
+
* Controller for text tracks discovered for this track, or null
|
|
137
137
|
* if the track type does not surface text tracks.
|
|
138
138
|
*/
|
|
139
139
|
readonly textTrackController: ReadonlyTextTrackController | null;
|
|
@@ -21,6 +21,8 @@ import type { BuildDashMediaTimelineDeps } from './buildDashMediaTimeline';
|
|
|
21
21
|
import { createDefaultMediaTimelineTransformer } from '../../streaming/createDefaultMediaTimelineTransformer';
|
|
22
22
|
import type { DashManifestData } from './DashManifestProvider';
|
|
23
23
|
import { SidecarTextTrackController } from '../../text/SidecarTextTrackController';
|
|
24
|
+
import type { MediaTextTrackProvider } from '../../text/mediaTextTrackProvider';
|
|
25
|
+
import type { TextTrackRenderer } from '../../text/TextTrackRenderer';
|
|
24
26
|
import type { AdController } from '../../ad/AdController';
|
|
25
27
|
import type { ManifestControllerImplDeps } from '../../streaming/ManifestControllerImpl';
|
|
26
28
|
import { ManifestControllerImpl } from '../../streaming/ManifestControllerImpl';
|
|
@@ -28,7 +30,7 @@ import { ManifestControllerImpl } from '../../streaming/ManifestControllerImpl';
|
|
|
28
30
|
* Player-level dependencies needed for the Dash-specific factories.
|
|
29
31
|
*/
|
|
30
32
|
export interface DashFactoryDeps {
|
|
31
|
-
readonly options: ObservableValue<Pick<VinylOptions, 'abr' | '
|
|
33
|
+
readonly options: ObservableValue<Pick<VinylOptions, 'abr' | 'audio' | 'allowedContentTypes' | 'text'>>;
|
|
32
34
|
readonly playbackController: PlaybackController;
|
|
33
35
|
readonly playbackSource: PlaybackSource;
|
|
34
36
|
readonly drmKeySystemResolver: DrmKeySystemResolver;
|
|
@@ -40,6 +42,14 @@ export interface DashFactoryDeps {
|
|
|
40
42
|
* `media.addTextTrack`.
|
|
41
43
|
*/
|
|
42
44
|
readonly media: HTMLMediaElement;
|
|
45
|
+
/**
|
|
46
|
+
* Creates and reuses the DOM text tracks for sidecar captions.
|
|
47
|
+
*/
|
|
48
|
+
readonly textTrackProvider: MediaTextTrackProvider;
|
|
49
|
+
/**
|
|
50
|
+
* Optional HTML cue renderer; null for native rendering.
|
|
51
|
+
*/
|
|
52
|
+
readonly textTrackRenderer: TextTrackRenderer | null;
|
|
43
53
|
/**
|
|
44
54
|
* The player-level ad controller. MseTrack sets discovered ad breaks on it
|
|
45
55
|
* when the media timeline resolves.
|
|
@@ -78,15 +88,12 @@ export declare function createDashFactories(options: Maybe<DashInitOptions>): (d
|
|
|
78
88
|
qualitySelector: (deps: {
|
|
79
89
|
options: ObservableValue<Pick<VinylOptions, "abr">>;
|
|
80
90
|
}) => QualitySelectorImpl;
|
|
81
|
-
|
|
82
|
-
options: ObservableValue<Pick<VinylOptions, "
|
|
83
|
-
}) => ObservableValue<
|
|
91
|
+
audio: (deps: {
|
|
92
|
+
options: ObservableValue<Pick<VinylOptions, "audio">>;
|
|
93
|
+
}) => ObservableValue<import("../..").AudioOptions>;
|
|
84
94
|
allowedContentTypes: (deps: {
|
|
85
95
|
options: ObservableValue<Pick<VinylOptions, "allowedContentTypes">>;
|
|
86
96
|
}) => ObservableValue<readonly import("../..").RestrictableContentType[] | null>;
|
|
87
|
-
preferDescriptiveAudio: (deps: {
|
|
88
|
-
options: ObservableValue<Pick<VinylOptions, "preferDescriptiveAudio">>;
|
|
89
|
-
}) => ObservableValue<boolean>;
|
|
90
97
|
abr: (deps: {
|
|
91
98
|
options: ObservableValue<Pick<VinylOptions, "abr">>;
|
|
92
99
|
}) => ObservableValue<import("../..").QualitySelectorImplOptions>;
|
|
@@ -96,11 +103,13 @@ export declare function createDashFactories(options: Maybe<DashInitOptions>): (d
|
|
|
96
103
|
}) => ObservableValue<Promise<import("../..").MediaTimeline>>;
|
|
97
104
|
mediaTimelineTransformed: typeof createDefaultMediaTimelineTransformer;
|
|
98
105
|
textTrackController: (deps: {
|
|
99
|
-
readonly
|
|
106
|
+
readonly textTrackProvider: MediaTextTrackProvider;
|
|
107
|
+
readonly textTrackRenderer: TextTrackRenderer | null;
|
|
108
|
+
readonly playbackController: PlaybackController;
|
|
100
109
|
readonly manifestTransformed: ObservableValue<Promise<DashManifestData>>;
|
|
101
|
-
readonly options: ObservableValue<Pick<VinylOptions, "
|
|
110
|
+
readonly options: ObservableValue<Pick<VinylOptions, "text">>;
|
|
102
111
|
}) => SidecarTextTrackController;
|
|
103
|
-
options: import("@amazon/vinyl-di").Factory<ObservableValue<Pick<VinylOptions, "
|
|
112
|
+
options: import("@amazon/vinyl-di").Factory<ObservableValue<Pick<VinylOptions, "audio" | "text" | "abr" | "allowedContentTypes">>>;
|
|
104
113
|
playbackController: import("@amazon/vinyl-di").Factory<PlaybackController>;
|
|
105
114
|
playbackSource: import("@amazon/vinyl-di").Factory<PlaybackSource>;
|
|
106
115
|
drmKeySystemResolver: import("@amazon/vinyl-di").Factory<DrmKeySystemResolver>;
|
|
@@ -108,6 +117,8 @@ export declare function createDashFactories(options: Maybe<DashInitOptions>): (d
|
|
|
108
117
|
drmController: import("@amazon/vinyl-di").Factory<DrmController>;
|
|
109
118
|
capabilities: import("@amazon/vinyl-di").Factory<Capabilities>;
|
|
110
119
|
media: import("@amazon/vinyl-di").Factory<HTMLMediaElement>;
|
|
120
|
+
textTrackProvider: import("@amazon/vinyl-di").Factory<MediaTextTrackProvider>;
|
|
121
|
+
textTrackRenderer: import("@amazon/vinyl-di").Factory<TextTrackRenderer | null>;
|
|
111
122
|
adController: import("@amazon/vinyl-di").Factory<AdController>;
|
|
112
123
|
};
|
|
113
124
|
//# sourceMappingURL=createDashFactories.d.ts.map
|
|
@@ -21,10 +21,12 @@ import type { BuildHlsMediaTimelineDeps } from './buildHlsMediaTimeline';
|
|
|
21
21
|
import { createDefaultMediaTimelineTransformer } from '../../streaming/createDefaultMediaTimelineTransformer';
|
|
22
22
|
import type { HlsManifestData } from './HlsManifestData';
|
|
23
23
|
import { SidecarTextTrackController } from '../../text/SidecarTextTrackController';
|
|
24
|
+
import type { MediaTextTrackProvider } from '../../text/mediaTextTrackProvider';
|
|
25
|
+
import type { TextTrackRenderer } from '../../text/TextTrackRenderer';
|
|
24
26
|
import type { ManifestControllerImplDeps } from '../../streaming/ManifestControllerImpl';
|
|
25
27
|
import { ManifestControllerImpl } from '../../streaming/ManifestControllerImpl';
|
|
26
28
|
export interface HlsFactoryDeps {
|
|
27
|
-
readonly options: ObservableValue<Pick<VinylOptions, 'abr' | '
|
|
29
|
+
readonly options: ObservableValue<Pick<VinylOptions, 'abr' | 'audio' | 'allowedContentTypes' | 'text'>>;
|
|
28
30
|
readonly playbackController: PlaybackController;
|
|
29
31
|
readonly playbackSource: PlaybackSource;
|
|
30
32
|
readonly drmKeySystemResolver: DrmKeySystemResolver;
|
|
@@ -36,6 +38,14 @@ export interface HlsFactoryDeps {
|
|
|
36
38
|
* `media.addTextTrack`.
|
|
37
39
|
*/
|
|
38
40
|
readonly media: HTMLMediaElement;
|
|
41
|
+
/**
|
|
42
|
+
* Creates and reuses the DOM text tracks for sidecar captions.
|
|
43
|
+
*/
|
|
44
|
+
readonly textTrackProvider: MediaTextTrackProvider;
|
|
45
|
+
/**
|
|
46
|
+
* Optional HTML cue renderer; null for native rendering.
|
|
47
|
+
*/
|
|
48
|
+
readonly textTrackRenderer: TextTrackRenderer | null;
|
|
39
49
|
/**
|
|
40
50
|
* The player-level ad controller. MseTrack sets discovered ad breaks on it
|
|
41
51
|
* when the media timeline resolves.
|
|
@@ -68,15 +78,12 @@ export declare function createHlsFactories(options: Maybe<HlsInitOptions>): (dep
|
|
|
68
78
|
qualitySelector: (deps: {
|
|
69
79
|
options: ObservableValue<Pick<VinylOptions, "abr">>;
|
|
70
80
|
}) => QualitySelectorImpl;
|
|
71
|
-
|
|
72
|
-
options: ObservableValue<Pick<VinylOptions, "
|
|
73
|
-
}) => ObservableValue<
|
|
81
|
+
audio: (deps: {
|
|
82
|
+
options: ObservableValue<Pick<VinylOptions, "audio">>;
|
|
83
|
+
}) => ObservableValue<import("../..").AudioOptions>;
|
|
74
84
|
allowedContentTypes: (deps: {
|
|
75
85
|
options: ObservableValue<Pick<VinylOptions, "allowedContentTypes">>;
|
|
76
86
|
}) => ObservableValue<readonly import("../..").RestrictableContentType[] | null>;
|
|
77
|
-
preferDescriptiveAudio: (deps: {
|
|
78
|
-
options: ObservableValue<Pick<VinylOptions, "preferDescriptiveAudio">>;
|
|
79
|
-
}) => ObservableValue<boolean>;
|
|
80
87
|
abr: (deps: {
|
|
81
88
|
options: ObservableValue<Pick<VinylOptions, "abr">>;
|
|
82
89
|
}) => ObservableValue<import("../..").QualitySelectorImplOptions>;
|
|
@@ -85,11 +92,13 @@ export declare function createHlsFactories(options: Maybe<HlsInitOptions>): (dep
|
|
|
85
92
|
}) => ObservableValue<Promise<import("../..").MediaTimeline>>;
|
|
86
93
|
mediaTimelineTransformed: typeof createDefaultMediaTimelineTransformer;
|
|
87
94
|
textTrackController: (deps: {
|
|
88
|
-
readonly
|
|
95
|
+
readonly textTrackProvider: MediaTextTrackProvider;
|
|
96
|
+
readonly textTrackRenderer: TextTrackRenderer | null;
|
|
97
|
+
readonly playbackController: PlaybackController;
|
|
89
98
|
readonly manifestTransformed: ObservableValue<Promise<HlsManifestData>>;
|
|
90
|
-
readonly options: ObservableValue<Pick<VinylOptions, "
|
|
99
|
+
readonly options: ObservableValue<Pick<VinylOptions, "text">>;
|
|
91
100
|
}) => SidecarTextTrackController;
|
|
92
|
-
options: import("@amazon/vinyl-di").Factory<ObservableValue<Pick<VinylOptions, "
|
|
101
|
+
options: import("@amazon/vinyl-di").Factory<ObservableValue<Pick<VinylOptions, "audio" | "text" | "abr" | "allowedContentTypes">>>;
|
|
93
102
|
playbackController: import("@amazon/vinyl-di").Factory<PlaybackController>;
|
|
94
103
|
playbackSource: import("@amazon/vinyl-di").Factory<PlaybackSource>;
|
|
95
104
|
drmKeySystemResolver: import("@amazon/vinyl-di").Factory<DrmKeySystemResolver>;
|
|
@@ -97,6 +106,8 @@ export declare function createHlsFactories(options: Maybe<HlsInitOptions>): (dep
|
|
|
97
106
|
drmController: import("@amazon/vinyl-di").Factory<DrmController>;
|
|
98
107
|
capabilities: import("@amazon/vinyl-di").Factory<Capabilities>;
|
|
99
108
|
media: import("@amazon/vinyl-di").Factory<HTMLMediaElement>;
|
|
109
|
+
textTrackProvider: import("@amazon/vinyl-di").Factory<MediaTextTrackProvider>;
|
|
110
|
+
textTrackRenderer: import("@amazon/vinyl-di").Factory<TextTrackRenderer | null>;
|
|
100
111
|
adController: import("@amazon/vinyl-di").Factory<AdController>;
|
|
101
112
|
};
|
|
102
113
|
//# sourceMappingURL=createHlsFactories.d.ts.map
|
|
@@ -43,9 +43,8 @@ export type MseTrackDeps = TrackBaseDeps & {
|
|
|
43
43
|
* the initial value) is applied to this track immediately so it takes
|
|
44
44
|
* effect without waiting for the buffered media to drain.
|
|
45
45
|
*/
|
|
46
|
-
readonly
|
|
46
|
+
readonly audio: ObservableValue<VinylOptions['audio']>;
|
|
47
47
|
readonly allowedContentTypes: ObservableValue<VinylOptions['allowedContentTypes']>;
|
|
48
|
-
readonly preferDescriptiveAudio: ObservableValue<VinylOptions['preferDescriptiveAudio']>;
|
|
49
48
|
readonly abr: ObservableValue<VinylOptions['abr']>;
|
|
50
49
|
};
|
|
51
50
|
/**
|
|
@@ -3,7 +3,8 @@ import type { ObjectSchema } from '@amazon/vinyl-validation';
|
|
|
3
3
|
import type { CodecOverrides } from '../util/media/codecOverrides';
|
|
4
4
|
import type { RestrictableContentType } from '../streaming/MediaQualityMetadata';
|
|
5
5
|
import type { LoudnessNormalizationControllerImplOptions } from '../playback/loudness/LoudnessNormalizationControllerImplOptions';
|
|
6
|
-
import type {
|
|
6
|
+
import type { TextTrackControllerOptions } from '../text/TextTrack';
|
|
7
|
+
import type { AudioOptions } from '../streaming/AudioOptions';
|
|
7
8
|
export interface VinylOptions {
|
|
8
9
|
/**
|
|
9
10
|
* Configuration for the default adaptive bitrate selector.
|
|
@@ -11,40 +12,16 @@ export interface VinylOptions {
|
|
|
11
12
|
readonly abr: QualitySelectorImplOptions;
|
|
12
13
|
readonly loudnessNormalization: LoudnessNormalizationControllerImplOptions;
|
|
13
14
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* earlier entries are preferred, with the best relatedness match kept for
|
|
17
|
-
* each period (audio without a language tag is always kept). `null` (the
|
|
18
|
-
* default) is NOT "no preference": it orders by the platform's
|
|
19
|
-
* `navigator.languages`. To keep every language, this option is not the
|
|
20
|
-
* mechanism — omit language content or pass a tag matching all.
|
|
21
|
-
*/
|
|
22
|
-
readonly preferredAudioLanguage: string | readonly string[] | null;
|
|
23
|
-
/**
|
|
24
|
-
* Preferred language(s) for text tracks (subtitles / closed captions), as
|
|
25
|
-
* RFC 5646 codes (e.g. `'en'`, `'ja'`, `'fr-CA'`). May be a single tag or
|
|
26
|
-
* an ordered list of tags — earlier entries are preferred, with the best
|
|
27
|
-
* relatedness match chosen among the discovered text tracks. When set, the
|
|
28
|
-
* matching text track is selected automatically and the choice carries
|
|
29
|
-
* across track changes (e.g. across an ad break), mirroring how
|
|
30
|
-
* {@link preferredAudioLanguage} drives audio selection.
|
|
15
|
+
* Audio (language / audio-description) configuration. See
|
|
16
|
+
* {@link AudioOptions}.
|
|
31
17
|
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*/
|
|
38
|
-
readonly preferredTextLanguage: string | readonly string[] | null;
|
|
39
|
-
/**
|
|
40
|
-
* Opt in to audio-description (a.k.a. described-video / DVS) audio: audio
|
|
41
|
-
* renditions carrying an accessibility "describes video" characteristic that
|
|
42
|
-
* narrate on-screen action. `false` (the default) keeps them out of the
|
|
43
|
-
* automatic default-audio selection — they are chosen only when this is set.
|
|
44
|
-
* When `true`, a description rendition is preferred where one exists for the
|
|
45
|
-
* selected language. Changing this reselects audio immediately.
|
|
18
|
+
* The default is `{ selection: { language: null, descriptive: false } }`:
|
|
19
|
+
* audio is ordered by the platform's `navigator.languages` and
|
|
20
|
+
* audio-description renditions are excluded. Set `selection.language` to
|
|
21
|
+
* prefer specific language(s) and `selection.descriptive` to `true` to opt
|
|
22
|
+
* into described audio.
|
|
46
23
|
*/
|
|
47
|
-
readonly
|
|
24
|
+
readonly audio: AudioOptions;
|
|
48
25
|
/**
|
|
49
26
|
* Explicit codec allow/deny overrides that bypass browser support
|
|
50
27
|
* detection. Keys are RFC 6381 codec strings or prefixes (e.g. `"hvc1"`),
|
|
@@ -68,15 +45,16 @@ export interface VinylOptions {
|
|
|
68
45
|
*/
|
|
69
46
|
readonly allowedContentTypes: readonly RestrictableContentType[] | null;
|
|
70
47
|
/**
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
* each cue as it is added, on platforms that support `VTTCue`.
|
|
48
|
+
* Text-track (subtitles / closed captions) configuration: enable/disable
|
|
49
|
+
* and the selection criteria. See {@link TextTrackControllerOptions}.
|
|
74
50
|
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
51
|
+
* The default is `{ enabled: 'forced' }`: with no
|
|
52
|
+
* explicit language, the platform's `navigator.languages` are preferred,
|
|
53
|
+
* showing only forced (narrative) tracks. Set `enabled` to `'on'` for full
|
|
54
|
+
* subtitle tracks or `'off'` to render nothing;
|
|
55
|
+
* `selection.language`/`selection.id` choose a specific rendition.
|
|
78
56
|
*/
|
|
79
|
-
readonly
|
|
57
|
+
readonly text: TextTrackControllerOptions;
|
|
80
58
|
}
|
|
81
59
|
export declare const defaultVinylOptions: VinylOptions;
|
|
82
60
|
export declare const vinylOptionsValidator: ObjectSchema<VinylOptions>;
|
|
@@ -157,12 +157,6 @@ export declare class VinylPlayer<TrackLoadOptionsType extends TrackLoadOptions =
|
|
|
157
157
|
getPlaybackQuality(contentType: ContentType): MediaQualityMetadata | null;
|
|
158
158
|
get textTracks(): readonly TextTrackInfo[];
|
|
159
159
|
get activeTextTrack(): (TextTrackInfo | null);
|
|
160
|
-
/**
|
|
161
|
-
* Selects the text track with the given id, or clears the active text
|
|
162
|
-
* track when called with null. No-op when the current track does not
|
|
163
|
-
* surface text tracks or the id is unknown.
|
|
164
|
-
*/
|
|
165
|
-
setActiveTextTrack(id: string | null): void;
|
|
166
160
|
private emitTextTrackChangeEventsFor;
|
|
167
161
|
get currentTrackAds(): (TrackAds | null);
|
|
168
162
|
get currentAdBreak(): (AdBreakInfo | null);
|
|
@@ -13,6 +13,8 @@ import type { VinylPatchOptions } from './VinylPatchOptions';
|
|
|
13
13
|
import type { QualitySelectorImplOptions } from '../streaming/abr/QualitySelectorImpl';
|
|
14
14
|
import type { AdControllerImplDeps, AdControllerImplOptions } from '../ad/AdControllerImpl';
|
|
15
15
|
import { AdControllerImpl } from '../ad/AdControllerImpl';
|
|
16
|
+
import type { MediaTextTrackProvider } from '../text/mediaTextTrackProvider';
|
|
17
|
+
import type { TextTrackRenderer } from '../text/TextTrackRenderer';
|
|
16
18
|
import type { DrmOptions } from '../drm/DrmOptions';
|
|
17
19
|
import { commonEmeFactory } from '../drm/commonEme/CommonEmeFactory';
|
|
18
20
|
import type { DrmControllerImplDeps } from '../drm/DrmControllerImpl';
|
|
@@ -36,6 +38,12 @@ export interface VinylDependencyOptions {
|
|
|
36
38
|
* The media element.
|
|
37
39
|
*/
|
|
38
40
|
readonly media: HTMLMediaElement;
|
|
41
|
+
/**
|
|
42
|
+
* Optional renderer for text-track cues (an HTML overlay). When provided,
|
|
43
|
+
* captions are painted by the renderer and the DOM text track is kept
|
|
44
|
+
* `'hidden'`; without one they render natively. See `TextTrackRenderer`.
|
|
45
|
+
*/
|
|
46
|
+
readonly textTrackRenderer?: TextTrackRenderer;
|
|
39
47
|
/**
|
|
40
48
|
* Flags for patches that should be applied browser-specifically.
|
|
41
49
|
* These will be defaulted based on the user-agent.
|
|
@@ -83,6 +91,10 @@ export declare function createVinylFactories(options: VinylDependencyOptions): {
|
|
|
83
91
|
readonly patched: HTMLMediaElement;
|
|
84
92
|
};
|
|
85
93
|
}) => HTMLMediaElement;
|
|
94
|
+
textTrackProvider: (deps: {
|
|
95
|
+
readonly media: HTMLMediaElement;
|
|
96
|
+
}) => MediaTextTrackProvider;
|
|
97
|
+
textTrackRenderer: () => TextTrackRenderer | null;
|
|
86
98
|
playbackController: (deps: PlaybackControllerImplDeps) => PlaybackControllerImpl;
|
|
87
99
|
playbackSource: (deps: PlaybackSourceImplDeps) => PlaybackSourceImpl;
|
|
88
100
|
loudnessNormalizationController: (deps: {
|
|
@@ -123,15 +135,12 @@ export declare function createVinylFactories(options: VinylDependencyOptions): {
|
|
|
123
135
|
qualitySelector: (deps: {
|
|
124
136
|
options: ObservableValue<Pick<VinylOptions, "abr">>;
|
|
125
137
|
}) => import("..").QualitySelectorImpl;
|
|
126
|
-
|
|
127
|
-
options: ObservableValue<Pick<VinylOptions, "
|
|
128
|
-
}) => ObservableValue<
|
|
138
|
+
audio: (deps: {
|
|
139
|
+
options: ObservableValue<Pick<VinylOptions, "audio">>;
|
|
140
|
+
}) => ObservableValue<import("..").AudioOptions>;
|
|
129
141
|
allowedContentTypes: (deps: {
|
|
130
142
|
options: ObservableValue<Pick<VinylOptions, "allowedContentTypes">>;
|
|
131
143
|
}) => ObservableValue<readonly import("..").RestrictableContentType[] | null>;
|
|
132
|
-
preferDescriptiveAudio: (deps: {
|
|
133
|
-
options: ObservableValue<Pick<VinylOptions, "preferDescriptiveAudio">>;
|
|
134
|
-
}) => ObservableValue<boolean>;
|
|
135
144
|
abr: (deps: {
|
|
136
145
|
options: ObservableValue<Pick<VinylOptions, "abr">>;
|
|
137
146
|
}) => ObservableValue<QualitySelectorImplOptions>;
|
|
@@ -141,11 +150,13 @@ export declare function createVinylFactories(options: VinylDependencyOptions): {
|
|
|
141
150
|
}) => ObservableValue<Promise<import("..").MediaTimeline>>;
|
|
142
151
|
mediaTimelineTransformed: typeof import("..").createDefaultMediaTimelineTransformer;
|
|
143
152
|
textTrackController: (deps: {
|
|
144
|
-
readonly
|
|
153
|
+
readonly textTrackProvider: MediaTextTrackProvider;
|
|
154
|
+
readonly textTrackRenderer: TextTrackRenderer | null;
|
|
155
|
+
readonly playbackController: import("..").PlaybackController;
|
|
145
156
|
readonly manifestTransformed: ObservableValue<Promise<import("..").DashManifestData>>;
|
|
146
|
-
readonly options: ObservableValue<Pick<VinylOptions, "
|
|
157
|
+
readonly options: ObservableValue<Pick<VinylOptions, "text">>;
|
|
147
158
|
}) => import("..").SidecarTextTrackController;
|
|
148
|
-
options: import("@amazon/vinyl-di").Factory<ObservableValue<Pick<VinylOptions, "
|
|
159
|
+
options: import("@amazon/vinyl-di").Factory<ObservableValue<Pick<VinylOptions, "audio" | "text" | "abr" | "allowedContentTypes">>>;
|
|
149
160
|
playbackController: import("@amazon/vinyl-di").Factory<import("..").PlaybackController>;
|
|
150
161
|
playbackSource: import("@amazon/vinyl-di").Factory<import("..").PlaybackSource>;
|
|
151
162
|
drmKeySystemResolver: import("@amazon/vinyl-di").Factory<import("..").DrmKeySystemResolver>;
|
|
@@ -153,6 +164,8 @@ export declare function createVinylFactories(options: VinylDependencyOptions): {
|
|
|
153
164
|
drmController: import("@amazon/vinyl-di").Factory<import("..").DrmController>;
|
|
154
165
|
capabilities: import("@amazon/vinyl-di").Factory<import("..").Capabilities>;
|
|
155
166
|
media: import("@amazon/vinyl-di").Factory<HTMLMediaElement>;
|
|
167
|
+
textTrackProvider: import("@amazon/vinyl-di").Factory<MediaTextTrackProvider>;
|
|
168
|
+
textTrackRenderer: import("@amazon/vinyl-di").Factory<TextTrackRenderer | null>;
|
|
156
169
|
adController: import("@amazon/vinyl-di").Factory<import("..").AdController>;
|
|
157
170
|
};
|
|
158
171
|
createHlsFactories: (deps: import("..").HlsFactoryDeps) => (loadOptions: import("..").HlsTrackLoadOptions) => {
|
|
@@ -178,15 +191,12 @@ export declare function createVinylFactories(options: VinylDependencyOptions): {
|
|
|
178
191
|
qualitySelector: (deps: {
|
|
179
192
|
options: ObservableValue<Pick<VinylOptions, "abr">>;
|
|
180
193
|
}) => import("..").QualitySelectorImpl;
|
|
181
|
-
|
|
182
|
-
options: ObservableValue<Pick<VinylOptions, "
|
|
183
|
-
}) => ObservableValue<
|
|
194
|
+
audio: (deps: {
|
|
195
|
+
options: ObservableValue<Pick<VinylOptions, "audio">>;
|
|
196
|
+
}) => ObservableValue<import("..").AudioOptions>;
|
|
184
197
|
allowedContentTypes: (deps: {
|
|
185
198
|
options: ObservableValue<Pick<VinylOptions, "allowedContentTypes">>;
|
|
186
199
|
}) => ObservableValue<readonly import("..").RestrictableContentType[] | null>;
|
|
187
|
-
preferDescriptiveAudio: (deps: {
|
|
188
|
-
options: ObservableValue<Pick<VinylOptions, "preferDescriptiveAudio">>;
|
|
189
|
-
}) => ObservableValue<boolean>;
|
|
190
200
|
abr: (deps: {
|
|
191
201
|
options: ObservableValue<Pick<VinylOptions, "abr">>;
|
|
192
202
|
}) => ObservableValue<QualitySelectorImplOptions>;
|
|
@@ -195,11 +205,13 @@ export declare function createVinylFactories(options: VinylDependencyOptions): {
|
|
|
195
205
|
}) => ObservableValue<Promise<import("..").MediaTimeline>>;
|
|
196
206
|
mediaTimelineTransformed: typeof import("..").createDefaultMediaTimelineTransformer;
|
|
197
207
|
textTrackController: (deps: {
|
|
198
|
-
readonly
|
|
208
|
+
readonly textTrackProvider: MediaTextTrackProvider;
|
|
209
|
+
readonly textTrackRenderer: TextTrackRenderer | null;
|
|
210
|
+
readonly playbackController: import("..").PlaybackController;
|
|
199
211
|
readonly manifestTransformed: ObservableValue<Promise<import("..").HlsManifestData>>;
|
|
200
|
-
readonly options: ObservableValue<Pick<VinylOptions, "
|
|
212
|
+
readonly options: ObservableValue<Pick<VinylOptions, "text">>;
|
|
201
213
|
}) => import("..").SidecarTextTrackController;
|
|
202
|
-
options: import("@amazon/vinyl-di").Factory<ObservableValue<Pick<VinylOptions, "
|
|
214
|
+
options: import("@amazon/vinyl-di").Factory<ObservableValue<Pick<VinylOptions, "audio" | "text" | "abr" | "allowedContentTypes">>>;
|
|
203
215
|
playbackController: import("@amazon/vinyl-di").Factory<import("..").PlaybackController>;
|
|
204
216
|
playbackSource: import("@amazon/vinyl-di").Factory<import("..").PlaybackSource>;
|
|
205
217
|
drmKeySystemResolver: import("@amazon/vinyl-di").Factory<import("..").DrmKeySystemResolver>;
|
|
@@ -207,6 +219,8 @@ export declare function createVinylFactories(options: VinylDependencyOptions): {
|
|
|
207
219
|
drmController: import("@amazon/vinyl-di").Factory<import("..").DrmController>;
|
|
208
220
|
capabilities: import("@amazon/vinyl-di").Factory<import("..").Capabilities>;
|
|
209
221
|
media: import("@amazon/vinyl-di").Factory<HTMLMediaElement>;
|
|
222
|
+
textTrackProvider: import("@amazon/vinyl-di").Factory<MediaTextTrackProvider>;
|
|
223
|
+
textTrackRenderer: import("@amazon/vinyl-di").Factory<TextTrackRenderer | null>;
|
|
210
224
|
adController: import("@amazon/vinyl-di").Factory<import("..").AdController>;
|
|
211
225
|
};
|
|
212
226
|
};
|