@amazon/vinyl 2.0.4 → 3.0.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.
- package/dist/index.cjs +603 -317
- package/dist/index.cjs.map +4 -4
- package/dist/index.js +622 -329
- 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 +182 -156
- package/dist/test/integ.js +1853 -796
- 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/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/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
|
@@ -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>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VinylOptions.d.ts","sourceRoot":"","sources":["../../../../src/vinyl/VinylOptions.ts"],"names":[],"mappings":"AAKA,OAAO,EAEH,KAAK,0BAA0B,EAElC,MAAM,sCAAsC,CAAA;AAC7C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"VinylOptions.d.ts","sourceRoot":"","sources":["../../../../src/vinyl/VinylOptions.ts"],"names":[],"mappings":"AAKA,OAAO,EAEH,KAAK,0BAA0B,EAElC,MAAM,sCAAsC,CAAA;AAC7C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAQ5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAClE,OAAO,EAEH,KAAK,uBAAuB,EAC/B,MAAM,mCAAmC,CAAA;AAC1C,OAAO,EAEH,KAAK,0CAA0C,EAElD,MAAM,iEAAiE,CAAA;AACxE,OAAO,EACH,KAAK,0BAA0B,EAElC,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EACH,KAAK,YAAY,EAGpB,MAAM,2BAA2B,CAAA;AAElC,MAAM,WAAW,YAAY;IACzB;;OAEG;IACH,QAAQ,CAAC,GAAG,EAAE,0BAA0B,CAAA;IAExC,QAAQ,CAAC,qBAAqB,EAAE,0CAA0C,CAAA;IAE1E;;;;;;;;;OASG;IACH,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAA;IAE5B;;;;;;;OAOG;IACH,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAA;IAEvC;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,mBAAmB,EAAE,SAAS,uBAAuB,EAAE,GAAG,IAAI,CAAA;IAEvE;;;;;;;;;OASG;IACH,QAAQ,CAAC,IAAI,EAAE,0BAA0B,CAAA;CAC5C;AAED,eAAO,MAAM,mBAAmB,EAAE,YAWjC,CAAA;AAED,eAAO,MAAM,qBAAqB,EAAE,YAAY,CAAC,YAAY,CAY3D,CAAA"}
|
|
@@ -3,30 +3,31 @@
|
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
5
|
import { defaultQualitySelectorImplOptions, qualitySelectorImplOptionsValidator, } from '../streaming/abr/QualitySelectorImpl';
|
|
6
|
-
import { array,
|
|
6
|
+
import { array, isOneOf, object, record, string, } from '@amazon/vinyl-validation';
|
|
7
7
|
import { RESTRICTABLE_CONTENT_TYPES, } from '../streaming/MediaQualityMetadata';
|
|
8
8
|
import { defaultLoudnessNormalizationControllerImplOptions, loudnessNormalizationControllerImplOptionsValidator, } from '../playback/loudness/LoudnessNormalizationControllerImplOptions';
|
|
9
|
-
import {
|
|
9
|
+
import { textTrackControllerOptionsValidator, } from '../text/TextTrack';
|
|
10
|
+
import { audioOptionsValidator, defaultAudioOptions, } from '../streaming/AudioOptions';
|
|
10
11
|
export const defaultVinylOptions = {
|
|
11
12
|
abr: defaultQualitySelectorImplOptions,
|
|
12
13
|
loudnessNormalization: defaultLoudnessNormalizationControllerImplOptions,
|
|
13
|
-
|
|
14
|
-
preferredTextLanguage: null,
|
|
15
|
-
preferDescriptiveAudio: false,
|
|
14
|
+
audio: defaultAudioOptions,
|
|
16
15
|
codecOverrides: {},
|
|
17
16
|
allowedContentTypes: null,
|
|
18
|
-
|
|
17
|
+
text: {
|
|
18
|
+
// Forced-only captions in the platform's preferred languages (no
|
|
19
|
+
// explicit language → navigator.languages).
|
|
20
|
+
enabled: 'forced',
|
|
21
|
+
},
|
|
19
22
|
};
|
|
20
23
|
export const vinylOptionsValidator = object({
|
|
21
24
|
abr: qualitySelectorImplOptionsValidator,
|
|
22
25
|
loudnessNormalization: loudnessNormalizationControllerImplOptionsValidator,
|
|
23
|
-
|
|
24
|
-
preferredTextLanguage: string().or(array(string()).readonly()).orNull(),
|
|
25
|
-
preferDescriptiveAudio: boolean(),
|
|
26
|
+
audio: audioOptionsValidator,
|
|
26
27
|
codecOverrides: record(string(), isOneOf('allow', 'deny')),
|
|
27
28
|
allowedContentTypes: array(isOneOf(...RESTRICTABLE_CONTENT_TYPES))
|
|
28
|
-
.
|
|
29
|
+
.readonly()
|
|
29
30
|
.describe('Allow list of media content types (audio, video) to stream; other media streams are ignored. Text tracks are unaffected.')
|
|
30
31
|
.orNull(),
|
|
31
|
-
|
|
32
|
+
text: textTrackControllerOptionsValidator,
|
|
32
33
|
});
|
|
@@ -221,12 +221,6 @@ export declare class VinylPlayer<TrackLoadOptionsType extends TrackLoadOptions =
|
|
|
221
221
|
* The currently active text track, or null if no track is selected.
|
|
222
222
|
*/
|
|
223
223
|
get activeTextTrack(): TextTrackInfo | null;
|
|
224
|
-
/**
|
|
225
|
-
* Selects the text track with the given id, or clears the active text
|
|
226
|
-
* track when called with null. No-op when the current track does not
|
|
227
|
-
* surface text tracks or the id is unknown.
|
|
228
|
-
*/
|
|
229
|
-
setActiveTextTrack(id: string | null): void;
|
|
230
224
|
private emitTextTrackChangeEventsFor;
|
|
231
225
|
/**
|
|
232
226
|
* The current track's ad breaks.
|
|
@@ -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,oCAA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BAAuB,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"}
|
|
@@ -111,15 +111,6 @@ export class VinylPlayer extends EventHostImpl {
|
|
|
111
111
|
if (previous === current)
|
|
112
112
|
return;
|
|
113
113
|
activeTrack = current;
|
|
114
|
-
// Clear the previous track's caption selection (it may stay cached),
|
|
115
|
-
// before tearing down subs so activeTextTrackChange flows through.
|
|
116
|
-
// Skip during an ad break: the content will resume, and its caption
|
|
117
|
-
// selection must survive for resume() (deactivation only suspends
|
|
118
|
-
// it). Tracks expose ReadonlyTrack; the controller is a full one.
|
|
119
|
-
const prevTextController = previous?.textTrackController;
|
|
120
|
-
if (!this.deps.adController.currentAdBreak) {
|
|
121
|
-
prevTextController?.setActiveTextTrack(null);
|
|
122
|
-
}
|
|
123
114
|
sub?.();
|
|
124
115
|
sub = null;
|
|
125
116
|
textSub?.();
|
|
@@ -510,28 +501,16 @@ export class VinylPlayer extends EventHostImpl {
|
|
|
510
501
|
get activeTextTrack() {
|
|
511
502
|
return this.activeTrack?.textTrackController?.activeTextTrack ?? null;
|
|
512
503
|
}
|
|
513
|
-
/**
|
|
514
|
-
* Selects the text track with the given id, or clears the active text
|
|
515
|
-
* track when called with null. No-op when the current track does not
|
|
516
|
-
* surface text tracks or the id is unknown.
|
|
517
|
-
*/
|
|
518
|
-
setActiveTextTrack(id) {
|
|
519
|
-
// activeTrack exposes ReadonlyTrack, but the concrete controller is a
|
|
520
|
-
// full TextTrackController.
|
|
521
|
-
const controller = this.deps.trackController.activeTrack
|
|
522
|
-
?.textTrackController;
|
|
523
|
-
controller?.setActiveTextTrack(id);
|
|
524
|
-
}
|
|
525
504
|
emitTextTrackChangeEventsFor(previous, current) {
|
|
526
505
|
// Bridge signals that lack their own redispatched event at track
|
|
527
506
|
// boundaries. The current track's controller only emits
|
|
528
507
|
// activeTextTrackChange when a selection is *made*; on becoming current
|
|
529
508
|
// it never re-announces an already-active selection. That gap surfaces
|
|
530
509
|
// after an ad break: the content track's caption selection is preserved
|
|
531
|
-
// and re-rendered by
|
|
510
|
+
// and re-rendered by activate() (silently), while the outgoing ad
|
|
532
511
|
// controller emits a clearing activeTextTrackChange(null) — leaving
|
|
533
512
|
// consumers that track state via events believing captions are off even
|
|
534
|
-
// though the (forced or
|
|
513
|
+
// though the (forced or options-driven) content caption is showing. Emit
|
|
535
514
|
// the current track's active selection so that final state is correct.
|
|
536
515
|
const prevList = previous?.textTrackController?.textTracks;
|
|
537
516
|
const curList = current?.textTrackController?.textTracks;
|
|
@@ -12,6 +12,8 @@ import { TrackControllerImpl } from '../track/TrackController';
|
|
|
12
12
|
import type { VinylPatchOptions } from './VinylPatchOptions';
|
|
13
13
|
import { type QualitySelectorImplOptions } from '../streaming/abr/QualitySelectorImpl';
|
|
14
14
|
import { AdControllerImpl, type AdControllerImplDeps, type AdControllerImplOptions } from '../ad/AdControllerImpl';
|
|
15
|
+
import { type MediaTextTrackProvider } from '../text/mediaTextTrackProvider';
|
|
16
|
+
import type { TextTrackRenderer } from '../text/TextTrackRenderer';
|
|
15
17
|
import { type DrmOptions } from '../drm/DrmOptions';
|
|
16
18
|
import { commonEmeFactory } from '../drm/commonEme/CommonEmeFactory';
|
|
17
19
|
import { DrmControllerImpl, type DrmControllerImplDeps } from '../drm/DrmControllerImpl';
|
|
@@ -33,6 +35,12 @@ export interface VinylDependencyOptions {
|
|
|
33
35
|
* The media element.
|
|
34
36
|
*/
|
|
35
37
|
readonly media: HTMLMediaElement;
|
|
38
|
+
/**
|
|
39
|
+
* Optional renderer for text-track cues (an HTML overlay). When provided,
|
|
40
|
+
* captions are painted by the renderer and the DOM text track is kept
|
|
41
|
+
* `'hidden'`; without one they render natively. See `TextTrackRenderer`.
|
|
42
|
+
*/
|
|
43
|
+
readonly textTrackRenderer?: TextTrackRenderer;
|
|
36
44
|
/**
|
|
37
45
|
* Flags for patches that should be applied browser-specifically.
|
|
38
46
|
* These will be defaulted based on the user-agent.
|
|
@@ -80,6 +88,10 @@ export declare function createVinylFactories(options: VinylDependencyOptions): N
|
|
|
80
88
|
readonly patched: HTMLMediaElement;
|
|
81
89
|
};
|
|
82
90
|
}) => HTMLMediaElement;
|
|
91
|
+
textTrackProvider: (deps: {
|
|
92
|
+
readonly media: HTMLMediaElement;
|
|
93
|
+
}) => MediaTextTrackProvider;
|
|
94
|
+
textTrackRenderer: () => TextTrackRenderer | null;
|
|
83
95
|
playbackController: (deps: PlaybackControllerImplDeps) => PlaybackControllerImpl;
|
|
84
96
|
playbackSource: (deps: PlaybackSourceImplDeps) => PlaybackSourceImpl;
|
|
85
97
|
loudnessNormalizationController: (deps: {
|
|
@@ -120,15 +132,12 @@ export declare function createVinylFactories(options: VinylDependencyOptions): N
|
|
|
120
132
|
qualitySelector: (deps: {
|
|
121
133
|
options: ObservableValue<Pick<VinylOptions, "abr">>;
|
|
122
134
|
}) => import("..").QualitySelectorImpl;
|
|
123
|
-
|
|
124
|
-
options: ObservableValue<Pick<VinylOptions, "
|
|
125
|
-
}) => ObservableValue<
|
|
135
|
+
audio: (deps: {
|
|
136
|
+
options: ObservableValue<Pick<VinylOptions, "audio">>;
|
|
137
|
+
}) => ObservableValue<import("..").AudioOptions>;
|
|
126
138
|
allowedContentTypes: (deps: {
|
|
127
139
|
options: ObservableValue<Pick<VinylOptions, "allowedContentTypes">>;
|
|
128
140
|
}) => ObservableValue<readonly import("..").RestrictableContentType[] | null>;
|
|
129
|
-
preferDescriptiveAudio: (deps: {
|
|
130
|
-
options: ObservableValue<Pick<VinylOptions, "preferDescriptiveAudio">>;
|
|
131
|
-
}) => ObservableValue<boolean>;
|
|
132
141
|
abr: (deps: {
|
|
133
142
|
options: ObservableValue<Pick<VinylOptions, "abr">>;
|
|
134
143
|
}) => ObservableValue<QualitySelectorImplOptions>;
|
|
@@ -138,11 +147,13 @@ export declare function createVinylFactories(options: VinylDependencyOptions): N
|
|
|
138
147
|
}) => ObservableValue<Promise<import("..").MediaTimeline>>;
|
|
139
148
|
mediaTimelineTransformed: typeof import("..").createDefaultMediaTimelineTransformer;
|
|
140
149
|
textTrackController: (deps: {
|
|
141
|
-
readonly
|
|
150
|
+
readonly textTrackProvider: MediaTextTrackProvider;
|
|
151
|
+
readonly textTrackRenderer: TextTrackRenderer | null;
|
|
152
|
+
readonly playbackController: import("..").PlaybackController;
|
|
142
153
|
readonly manifestTransformed: ObservableValue<Promise<import("..").DashManifestData>>;
|
|
143
|
-
readonly options: ObservableValue<Pick<VinylOptions, "
|
|
154
|
+
readonly options: ObservableValue<Pick<VinylOptions, "text">>;
|
|
144
155
|
}) => import("..").SidecarTextTrackController;
|
|
145
|
-
options: import("@amazon/vinyl-di").Factory<ObservableValue<Pick<VinylOptions, "
|
|
156
|
+
options: import("@amazon/vinyl-di").Factory<ObservableValue<Pick<VinylOptions, "audio" | "text" | "abr" | "allowedContentTypes">>>;
|
|
146
157
|
playbackController: import("@amazon/vinyl-di").Factory<import("..").PlaybackController>;
|
|
147
158
|
playbackSource: import("@amazon/vinyl-di").Factory<import("..").PlaybackSource>;
|
|
148
159
|
drmKeySystemResolver: import("@amazon/vinyl-di").Factory<import("..").DrmKeySystemResolver>;
|
|
@@ -150,6 +161,8 @@ export declare function createVinylFactories(options: VinylDependencyOptions): N
|
|
|
150
161
|
drmController: import("@amazon/vinyl-di").Factory<import("..").DrmController>;
|
|
151
162
|
capabilities: import("@amazon/vinyl-di").Factory<import("..").Capabilities>;
|
|
152
163
|
media: import("@amazon/vinyl-di").Factory<HTMLMediaElement>;
|
|
164
|
+
textTrackProvider: import("@amazon/vinyl-di").Factory<MediaTextTrackProvider>;
|
|
165
|
+
textTrackRenderer: import("@amazon/vinyl-di").Factory<TextTrackRenderer | null>;
|
|
153
166
|
adController: import("@amazon/vinyl-di").Factory<import("..").AdController>;
|
|
154
167
|
}>;
|
|
155
168
|
createHlsFactories: (deps: import("..").HlsFactoryDeps) => (loadOptions: import("..").HlsTrackLoadOptions) => NoInfer<{
|
|
@@ -175,15 +188,12 @@ export declare function createVinylFactories(options: VinylDependencyOptions): N
|
|
|
175
188
|
qualitySelector: (deps: {
|
|
176
189
|
options: ObservableValue<Pick<VinylOptions, "abr">>;
|
|
177
190
|
}) => import("..").QualitySelectorImpl;
|
|
178
|
-
|
|
179
|
-
options: ObservableValue<Pick<VinylOptions, "
|
|
180
|
-
}) => ObservableValue<
|
|
191
|
+
audio: (deps: {
|
|
192
|
+
options: ObservableValue<Pick<VinylOptions, "audio">>;
|
|
193
|
+
}) => ObservableValue<import("..").AudioOptions>;
|
|
181
194
|
allowedContentTypes: (deps: {
|
|
182
195
|
options: ObservableValue<Pick<VinylOptions, "allowedContentTypes">>;
|
|
183
196
|
}) => ObservableValue<readonly import("..").RestrictableContentType[] | null>;
|
|
184
|
-
preferDescriptiveAudio: (deps: {
|
|
185
|
-
options: ObservableValue<Pick<VinylOptions, "preferDescriptiveAudio">>;
|
|
186
|
-
}) => ObservableValue<boolean>;
|
|
187
197
|
abr: (deps: {
|
|
188
198
|
options: ObservableValue<Pick<VinylOptions, "abr">>;
|
|
189
199
|
}) => ObservableValue<QualitySelectorImplOptions>;
|
|
@@ -192,11 +202,13 @@ export declare function createVinylFactories(options: VinylDependencyOptions): N
|
|
|
192
202
|
}) => ObservableValue<Promise<import("..").MediaTimeline>>;
|
|
193
203
|
mediaTimelineTransformed: typeof import("..").createDefaultMediaTimelineTransformer;
|
|
194
204
|
textTrackController: (deps: {
|
|
195
|
-
readonly
|
|
205
|
+
readonly textTrackProvider: MediaTextTrackProvider;
|
|
206
|
+
readonly textTrackRenderer: TextTrackRenderer | null;
|
|
207
|
+
readonly playbackController: import("..").PlaybackController;
|
|
196
208
|
readonly manifestTransformed: ObservableValue<Promise<import("..").HlsManifestData>>;
|
|
197
|
-
readonly options: ObservableValue<Pick<VinylOptions, "
|
|
209
|
+
readonly options: ObservableValue<Pick<VinylOptions, "text">>;
|
|
198
210
|
}) => import("..").SidecarTextTrackController;
|
|
199
|
-
options: import("@amazon/vinyl-di").Factory<ObservableValue<Pick<VinylOptions, "
|
|
211
|
+
options: import("@amazon/vinyl-di").Factory<ObservableValue<Pick<VinylOptions, "audio" | "text" | "abr" | "allowedContentTypes">>>;
|
|
200
212
|
playbackController: import("@amazon/vinyl-di").Factory<import("..").PlaybackController>;
|
|
201
213
|
playbackSource: import("@amazon/vinyl-di").Factory<import("..").PlaybackSource>;
|
|
202
214
|
drmKeySystemResolver: import("@amazon/vinyl-di").Factory<import("..").DrmKeySystemResolver>;
|
|
@@ -204,6 +216,8 @@ export declare function createVinylFactories(options: VinylDependencyOptions): N
|
|
|
204
216
|
drmController: import("@amazon/vinyl-di").Factory<import("..").DrmController>;
|
|
205
217
|
capabilities: import("@amazon/vinyl-di").Factory<import("..").Capabilities>;
|
|
206
218
|
media: import("@amazon/vinyl-di").Factory<HTMLMediaElement>;
|
|
219
|
+
textTrackProvider: import("@amazon/vinyl-di").Factory<MediaTextTrackProvider>;
|
|
220
|
+
textTrackRenderer: import("@amazon/vinyl-di").Factory<TextTrackRenderer | null>;
|
|
207
221
|
adController: import("@amazon/vinyl-di").Factory<import("..").AdController>;
|
|
208
222
|
}>;
|
|
209
223
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createVinylFactories.d.ts","sourceRoot":"","sources":["../../../../src/vinyl/createVinylFactories.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAA;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA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C,EAAE,OAAO,CAAC,uBAAuB,CAAC,CAAA;CAC3D;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,sBAAsB;;wBAU1C,UAAU,CAAC,gBAAgB,CAAC;kBAIhC;QACV,QAAQ,CAAC,YAAY,EAAE;YACnB,QAAQ,CAAC,OAAO,EAAE,gBAAgB,CAAA;SACrC,CAAA;KACJ,KAAG,gBAAgB;8BAGM;QACtB,QAAQ,CAAC,KAAK,EAAE,gBAAgB,CAAA;KACnC,KAAG,sBAAsB;6BAGH,iBAAiB,GAAG,IAAI;+BAEpB,0BAA0B;2BAE9B,sBAAsB;4CAEL;QACpC,OAAO,EAAE,eAAe,CACpB,IAAI,CAAC,YAAY,EAAE,uBAAuB,CAAC,CAC9C,CAAA;KACJ;yBAIoB,oBAAoB;;yBAGpB,qBAAqB;;4BAGlB,uBAAuB,CAAC,GAAG,CAAC;;0BAG9B,qBAAqB;;gCAGf,2BAA2B;yBAElC,oBAAoB;kEA/EA,8CAE5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gEAfK,6CAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiGzD;AAED;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAE3E;;GAEG;AACH,MAAM,MAAM,gCAAgC,CACxC,SAAS,EACT,CAAC,SAAS,MAAM,qBAAqB,IACrC,YAAY,CACZ,SAAS,SAAS,SAAS,GACrB,KAAK,CAAC,qBAAqB,EAAE,SAAS,CAAC,GACvC,qBAAqB,CAC9B,CAAC,CAAC,CAAC,CAAA"}
|
|
@@ -14,6 +14,7 @@ import { defaultPatchOptions } from './VinylPatchOptions';
|
|
|
14
14
|
import { AdControllerImpl, } from '../ad/AdControllerImpl';
|
|
15
15
|
import { createDashFactories } from '../track/dash/createDashFactories';
|
|
16
16
|
import { createHlsFactories } from '../track/hls/createHlsFactories';
|
|
17
|
+
import { createMediaTextTrackProvider, } from '../text/mediaTextTrackProvider';
|
|
17
18
|
import { commonEmeFactory } from '../drm/commonEme/CommonEmeFactory';
|
|
18
19
|
import { DrmControllerImpl, } from '../drm/DrmControllerImpl';
|
|
19
20
|
import { defaultDrmKeySystemResolver } from '../drm/DrmKeySystemResolver';
|
|
@@ -40,6 +41,11 @@ export function createVinylFactories(options) {
|
|
|
40
41
|
return patchMediaElement(options.media, patches.media);
|
|
41
42
|
},
|
|
42
43
|
media: (deps) => deps.patchedMedia.patched,
|
|
44
|
+
// One provider per media element (the player container creates each
|
|
45
|
+
// dependency once), so text tracks are reused rather than accumulated.
|
|
46
|
+
textTrackProvider: (deps) => createMediaTextTrackProvider({ media: deps.media }),
|
|
47
|
+
// App-provided cue renderer (or null for native rendering).
|
|
48
|
+
textTrackRenderer: () => options.textTrackRenderer ?? null,
|
|
43
49
|
playbackController: (deps) => new PlaybackControllerImpl(deps, options.playbackController),
|
|
44
50
|
playbackSource: (deps) => new PlaybackSourceImpl(deps),
|
|
45
51
|
loudnessNormalizationController: (deps) => new LoudnessNormalizationControllerImpl({
|
|
@@ -58,6 +58,7 @@ export * from './playback/PlaybackSourceImpl';
|
|
|
58
58
|
export * from './playback/ReadonlyPlaybackController';
|
|
59
59
|
export * from './streaming/abr/QualitySelector';
|
|
60
60
|
export * from './streaming/abr/QualitySelectorImpl';
|
|
61
|
+
export * from './streaming/AudioOptions';
|
|
61
62
|
export * from './streaming/buffering/BufferingController';
|
|
62
63
|
export * from './streaming/buffering/codecDenylist';
|
|
63
64
|
export * from './streaming/buffering/error/SourceBufferError';
|
|
@@ -87,11 +88,14 @@ export * from './streaming/StreamingEventMap';
|
|
|
87
88
|
export * from './streaming/util/segment';
|
|
88
89
|
export * from './text/discoverDashTextTracks';
|
|
89
90
|
export * from './text/discoverHlsTextTracks';
|
|
91
|
+
export * from './text/HtmlTextTrackRenderer';
|
|
92
|
+
export * from './text/mediaTextTrackProvider';
|
|
90
93
|
export * from './text/parseWebVtt';
|
|
91
94
|
export * from './text/pickPreferredTextTrack';
|
|
92
95
|
export * from './text/SidecarTextTrackController';
|
|
93
96
|
export * from './text/SidecarTextTrackLoader';
|
|
94
97
|
export * from './text/TextTrack';
|
|
98
|
+
export * from './text/TextTrackRenderer';
|
|
95
99
|
export * from './text/VttCueStyle';
|
|
96
100
|
export * from './track/AutoResetController';
|
|
97
101
|
export * from './track/createSegmentDataProvider';
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ObjectSchema } from '@amazon/vinyl-validation';
|
|
2
|
+
/**
|
|
3
|
+
* Criteria used to pick which audio rendition to play.
|
|
4
|
+
*/
|
|
5
|
+
export interface AudioSelection {
|
|
6
|
+
/**
|
|
7
|
+
* Preferred language(s) for audio content, as RFC 5646 codes (e.g. `'en'`,
|
|
8
|
+
* `'ja'`, `'fr-CA'`). May be a single tag or an ordered list of tags —
|
|
9
|
+
* earlier entries are preferred, with the best relatedness match kept for
|
|
10
|
+
* each period (audio without a language tag is always kept). `null` (the
|
|
11
|
+
* default) is NOT "no preference": it orders by the platform's
|
|
12
|
+
* `navigator.languages`. To keep every language, this option is not the
|
|
13
|
+
* mechanism — omit language content or pass a tag matching all.
|
|
14
|
+
*/
|
|
15
|
+
readonly language?: string | readonly string[] | null;
|
|
16
|
+
/**
|
|
17
|
+
* Opt in to audio-description (a.k.a. described-video / DVS) audio: audio
|
|
18
|
+
* renditions carrying an accessibility "describes video" characteristic that
|
|
19
|
+
* narrate on-screen action. `false` (the default) keeps them out of the
|
|
20
|
+
* automatic default-audio selection — they are chosen only when this is set.
|
|
21
|
+
* When `true`, a description rendition is preferred where one exists for the
|
|
22
|
+
* selected language. Changing this reselects audio immediately.
|
|
23
|
+
*/
|
|
24
|
+
readonly descriptive?: boolean;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Declarative audio configuration. Mirrors `VinylOptions.text`: the audio
|
|
28
|
+
* rendition is chosen from {@link selection}; changing it reselects audio
|
|
29
|
+
* immediately.
|
|
30
|
+
*/
|
|
31
|
+
export interface AudioOptions {
|
|
32
|
+
/**
|
|
33
|
+
* The audio selection criteria (language / descriptive).
|
|
34
|
+
*/
|
|
35
|
+
readonly selection?: AudioSelection;
|
|
36
|
+
}
|
|
37
|
+
export declare const defaultAudioOptions: AudioOptions;
|
|
38
|
+
export declare const audioOptionsValidator: ObjectSchema<AudioOptions>;
|
|
39
|
+
//# sourceMappingURL=AudioOptions.d.ts.map
|
|
@@ -3,13 +3,13 @@ import { Capabilities } from '../client/Capabilities';
|
|
|
3
3
|
import { DrmController } from '../drm/DrmController';
|
|
4
4
|
import { MediaTimeline } from './MediaTimeline';
|
|
5
5
|
import { CodecOverrides } from '../util/media/codecOverrides';
|
|
6
|
+
import { AudioOptions } from './AudioOptions';
|
|
6
7
|
export interface DefaultMediaTimelineTransformerDeps {
|
|
7
8
|
readonly capabilities: Capabilities;
|
|
8
9
|
readonly drmController: DrmController;
|
|
9
10
|
readonly mediaTimeline: ObservableValue<Promise<MediaTimeline>>;
|
|
10
11
|
readonly options: ObservableValue<{
|
|
11
|
-
readonly
|
|
12
|
-
readonly preferDescriptiveAudio?: boolean;
|
|
12
|
+
readonly audio: AudioOptions;
|
|
13
13
|
readonly codecOverrides?: CodecOverrides;
|
|
14
14
|
}>;
|
|
15
15
|
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { Disposable } from '@amazon/vinyl-util';
|
|
2
|
+
import { TextTrackRenderer } from './TextTrackRenderer';
|
|
3
|
+
/**
|
|
4
|
+
* The subset of a `VTTCue`'s positioning properties {@link computeCueLayout}
|
|
5
|
+
* reads. A native `VTTCue` satisfies this; a plain `TextTrackCue` (platforms
|
|
6
|
+
* without `VTTCue`) leaves them undefined and falls back to defaults.
|
|
7
|
+
*/
|
|
8
|
+
export interface CueGeometry {
|
|
9
|
+
readonly align?: string | null;
|
|
10
|
+
readonly line?: number | AutoKeyword;
|
|
11
|
+
readonly lineAlign?: LineAlignSetting;
|
|
12
|
+
readonly position?: number | AutoKeyword;
|
|
13
|
+
readonly positionAlign?: PositionAlignSetting;
|
|
14
|
+
readonly size?: number;
|
|
15
|
+
readonly snapToLines?: boolean;
|
|
16
|
+
readonly vertical?: DirectionSetting;
|
|
17
|
+
}
|
|
18
|
+
/** Inline styles (camelCase CSS properties) to apply to a rendered cue box. */
|
|
19
|
+
export type CueLayout = Record<string, string>;
|
|
20
|
+
/**
|
|
21
|
+
* Maps a cue's WebVTT positioning settings to inline CSS. Pure and DOM-free so
|
|
22
|
+
* the (branchy) placement logic is unit-testable in isolation.
|
|
23
|
+
*
|
|
24
|
+
* A cue with neither `line` nor `position` set flows in the renderer's
|
|
25
|
+
* bottom-anchored, centered container (the common subtitle case). Otherwise it
|
|
26
|
+
* is absolutely positioned: `size` → width, `position`/`positionAlign` →
|
|
27
|
+
* horizontal, `line`/`lineAlign`/`snapToLines` → vertical (percentage lines, or
|
|
28
|
+
* whole rows counted from the bottom for negative integers), `align` → text
|
|
29
|
+
* alignment, `vertical` → writing mode.
|
|
30
|
+
*/
|
|
31
|
+
export declare function computeCueLayout(cue: CueGeometry): CueLayout;
|
|
32
|
+
/**
|
|
33
|
+
* Renders a cue's text payload as safe HTML. Text is escaped (so it can't
|
|
34
|
+
* inject nodes); newlines become `<br>`; and WebVTT cue tags are converted:
|
|
35
|
+
* `<c.foo>`→`<span class="foo">`, `<i>/<b>/<u>/<ruby>/<rt>` pass through,
|
|
36
|
+
* `<v Name>`→`<span title>`, `<lang xx>`→`<span lang>`, timestamp tags are
|
|
37
|
+
* dropped. Class-based styling requires matching app CSS (STYLE blocks in the
|
|
38
|
+
* VTT are not applied).
|
|
39
|
+
*/
|
|
40
|
+
export declare function renderCueText(text: string): string;
|
|
41
|
+
/**
|
|
42
|
+
* A {@link TextTrackRenderer} that paints cues as HTML into {@link element}.
|
|
43
|
+
* Mount `element` over the video; it stacks cues at the bottom, centered, and
|
|
44
|
+
* positions any cue that carries explicit WebVTT settings. The DOM track is
|
|
45
|
+
* expected to be `'hidden'` so only this renderer paints.
|
|
46
|
+
*/
|
|
47
|
+
export declare class HtmlTextTrackRenderer implements TextTrackRenderer, Disposable {
|
|
48
|
+
/** The overlay container to mount over the video. */
|
|
49
|
+
readonly element: HTMLElement;
|
|
50
|
+
private track;
|
|
51
|
+
private readonly styleElement;
|
|
52
|
+
private readonly onCueChange;
|
|
53
|
+
constructor();
|
|
54
|
+
setTextTrack(track: TextTrack | null): void;
|
|
55
|
+
setStyles(styles: readonly string[]): void;
|
|
56
|
+
dispose(): void;
|
|
57
|
+
private renderActiveCues;
|
|
58
|
+
private createCueBox;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=HtmlTextTrackRenderer.d.ts.map
|