@amazon/vinyl 3.0.1 → 3.1.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 +972 -954
- package/dist/index.cjs.map +4 -4
- package/dist/index.js +646 -619
- package/dist/index.js.map +4 -4
- package/dist/test/benchmark.js.map +2 -2
- package/dist/test/integ.es5.js +357 -353
- package/dist/test/integ.js +2251 -1852
- package/dist/test/integ.js.map +4 -4
- package/dist/test/jasmine.css +50 -3
- package/dist/test/jasmineHtml.es5.js +195 -155
- package/dist/test/jasmineHtml.js +2938 -1833
- package/dist/test/jasmineHtml.js.map +3 -3
- package/dist/types/current/ad/AdControllerImpl.d.ts.map +1 -1
- package/dist/types/current/ad/AdControllerImpl.js +4 -1
- package/dist/types/current/ad/discoverHlsInterstitials.d.ts.map +1 -1
- package/dist/types/current/ad/discoverHlsInterstitials.js +2 -2
- package/dist/types/current/drm/DrmControllerImpl.d.ts +2 -0
- package/dist/types/current/drm/DrmControllerImpl.d.ts.map +1 -1
- package/dist/types/current/drm/DrmControllerImpl.js +56 -48
- package/dist/types/current/drm/licenseProvider/defaultLicenseProvider.d.ts.map +1 -1
- package/dist/types/current/drm/licenseProvider/defaultLicenseProvider.js +2 -2
- package/dist/types/current/index.d.ts +3 -6
- package/dist/types/current/index.d.ts.map +1 -1
- package/dist/types/current/index.js +3 -6
- package/dist/types/current/playback/PlaybackControllerImpl.d.ts +15 -0
- package/dist/types/current/playback/PlaybackControllerImpl.d.ts.map +1 -1
- package/dist/types/current/playback/PlaybackControllerImpl.js +100 -9
- package/dist/types/current/playback/ReadonlyPlaybackController.d.ts +27 -1
- package/dist/types/current/playback/ReadonlyPlaybackController.d.ts.map +1 -1
- package/dist/types/current/playback/ReadonlyPlaybackController.js +16 -0
- package/dist/types/current/playback/createStallDetector.d.ts +43 -0
- package/dist/types/current/playback/createStallDetector.d.ts.map +1 -0
- package/dist/types/current/playback/createStallDetector.js +101 -0
- package/dist/types/current/playback/createStallMonitor.d.ts +45 -0
- package/dist/types/current/playback/createStallMonitor.d.ts.map +1 -0
- package/dist/types/current/playback/createStallMonitor.js +94 -0
- package/dist/types/current/streaming/AudioOptions.d.ts +27 -0
- package/dist/types/current/streaming/AudioOptions.d.ts.map +1 -1
- package/dist/types/current/streaming/AudioOptions.js +5 -1
- package/dist/types/current/streaming/ContentStream.d.ts +0 -5
- package/dist/types/current/streaming/ContentStream.d.ts.map +1 -1
- package/dist/types/current/streaming/ContentStream.js +0 -4
- package/dist/types/current/streaming/LoadMetric.d.ts.map +1 -1
- package/dist/types/current/streaming/StreamingEventMap.d.ts +1 -5
- package/dist/types/current/streaming/StreamingEventMap.d.ts.map +1 -1
- package/dist/types/current/streaming/StreamingEventMap.js +0 -1
- package/dist/types/current/streaming/buffering/BufferingController.d.ts +0 -11
- package/dist/types/current/streaming/buffering/BufferingController.d.ts.map +1 -1
- package/dist/types/current/streaming/buffering/BufferingController.js +0 -13
- package/dist/types/current/streaming/createDefaultMediaTimelineTransformer.d.ts.map +1 -1
- package/dist/types/current/streaming/createDefaultMediaTimelineTransformer.js +13 -4
- package/dist/types/current/text/SidecarTextTrackLoader.d.ts.map +1 -1
- package/dist/types/current/text/SidecarTextTrackLoader.js +4 -4
- package/dist/types/current/text/TextTrack.d.ts.map +1 -1
- package/dist/types/current/track/TrackController.d.ts.map +1 -1
- package/dist/types/current/track/TrackController.js +8 -2
- package/dist/types/current/track/createSegmentDataProvider.d.ts.map +1 -1
- package/dist/types/current/track/createSegmentDataProvider.js +6 -3
- package/dist/types/current/track/dash/DashMediaQualityMetadataResolver.d.ts +10 -6
- package/dist/types/current/track/dash/DashMediaQualityMetadataResolver.d.ts.map +1 -1
- package/dist/types/current/track/dash/DashMediaQualityMetadataResolver.js +13 -8
- package/dist/types/current/track/dash/createDashFactories.d.ts +1 -1
- package/dist/types/current/track/dash/timeline/DashRepresentationSegmentProvider.d.ts.map +1 -1
- package/dist/types/current/track/dash/timeline/DashRepresentationSegmentProvider.js +71 -3
- package/dist/types/current/track/dash/urlDashManifestProvider.js +2 -2
- package/dist/types/current/track/dash/util/mpd.d.ts +6 -0
- package/dist/types/current/track/dash/util/mpd.d.ts.map +1 -1
- package/dist/types/current/track/dash/util/mpd.js +24 -3
- package/dist/types/current/track/filters/resourceTypeFilter.d.ts +4 -0
- package/dist/types/current/track/filters/resourceTypeFilter.d.ts.map +1 -1
- package/dist/types/current/track/filters/resourceTypeFilter.js +4 -0
- package/dist/types/current/track/filters/sampleRateFilter.d.ts +21 -7
- package/dist/types/current/track/filters/sampleRateFilter.d.ts.map +1 -1
- package/dist/types/current/track/filters/sampleRateFilter.js +42 -24
- package/dist/types/current/track/hls/createHlsFactories.d.ts +1 -1
- package/dist/types/current/track/hls/createUrlHlsManifestProvider.d.ts.map +1 -1
- package/dist/types/current/track/hls/createUrlHlsManifestProvider.js +3 -3
- package/dist/types/current/track/mse/MseTrack.d.ts +9 -17
- package/dist/types/current/track/mse/MseTrack.d.ts.map +1 -1
- package/dist/types/current/track/mse/MseTrack.js +29 -46
- package/dist/types/current/tsconfig.tsbuildinfo +1 -1
- package/dist/types/current/util/media/mimeType.d.ts +8 -0
- package/dist/types/current/util/media/mimeType.d.ts.map +1 -0
- package/dist/types/current/util/media/mimeType.js +13 -0
- package/dist/types/current/vinyl/createVinylFactories.d.ts +7 -16
- package/dist/types/current/vinyl/createVinylFactories.d.ts.map +1 -1
- package/dist/types/current/vinyl/createVinylFactories.js +2 -12
- package/dist/types/ts3.7/drm/DrmControllerImpl.d.ts +2 -0
- package/dist/types/ts3.7/index.d.ts +3 -6
- package/dist/types/ts3.7/playback/PlaybackControllerImpl.d.ts +15 -0
- package/dist/types/ts3.7/playback/ReadonlyPlaybackController.d.ts +28 -0
- package/dist/types/ts3.7/playback/createStallDetector.d.ts +43 -0
- package/dist/types/ts3.7/playback/createStallMonitor.d.ts +45 -0
- package/dist/types/ts3.7/streaming/AudioOptions.d.ts +27 -0
- package/dist/types/ts3.7/streaming/ContentStream.d.ts +0 -5
- package/dist/types/ts3.7/streaming/StreamingEventMap.d.ts +0 -5
- package/dist/types/ts3.7/streaming/buffering/BufferingController.d.ts +0 -11
- package/dist/types/ts3.7/track/dash/DashMediaQualityMetadataResolver.d.ts +10 -6
- package/dist/types/ts3.7/track/dash/createDashFactories.d.ts +1 -1
- package/dist/types/ts3.7/track/dash/util/mpd.d.ts +6 -0
- package/dist/types/ts3.7/track/filters/resourceTypeFilter.d.ts +4 -0
- package/dist/types/ts3.7/track/filters/sampleRateFilter.d.ts +21 -7
- package/dist/types/ts3.7/track/hls/createHlsFactories.d.ts +1 -1
- package/dist/types/ts3.7/track/mse/MseTrack.d.ts +9 -17
- package/dist/types/ts3.7/util/media/mimeType.d.ts +8 -0
- package/dist/types/ts3.7/vinyl/createVinylFactories.d.ts +7 -16
- package/dist/types/ts4.1/drm/DrmControllerImpl.d.ts +2 -0
- package/dist/types/ts4.1/index.d.ts +3 -6
- package/dist/types/ts4.1/playback/PlaybackControllerImpl.d.ts +15 -0
- package/dist/types/ts4.1/playback/ReadonlyPlaybackController.d.ts +28 -0
- package/dist/types/ts4.1/playback/createStallDetector.d.ts +43 -0
- package/dist/types/ts4.1/playback/createStallMonitor.d.ts +45 -0
- package/dist/types/ts4.1/streaming/AudioOptions.d.ts +27 -0
- package/dist/types/ts4.1/streaming/ContentStream.d.ts +0 -5
- package/dist/types/ts4.1/streaming/StreamingEventMap.d.ts +0 -5
- package/dist/types/ts4.1/streaming/buffering/BufferingController.d.ts +0 -11
- package/dist/types/ts4.1/track/dash/DashMediaQualityMetadataResolver.d.ts +10 -6
- package/dist/types/ts4.1/track/dash/createDashFactories.d.ts +1 -1
- package/dist/types/ts4.1/track/dash/util/mpd.d.ts +6 -0
- package/dist/types/ts4.1/track/filters/resourceTypeFilter.d.ts +4 -0
- package/dist/types/ts4.1/track/filters/sampleRateFilter.d.ts +21 -7
- package/dist/types/ts4.1/track/hls/createHlsFactories.d.ts +1 -1
- package/dist/types/ts4.1/track/mse/MseTrack.d.ts +9 -17
- package/dist/types/ts4.1/util/media/mimeType.d.ts +8 -0
- package/dist/types/ts4.1/vinyl/createVinylFactories.d.ts +7 -16
- package/dist/types/ts4.7/drm/DrmControllerImpl.d.ts +2 -0
- package/dist/types/ts4.7/index.d.ts +3 -6
- package/dist/types/ts4.7/playback/PlaybackControllerImpl.d.ts +15 -0
- package/dist/types/ts4.7/playback/ReadonlyPlaybackController.d.ts +28 -0
- package/dist/types/ts4.7/playback/createStallDetector.d.ts +43 -0
- package/dist/types/ts4.7/playback/createStallMonitor.d.ts +45 -0
- package/dist/types/ts4.7/streaming/AudioOptions.d.ts +27 -0
- package/dist/types/ts4.7/streaming/ContentStream.d.ts +0 -5
- package/dist/types/ts4.7/streaming/StreamingEventMap.d.ts +0 -5
- package/dist/types/ts4.7/streaming/buffering/BufferingController.d.ts +0 -11
- package/dist/types/ts4.7/track/dash/DashMediaQualityMetadataResolver.d.ts +10 -6
- package/dist/types/ts4.7/track/dash/createDashFactories.d.ts +1 -1
- package/dist/types/ts4.7/track/dash/util/mpd.d.ts +6 -0
- package/dist/types/ts4.7/track/filters/resourceTypeFilter.d.ts +4 -0
- package/dist/types/ts4.7/track/filters/sampleRateFilter.d.ts +21 -7
- package/dist/types/ts4.7/track/hls/createHlsFactories.d.ts +1 -1
- package/dist/types/ts4.7/track/mse/MseTrack.d.ts +9 -17
- package/dist/types/ts4.7/util/media/mimeType.d.ts +8 -0
- package/dist/types/ts4.7/vinyl/createVinylFactories.d.ts +7 -16
- package/dist/unit/types/current/ad/AdControllerImpl.test.js +27 -1
- package/dist/unit/types/current/drm/DrmControllerImpl.test.js +93 -0
- package/dist/unit/types/current/index.d.ts +3 -4
- package/dist/unit/types/current/index.d.ts.map +1 -1
- package/dist/unit/types/current/index.js +3 -4
- package/dist/unit/types/current/playback/PlaybackControllerImpl.test.js +165 -0
- package/dist/unit/types/current/playback/createStallDetector.test.d.ts +2 -0
- package/dist/unit/types/current/playback/createStallDetector.test.d.ts.map +1 -0
- package/dist/unit/types/current/playback/createStallDetector.test.js +163 -0
- package/dist/unit/types/current/playback/createStallMonitor.test.d.ts +2 -0
- package/dist/unit/types/current/playback/createStallMonitor.test.d.ts.map +1 -0
- package/dist/unit/types/current/playback/createStallMonitor.test.js +125 -0
- package/dist/unit/types/current/streaming/ContentStream.test.js +0 -11
- package/dist/unit/types/current/streaming/MseTrack.test.js +47 -74
- package/dist/unit/types/current/streaming/abr/QualitySelectorImpl.test.js +1 -1
- package/dist/unit/types/current/streaming/buffering/BufferingController.test.js +0 -21
- package/dist/unit/types/current/streaming/createDefaultMediaTimelineTransformer.test.js +133 -0
- package/dist/unit/types/current/track/TrackController.test.js +61 -1
- package/dist/unit/types/current/track/createSegmentDataProvider.test.js +18 -0
- package/dist/unit/types/current/track/dash/DashMediaQualityMetadataResolver.test.js +46 -14
- package/dist/unit/types/current/track/dash/createSegmentControllerFactory.test.js +1 -0
- package/dist/unit/types/current/track/dash/timeline/DashRepresentationSegmentProvider.test.js +114 -0
- package/dist/unit/types/current/track/dash/util/mpd.test.js +37 -0
- package/dist/unit/types/current/track/filters/resourceTypeFilter.test.js +7 -0
- package/dist/unit/types/current/track/filters/sampleRateFilter.test.js +136 -34
- package/dist/unit/types/current/track/source/SourceObjectTrack.test.js +1 -1
- package/dist/unit/types/current/tsconfig.tsbuildinfo +1 -1
- package/dist/unit/types/current/util/media/mimeType.test.d.ts +2 -0
- package/dist/unit/types/current/util/media/mimeType.test.d.ts.map +1 -0
- package/dist/unit/types/current/util/media/mimeType.test.js +22 -0
- package/dist/unit/types/current/vinyl/createVinylFactories.test.js +2 -36
- package/dist/vinylTestUtil/index.js +6 -4
- package/dist/vinylTestUtil/index.js.map +2 -2
- package/dist/vinylTestUtil/types/current/assets/vinylTestAssets.d.ts +1 -0
- package/dist/vinylTestUtil/types/current/assets/vinylTestAssets.d.ts.map +1 -1
- package/dist/vinylTestUtil/types/current/assets/vinylTestAssets.js +1 -0
- package/dist/vinylTestUtil/types/current/media/FrequencyAnalyzer.d.ts.map +1 -1
- package/dist/vinylTestUtil/types/current/mock/streaming/MockContentStream.d.ts +0 -1
- package/dist/vinylTestUtil/types/current/mock/streaming/MockContentStream.d.ts.map +1 -1
- package/dist/vinylTestUtil/types/current/mock/streaming/MockContentStream.js +0 -1
- package/dist/vinylTestUtil/types/current/mock/streaming/buffering/MockBufferingController.d.ts +0 -1
- package/dist/vinylTestUtil/types/current/mock/streaming/buffering/MockBufferingController.d.ts.map +1 -1
- package/dist/vinylTestUtil/types/current/mock/streaming/buffering/MockBufferingController.js +0 -1
- package/dist/vinylTestUtil/types/current/tsconfig.tsbuildinfo +1 -1
- package/dist/vinylTestUtil/types/current/util/playback/eventPromises.js +1 -1
- package/dist/vinylTestUtil/types/current/util/playback/expectTrackCanSeek.d.ts.map +1 -1
- package/dist/vinylTestUtil/types/current/util/playback/expectTrackCanSeek.js +9 -1
- package/dist/vinylTestUtil/types/ts3.7/assets/vinylTestAssets.d.ts +1 -0
- package/dist/vinylTestUtil/types/ts3.7/mock/streaming/MockContentStream.d.ts +0 -1
- package/dist/vinylTestUtil/types/ts3.7/mock/streaming/buffering/MockBufferingController.d.ts +0 -1
- package/dist/vinylTestUtil/types/ts4.1/assets/vinylTestAssets.d.ts +1 -0
- package/dist/vinylTestUtil/types/ts4.1/mock/streaming/MockContentStream.d.ts +0 -1
- package/dist/vinylTestUtil/types/ts4.1/mock/streaming/buffering/MockBufferingController.d.ts +0 -1
- package/dist/vinylTestUtil/types/ts4.7/assets/vinylTestAssets.d.ts +1 -0
- package/dist/vinylTestUtil/types/ts4.7/mock/streaming/MockContentStream.d.ts +0 -1
- package/dist/vinylTestUtil/types/ts4.7/mock/streaming/buffering/MockBufferingController.d.ts +0 -1
- package/docs/USAGE.md +29 -0
- package/package.json +11 -10
- package/dist/types/current/patch/media/HtmlMediaElementPatch.d.ts +0 -3
- package/dist/types/current/patch/media/HtmlMediaElementPatch.d.ts.map +0 -1
- package/dist/types/current/patch/media/HtmlMediaElementPatch.js +0 -5
- package/dist/types/current/patch/media/MediaElementPatchOptions.d.ts +0 -19
- package/dist/types/current/patch/media/MediaElementPatchOptions.d.ts.map +0 -1
- package/dist/types/current/patch/media/MediaElementPatchOptions.js +0 -16
- package/dist/types/current/patch/media/patchMediaElement.d.ts +0 -9
- package/dist/types/current/patch/media/patchMediaElement.d.ts.map +0 -1
- package/dist/types/current/patch/media/patchMediaElement.js +0 -15
- package/dist/types/current/patch/media/patches/createPreventStallsPatch.d.ts +0 -17
- package/dist/types/current/patch/media/patches/createPreventStallsPatch.d.ts.map +0 -1
- package/dist/types/current/patch/media/patches/createPreventStallsPatch.js +0 -55
- package/dist/types/current/patch/media/patches/createUnreliablePlaybackEventsPatch.d.ts +0 -26
- package/dist/types/current/patch/media/patches/createUnreliablePlaybackEventsPatch.d.ts.map +0 -1
- package/dist/types/current/patch/media/patches/createUnreliablePlaybackEventsPatch.js +0 -218
- package/dist/types/current/vinyl/VinylPatchOptions.d.ts +0 -10
- package/dist/types/current/vinyl/VinylPatchOptions.d.ts.map +0 -1
- package/dist/types/current/vinyl/VinylPatchOptions.js +0 -11
- package/dist/types/ts3.7/patch/media/HtmlMediaElementPatch.d.ts +0 -3
- package/dist/types/ts3.7/patch/media/MediaElementPatchOptions.d.ts +0 -19
- package/dist/types/ts3.7/patch/media/patchMediaElement.d.ts +0 -9
- package/dist/types/ts3.7/patch/media/patches/createPreventStallsPatch.d.ts +0 -17
- package/dist/types/ts3.7/patch/media/patches/createUnreliablePlaybackEventsPatch.d.ts +0 -26
- package/dist/types/ts3.7/vinyl/VinylPatchOptions.d.ts +0 -10
- package/dist/types/ts4.1/patch/media/HtmlMediaElementPatch.d.ts +0 -3
- package/dist/types/ts4.1/patch/media/MediaElementPatchOptions.d.ts +0 -19
- package/dist/types/ts4.1/patch/media/patchMediaElement.d.ts +0 -9
- package/dist/types/ts4.1/patch/media/patches/createPreventStallsPatch.d.ts +0 -17
- package/dist/types/ts4.1/patch/media/patches/createUnreliablePlaybackEventsPatch.d.ts +0 -26
- package/dist/types/ts4.1/vinyl/VinylPatchOptions.d.ts +0 -10
- package/dist/types/ts4.7/patch/media/HtmlMediaElementPatch.d.ts +0 -3
- package/dist/types/ts4.7/patch/media/MediaElementPatchOptions.d.ts +0 -19
- package/dist/types/ts4.7/patch/media/patchMediaElement.d.ts +0 -9
- package/dist/types/ts4.7/patch/media/patches/createPreventStallsPatch.d.ts +0 -17
- package/dist/types/ts4.7/patch/media/patches/createUnreliablePlaybackEventsPatch.d.ts +0 -26
- package/dist/types/ts4.7/vinyl/VinylPatchOptions.d.ts +0 -10
- package/dist/unit/types/current/patch/media/MediaElementPatchOptions.test.d.ts +0 -2
- package/dist/unit/types/current/patch/media/MediaElementPatchOptions.test.d.ts.map +0 -1
- package/dist/unit/types/current/patch/media/MediaElementPatchOptions.test.js +0 -17
- package/dist/unit/types/current/patch/media/patchMediaElement.test.d.ts +0 -2
- package/dist/unit/types/current/patch/media/patchMediaElement.test.d.ts.map +0 -1
- package/dist/unit/types/current/patch/media/patchMediaElement.test.js +0 -36
- package/dist/unit/types/current/patch/media/patches/createPreventStallsPatch.test.d.ts +0 -2
- package/dist/unit/types/current/patch/media/patches/createPreventStallsPatch.test.d.ts.map +0 -1
- package/dist/unit/types/current/patch/media/patches/createPreventStallsPatch.test.js +0 -93
- package/dist/unit/types/current/patch/media/patches/createUnreliablePlaybackEventsPatch.test.d.ts +0 -2
- package/dist/unit/types/current/patch/media/patches/createUnreliablePlaybackEventsPatch.test.d.ts.map +0 -1
- package/dist/unit/types/current/patch/media/patches/createUnreliablePlaybackEventsPatch.test.js +0 -423
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extracts the container subtype from a MIME type, lowercased — the portion
|
|
3
|
+
* after the `/`, ignoring any parameters. For example
|
|
4
|
+
* `video/webm; codecs="vp9"` → `webm` and `audio/mp4` → `mp4`. Returns an empty
|
|
5
|
+
* string when the MIME type has no subtype.
|
|
6
|
+
*/
|
|
7
|
+
export declare function mimeSubtype(mimeType: string): string;
|
|
8
|
+
//# sourceMappingURL=mimeType.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mimeType.d.ts","sourceRoot":"","sources":["../../../../../src/util/media/mimeType.ts"],"names":[],"mappings":"AAKA;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEpD"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Extracts the container subtype from a MIME type, lowercased — the portion
|
|
7
|
+
* after the `/`, ignoring any parameters. For example
|
|
8
|
+
* `video/webm; codecs="vp9"` → `webm` and `audio/mp4` → `mp4`. Returns an empty
|
|
9
|
+
* string when the MIME type has no subtype.
|
|
10
|
+
*/
|
|
11
|
+
export function mimeSubtype(mimeType) {
|
|
12
|
+
return mimeType.split(';', 1)[0].trim().toLowerCase().split('/')[1] ?? '';
|
|
13
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CapabilitiesImplDeps } from '../client/CapabilitiesImpl';
|
|
2
2
|
import { CapabilitiesImpl } from '../client/CapabilitiesImpl';
|
|
3
|
-
import type { Merge, PartialDeep
|
|
3
|
+
import type { Merge, PartialDeep } from '@amazon/vinyl-util';
|
|
4
4
|
import { noop } from '@amazon/vinyl-util';
|
|
5
5
|
import type { PlaybackControllerImplDeps, PlaybackControllerImplOptions } from '../playback/PlaybackControllerImpl';
|
|
6
6
|
import { PlaybackControllerImpl } from '../playback/PlaybackControllerImpl';
|
|
@@ -9,7 +9,6 @@ import { PlaybackSourceImpl } from '../playback/PlaybackSourceImpl';
|
|
|
9
9
|
import { type VinylTrackFactoryDeps } from '../track/createVinylTrackFactories';
|
|
10
10
|
import type { TrackControllerImplDeps, TrackControllerImplOptions } from '../track/TrackController';
|
|
11
11
|
import { TrackControllerImpl } from '../track/TrackController';
|
|
12
|
-
import type { VinylPatchOptions } from './VinylPatchOptions';
|
|
13
12
|
import { type QualitySelectorImplOptions } from '../streaming/abr/QualitySelectorImpl';
|
|
14
13
|
import { AdControllerImpl, type AdControllerImplDeps, type AdControllerImplOptions } from '../ad/AdControllerImpl';
|
|
15
14
|
import { type MediaTextTrackProvider } from '../text/mediaTextTrackProvider';
|
|
@@ -41,11 +40,6 @@ export interface VinylDependencyOptions {
|
|
|
41
40
|
* `'hidden'`; without one they render natively. See `TextTrackRenderer`.
|
|
42
41
|
*/
|
|
43
42
|
readonly textTrackRenderer?: TextTrackRenderer;
|
|
44
|
-
/**
|
|
45
|
-
* Flags for patches that should be applied browser-specifically.
|
|
46
|
-
* These will be defaulted based on the user-agent.
|
|
47
|
-
*/
|
|
48
|
-
readonly patches?: PartialDeep<VinylPatchOptions>;
|
|
49
43
|
/**
|
|
50
44
|
* Configuration for the track controller.
|
|
51
45
|
*/
|
|
@@ -82,12 +76,7 @@ export interface VinylDependencyOptions {
|
|
|
82
76
|
*/
|
|
83
77
|
export declare function createVinylFactories(options: VinylDependencyOptions): NoInfer<{
|
|
84
78
|
options: (_deps: import("@amazon/vinyl-util").AnyRecord, add: import("@amazon/vinyl-util").AddDisposable) => import("@amazon/vinyl-observable").MutableValue<VinylOptions>;
|
|
85
|
-
|
|
86
|
-
media: (deps: {
|
|
87
|
-
readonly patchedMedia: {
|
|
88
|
-
readonly patched: HTMLMediaElement;
|
|
89
|
-
};
|
|
90
|
-
}) => HTMLMediaElement;
|
|
79
|
+
media: () => HTMLMediaElement;
|
|
91
80
|
textTrackProvider: (deps: {
|
|
92
81
|
readonly media: HTMLMediaElement;
|
|
93
82
|
}) => MediaTextTrackProvider;
|
|
@@ -153,7 +142,7 @@ export declare function createVinylFactories(options: VinylDependencyOptions): N
|
|
|
153
142
|
readonly manifestTransformed: ObservableValue<Promise<import("..").DashManifestData>>;
|
|
154
143
|
readonly options: ObservableValue<Pick<VinylOptions, "text">>;
|
|
155
144
|
}) => import("..").SidecarTextTrackController;
|
|
156
|
-
options: import("@amazon/vinyl-di").Factory<ObservableValue<Pick<VinylOptions, "
|
|
145
|
+
options: import("@amazon/vinyl-di").Factory<ObservableValue<Pick<VinylOptions, "text" | "audio" | "abr" | "allowedContentTypes">>>;
|
|
157
146
|
playbackController: import("@amazon/vinyl-di").Factory<import("..").PlaybackController>;
|
|
158
147
|
playbackSource: import("@amazon/vinyl-di").Factory<import("..").PlaybackSource>;
|
|
159
148
|
drmKeySystemResolver: import("@amazon/vinyl-di").Factory<import("..").DrmKeySystemResolver>;
|
|
@@ -165,7 +154,9 @@ export declare function createVinylFactories(options: VinylDependencyOptions): N
|
|
|
165
154
|
textTrackRenderer: import("@amazon/vinyl-di").Factory<TextTrackRenderer | null>;
|
|
166
155
|
adController: import("@amazon/vinyl-di").Factory<import("..").AdController>;
|
|
167
156
|
}>;
|
|
168
|
-
createHlsFactories: (deps: import("..").HlsFactoryDeps) => (loadOptions: import("..").HlsTrackLoadOptions
|
|
157
|
+
createHlsFactories: (deps: import("..").HlsFactoryDeps) => (loadOptions: import("..").HlsTrackLoadOptions /**
|
|
158
|
+
* Configuration for adaptive bitrate switching.
|
|
159
|
+
*/) => NoInfer<{
|
|
169
160
|
baseContentTypesValue: typeof import("..").createHlsContentTypesValue;
|
|
170
161
|
contentTypesValue: typeof import("..").createAllowedContentTypesValue;
|
|
171
162
|
manifestProvider: () => import("..").HlsManifestProvider;
|
|
@@ -208,7 +199,7 @@ export declare function createVinylFactories(options: VinylDependencyOptions): N
|
|
|
208
199
|
readonly manifestTransformed: ObservableValue<Promise<import("..").HlsManifestData>>;
|
|
209
200
|
readonly options: ObservableValue<Pick<VinylOptions, "text">>;
|
|
210
201
|
}) => import("..").SidecarTextTrackController;
|
|
211
|
-
options: import("@amazon/vinyl-di").Factory<ObservableValue<Pick<VinylOptions, "
|
|
202
|
+
options: import("@amazon/vinyl-di").Factory<ObservableValue<Pick<VinylOptions, "text" | "audio" | "abr" | "allowedContentTypes">>>;
|
|
212
203
|
playbackController: import("@amazon/vinyl-di").Factory<import("..").PlaybackController>;
|
|
213
204
|
playbackSource: import("@amazon/vinyl-di").Factory<import("..").PlaybackSource>;
|
|
214
205
|
drmKeySystemResolver: import("@amazon/vinyl-di").Factory<import("..").DrmKeySystemResolver>;
|
|
@@ -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;AAC7D,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,
|
|
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;AAC7D,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAC5D,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAA;AACzC,OAAO,KAAK,EACR,0BAA0B,EAC1B,6BAA6B,EAChC,MAAM,oCAAoC,CAAA;AAC3C,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAA;AAC3E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAA;AAC5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAA;AACnE,OAAO,EAEH,KAAK,qBAAqB,EAC7B,MAAM,oCAAoC,CAAA;AAC3C,OAAO,KAAK,EACR,uBAAuB,EACvB,0BAA0B,EAC7B,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAG9D,OAAO,EAAE,KAAK,0BAA0B,EAAE,MAAM,sCAAsC,CAAA;AACtF,OAAO,EACH,gBAAgB,EAChB,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,EAC/B,MAAM,wBAAwB,CAAA;AAG/B,OAAO,EAEH,KAAK,sBAAsB,EAC9B,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAClE,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAA;AACpE,OAAO,EACH,iBAAiB,EACjB,KAAK,qBAAqB,EAC7B,MAAM,0BAA0B,CAAA;AAEjC,OAAO,EAAE,mCAAmC,EAAE,MAAM,0DAA0D,CAAA;AAC9G,OAAO,EACH,uBAAuB,EACvB,KAAK,2BAA2B,EAChC,KAAK,8BAA8B,EACtC,MAAM,8BAA8B,CAAA;AACrC,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAE/D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAA;AACnF,OAAO,EAEH,KAAK,YAAY,EAEpB,MAAM,gBAAgB,CAAA;AAEvB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAC/D,OAAO,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAA;AAEjF;;;;;GAKG;AACH,MAAM,WAAW,sBAAsB;IACnC;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,gBAAgB,CAAA;IAEhC;;;;OAIG;IACH,QAAQ,CAAC,iBAAiB,CAAC,EAAE,iBAAiB,CAAA;IAE9C;;OAEG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC,0BAA0B,CAAC,CAAA;IAE9D;;OAEG;IACH,QAAQ,CAAC,kBAAkB,CAAC,EAAE,OAAO,CAAC,6BAA6B,CAAC,CAAA;IAEpE;;OAEG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,WAAW,CAAC,uBAAuB,CAAC,CAAA;IAEzD;;OAEG;IACH,QAAQ,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,CAAA;IAElC;;OAEG;IACH,QAAQ,CAAC,GAAG,CAAC,EAAE,WAAW,CAAC,0BAA0B,CAAC,CAAA;IAEtD;;OAEG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,8BAA8B,CAAC,CAAA;IAE5D;;OAEG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC,uBAAuB,CAAC,CAAA;CAC3D;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,sBAAsB;;iBAMjD,gBAAgB;8BAGD;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;kEAlDV,8CAInC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gEAnBS,6CAET,CAAA;;OAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkEN;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"}
|
|
@@ -3,14 +3,12 @@
|
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
*/
|
|
5
5
|
import { CapabilitiesImpl } from '../client/CapabilitiesImpl';
|
|
6
|
-
import {
|
|
7
|
-
import { patchMediaElement } from '../patch/media/patchMediaElement';
|
|
6
|
+
import { noop } from '@amazon/vinyl-util';
|
|
8
7
|
import { PlaybackControllerImpl } from '../playback/PlaybackControllerImpl';
|
|
9
8
|
import { PlaybackSourceImpl } from '../playback/PlaybackSourceImpl';
|
|
10
9
|
import { createVinylTrackFactories, } from '../track/createVinylTrackFactories';
|
|
11
10
|
import { TrackControllerImpl } from '../track/TrackController';
|
|
12
11
|
import { createTrackFactory } from '../track/TrackFactory';
|
|
13
|
-
import { defaultPatchOptions } from './VinylPatchOptions';
|
|
14
12
|
import { AdControllerImpl, } from '../ad/AdControllerImpl';
|
|
15
13
|
import { createDashFactories } from '../track/dash/createDashFactories';
|
|
16
14
|
import { createHlsFactories } from '../track/hls/createHlsFactories';
|
|
@@ -30,17 +28,9 @@ import { defaultAdLoadOptionsResolver } from '../ad/defaultAdLoadOptionsResolver
|
|
|
30
28
|
* @param options
|
|
31
29
|
*/
|
|
32
30
|
export function createVinylFactories(options) {
|
|
33
|
-
const patches = mergeDeep([
|
|
34
|
-
defaultPatchOptions.value,
|
|
35
|
-
options.patches ?? {},
|
|
36
|
-
]);
|
|
37
31
|
return validateFactories({
|
|
38
32
|
options: playerConfigFactory(defaultVinylOptions, vinylOptionsValidator),
|
|
39
|
-
|
|
40
|
-
// Patches the media element if necessary.
|
|
41
|
-
return patchMediaElement(options.media, patches.media);
|
|
42
|
-
},
|
|
43
|
-
media: (deps) => deps.patchedMedia.patched,
|
|
33
|
+
media: () => options.media,
|
|
44
34
|
// One provider per media element (the player container creates each
|
|
45
35
|
// dependency once), so text tracks are reused rather than accumulated.
|
|
46
36
|
textTrackProvider: (deps) => createMediaTextTrackProvider({ media: deps.media }),
|
|
@@ -65,6 +65,8 @@ export declare class DrmControllerImpl extends EventHostImpl<DrmControllerEventM
|
|
|
65
65
|
*/
|
|
66
66
|
private maybeCreateSession;
|
|
67
67
|
initializeForPlayback(drmInfo: MediaFormatMetadata | null, options?: DrmPlaybackOptions): void;
|
|
68
|
+
/** True when the manifest carried pssh (sessions come from it, not events). */
|
|
69
|
+
private manifestProvidesInitData;
|
|
68
70
|
setBufferingDrmInfo(drmInfo: MediaFormatMetadata | null, options?: DrmPlaybackOptions): void;
|
|
69
71
|
/**
|
|
70
72
|
* If the drm metadata contains initialization data for the current key system, create a new session.
|
|
@@ -38,11 +38,8 @@ export * from './global/environment';
|
|
|
38
38
|
export * from './global/globalRef';
|
|
39
39
|
export * from './global/initializeVinylGlobal';
|
|
40
40
|
export * from './global/PlayerRegistry';
|
|
41
|
-
export * from './
|
|
42
|
-
export * from './
|
|
43
|
-
export * from './patch/media/patches/createPreventStallsPatch';
|
|
44
|
-
export * from './patch/media/patches/createUnreliablePlaybackEventsPatch';
|
|
45
|
-
export * from './patch/media/patchMediaElement';
|
|
41
|
+
export * from './playback/createStallDetector';
|
|
42
|
+
export * from './playback/createStallMonitor';
|
|
46
43
|
export * from './playback/error/InvalidSeekError';
|
|
47
44
|
export * from './playback/error/ReportableMediaError';
|
|
48
45
|
export * from './playback/logging/mediaErrorToJson';
|
|
@@ -150,12 +147,12 @@ export * from './util/media/codecOverrides';
|
|
|
150
147
|
export * from './util/media/codecSupport';
|
|
151
148
|
export * from './util/media/getAudioContext';
|
|
152
149
|
export * from './util/media/mediaSource';
|
|
150
|
+
export * from './util/media/mimeType';
|
|
153
151
|
export * from './util/media/sourceBuffer';
|
|
154
152
|
export * from './vinyl/createVinylFactories';
|
|
155
153
|
export * from './vinyl/playerConfigFactory';
|
|
156
154
|
export * from './vinyl/ReadonlyPlaybackStreamingState';
|
|
157
155
|
export * from './vinyl/VinylDeps';
|
|
158
156
|
export * from './vinyl/VinylOptions';
|
|
159
|
-
export * from './vinyl/VinylPatchOptions';
|
|
160
157
|
export * from './vinyl/VinylPlayer';
|
|
161
158
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -29,12 +29,19 @@ export interface PlaybackControllerImplOptions {
|
|
|
29
29
|
* Default: 30
|
|
30
30
|
*/
|
|
31
31
|
readonly seekTimeout: number;
|
|
32
|
+
/**
|
|
33
|
+
* The number of seconds the play head must be frozen while playing before a stall is reported
|
|
34
|
+
* via the `stallEntered`/`stallEnded` events.
|
|
35
|
+
* Default: 1
|
|
36
|
+
*/
|
|
37
|
+
readonly stallThreshold: number;
|
|
32
38
|
}
|
|
33
39
|
export declare const defaultPlaybackControllerImplOptions: {
|
|
34
40
|
readonly loopTimeAffordance: 2;
|
|
35
41
|
readonly minSeekableBuffer: -1;
|
|
36
42
|
readonly playTimeout: 30;
|
|
37
43
|
readonly seekTimeout: 30;
|
|
44
|
+
readonly stallThreshold: 1;
|
|
38
45
|
};
|
|
39
46
|
/**
|
|
40
47
|
* Safari and Edge Legacy cannot reliably seek close to the end of a seekable range.
|
|
@@ -57,6 +64,7 @@ export declare class PlaybackControllerImpl extends EventHostImpl<PlaybackContro
|
|
|
57
64
|
private _seeking;
|
|
58
65
|
private _waiting;
|
|
59
66
|
private _seekId;
|
|
67
|
+
private stopStallDetection;
|
|
60
68
|
private userVolume;
|
|
61
69
|
private _pendingPlay;
|
|
62
70
|
private playAbort;
|
|
@@ -153,6 +161,13 @@ export declare class PlaybackControllerImpl extends EventHostImpl<PlaybackContro
|
|
|
153
161
|
pause(): void;
|
|
154
162
|
private get pendingPlay();
|
|
155
163
|
private set pendingPlay(value);
|
|
164
|
+
/**
|
|
165
|
+
* Starts (or restarts) the stall detector: recovers a play head that stays frozen when it
|
|
166
|
+
* should be advancing — some WebKit versions never resume after a seek or a play, e.g. after a
|
|
167
|
+
* buffer-flushing seek. Superseded by the next seek/play and stopped on dispose.
|
|
168
|
+
* @private
|
|
169
|
+
*/
|
|
170
|
+
private startStallDetection;
|
|
156
171
|
play(): Promise<void>;
|
|
157
172
|
get canPlay(): boolean;
|
|
158
173
|
get canPlayThrough(): boolean;
|
|
@@ -194,6 +194,19 @@ export interface PlaybackControllerEventMap {
|
|
|
194
194
|
* true and the media is seeking a new position.
|
|
195
195
|
*/
|
|
196
196
|
readonly seeking: AnyRecord;
|
|
197
|
+
/**
|
|
198
|
+
* Fired when the play head has been detected as frozen while playing — i.e. no `timeUpdate`
|
|
199
|
+
* was observed for longer than the stall threshold. Only emitted once playback has actually
|
|
200
|
+
* been observed (a `playing` event), so it is not emitted during initial loading or while
|
|
201
|
+
* awaiting a seek. Each stall is bracketed by a `stallEntered`/{@link stallEnded} pair.
|
|
202
|
+
*/
|
|
203
|
+
readonly stallEntered: AnyRecord;
|
|
204
|
+
/**
|
|
205
|
+
* Fired when a stall (see {@link stallEntered}) has ended, for any reason. `started` is the
|
|
206
|
+
* time of the last `timeUpdate` observed before the play head froze, and `duration` is the
|
|
207
|
+
* total number of seconds the play head was frozen.
|
|
208
|
+
*/
|
|
209
|
+
readonly stallEnded: OperationCompletedEvent<StallEndedReason>;
|
|
197
210
|
/**
|
|
198
211
|
* Fired when the time indicated by the currentTime attribute has been updated.
|
|
199
212
|
*/
|
|
@@ -241,6 +254,19 @@ export declare const waitedReasons: readonly [
|
|
|
241
254
|
WaitedReason.EMPTIED,
|
|
242
255
|
WaitedReason.SEEKING
|
|
243
256
|
];
|
|
257
|
+
/**
|
|
258
|
+
* Reasons a stall (see {@link PlaybackControllerEventMap.stallEntered}) has ended.
|
|
259
|
+
*/
|
|
260
|
+
export declare enum StallEndedReason {
|
|
261
|
+
/** The play head advanced again — playback resumed. */
|
|
262
|
+
PLAYING = "playing",
|
|
263
|
+
/** Playback was paused. */
|
|
264
|
+
PAUSE = "pause",
|
|
265
|
+
/** A seek started. */
|
|
266
|
+
SEEKING = "seeking",
|
|
267
|
+
/** The media was emptied (e.g. unloaded/reloaded). */
|
|
268
|
+
EMPTIED = "emptied"
|
|
269
|
+
}
|
|
244
270
|
export declare const ALL_PLAYBACK_STATE_EVENTS: readonly [
|
|
245
271
|
"abort",
|
|
246
272
|
"canPlay",
|
|
@@ -267,6 +293,8 @@ export declare const ALL_PLAYBACK_STATE_EVENTS: readonly [
|
|
|
267
293
|
"resize",
|
|
268
294
|
"seeked",
|
|
269
295
|
"seeking",
|
|
296
|
+
"stallEntered",
|
|
297
|
+
"stallEnded",
|
|
270
298
|
"timeUpdate",
|
|
271
299
|
"volumeChange",
|
|
272
300
|
"waited",
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export interface StallDetectorOptions {
|
|
2
|
+
/**
|
|
3
|
+
* Called when playback resumes without emitting a `playing` event (or after the detector
|
|
4
|
+
* revived it), so the caller can announce playback.
|
|
5
|
+
*/
|
|
6
|
+
readonly fabricatePlaying: () => void;
|
|
7
|
+
/** Poll interval in seconds. Default: 0.25 */
|
|
8
|
+
readonly pollInterval?: number;
|
|
9
|
+
/** Seconds the play head must be frozen before recovering. Default: 0.75 */
|
|
10
|
+
readonly stallThreshold?: number;
|
|
11
|
+
/**
|
|
12
|
+
* Don't nudge this close to the end of buffered data; a freeze there is a
|
|
13
|
+
* legitimate wait for more data. Seconds. Default: 0.5
|
|
14
|
+
*/
|
|
15
|
+
readonly bufferEndMargin?: number;
|
|
16
|
+
/** Seconds to nudge the play head forward to prod a resume. Default: 0.1 */
|
|
17
|
+
readonly stallSkip?: number;
|
|
18
|
+
/** Max recovery attempts before giving up. Default: 3 */
|
|
19
|
+
readonly maxAttempts?: number;
|
|
20
|
+
/**
|
|
21
|
+
* Nudge even when the playhead isn't inside a buffered range. Some WebKit versions leave a
|
|
22
|
+
* seek perpetually pending (no `seeked`) with a stale empty `buffered` even though data is
|
|
23
|
+
* appended; re-issuing the seek via a nudge can complete it. Off by default (only nudge over
|
|
24
|
+
* genuinely buffered data). Default: false
|
|
25
|
+
*/
|
|
26
|
+
readonly nudgeUnbuffered?: boolean;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Watches a media element after a seek/play and drives it back into a playing state. Some WebKit
|
|
30
|
+
* versions stall: the play head freezes inside buffered data and playback never resumes (often with
|
|
31
|
+
* a stale low readyState). This polls the play head and, while the element should be advancing:
|
|
32
|
+
*
|
|
33
|
+
* - if it's frozen inside buffered data, nudges currentTime forward to prod a resume;
|
|
34
|
+
* - if there's no data at the playhead, waits (it's legitimately buffering, or between sources).
|
|
35
|
+
*
|
|
36
|
+
* When the play head progresses it calls {@link StallDetectorOptions.fabricatePlaying} if playback
|
|
37
|
+
* resumed without a `playing` event (or after the detector revived it), then stops. It also stops
|
|
38
|
+
* on pause/ended/emptied or after {@link StallDetectorOptions.maxAttempts}.
|
|
39
|
+
*
|
|
40
|
+
* Start it after a seek or play only when playback is intended — a paused element won't advance.
|
|
41
|
+
*/
|
|
42
|
+
export declare function createStallDetector(media: HTMLMediaElement, options: StallDetectorOptions): () => void;
|
|
43
|
+
//# sourceMappingURL=createStallDetector.d.ts.map
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Timestamp } from '@amazon/vinyl-util';
|
|
2
|
+
import { ReadonlyPlaybackController } from './ReadonlyPlaybackController';
|
|
3
|
+
import { StallEndedReason } from './ReadonlyPlaybackController';
|
|
4
|
+
export interface StallMonitorOptions {
|
|
5
|
+
/**
|
|
6
|
+
* Seconds the play head must be frozen (no `timeUpdate`) while playing before a stall is
|
|
7
|
+
* reported. Default: 1
|
|
8
|
+
*/
|
|
9
|
+
readonly stallThreshold?: number;
|
|
10
|
+
/**
|
|
11
|
+
* How often (seconds) the play head freeze is checked. Default: 0.25
|
|
12
|
+
*/
|
|
13
|
+
readonly pollInterval?: number;
|
|
14
|
+
}
|
|
15
|
+
export interface StallEndedInfo {
|
|
16
|
+
/** Time of the last `timeUpdate` observed before the play head froze. */
|
|
17
|
+
readonly started: Timestamp;
|
|
18
|
+
/** Time the stall ended. */
|
|
19
|
+
readonly ended: Timestamp;
|
|
20
|
+
/** Total seconds the play head was frozen. */
|
|
21
|
+
readonly duration: number;
|
|
22
|
+
/** Why the stall ended. */
|
|
23
|
+
readonly reason: StallEndedReason;
|
|
24
|
+
}
|
|
25
|
+
export interface StallMonitorCallbacks {
|
|
26
|
+
/** Called when a stall is first detected. */
|
|
27
|
+
readonly onStallEntered: () => void;
|
|
28
|
+
/** Called when a detected stall ends. */
|
|
29
|
+
readonly onStallEnded: (info: StallEndedInfo) => void;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Watches a {@link ReadonlyPlaybackController} for stalls while playing: the play head freezing
|
|
33
|
+
* (no `timeUpdate`) for longer than {@link StallMonitorOptions.stallThreshold} seconds.
|
|
34
|
+
*
|
|
35
|
+
* Detection only runs once playback has actually been observed (a `playing` event) and is
|
|
36
|
+
* suspended on `pause`/`seeking`/`emptied` until playback is observed again — so a stall is never
|
|
37
|
+
* reported during initial loading or while awaiting a seek. A detected stall ends when the play
|
|
38
|
+
* head advances again (`playing`) or playback stops for another reason (`pause`/`seeking`/
|
|
39
|
+
* `emptied`); {@link StallEndedInfo.duration} is measured from the last `timeUpdate` before the
|
|
40
|
+
* freeze, so it reflects the full frozen time rather than only the time past the threshold.
|
|
41
|
+
*
|
|
42
|
+
* Returns a function that stops the monitor.
|
|
43
|
+
*/
|
|
44
|
+
export declare function createStallMonitor(controller: ReadonlyPlaybackController, callbacks: StallMonitorCallbacks, options?: StallMonitorOptions): () => void;
|
|
45
|
+
//# sourceMappingURL=createStallMonitor.d.ts.map
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ObjectSchema } from '@amazon/vinyl-validation';
|
|
2
|
+
import { Maybe } from '@amazon/vinyl-util';
|
|
2
3
|
/**
|
|
3
4
|
* Criteria used to pick which audio rendition to play.
|
|
4
5
|
*/
|
|
@@ -33,6 +34,32 @@ export interface AudioOptions {
|
|
|
33
34
|
* The audio selection criteria (language / descriptive).
|
|
34
35
|
*/
|
|
35
36
|
readonly selection?: AudioSelection;
|
|
37
|
+
/**
|
|
38
|
+
* When `true`, disables the audio sampling-rate support filter, so audio
|
|
39
|
+
* renditions whose sampling rate exceeds what the platform reports (via the
|
|
40
|
+
* `AudioContext` output rate) are kept and offered to playback anyway.
|
|
41
|
+
* `false` (the default) applies the filter. Changing this re-filters the
|
|
42
|
+
* timeline immediately.
|
|
43
|
+
*/
|
|
44
|
+
readonly disableSampleRateFilter?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* The maximum audio sampling rate (Hz) the sampling-rate filter treats as
|
|
47
|
+
* supported. When set, it takes precedence over the platform's
|
|
48
|
+
* `AudioContext`-reported output rate. Ignored when
|
|
49
|
+
* {@link disableSampleRateFilter} is `true`. Changing this re-filters the
|
|
50
|
+
* timeline immediately. `null`/`undefined` falls back to the reported rate.
|
|
51
|
+
*/
|
|
52
|
+
readonly maxSampleRate?: Maybe<number>;
|
|
53
|
+
/**
|
|
54
|
+
* The minimum audio sampling rate (Hz) the sampling-rate filter treats as
|
|
55
|
+
* supported. When set, renditions below it are filtered out as a soft floor
|
|
56
|
+
* (if every audio rendition is below it, the highest is kept so playback is
|
|
57
|
+
* never stranded). Applied alongside the max cap whenever the filter runs,
|
|
58
|
+
* regardless of how the max was determined; ignored when
|
|
59
|
+
* {@link disableSampleRateFilter} is `true`. Changing this re-filters the
|
|
60
|
+
* timeline immediately.
|
|
61
|
+
*/
|
|
62
|
+
readonly minSampleRate?: Maybe<number>;
|
|
36
63
|
}
|
|
37
64
|
export declare const defaultAudioOptions: AudioOptions;
|
|
38
65
|
export declare const audioOptionsValidator: ObjectSchema<AudioOptions>;
|
|
@@ -38,10 +38,6 @@ export interface ContentStream extends ReadonlyEventHost<StreamingEventMap>, Dis
|
|
|
38
38
|
* True if the last segment has been appended.
|
|
39
39
|
*/
|
|
40
40
|
readonly bufferingEnded: boolean;
|
|
41
|
-
/**
|
|
42
|
-
* True while this stream's buffer holds any data.
|
|
43
|
-
*/
|
|
44
|
-
readonly hasData: boolean;
|
|
45
41
|
/**
|
|
46
42
|
* Starts prefetching with the given priority and prefetch start time.
|
|
47
43
|
* @param options
|
|
@@ -96,7 +92,6 @@ export declare class ContentStreamImpl extends EventHostImpl<StreamingEventMap>
|
|
|
96
92
|
get streamingQuality(): (MediaQualityMetadata | null);
|
|
97
93
|
get bufferingQuality(): (MediaQualityMetadata | null);
|
|
98
94
|
get playbackQuality(): (MediaQualityMetadata | null);
|
|
99
|
-
get hasData(): boolean;
|
|
100
95
|
get bufferingEnded(): boolean;
|
|
101
96
|
get error(): (Error | null);
|
|
102
97
|
/**
|
|
@@ -34,10 +34,6 @@ export interface StreamingEventMap {
|
|
|
34
34
|
* The last segment has finished appending.
|
|
35
35
|
*/
|
|
36
36
|
readonly bufferingEnded: AnyRecord;
|
|
37
|
-
/**
|
|
38
|
-
* The buffer went from empty to holding data, or back to empty.
|
|
39
|
-
*/
|
|
40
|
-
readonly hasDataChange: ChangeEvent<boolean>;
|
|
41
37
|
/**
|
|
42
38
|
* Dispatched when a streaming error occurs.
|
|
43
39
|
*/
|
|
@@ -97,7 +93,6 @@ export declare const ALL_STREAMING_EVENTS: readonly [
|
|
|
97
93
|
"bufferingQualityChange",
|
|
98
94
|
"playbackQualityChange",
|
|
99
95
|
"bufferingEnded",
|
|
100
|
-
"hasDataChange",
|
|
101
96
|
"error",
|
|
102
97
|
"reset",
|
|
103
98
|
"qualitiesChange",
|
|
@@ -44,10 +44,6 @@ export interface BufferingControllerEventMap {
|
|
|
44
44
|
* The last segment has finished appending.
|
|
45
45
|
*/
|
|
46
46
|
readonly bufferingEnded: AnyRecord;
|
|
47
|
-
/**
|
|
48
|
-
* The buffer went from empty to holding data, or back to empty.
|
|
49
|
-
*/
|
|
50
|
-
readonly hasDataChange: ChangeEvent<boolean>;
|
|
51
47
|
/**
|
|
52
48
|
* A codec the browser reported as supported failed to decode on append and
|
|
53
49
|
* has been denylisted. Dispatched instead of `error` so the media can be
|
|
@@ -83,10 +79,6 @@ export interface BufferingController extends ReadonlyEventHost<BufferingControll
|
|
|
83
79
|
* True if the stream has buffered the last segment.
|
|
84
80
|
*/
|
|
85
81
|
readonly bufferingEnded: boolean;
|
|
86
|
-
/**
|
|
87
|
-
* True while the buffer holds any data (false when empty or cleared).
|
|
88
|
-
*/
|
|
89
|
-
readonly hasData: boolean;
|
|
90
82
|
/**
|
|
91
83
|
* Begins buffering.
|
|
92
84
|
*/
|
|
@@ -163,7 +155,6 @@ export declare class BufferingControllerImpl extends EventHostImpl<BufferingCont
|
|
|
163
155
|
private reopen;
|
|
164
156
|
private _error;
|
|
165
157
|
private _bufferingEnded;
|
|
166
|
-
private _hasData;
|
|
167
158
|
private readonly queue;
|
|
168
159
|
private disposer;
|
|
169
160
|
private _active;
|
|
@@ -224,8 +215,6 @@ export declare class BufferingControllerImpl extends EventHostImpl<BufferingCont
|
|
|
224
215
|
*/
|
|
225
216
|
private get mediaSourceClosed();
|
|
226
217
|
get bufferingEnded(): boolean;
|
|
227
|
-
get hasData(): boolean;
|
|
228
|
-
private setHasData;
|
|
229
218
|
private readonly handleError;
|
|
230
219
|
/**
|
|
231
220
|
* Attempts to recover from a SourceBuffer decode/append failure caused by a
|
|
@@ -20,13 +20,17 @@ export interface DashMediaQualityMetadataResolverDeps {
|
|
|
20
20
|
}
|
|
21
21
|
export declare function createMediaQualityMetadataFromDashRepresentation(representation: RepresentationType, deps: DashMediaQualityMetadataResolverDeps): MediaQualityMetadata;
|
|
22
22
|
/**
|
|
23
|
-
* Estimates the total bandwidth a representation
|
|
24
|
-
*
|
|
23
|
+
* Estimates the total bandwidth a representation uses alongside sibling content
|
|
24
|
+
* types, pairing it with the cheapest sibling rendition in its proportional
|
|
25
|
+
* bucket.
|
|
25
26
|
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* sibling
|
|
29
|
-
*
|
|
27
|
+
* Each content type's sorted list is split into as many buckets as this
|
|
28
|
+
* representation's own list has tiers; the representation is paired with the
|
|
29
|
+
* cheapest sibling rendition in the matching bucket. A stream with few tiers
|
|
30
|
+
* therefore stays selected across the span of a finer sibling's tiers (e.g. the
|
|
31
|
+
* top audio across the top half of video tiers) rather than being pinned to a
|
|
32
|
+
* single endpoint — with video [v1..v4] and audio [a1,a2], a1's bucket is
|
|
33
|
+
* v1..v2 so a1 pairs with v2, and a2's bucket is v3..v4 so a2 pairs with v4.
|
|
30
34
|
*/
|
|
31
35
|
export declare function estimatePeakBandwidth(representation: RepresentationType, contentType: ContentType): number;
|
|
32
36
|
/**
|
|
@@ -107,7 +107,7 @@ export declare function createDashFactories(options: Maybe<DashInitOptions>): (d
|
|
|
107
107
|
readonly manifestTransformed: ObservableValue<Promise<DashManifestData>>;
|
|
108
108
|
readonly options: ObservableValue<Pick<VinylOptions, "text">>;
|
|
109
109
|
}) => SidecarTextTrackController;
|
|
110
|
-
options: import("@amazon/vinyl-di").Factory<ObservableValue<Pick<VinylOptions, "
|
|
110
|
+
options: import("@amazon/vinyl-di").Factory<ObservableValue<Pick<VinylOptions, "text" | "audio" | "abr" | "allowedContentTypes">>>;
|
|
111
111
|
playbackController: import("@amazon/vinyl-di").Factory<PlaybackController>;
|
|
112
112
|
playbackSource: import("@amazon/vinyl-di").Factory<PlaybackSource>;
|
|
113
113
|
drmKeySystemResolver: import("@amazon/vinyl-di").Factory<DrmKeySystemResolver>;
|
|
@@ -36,6 +36,12 @@ export declare function calculatePeriodTimeRange(period: PeriodType): PeriodRang
|
|
|
36
36
|
*
|
|
37
37
|
* In a static presentation, the first period SHALL start at the zero point of the MPD timeline (with a
|
|
38
38
|
* Period@start value of 0 seconds).
|
|
39
|
+
*
|
|
40
|
+
* When `Period@start` is absent, the start is derived from the sum of the
|
|
41
|
+
* preceding periods' `Period@duration` values, per the PeriodStart derivation
|
|
42
|
+
* in ISO/IEC 23009-1 §5.3.2.1. This is common in on-demand manifests that
|
|
43
|
+
* declare only per-period durations (no explicit `@start`, no
|
|
44
|
+
* `MPD@mediaPresentationDuration`).
|
|
39
45
|
*/
|
|
40
46
|
export declare function calculatePeriodStart(period: PeriodType): number;
|
|
41
47
|
/**
|
|
@@ -3,6 +3,10 @@ import { MediaFormatMetadata } from '../../streaming/MediaQualityMetadata';
|
|
|
3
3
|
export declare function throwMimeTypesUnsupported(): never;
|
|
4
4
|
/**
|
|
5
5
|
* Returns true when the media's codec and container is supported.
|
|
6
|
+
*
|
|
7
|
+
* Both ISO-BMFF (MP4/fMP4) and WebM containers are supported: the DASH
|
|
8
|
+
* `SegmentBase` indexer reads ISO-BMFF `sidx` boxes or WebM EBML `Cues` as
|
|
9
|
+
* appropriate, and MSE appends each to a matching SourceBuffer.
|
|
6
10
|
*/
|
|
7
11
|
export declare function canPlayMimeType(deps: {
|
|
8
12
|
readonly capabilities: Capabilities;
|
|
@@ -1,13 +1,27 @@
|
|
|
1
1
|
import { MediaQualityMetadata } from '../../streaming/MediaQualityMetadata';
|
|
2
2
|
import { Capabilities } from '../../client/Capabilities';
|
|
3
3
|
export declare function throwSamplingRatesUnsupported(): never;
|
|
4
|
+
export interface AudioSampleRateRangeOptions {
|
|
5
|
+
readonly capabilities: Capabilities;
|
|
6
|
+
/**
|
|
7
|
+
* An explicit maximum sampling rate that takes precedence over the
|
|
8
|
+
* platform's `AudioContext`-reported output rate when set.
|
|
9
|
+
*/
|
|
10
|
+
readonly maxSampleRate?: number | null;
|
|
11
|
+
/** An optional minimum sampling-rate floor. */
|
|
12
|
+
readonly minSampleRate?: number | null;
|
|
13
|
+
}
|
|
4
14
|
/**
|
|
5
|
-
* Returns true when the media's sampling rate is supported.
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
15
|
+
* Returns true when the media's sampling rate is within the supported range.
|
|
16
|
+
* Only audio content types are gated; every other content type passes through.
|
|
17
|
+
*
|
|
18
|
+
* The upper bound is `maxSampleRate` when set, otherwise the platform's
|
|
19
|
+
* `AudioContext`-reported output rate (Firefox is hard-capped at 48kHz, which it
|
|
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.
|
|
9
25
|
*/
|
|
10
|
-
export declare function
|
|
11
|
-
readonly capabilities: Capabilities;
|
|
12
|
-
}, metadata: MediaQualityMetadata, _index: number, array: ArrayLike<MediaQualityMetadata>): boolean;
|
|
26
|
+
export declare function withinAudioSampleRateRange(options: AudioSampleRateRangeOptions, metadata: MediaQualityMetadata, _index: number, array: ArrayLike<MediaQualityMetadata>): boolean;
|
|
13
27
|
//# sourceMappingURL=sampleRateFilter.d.ts.map
|
|
@@ -96,7 +96,7 @@ export declare function createHlsFactories(options: Maybe<HlsInitOptions>): (dep
|
|
|
96
96
|
readonly manifestTransformed: ObservableValue<Promise<HlsManifestData>>;
|
|
97
97
|
readonly options: ObservableValue<Pick<VinylOptions, "text">>;
|
|
98
98
|
}) => SidecarTextTrackController;
|
|
99
|
-
options: import("@amazon/vinyl-di").Factory<ObservableValue<Pick<VinylOptions, "
|
|
99
|
+
options: import("@amazon/vinyl-di").Factory<ObservableValue<Pick<VinylOptions, "text" | "audio" | "abr" | "allowedContentTypes">>>;
|
|
100
100
|
playbackController: import("@amazon/vinyl-di").Factory<PlaybackController>;
|
|
101
101
|
playbackSource: import("@amazon/vinyl-di").Factory<PlaybackSource>;
|
|
102
102
|
drmKeySystemResolver: import("@amazon/vinyl-di").Factory<DrmKeySystemResolver>;
|