@amazon/vinyl 1.1.1 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +276 -200
- package/dist/index.cjs.map +4 -4
- package/dist/index.js +280 -203
- package/dist/index.js.map +4 -4
- package/dist/test/benchmark.es5.js +169 -232
- package/dist/test/benchmark.js +1475 -1933
- package/dist/test/benchmark.js.map +4 -4
- package/dist/test/integ.es5.js +771 -394
- package/dist/test/integ.js +6063 -5273
- package/dist/test/integ.js.map +4 -4
- package/dist/test/jasmineHtml.es5.js +8 -8
- package/dist/test/jasmineHtml.js +8 -4
- package/dist/test/jasmineHtml.js.map +3 -3
- package/dist/types/current/client/Capabilities.d.ts.map +1 -1
- package/dist/types/current/client/CapabilitiesImpl.d.ts.map +1 -1
- package/dist/types/current/drm/DrmController.d.ts +2 -2
- package/dist/types/current/drm/DrmController.d.ts.map +1 -1
- package/dist/types/current/drm/DrmControllerImpl.d.ts +3 -3
- package/dist/types/current/drm/DrmControllerImpl.d.ts.map +1 -1
- package/dist/types/current/drm/DrmControllerImpl.js +7 -7
- package/dist/types/current/drm/DrmKeySystemResolver.d.ts +1 -1
- package/dist/types/current/drm/DrmKeySystemResolver.d.ts.map +1 -1
- package/dist/types/current/drm/DrmKeySystemResolver.js +1 -1
- package/dist/types/current/drm/DrmOptions.d.ts +1 -1
- package/dist/types/current/drm/DrmOptions.d.ts.map +1 -1
- package/dist/types/current/drm/DrmOptions.js +1 -1
- package/dist/types/current/drm/commonEme/CommonEme.d.ts +2 -2
- package/dist/types/current/drm/commonEme/CommonEme.d.ts.map +1 -1
- package/dist/types/current/drm/commonEme/CommonEmeFactory.d.ts +1 -1
- package/dist/types/current/drm/commonEme/CommonEmeFactory.d.ts.map +1 -1
- package/dist/types/current/drm/commonEme/MsCommonEme.d.ts +1 -1
- package/dist/types/current/drm/commonEme/MsCommonEme.d.ts.map +1 -1
- package/dist/types/current/drm/commonEme/MsCommonEme.js +1 -1
- package/dist/types/current/drm/commonEme/StandardCommonEme.d.ts +1 -1
- package/dist/types/current/drm/commonEme/StandardCommonEme.d.ts.map +1 -1
- package/dist/types/current/drm/commonEme/WebKitCommonEme.d.ts +2 -2
- package/dist/types/current/drm/commonEme/WebKitCommonEme.d.ts.map +1 -1
- package/dist/types/current/drm/commonEme/WebKitCommonEme.js +1 -1
- package/dist/types/current/drm/commonEme/createDrmErrorHandler.js +1 -1
- package/dist/types/current/drm/licenseProvider/LicenseProvider.d.ts +1 -1
- package/dist/types/current/drm/licenseProvider/LicenseProvider.d.ts.map +1 -1
- package/dist/types/current/global/environment.d.ts +6 -2
- package/dist/types/current/global/environment.d.ts.map +1 -1
- package/dist/types/current/global/environment.js +4 -3
- package/dist/types/current/global/initializeVinylGlobal.js +1 -1
- package/dist/types/current/patch/media/MediaElementPatchOptions.js +1 -1
- package/dist/types/current/patch/media/patchMediaElement.js +1 -1
- package/dist/types/current/patch/media/patches/createPreventStallsPatch.d.ts +1 -1
- package/dist/types/current/patch/media/patches/createPreventStallsPatch.d.ts.map +1 -1
- package/dist/types/current/patch/media/patches/createUnreliablePlaybackEventsPatch.d.ts +1 -1
- package/dist/types/current/patch/media/patches/createUnreliablePlaybackEventsPatch.d.ts.map +1 -1
- package/dist/types/current/playback/PlaybackControllerImpl.d.ts +1 -1
- package/dist/types/current/playback/PlaybackControllerImpl.d.ts.map +1 -1
- package/dist/types/current/playback/PlaybackControllerImpl.js +4 -4
- package/dist/types/current/playback/ReadonlyPlaybackController.d.ts.map +1 -1
- package/dist/types/current/playback/error/ReportableMediaError.js +1 -1
- package/dist/types/current/playback/logging/playbackStateLoggingHandler.d.ts +1 -1
- package/dist/types/current/playback/logging/playbackStateLoggingHandler.d.ts.map +1 -1
- package/dist/types/current/playback/logging/playbackStateLoggingHandler.js +1 -1
- package/dist/types/current/playback/nextHasMetadata.d.ts +1 -1
- package/dist/types/current/playback/nextHasMetadata.d.ts.map +1 -1
- package/dist/types/current/streaming/ContentStream.d.ts +4 -4
- package/dist/types/current/streaming/ContentStream.d.ts.map +1 -1
- package/dist/types/current/streaming/ContentStreamingOptions.d.ts +2 -2
- package/dist/types/current/streaming/ContentStreamingOptions.d.ts.map +1 -1
- package/dist/types/current/streaming/MediaQualityMetadata.d.ts +2 -2
- package/dist/types/current/streaming/MediaQualityMetadata.d.ts.map +1 -1
- package/dist/types/current/streaming/MediaQualityMetadata.js +1 -1
- package/dist/types/current/streaming/MediaTimeline.d.ts +6 -5
- package/dist/types/current/streaming/MediaTimeline.d.ts.map +1 -1
- package/dist/types/current/streaming/SegmentController.d.ts +2 -7
- package/dist/types/current/streaming/SegmentController.d.ts.map +1 -1
- package/dist/types/current/streaming/SegmentControllerImpl.d.ts +5 -6
- package/dist/types/current/streaming/SegmentControllerImpl.d.ts.map +1 -1
- package/dist/types/current/streaming/SegmentControllerImpl.js +5 -15
- package/dist/types/current/streaming/SegmentReference.d.ts +1 -1
- package/dist/types/current/streaming/SegmentReference.d.ts.map +1 -1
- package/dist/types/current/streaming/StreamingEventMap.d.ts +1 -1
- package/dist/types/current/streaming/StreamingEventMap.d.ts.map +1 -1
- package/dist/types/current/streaming/abr/QualitySelector.d.ts +1 -1
- package/dist/types/current/streaming/abr/QualitySelector.d.ts.map +1 -1
- package/dist/types/current/streaming/abr/QualitySelectorImpl.d.ts +18 -3
- package/dist/types/current/streaming/abr/QualitySelectorImpl.d.ts.map +1 -1
- package/dist/types/current/streaming/abr/QualitySelectorImpl.js +8 -2
- package/dist/types/current/streaming/buffering/BufferingController.d.ts +3 -13
- package/dist/types/current/streaming/buffering/BufferingController.d.ts.map +1 -1
- package/dist/types/current/streaming/buffering/BufferingController.js +1 -24
- package/dist/types/current/streaming/buffering/MediaSourceController.d.ts +41 -15
- package/dist/types/current/streaming/buffering/MediaSourceController.d.ts.map +1 -1
- package/dist/types/current/streaming/buffering/MediaSourceController.js +74 -17
- package/dist/types/current/streaming/buffering/SourceBufferController.d.ts +1 -1
- package/dist/types/current/streaming/buffering/SourceBufferController.d.ts.map +1 -1
- package/dist/types/current/streaming/createDefaultMediaTimelineTransformer.d.ts +1 -1
- package/dist/types/current/streaming/createDefaultMediaTimelineTransformer.d.ts.map +1 -1
- package/dist/types/current/streaming/createDefaultMediaTimelineTransformer.js +2 -2
- package/dist/types/current/streaming/mediaTimelineFilter.d.ts +3 -3
- package/dist/types/current/streaming/mediaTimelineFilter.d.ts.map +1 -1
- package/dist/types/current/streaming/mediaTimelineFilter.js +1 -1
- package/dist/types/current/streaming/mediaTimelineLanguageFilter.d.ts +1 -1
- package/dist/types/current/streaming/mediaTimelineLanguageFilter.d.ts.map +1 -1
- package/dist/types/current/streaming/util/segment.d.ts +1 -1
- package/dist/types/current/streaming/util/segment.d.ts.map +1 -1
- package/dist/types/current/track/AutoResetController.d.ts +37 -12
- package/dist/types/current/track/AutoResetController.d.ts.map +1 -1
- package/dist/types/current/track/AutoResetController.js +38 -28
- package/dist/types/current/track/Track.d.ts.map +1 -1
- package/dist/types/current/track/TrackBase.d.ts.map +1 -1
- package/dist/types/current/track/TrackController.d.ts +2 -2
- package/dist/types/current/track/TrackController.d.ts.map +1 -1
- package/dist/types/current/track/TrackFactory.d.ts +1 -1
- package/dist/types/current/track/TrackFactory.d.ts.map +1 -1
- package/dist/types/current/track/createSegmentDataProvider.d.ts.map +1 -1
- package/dist/types/current/track/createVinylTrackFactories.d.ts +5 -5
- package/dist/types/current/track/createVinylTrackFactories.d.ts.map +1 -1
- package/dist/types/current/track/createVinylTrackFactories.js +4 -4
- package/dist/types/current/track/dash/DashManifestController.d.ts +1 -1
- package/dist/types/current/track/dash/DashManifestController.d.ts.map +1 -1
- package/dist/types/current/track/dash/DashMediaQualityMetadataResolver.d.ts.map +1 -1
- package/dist/types/current/track/dash/DashMediaQualityMetadataResolver.js +1 -1
- package/dist/types/current/track/dash/DashTrack.d.ts +4 -4
- package/dist/types/current/track/dash/DashTrack.d.ts.map +1 -1
- package/dist/types/current/track/dash/DashTrack.js +2 -2
- package/dist/types/current/track/dash/buildDashMediaTimeline.d.ts +2 -2
- package/dist/types/current/track/dash/buildDashMediaTimeline.d.ts.map +1 -1
- package/dist/types/current/track/dash/buildDashMediaTimeline.js +2 -2
- package/dist/types/current/track/dash/createDashContentStreamFactories.d.ts.map +1 -1
- package/dist/types/current/track/dash/createDashContentTypesValue.d.ts +2 -2
- package/dist/types/current/track/dash/createDashContentTypesValue.d.ts.map +1 -1
- package/dist/types/current/track/dash/createDashContentTypesValue.js +1 -1
- package/dist/types/current/track/dash/createDashFactories.d.ts +12 -12
- package/dist/types/current/track/dash/createDashFactories.d.ts.map +1 -1
- package/dist/types/current/track/dash/createDashFactories.js +8 -8
- package/dist/types/current/track/dash/createDashManifestProvider.d.ts +1 -1
- package/dist/types/current/track/dash/createDashManifestProvider.d.ts.map +1 -1
- package/dist/types/current/track/dash/createDashManifestProvider.js +1 -1
- package/dist/types/current/track/dash/createDefaultDashManifestTransformer.d.ts +1 -1
- package/dist/types/current/track/dash/createDefaultDashManifestTransformer.d.ts.map +1 -1
- package/dist/types/current/track/dash/createDefaultDashManifestTransformer.js +1 -1
- package/dist/types/current/track/dash/createSegmentControllerFactory.d.ts.map +1 -1
- package/dist/types/current/track/dash/manifestTransformUtils.d.ts +1 -1
- package/dist/types/current/track/dash/manifestTransformUtils.d.ts.map +1 -1
- package/dist/types/current/track/dash/timeline/DashRepresentationSegmentProvider.d.ts +3 -3
- package/dist/types/current/track/dash/timeline/DashRepresentationSegmentProvider.d.ts.map +1 -1
- package/dist/types/current/track/dash/timeline/DashRepresentationSegmentProvider.js +3 -3
- package/dist/types/current/track/dash/urlDashManifestProvider.d.ts +1 -1
- package/dist/types/current/track/dash/urlDashManifestProvider.d.ts.map +1 -1
- package/dist/types/current/track/dash/util/mimeType.d.ts.map +1 -1
- package/dist/types/current/track/dash/util/mimeType.js +1 -1
- package/dist/types/current/track/dash/util/mpd.d.ts +3 -2
- package/dist/types/current/track/dash/util/mpd.d.ts.map +1 -1
- package/dist/types/current/track/dash/util/mpd.js +13 -3
- package/dist/types/current/track/dash/util/uriResolution.js +1 -1
- package/dist/types/current/track/filters/keySystemFilter.d.ts.map +1 -1
- package/dist/types/current/track/filters/resourceTypeFilter.d.ts.map +1 -1
- package/dist/types/current/track/filters/sampleRateFilter.d.ts.map +1 -1
- package/dist/types/current/track/hls/HlsTrack.d.ts.map +1 -1
- package/dist/types/current/track/hls/buildHlsMediaTimeline.d.ts +3 -3
- package/dist/types/current/track/hls/buildHlsMediaTimeline.d.ts.map +1 -1
- package/dist/types/current/track/hls/buildHlsMediaTimeline.js +16 -14
- package/dist/types/current/track/hls/createDefaultHlsManifestTransformer.d.ts +1 -1
- package/dist/types/current/track/hls/createDefaultHlsManifestTransformer.d.ts.map +1 -1
- package/dist/types/current/track/hls/createHlsContentStreamFactories.d.ts.map +1 -1
- package/dist/types/current/track/hls/util/hlsSegmentTime.d.ts +1 -1
- package/dist/types/current/track/hls/util/hlsSegmentTime.d.ts.map +1 -1
- package/dist/types/current/track/hls/util/hlsSegmentTime.js +1 -1
- package/dist/types/current/track/mse/MseTrack.d.ts +2 -2
- package/dist/types/current/track/mse/MseTrack.d.ts.map +1 -1
- package/dist/types/current/track/mse/MseTrack.js +2 -1
- package/dist/types/current/track/mse/codec.d.ts.map +1 -1
- package/dist/types/current/track/source/FixedPlaybackQuality.d.ts +1 -1
- package/dist/types/current/track/source/FixedPlaybackQuality.d.ts.map +1 -1
- package/dist/types/current/track/source/SourceObjectTrack.d.ts +4 -4
- package/dist/types/current/track/source/SourceObjectTrack.d.ts.map +1 -1
- package/dist/types/current/track/source/SourceObjectTrack.js +2 -2
- package/dist/types/current/track/source/SourceTrack.d.ts +4 -4
- package/dist/types/current/track/source/SourceTrack.d.ts.map +1 -1
- package/dist/types/current/track/source/SourceTrack.js +2 -2
- package/dist/types/current/track/source/SourceTrackBase.d.ts +2 -2
- package/dist/types/current/track/source/SourceTrackBase.d.ts.map +1 -1
- package/dist/types/current/track/source/SourceTrackBase.js +2 -2
- package/dist/types/current/tsconfig.tsbuildinfo +1 -1
- package/dist/types/current/vinyl/ReadonlyPlaybackStreamingState.d.ts.map +1 -1
- package/dist/types/current/vinyl/VinylDeps.d.ts +1 -1
- package/dist/types/current/vinyl/VinylDeps.d.ts.map +1 -1
- package/dist/types/current/vinyl/VinylOptions.d.ts.map +1 -1
- package/dist/types/current/vinyl/VinylPatchOptions.d.ts.map +1 -1
- package/dist/types/current/vinyl/VinylPlayer.d.ts +26 -2
- package/dist/types/current/vinyl/VinylPlayer.d.ts.map +1 -1
- package/dist/types/current/vinyl/VinylPlayer.js +18 -3
- package/dist/types/current/vinyl/createVinylFactories.d.ts +9 -11
- package/dist/types/current/vinyl/createVinylFactories.d.ts.map +1 -1
- package/dist/types/current/vinyl/createVinylFactories.js +2 -2
- package/dist/types/ts3.7/drm/DrmController.d.ts +2 -2
- package/dist/types/ts3.7/drm/DrmControllerImpl.d.ts +3 -3
- package/dist/types/ts3.7/drm/DrmKeySystemResolver.d.ts +1 -1
- package/dist/types/ts3.7/drm/DrmOptions.d.ts +1 -1
- package/dist/types/ts3.7/drm/commonEme/CommonEme.d.ts +2 -2
- package/dist/types/ts3.7/drm/commonEme/CommonEmeFactory.d.ts +1 -1
- package/dist/types/ts3.7/drm/commonEme/MsCommonEme.d.ts +1 -1
- package/dist/types/ts3.7/drm/commonEme/StandardCommonEme.d.ts +1 -1
- package/dist/types/ts3.7/drm/commonEme/WebKitCommonEme.d.ts +2 -2
- package/dist/types/ts3.7/drm/licenseProvider/LicenseProvider.d.ts +1 -1
- package/dist/types/ts3.7/global/environment.d.ts +6 -2
- package/dist/types/ts3.7/patch/media/patches/createPreventStallsPatch.d.ts +1 -1
- package/dist/types/ts3.7/patch/media/patches/createUnreliablePlaybackEventsPatch.d.ts +1 -1
- package/dist/types/ts3.7/playback/PlaybackControllerImpl.d.ts +1 -1
- package/dist/types/ts3.7/playback/logging/playbackStateLoggingHandler.d.ts +1 -1
- package/dist/types/ts3.7/playback/nextHasMetadata.d.ts +1 -1
- package/dist/types/ts3.7/streaming/ContentStream.d.ts +4 -4
- package/dist/types/ts3.7/streaming/ContentStreamingOptions.d.ts +2 -2
- package/dist/types/ts3.7/streaming/MediaQualityMetadata.d.ts +2 -2
- package/dist/types/ts3.7/streaming/MediaTimeline.d.ts +6 -5
- package/dist/types/ts3.7/streaming/SegmentController.d.ts +2 -7
- package/dist/types/ts3.7/streaming/SegmentControllerImpl.d.ts +5 -6
- package/dist/types/ts3.7/streaming/SegmentReference.d.ts +1 -1
- package/dist/types/ts3.7/streaming/StreamingEventMap.d.ts +1 -1
- package/dist/types/ts3.7/streaming/abr/QualitySelector.d.ts +1 -1
- package/dist/types/ts3.7/streaming/abr/QualitySelectorImpl.d.ts +18 -3
- package/dist/types/ts3.7/streaming/buffering/BufferingController.d.ts +3 -13
- package/dist/types/ts3.7/streaming/buffering/MediaSourceController.d.ts +41 -15
- package/dist/types/ts3.7/streaming/buffering/SourceBufferController.d.ts +1 -1
- package/dist/types/ts3.7/streaming/createDefaultMediaTimelineTransformer.d.ts +1 -1
- package/dist/types/ts3.7/streaming/mediaTimelineFilter.d.ts +3 -3
- package/dist/types/ts3.7/streaming/mediaTimelineLanguageFilter.d.ts +1 -1
- package/dist/types/ts3.7/streaming/util/segment.d.ts +1 -1
- package/dist/types/ts3.7/track/AutoResetController.d.ts +37 -12
- package/dist/types/ts3.7/track/TrackController.d.ts +2 -2
- package/dist/types/ts3.7/track/TrackFactory.d.ts +1 -1
- package/dist/types/ts3.7/track/createVinylTrackFactories.d.ts +5 -5
- package/dist/types/ts3.7/track/dash/DashManifestController.d.ts +1 -1
- package/dist/types/ts3.7/track/dash/DashTrack.d.ts +4 -4
- package/dist/types/ts3.7/track/dash/buildDashMediaTimeline.d.ts +2 -2
- package/dist/types/ts3.7/track/dash/createDashContentTypesValue.d.ts +2 -2
- package/dist/types/ts3.7/track/dash/createDashFactories.d.ts +12 -12
- package/dist/types/ts3.7/track/dash/createDashManifestProvider.d.ts +1 -1
- package/dist/types/ts3.7/track/dash/createDefaultDashManifestTransformer.d.ts +1 -1
- package/dist/types/ts3.7/track/dash/manifestTransformUtils.d.ts +1 -1
- package/dist/types/ts3.7/track/dash/timeline/DashRepresentationSegmentProvider.d.ts +3 -3
- package/dist/types/ts3.7/track/dash/urlDashManifestProvider.d.ts +1 -1
- package/dist/types/ts3.7/track/dash/util/mpd.d.ts +3 -2
- package/dist/types/ts3.7/track/hls/buildHlsMediaTimeline.d.ts +3 -3
- package/dist/types/ts3.7/track/hls/createDefaultHlsManifestTransformer.d.ts +1 -1
- package/dist/types/ts3.7/track/hls/util/hlsSegmentTime.d.ts +1 -1
- package/dist/types/ts3.7/track/mse/MseTrack.d.ts +2 -2
- package/dist/types/ts3.7/track/source/FixedPlaybackQuality.d.ts +1 -1
- package/dist/types/ts3.7/track/source/SourceObjectTrack.d.ts +4 -4
- package/dist/types/ts3.7/track/source/SourceTrack.d.ts +4 -4
- package/dist/types/ts3.7/track/source/SourceTrackBase.d.ts +2 -2
- package/dist/types/ts3.7/vinyl/VinylDeps.d.ts +1 -1
- package/dist/types/ts3.7/vinyl/VinylPlayer.d.ts +18 -2
- package/dist/types/ts3.7/vinyl/createVinylFactories.d.ts +9 -11
- package/dist/types/ts4.1/drm/DrmController.d.ts +2 -2
- package/dist/types/ts4.1/drm/DrmControllerImpl.d.ts +3 -3
- package/dist/types/ts4.1/drm/DrmKeySystemResolver.d.ts +1 -1
- package/dist/types/ts4.1/drm/DrmOptions.d.ts +1 -1
- package/dist/types/ts4.1/drm/commonEme/CommonEme.d.ts +2 -2
- package/dist/types/ts4.1/drm/commonEme/CommonEmeFactory.d.ts +1 -1
- package/dist/types/ts4.1/drm/commonEme/MsCommonEme.d.ts +1 -1
- package/dist/types/ts4.1/drm/commonEme/StandardCommonEme.d.ts +1 -1
- package/dist/types/ts4.1/drm/commonEme/WebKitCommonEme.d.ts +2 -2
- package/dist/types/ts4.1/drm/licenseProvider/LicenseProvider.d.ts +1 -1
- package/dist/types/ts4.1/global/environment.d.ts +6 -2
- package/dist/types/ts4.1/patch/media/patches/createPreventStallsPatch.d.ts +1 -1
- package/dist/types/ts4.1/patch/media/patches/createUnreliablePlaybackEventsPatch.d.ts +1 -1
- package/dist/types/ts4.1/playback/PlaybackControllerImpl.d.ts +1 -1
- package/dist/types/ts4.1/playback/logging/playbackStateLoggingHandler.d.ts +1 -1
- package/dist/types/ts4.1/playback/nextHasMetadata.d.ts +1 -1
- package/dist/types/ts4.1/streaming/ContentStream.d.ts +4 -4
- package/dist/types/ts4.1/streaming/ContentStreamingOptions.d.ts +2 -2
- package/dist/types/ts4.1/streaming/MediaQualityMetadata.d.ts +2 -2
- package/dist/types/ts4.1/streaming/MediaTimeline.d.ts +6 -5
- package/dist/types/ts4.1/streaming/SegmentController.d.ts +2 -7
- package/dist/types/ts4.1/streaming/SegmentControllerImpl.d.ts +5 -6
- package/dist/types/ts4.1/streaming/SegmentReference.d.ts +1 -1
- package/dist/types/ts4.1/streaming/StreamingEventMap.d.ts +1 -1
- package/dist/types/ts4.1/streaming/abr/QualitySelector.d.ts +1 -1
- package/dist/types/ts4.1/streaming/abr/QualitySelectorImpl.d.ts +18 -3
- package/dist/types/ts4.1/streaming/buffering/BufferingController.d.ts +3 -13
- package/dist/types/ts4.1/streaming/buffering/MediaSourceController.d.ts +41 -15
- package/dist/types/ts4.1/streaming/buffering/SourceBufferController.d.ts +1 -1
- package/dist/types/ts4.1/streaming/createDefaultMediaTimelineTransformer.d.ts +1 -1
- package/dist/types/ts4.1/streaming/mediaTimelineFilter.d.ts +3 -3
- package/dist/types/ts4.1/streaming/mediaTimelineLanguageFilter.d.ts +1 -1
- package/dist/types/ts4.1/streaming/util/segment.d.ts +1 -1
- package/dist/types/ts4.1/track/AutoResetController.d.ts +37 -12
- package/dist/types/ts4.1/track/TrackController.d.ts +2 -2
- package/dist/types/ts4.1/track/TrackFactory.d.ts +1 -1
- package/dist/types/ts4.1/track/createVinylTrackFactories.d.ts +5 -5
- package/dist/types/ts4.1/track/dash/DashManifestController.d.ts +1 -1
- package/dist/types/ts4.1/track/dash/DashTrack.d.ts +4 -4
- package/dist/types/ts4.1/track/dash/buildDashMediaTimeline.d.ts +2 -2
- package/dist/types/ts4.1/track/dash/createDashContentTypesValue.d.ts +2 -2
- package/dist/types/ts4.1/track/dash/createDashFactories.d.ts +12 -12
- package/dist/types/ts4.1/track/dash/createDashManifestProvider.d.ts +1 -1
- package/dist/types/ts4.1/track/dash/createDefaultDashManifestTransformer.d.ts +1 -1
- package/dist/types/ts4.1/track/dash/manifestTransformUtils.d.ts +1 -1
- package/dist/types/ts4.1/track/dash/timeline/DashRepresentationSegmentProvider.d.ts +3 -3
- package/dist/types/ts4.1/track/dash/urlDashManifestProvider.d.ts +1 -1
- package/dist/types/ts4.1/track/dash/util/mpd.d.ts +3 -2
- package/dist/types/ts4.1/track/hls/buildHlsMediaTimeline.d.ts +3 -3
- package/dist/types/ts4.1/track/hls/createDefaultHlsManifestTransformer.d.ts +1 -1
- package/dist/types/ts4.1/track/hls/util/hlsSegmentTime.d.ts +1 -1
- package/dist/types/ts4.1/track/mse/MseTrack.d.ts +3 -3
- package/dist/types/ts4.1/track/source/FixedPlaybackQuality.d.ts +1 -1
- package/dist/types/ts4.1/track/source/SourceObjectTrack.d.ts +5 -5
- package/dist/types/ts4.1/track/source/SourceTrack.d.ts +5 -5
- package/dist/types/ts4.1/track/source/SourceTrackBase.d.ts +3 -3
- package/dist/types/ts4.1/vinyl/VinylDeps.d.ts +1 -1
- package/dist/types/ts4.1/vinyl/VinylPlayer.d.ts +18 -2
- package/dist/types/ts4.1/vinyl/createVinylFactories.d.ts +9 -11
- package/dist/types/ts4.7/drm/DrmController.d.ts +2 -2
- package/dist/types/ts4.7/drm/DrmControllerImpl.d.ts +3 -3
- package/dist/types/ts4.7/drm/DrmKeySystemResolver.d.ts +1 -1
- package/dist/types/ts4.7/drm/DrmOptions.d.ts +1 -1
- package/dist/types/ts4.7/drm/commonEme/CommonEme.d.ts +2 -2
- package/dist/types/ts4.7/drm/commonEme/CommonEmeFactory.d.ts +1 -1
- package/dist/types/ts4.7/drm/commonEme/MsCommonEme.d.ts +1 -1
- package/dist/types/ts4.7/drm/commonEme/StandardCommonEme.d.ts +1 -1
- package/dist/types/ts4.7/drm/commonEme/WebKitCommonEme.d.ts +2 -2
- package/dist/types/ts4.7/drm/licenseProvider/LicenseProvider.d.ts +1 -1
- package/dist/types/ts4.7/global/environment.d.ts +6 -2
- package/dist/types/ts4.7/patch/media/patches/createPreventStallsPatch.d.ts +1 -1
- package/dist/types/ts4.7/patch/media/patches/createUnreliablePlaybackEventsPatch.d.ts +1 -1
- package/dist/types/ts4.7/playback/PlaybackControllerImpl.d.ts +1 -1
- package/dist/types/ts4.7/playback/logging/playbackStateLoggingHandler.d.ts +1 -1
- package/dist/types/ts4.7/playback/nextHasMetadata.d.ts +1 -1
- package/dist/types/ts4.7/streaming/ContentStream.d.ts +4 -4
- package/dist/types/ts4.7/streaming/ContentStreamingOptions.d.ts +2 -2
- package/dist/types/ts4.7/streaming/MediaQualityMetadata.d.ts +2 -2
- package/dist/types/ts4.7/streaming/MediaTimeline.d.ts +6 -5
- package/dist/types/ts4.7/streaming/SegmentController.d.ts +2 -7
- package/dist/types/ts4.7/streaming/SegmentControllerImpl.d.ts +5 -6
- package/dist/types/ts4.7/streaming/SegmentReference.d.ts +1 -1
- package/dist/types/ts4.7/streaming/StreamingEventMap.d.ts +1 -1
- package/dist/types/ts4.7/streaming/abr/QualitySelector.d.ts +1 -1
- package/dist/types/ts4.7/streaming/abr/QualitySelectorImpl.d.ts +18 -3
- package/dist/types/ts4.7/streaming/buffering/BufferingController.d.ts +3 -13
- package/dist/types/ts4.7/streaming/buffering/MediaSourceController.d.ts +41 -15
- package/dist/types/ts4.7/streaming/buffering/SourceBufferController.d.ts +1 -1
- package/dist/types/ts4.7/streaming/createDefaultMediaTimelineTransformer.d.ts +1 -1
- package/dist/types/ts4.7/streaming/mediaTimelineFilter.d.ts +3 -3
- package/dist/types/ts4.7/streaming/mediaTimelineLanguageFilter.d.ts +1 -1
- package/dist/types/ts4.7/streaming/util/segment.d.ts +1 -1
- package/dist/types/ts4.7/track/AutoResetController.d.ts +37 -12
- package/dist/types/ts4.7/track/TrackController.d.ts +2 -2
- package/dist/types/ts4.7/track/TrackFactory.d.ts +1 -1
- package/dist/types/ts4.7/track/createVinylTrackFactories.d.ts +5 -5
- package/dist/types/ts4.7/track/dash/DashManifestController.d.ts +1 -1
- package/dist/types/ts4.7/track/dash/DashTrack.d.ts +4 -4
- package/dist/types/ts4.7/track/dash/buildDashMediaTimeline.d.ts +2 -2
- package/dist/types/ts4.7/track/dash/createDashContentTypesValue.d.ts +2 -2
- package/dist/types/ts4.7/track/dash/createDashFactories.d.ts +12 -12
- package/dist/types/ts4.7/track/dash/createDashManifestProvider.d.ts +1 -1
- package/dist/types/ts4.7/track/dash/createDefaultDashManifestTransformer.d.ts +1 -1
- package/dist/types/ts4.7/track/dash/manifestTransformUtils.d.ts +1 -1
- package/dist/types/ts4.7/track/dash/timeline/DashRepresentationSegmentProvider.d.ts +3 -3
- package/dist/types/ts4.7/track/dash/urlDashManifestProvider.d.ts +1 -1
- package/dist/types/ts4.7/track/dash/util/mpd.d.ts +3 -2
- package/dist/types/ts4.7/track/hls/buildHlsMediaTimeline.d.ts +3 -3
- package/dist/types/ts4.7/track/hls/createDefaultHlsManifestTransformer.d.ts +1 -1
- package/dist/types/ts4.7/track/hls/util/hlsSegmentTime.d.ts +1 -1
- package/dist/types/ts4.7/track/mse/MseTrack.d.ts +2 -2
- package/dist/types/ts4.7/track/source/FixedPlaybackQuality.d.ts +1 -1
- package/dist/types/ts4.7/track/source/SourceObjectTrack.d.ts +4 -4
- package/dist/types/ts4.7/track/source/SourceTrack.d.ts +4 -4
- package/dist/types/ts4.7/track/source/SourceTrackBase.d.ts +2 -2
- package/dist/types/ts4.7/vinyl/VinylDeps.d.ts +1 -1
- package/dist/types/ts4.7/vinyl/VinylPlayer.d.ts +26 -2
- package/dist/types/ts4.7/vinyl/createVinylFactories.d.ts +9 -11
- package/dist/unit/types/current/streaming/MediaTimeline.test.js +6 -1
- package/dist/unit/types/current/streaming/MseTrack.test.js +4 -0
- package/dist/unit/types/current/streaming/SegmentControllerImpl.test.js +3 -33
- package/dist/unit/types/current/streaming/abr/QualitySelectorImpl.test.js +73 -0
- package/dist/unit/types/current/streaming/buffering/BufferingController.test.js +1 -41
- package/dist/unit/types/current/streaming/buffering/MediaSourceController.test.js +97 -17
- package/dist/unit/types/current/streaming/createDefaultMediaTimelineTransformer.test.js +6 -0
- package/dist/unit/types/current/streaming/mediaTimelineFilter.test.js +2 -0
- package/dist/unit/types/current/streaming/mediaTimelineLanguageFilter.test.js +7 -0
- package/dist/unit/types/current/track/AutoResetController.test.js +134 -22
- package/dist/unit/types/current/track/dash/createDashContentStreamFactories.test.js +5 -1
- package/dist/unit/types/current/track/dash/createSegmentControllerFactory.test.js +5 -1
- package/dist/unit/types/current/track/dash/util/mpd.test.js +29 -0
- package/dist/unit/types/current/track/hls/buildHlsMediaTimeline.test.js +16 -8
- package/dist/unit/types/current/track/hls/createHlsContentStreamFactories.test.js +5 -1
- package/dist/unit/types/current/tsconfig.tsbuildinfo +1 -1
- package/dist/unit/types/current/vinyl/VinylPlayer.test.js +35 -0
- package/dist/vinylTestUtil/index.js +20 -14
- package/dist/vinylTestUtil/index.js.map +2 -2
- package/dist/vinylTestUtil/types/current/media/FrequencyAnalyzer.js +1 -1
- package/dist/vinylTestUtil/types/current/mediaSource/ControlledMediaSource.d.ts.map +1 -1
- package/dist/vinylTestUtil/types/current/mock/dash/mockDashManifest.d.ts +12 -12
- package/dist/vinylTestUtil/types/current/mock/dom/ms/MockMSMediaKeySession.d.ts +2 -2
- package/dist/vinylTestUtil/types/current/mock/dom/webkit/MockWebKitMediaKeySession.d.ts +2 -2
- package/dist/vinylTestUtil/types/current/mock/player/MockVinylPlayerDependencies.d.ts +6 -6
- package/dist/vinylTestUtil/types/current/mock/player/MockVinylPlayerDependencies.d.ts.map +1 -1
- package/dist/vinylTestUtil/types/current/mock/player/MockVinylPlayerDependencies.js +7 -7
- package/dist/vinylTestUtil/types/current/mock/streaming/MockSegmentController.d.ts +0 -1
- package/dist/vinylTestUtil/types/current/mock/streaming/MockSegmentController.d.ts.map +1 -1
- package/dist/vinylTestUtil/types/current/mock/streaming/MockSegmentController.js +0 -1
- package/dist/vinylTestUtil/types/current/mock/streaming/buffering/MockMediaSourceController.d.ts +0 -1
- package/dist/vinylTestUtil/types/current/mock/streaming/buffering/MockMediaSourceController.d.ts.map +1 -1
- package/dist/vinylTestUtil/types/current/mock/streaming/buffering/MockMediaSourceController.js +0 -1
- package/dist/vinylTestUtil/types/current/mock/track/MockAutoResetController.d.ts +1 -0
- package/dist/vinylTestUtil/types/current/mock/track/MockAutoResetController.d.ts.map +1 -1
- package/dist/vinylTestUtil/types/current/mock/track/MockAutoResetController.js +1 -0
- package/dist/vinylTestUtil/types/current/mock/track/dash/createMockDashDependencies.d.ts +5 -5
- package/dist/vinylTestUtil/types/current/mock/track/dash/createMockDashDependencies.d.ts.map +1 -1
- package/dist/vinylTestUtil/types/current/mock/track/dash/createMockDashDependencies.js +11 -7
- package/dist/vinylTestUtil/types/current/mock/track/hls/createMockHlsDependencies.d.ts +5 -5
- package/dist/vinylTestUtil/types/current/mock/track/hls/createMockHlsDependencies.d.ts.map +1 -1
- package/dist/vinylTestUtil/types/current/mock/track/hls/createMockHlsDependencies.js +11 -7
- package/dist/vinylTestUtil/types/current/player/createVinylSuite.js +1 -1
- package/dist/vinylTestUtil/types/current/tsconfig.tsbuildinfo +1 -1
- package/dist/vinylTestUtil/types/current/util/playback/expectTrackCanSeek.js +1 -1
- package/dist/vinylTestUtil/types/current/util/playback/expectTrackPlays.js +2 -2
- package/dist/vinylTestUtil/types/current/util/playback/expectTrackPlaysUntil.d.ts.map +1 -1
- package/dist/vinylTestUtil/types/current/util/playback/expectTrackPlaysUntil.js +1 -2
- package/dist/vinylTestUtil/types/ts3.7/mock/dash/mockDashManifest.d.ts +12 -12
- package/dist/vinylTestUtil/types/ts3.7/mock/dom/ms/MockMSMediaKeySession.d.ts +2 -2
- package/dist/vinylTestUtil/types/ts3.7/mock/dom/webkit/MockWebKitMediaKeySession.d.ts +2 -2
- package/dist/vinylTestUtil/types/ts3.7/mock/player/MockVinylPlayerDependencies.d.ts +6 -6
- package/dist/vinylTestUtil/types/ts3.7/mock/streaming/MockSegmentController.d.ts +0 -1
- package/dist/vinylTestUtil/types/ts3.7/mock/streaming/buffering/MockMediaSourceController.d.ts +0 -1
- package/dist/vinylTestUtil/types/ts3.7/mock/track/MockAutoResetController.d.ts +1 -0
- package/dist/vinylTestUtil/types/ts3.7/mock/track/dash/createMockDashDependencies.d.ts +5 -5
- package/dist/vinylTestUtil/types/ts3.7/mock/track/hls/createMockHlsDependencies.d.ts +5 -5
- package/dist/vinylTestUtil/types/ts4.1/mock/dash/mockDashManifest.d.ts +12 -12
- package/dist/vinylTestUtil/types/ts4.1/mock/dom/ms/MockMSMediaKeySession.d.ts +2 -2
- package/dist/vinylTestUtil/types/ts4.1/mock/dom/webkit/MockWebKitMediaKeySession.d.ts +2 -2
- package/dist/vinylTestUtil/types/ts4.1/mock/player/MockVinylPlayerDependencies.d.ts +6 -6
- package/dist/vinylTestUtil/types/ts4.1/mock/streaming/MockSegmentController.d.ts +0 -1
- package/dist/vinylTestUtil/types/ts4.1/mock/streaming/buffering/MockMediaSourceController.d.ts +0 -1
- package/dist/vinylTestUtil/types/ts4.1/mock/track/MockAutoResetController.d.ts +1 -0
- package/dist/vinylTestUtil/types/ts4.1/mock/track/dash/createMockDashDependencies.d.ts +5 -5
- package/dist/vinylTestUtil/types/ts4.1/mock/track/hls/createMockHlsDependencies.d.ts +5 -5
- package/dist/vinylTestUtil/types/ts4.7/mock/dash/mockDashManifest.d.ts +12 -12
- package/dist/vinylTestUtil/types/ts4.7/mock/dom/ms/MockMSMediaKeySession.d.ts +2 -2
- package/dist/vinylTestUtil/types/ts4.7/mock/dom/webkit/MockWebKitMediaKeySession.d.ts +2 -2
- package/dist/vinylTestUtil/types/ts4.7/mock/player/MockVinylPlayerDependencies.d.ts +6 -6
- package/dist/vinylTestUtil/types/ts4.7/mock/streaming/MockSegmentController.d.ts +0 -1
- package/dist/vinylTestUtil/types/ts4.7/mock/streaming/buffering/MockMediaSourceController.d.ts +0 -1
- package/dist/vinylTestUtil/types/ts4.7/mock/track/MockAutoResetController.d.ts +1 -0
- package/dist/vinylTestUtil/types/ts4.7/mock/track/dash/createMockDashDependencies.d.ts +5 -5
- package/dist/vinylTestUtil/types/ts4.7/mock/track/hls/createMockHlsDependencies.d.ts +5 -5
- package/docs/USAGE.md +33 -0
- package/package.json +13 -15
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { DashTrackLoadOptions } from '
|
|
1
|
+
import type { DashTrackLoadOptions } from './DashTrack';
|
|
2
2
|
import { type Maybe, type RequestInterceptor } from '@amazon/vinyl-util';
|
|
3
|
-
import { createDefaultDashManifestTransformer } from '
|
|
3
|
+
import { createDefaultDashManifestTransformer } from './createDefaultDashManifestTransformer';
|
|
4
4
|
import { createMediaSource } from '../../util/media/mediaSource';
|
|
5
|
-
import { type DashMediaQualityMetadataResolverDeps } from '
|
|
5
|
+
import { type DashMediaQualityMetadataResolverDeps } from './DashMediaQualityMetadataResolver';
|
|
6
6
|
import { MediaSourceControllerImpl, type MediaSourceControllerImplDeps } from '../../streaming/buffering/MediaSourceController';
|
|
7
7
|
import type { PlaybackController } from '../../playback/PlaybackController';
|
|
8
|
-
import { type DashManifestController, type DashManifestControllerImplDeps } from '
|
|
8
|
+
import { type DashManifestController, type DashManifestControllerImplDeps } from './DashManifestController';
|
|
9
9
|
import type { DrmKeySystemResolver } from '../../drm/DrmKeySystemResolver';
|
|
10
10
|
import type { DrmController } from '../../drm/DrmController';
|
|
11
11
|
import type { Capabilities } from '../../client/Capabilities';
|
|
@@ -13,12 +13,12 @@ import { QualitySelectorImpl, type QualitySelectorImplOptions } from '../../stre
|
|
|
13
13
|
import type { PlaybackSource } from '../../playback/PlaybackSource';
|
|
14
14
|
import { createContentStreamFactory } from '../../streaming/ContentStream';
|
|
15
15
|
import type { ContentStreamingOptions } from '../../streaming/ContentStreamingOptions';
|
|
16
|
-
import { createDashContentTypesValue } from '
|
|
16
|
+
import { createDashContentTypesValue } from './createDashContentTypesValue';
|
|
17
17
|
import type { ObservableValue } from '@amazon/vinyl-observable';
|
|
18
18
|
import type { VinylOptions } from '../../vinyl/VinylOptions';
|
|
19
|
-
import { type BuildDashMediaTimelineDeps } from '
|
|
19
|
+
import { type BuildDashMediaTimelineDeps } from './buildDashMediaTimeline';
|
|
20
20
|
import { createDefaultMediaTimelineTransformer } from '../../streaming/createDefaultMediaTimelineTransformer';
|
|
21
|
-
import type { DashManifestData } from '
|
|
21
|
+
import type { DashManifestData } from './DashManifestProvider';
|
|
22
22
|
/**
|
|
23
23
|
* Player-level dependencies needed for the Dash-specific factories.
|
|
24
24
|
*/
|
|
@@ -43,20 +43,20 @@ export type DashInitOptions = {
|
|
|
43
43
|
*/
|
|
44
44
|
export declare function createDashFactories(options: Maybe<DashInitOptions>): (deps: DashFactoryDeps) => (loadOptions: DashTrackLoadOptions) => {
|
|
45
45
|
contentTypesValue: typeof createDashContentTypesValue;
|
|
46
|
-
baseUrlSelector: () => import("
|
|
46
|
+
baseUrlSelector: () => import("./util/uriResolution").BaseUrlSelector;
|
|
47
47
|
segmentRequestInit: () => Maybe<Readonly<Omit<RequestInit, "signal">>>;
|
|
48
48
|
manifestProvider: (deps: {
|
|
49
49
|
readonly requestInterceptor: RequestInterceptor;
|
|
50
|
-
}) => import("
|
|
50
|
+
}) => import("./DashManifestProvider").DashManifestProvider;
|
|
51
51
|
manifestController: (deps: DashManifestControllerImplDeps) => DashManifestController;
|
|
52
52
|
mediaSourceFactory: () => typeof createMediaSource;
|
|
53
|
-
mediaQualityMetadataResolver: (deps: DashMediaQualityMetadataResolverDeps) => import("
|
|
53
|
+
mediaQualityMetadataResolver: (deps: DashMediaQualityMetadataResolverDeps) => import("./DashMediaQualityMetadataResolver").DashMediaQualityMetadataResolver;
|
|
54
54
|
mediaSourceController: (deps: MediaSourceControllerImplDeps) => MediaSourceControllerImpl;
|
|
55
|
-
createContentStreamFactories: (deps: import("
|
|
55
|
+
createContentStreamFactories: (deps: import("./createDashContentStreamFactories").DashContentStreamTrackDeps) => import("@amazon/vinyl-util").MemoizedFunction & ((contentType: import("../..").ContentType) => {
|
|
56
56
|
sourceBufferControllerFactory: (deps: import("../..").SourceBufferControllerImplDeps) => () => import("../..").SourceBufferControllerImpl;
|
|
57
57
|
bufferingController: (deps: import("../..").BufferingControllerImplDeps) => import("../..").BufferingControllerImpl;
|
|
58
58
|
segmentController: (deps: import("../..").SegmentControllerImplDeps) => import("../..").SegmentControllerImpl;
|
|
59
|
-
mediaSourceController: import("@amazon/vinyl-di").Factory<import("
|
|
59
|
+
mediaSourceController: import("@amazon/vinyl-di").Factory<import("../..").MediaSourceController>;
|
|
60
60
|
playbackController: import("@amazon/vinyl-di").Factory<PlaybackController>;
|
|
61
61
|
mediaTimelineTransformed: import("@amazon/vinyl-di").Factory<ObservableValue<Promise<import("../..").MediaTimeline>>>;
|
|
62
62
|
qualitySelector: import("@amazon/vinyl-di").Factory<import("../..").QualitySelector>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DashTrackLoadOptions } from '
|
|
1
|
+
import type { DashTrackLoadOptions } from './DashTrack';
|
|
2
2
|
import type { RequestInterceptor } from '@amazon/vinyl-util';
|
|
3
3
|
/**
|
|
4
4
|
* Creates a DashManifestProvider which uses the manifestProvider set on the loadOptions, or a urlDashManifestProvider
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ObservableValue } from '@amazon/vinyl-observable';
|
|
2
|
-
import type { DashManifestData } from '
|
|
2
|
+
import type { DashManifestData } from './DashManifestProvider';
|
|
3
3
|
import type { AdaptationSetType, RepresentationType } from '@amazon/vinyl-mpd-parser';
|
|
4
4
|
import { type Comparator } from '@amazon/vinyl-util';
|
|
5
5
|
export interface DashManifestTransformerDeps {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AdaptationSetType, DashManifest, RepresentationType } from '@amazon/vinyl-mpd-parser';
|
|
2
|
-
import type { DashManifestData } from '
|
|
2
|
+
import type { DashManifestData } from './DashManifestProvider';
|
|
3
3
|
import type { ObservableValue } from '@amazon/vinyl-observable';
|
|
4
4
|
import { type Comparator, type FilterPredicate, type MaybePromise } from '@amazon/vinyl-util';
|
|
5
5
|
/**
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { RepresentationType } from '@amazon/vinyl-mpd-parser';
|
|
2
|
-
import { type DashUriResolveDeps } from '
|
|
3
|
-
import { type CreateSegmentDataProviderDeps } from '
|
|
2
|
+
import { type DashUriResolveDeps } from '../util/uriResolution';
|
|
3
|
+
import { type CreateSegmentDataProviderDeps } from '../../createSegmentDataProvider';
|
|
4
4
|
import type { SegmentReference } from '../../../streaming/SegmentReference';
|
|
5
5
|
import type { SegmentDataProvider } from '../../../streaming/SegmentDataSlot';
|
|
6
|
-
import type { DashMediaQualityMetadataResolver } from '
|
|
6
|
+
import type { DashMediaQualityMetadataResolver } from '../DashMediaQualityMetadataResolver';
|
|
7
7
|
export interface DashSegmentProviderDeps extends DashUriResolveDeps, CreateSegmentDataProviderDeps {
|
|
8
8
|
/**
|
|
9
9
|
* Produces abstract metadata from a dash representation.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Maybe } from '@amazon/vinyl-util';
|
|
2
2
|
import type { RequestInitOptions } from '@amazon/vinyl-util';
|
|
3
3
|
import type { RequestInterceptor } from '@amazon/vinyl-util';
|
|
4
|
-
import type { DashManifestProvider } from '
|
|
4
|
+
import type { DashManifestProvider } from './DashManifestProvider';
|
|
5
5
|
/**
|
|
6
6
|
* Creates a DashManifestProvider which performs a request to retrieve a dash manifest.
|
|
7
7
|
* Can be a relative path.
|
|
@@ -74,7 +74,8 @@ export declare function getPeriodAtTime(manifest: DashManifest, time: number): P
|
|
|
74
74
|
export declare function flattenRepresentations(period: PeriodType): RepresentationType[];
|
|
75
75
|
/**
|
|
76
76
|
* Calculates the manifest duration, either from the mediaPresentationDuration or the last period end time.
|
|
77
|
-
*
|
|
77
|
+
* Returns `Infinity` for live (dynamic) presentations.
|
|
78
|
+
* Throws if duration cannot be determined.
|
|
78
79
|
*/
|
|
79
|
-
export declare function calculateDuration(manifest: DashManifest): number
|
|
80
|
+
export declare function calculateDuration(manifest: DashManifest): number;
|
|
80
81
|
//# sourceMappingURL=mpd.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { HlsManifestData } from '
|
|
2
|
-
import type { HlsMediaQualityMetadataResolver } from '
|
|
1
|
+
import type { HlsManifestData } from './HlsManifestProvider';
|
|
2
|
+
import type { HlsMediaQualityMetadataResolver } from './HlsMediaQualityMetadataResolver';
|
|
3
3
|
import type { MediaTimeline } from '../../streaming/MediaTimeline';
|
|
4
|
-
import { type CreateSegmentDataProviderDeps } from '
|
|
4
|
+
import { type CreateSegmentDataProviderDeps } from '../createSegmentDataProvider';
|
|
5
5
|
export interface BuildHlsMediaTimelineDeps extends CreateSegmentDataProviderDeps {
|
|
6
6
|
readonly mediaQualityMetadataResolver: HlsMediaQualityMetadataResolver;
|
|
7
7
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ObservableValue } from '@amazon/vinyl-observable';
|
|
2
|
-
import type { HlsManifestData } from '
|
|
2
|
+
import type { HlsManifestData } from './HlsManifestProvider';
|
|
3
3
|
export interface HlsManifestTransformerDeps {
|
|
4
4
|
readonly manifestController: ObservableValue<Promise<HlsManifestData>>;
|
|
5
5
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { HlsSegment } from '@amazon/vinyl-hls-parser';
|
|
2
2
|
import type { MediaSegmentReference } from '../../../streaming/SegmentReference';
|
|
3
3
|
import type { SegmentDataProvider } from '../../../streaming/SegmentDataSlot';
|
|
4
|
-
import { type CreateSegmentDataProviderDeps } from '
|
|
4
|
+
import { type CreateSegmentDataProviderDeps } from '../../createSegmentDataProvider';
|
|
5
5
|
/**
|
|
6
6
|
* Builds a timeline of MediaSegmentReferences from an HLS media playlist's
|
|
7
7
|
* segment list. Cumulative durations are used to compute start/end times.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { TrackBase, type TrackBaseDeps, type TrackBaseOptions } from '
|
|
1
|
+
import { TrackBase, type TrackBaseDeps, type TrackBaseOptions } from '../TrackBase';
|
|
2
2
|
import { type ReadonlyRanges, type ReadonlySet } from '@amazon/vinyl-util';
|
|
3
|
-
import type { TrackPreloadOptions, TrackTypeId, TrackUri } from '
|
|
3
|
+
import type { TrackPreloadOptions, TrackTypeId, TrackUri } from '../Track';
|
|
4
4
|
import type { ContentType, MediaQualityMetadata } from '../../streaming/MediaQualityMetadata';
|
|
5
5
|
import { type Factories } from '@amazon/vinyl-di';
|
|
6
6
|
import type { ContentStream } from '../../streaming/ContentStream';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TrackEventMap } from '
|
|
1
|
+
import type { TrackEventMap } from '../Track';
|
|
2
2
|
import { EventHostImpl, type ReadonlySet } from '@amazon/vinyl-util';
|
|
3
3
|
import type { PlaybackController } from '../../playback/PlaybackController';
|
|
4
4
|
import type { ContentType, MediaQualityMetadata } from '../../streaming/MediaQualityMetadata';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { PlaybackSource } from '../../playback/PlaybackSource';
|
|
2
|
-
import type { TrackTypeId, TrackUri } from '
|
|
3
|
-
import { type TrackBaseDeps } from '
|
|
4
|
-
import { type TrackFactory, type TrackLoadOptions } from '
|
|
2
|
+
import type { TrackTypeId, TrackUri } from '../Track';
|
|
3
|
+
import { type TrackBaseDeps } from '../TrackBase';
|
|
4
|
+
import { type TrackFactory, type TrackLoadOptions } from '../TrackFactory';
|
|
5
5
|
import { type Maybe } from '@amazon/vinyl-util';
|
|
6
|
-
import { SourceTrackBase, type SourceTrackBaseOptions } from '
|
|
6
|
+
import { SourceTrackBase, type SourceTrackBaseOptions } from './SourceTrackBase';
|
|
7
7
|
/**
|
|
8
8
|
* Dependencies for a SourceObjectTrack.
|
|
9
9
|
*/
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { TrackTypeId, TrackUri } from '
|
|
2
|
-
import { type TrackBaseDeps } from '
|
|
3
|
-
import { type TrackFactory, type TrackLoadOptions } from '
|
|
1
|
+
import type { TrackTypeId, TrackUri } from '../Track';
|
|
2
|
+
import { type TrackBaseDeps } from '../TrackBase';
|
|
3
|
+
import { type TrackFactory, type TrackLoadOptions } from '../TrackFactory';
|
|
4
4
|
import { type Maybe } from '@amazon/vinyl-util';
|
|
5
|
-
import { SourceTrackBase, type SourceTrackBaseOptions } from '
|
|
5
|
+
import { SourceTrackBase, type SourceTrackBaseOptions } from './SourceTrackBase';
|
|
6
6
|
import type { PlaybackSource } from '../../playback/PlaybackSource';
|
|
7
7
|
/**
|
|
8
8
|
* Dependencies for a SourceTrack.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { TrackBase, type TrackBaseDeps, type TrackBaseOptions } from '
|
|
2
|
-
import type { TrackEventMap, TrackPreloadOptions, TrackTypeId, TrackUri } from '
|
|
1
|
+
import { TrackBase, type TrackBaseDeps, type TrackBaseOptions } from '../TrackBase';
|
|
2
|
+
import type { TrackEventMap, TrackPreloadOptions, TrackTypeId, TrackUri } from '../Track';
|
|
3
3
|
import { type Maybe, type ReadonlySet } from '@amazon/vinyl-util';
|
|
4
4
|
import { type ContentType, type MediaQualityMetadata } from '../../streaming/MediaQualityMetadata';
|
|
5
5
|
import type { ObjectSchema } from '@amazon/vinyl-validation';
|
|
@@ -7,7 +7,7 @@ import type { TrackLoadOptions } from '../track/TrackFactory';
|
|
|
7
7
|
import type { DrmController } from '../drm/DrmController';
|
|
8
8
|
import type { AutoResetController } from '../track/AutoResetController';
|
|
9
9
|
import type { MutableValue } from '@amazon/vinyl-observable';
|
|
10
|
-
import type { VinylOptions } from '
|
|
10
|
+
import type { VinylOptions } from './VinylOptions';
|
|
11
11
|
export interface VinylDeps<TrackLoadOptionsType extends TrackLoadOptions = VinylTrackLoadOptions, OptionsType = VinylOptions> {
|
|
12
12
|
/**
|
|
13
13
|
* A mutable provider for configuration options.
|
|
@@ -11,14 +11,28 @@ import type { DefaultVinylFactories, InferVinylOverrideDependencyType, VinylDepe
|
|
|
11
11
|
import type { VinylDeps } from './VinylDeps';
|
|
12
12
|
import type { Capabilities } from '../client/Capabilities';
|
|
13
13
|
import { type ContentType, type MediaQualityMetadata } from '../streaming/MediaQualityMetadata';
|
|
14
|
-
import type { ReadonlyPlaybackStreamingState } from '
|
|
14
|
+
import type { ReadonlyPlaybackStreamingState } from './ReadonlyPlaybackStreamingState';
|
|
15
15
|
import { type StreamingEventMap } from '../streaming/StreamingEventMap';
|
|
16
16
|
import type { InferObservableValueType } from '@amazon/vinyl-observable';
|
|
17
|
-
import type { VinylOptions } from '
|
|
17
|
+
import type { VinylOptions } from './VinylOptions';
|
|
18
|
+
import type { ChangeEvent } from '../event/ChangeEvent';
|
|
18
19
|
/**
|
|
19
20
|
* Events the Vinyl Player emits.
|
|
20
21
|
*/
|
|
21
22
|
export interface VinylPlayerEventMap<TrackLoadOptionsType extends TrackLoadOptions = VinylTrackLoadOptions> extends PlaybackControllerEventMap, TrackControllerEventMap<TrackLoadOptionsType>, StreamingEventMap {
|
|
23
|
+
/**
|
|
24
|
+
* Dispatched when {@link VinylPlayer.resetPending} changes.
|
|
25
|
+
*
|
|
26
|
+
* `current` is true when the player has hit a transient, potentially
|
|
27
|
+
* recoverable error (e.g. a network outage) and an automatic reset
|
|
28
|
+
* attempt is scheduled. `current` is false once the pending reset is
|
|
29
|
+
* emitted, the error is cleared, or all retries are exhausted.
|
|
30
|
+
*
|
|
31
|
+
* If `resetPending` becomes false while {@link VinylPlayer.error} is
|
|
32
|
+
* still non-null, all automatic reset attempts have been exhausted
|
|
33
|
+
* and playback will not recover without user action.
|
|
34
|
+
*/
|
|
35
|
+
readonly resetPendingChange: ChangeEvent<boolean>;
|
|
22
36
|
}
|
|
23
37
|
/**
|
|
24
38
|
* A Vinyl Media Player.
|
|
@@ -32,6 +46,7 @@ export declare class VinylPlayer<TrackLoadOptionsType extends TrackLoadOptions =
|
|
|
32
46
|
private get drmController();
|
|
33
47
|
private get playbackController();
|
|
34
48
|
private get trackController();
|
|
49
|
+
private get autoResetController();
|
|
35
50
|
/**
|
|
36
51
|
* Provides information about the client, such as device and browser capabilities.
|
|
37
52
|
*/
|
|
@@ -81,6 +96,15 @@ export declare class VinylPlayer<TrackLoadOptionsType extends TrackLoadOptions =
|
|
|
81
96
|
* The last error reported.
|
|
82
97
|
*/
|
|
83
98
|
get error(): Error | null;
|
|
99
|
+
/**
|
|
100
|
+
* True when an error has interrupted playback and an automatic reset
|
|
101
|
+
* is scheduled. This distinguishes transient, potentially recoverable
|
|
102
|
+
* errors (such as a brief network outage) from terminal errors that
|
|
103
|
+
* will not trigger a reset on their own.
|
|
104
|
+
*
|
|
105
|
+
* Listen to `resetPendingChange` events for changes.
|
|
106
|
+
*/
|
|
107
|
+
get resetPending(): boolean;
|
|
84
108
|
get hasMetadata(): boolean;
|
|
85
109
|
get loop(): boolean;
|
|
86
110
|
set loop(value: boolean);
|
|
@@ -18,7 +18,7 @@ import { LoudnessNormalizationControllerImpl } from '../playback/loudness/Loudne
|
|
|
18
18
|
import { AutoResetControllerImpl, type AutoResetControllerImplDeps, type AutoResetControllerImplOptions } from '../track/AutoResetController';
|
|
19
19
|
import type { Dependencies, Factories } from '@amazon/vinyl-di';
|
|
20
20
|
import type { ContentStreamingOptions } from '../streaming/ContentStreamingOptions';
|
|
21
|
-
import { type VinylOptions } from '
|
|
21
|
+
import { type VinylOptions } from './VinylOptions';
|
|
22
22
|
import type { ObservableValue } from '@amazon/vinyl-observable';
|
|
23
23
|
/**
|
|
24
24
|
* Configuration used by the default dependency factories for Vinyl.
|
|
@@ -81,15 +81,13 @@ export declare function createVinylFactories(options: VinylDependencyOptions): {
|
|
|
81
81
|
}) => LoudnessNormalizationControllerImpl;
|
|
82
82
|
capabilities: (deps: CapabilitiesImplDeps) => CapabilitiesImpl;
|
|
83
83
|
requestInterceptor: () => typeof noop;
|
|
84
|
-
trackFactory: (deps: VinylTrackFactoryDeps) => import("
|
|
84
|
+
trackFactory: (deps: VinylTrackFactoryDeps) => import("..").TrackFactory<import("..").SourceObjectTrackLoadOptions | import("..").SourceTrackLoadOptions | import("..").DashTrackLoadOptions | import("..").HlsTrackLoadOptions>;
|
|
85
85
|
trackController: (deps: TrackControllerImplDeps<any>) => TrackControllerImpl<any>;
|
|
86
|
-
drmKeySystemResolver: () => import("
|
|
86
|
+
drmKeySystemResolver: () => import("..").DrmKeySystemResolver;
|
|
87
87
|
drmController: (deps: DrmControllerImplDeps) => DrmControllerImpl;
|
|
88
88
|
commonEme: typeof commonEmeFactory;
|
|
89
89
|
autoResetController: (deps: AutoResetControllerImplDeps) => AutoResetControllerImpl;
|
|
90
|
-
createDashFactories: (deps: import("
|
|
91
|
-
* Configuration for segmented streaming tracks (hls / dash).
|
|
92
|
-
*/ loadOptions: import("..").DashTrackLoadOptions) => {
|
|
90
|
+
createDashFactories: (deps: import("..").DashFactoryDeps) => (loadOptions: import("..").DashTrackLoadOptions) => {
|
|
93
91
|
contentTypesValue: typeof import("..").createDashContentTypesValue;
|
|
94
92
|
baseUrlSelector: () => import("..").BaseUrlSelector;
|
|
95
93
|
segmentRequestInit: () => import("@amazon/vinyl-util").Maybe<Readonly<Omit<RequestInit, "signal">>>;
|
|
@@ -112,7 +110,7 @@ export declare function createVinylFactories(options: VinylDependencyOptions): {
|
|
|
112
110
|
contentStreamFactory: typeof import("..").createContentStreamFactory;
|
|
113
111
|
qualitySelector: (deps: {
|
|
114
112
|
options: ObservableValue<Pick<VinylOptions, "abr">>;
|
|
115
|
-
}) => import("
|
|
113
|
+
}) => import("..").QualitySelectorImpl;
|
|
116
114
|
manifestTransformed: typeof import("..").createDefaultDashManifestTransformer;
|
|
117
115
|
mediaTimeline: (deps: import("..").BuildDashMediaTimelineDeps & {
|
|
118
116
|
readonly manifestTransformed: ObservableValue<Promise<import("..").DashManifestData>>;
|
|
@@ -124,12 +122,12 @@ export declare function createVinylFactories(options: VinylDependencyOptions): {
|
|
|
124
122
|
}>>;
|
|
125
123
|
playbackController: import("@amazon/vinyl-di").Factory<import("..").PlaybackController>;
|
|
126
124
|
playbackSource: import("@amazon/vinyl-di").Factory<import("..").PlaybackSource>;
|
|
127
|
-
drmKeySystemResolver: import("@amazon/vinyl-di").Factory<import("
|
|
125
|
+
drmKeySystemResolver: import("@amazon/vinyl-di").Factory<import("..").DrmKeySystemResolver>;
|
|
128
126
|
requestInterceptor: import("@amazon/vinyl-di").Factory<import("@amazon/vinyl-util").RequestInterceptor>;
|
|
129
127
|
drmController: import("@amazon/vinyl-di").Factory<import("..").DrmController>;
|
|
130
128
|
capabilities: import("@amazon/vinyl-di").Factory<import("..").Capabilities>;
|
|
131
129
|
};
|
|
132
|
-
createHlsFactories: (deps: import("
|
|
130
|
+
createHlsFactories: (deps: import("..").HlsFactoryDeps) => (loadOptions: import("..").HlsTrackLoadOptions) => {
|
|
133
131
|
contentTypesValue: typeof import("..").createHlsContentTypesValue;
|
|
134
132
|
manifestController: () => import("..").HlsManifestControllerImpl;
|
|
135
133
|
manifestTransformed: typeof import("..").createDefaultHlsManifestTransformer;
|
|
@@ -149,7 +147,7 @@ export declare function createVinylFactories(options: VinylDependencyOptions): {
|
|
|
149
147
|
contentStreamFactory: typeof import("..").createContentStreamFactory;
|
|
150
148
|
qualitySelector: (deps: {
|
|
151
149
|
options: ObservableValue<Pick<VinylOptions, "abr">>;
|
|
152
|
-
}) => import("
|
|
150
|
+
}) => import("..").QualitySelectorImpl;
|
|
153
151
|
mediaTimeline: (deps: import("..").BuildHlsMediaTimelineDeps & {
|
|
154
152
|
readonly manifestTransformed: ObservableValue<Promise<import("..").HlsManifestData>>;
|
|
155
153
|
}) => ObservableValue<Promise<import("..").MediaTimeline>>;
|
|
@@ -160,7 +158,7 @@ export declare function createVinylFactories(options: VinylDependencyOptions): {
|
|
|
160
158
|
}>>;
|
|
161
159
|
playbackController: import("@amazon/vinyl-di").Factory<import("..").PlaybackController>;
|
|
162
160
|
playbackSource: import("@amazon/vinyl-di").Factory<import("..").PlaybackSource>;
|
|
163
|
-
drmKeySystemResolver: import("@amazon/vinyl-di").Factory<import("
|
|
161
|
+
drmKeySystemResolver: import("@amazon/vinyl-di").Factory<import("..").DrmKeySystemResolver>;
|
|
164
162
|
requestInterceptor: import("@amazon/vinyl-di").Factory<import("@amazon/vinyl-util").RequestInterceptor>;
|
|
165
163
|
drmController: import("@amazon/vinyl-di").Factory<import("..").DrmController>;
|
|
166
164
|
capabilities: import("@amazon/vinyl-di").Factory<import("..").Capabilities>;
|
|
@@ -22,6 +22,7 @@ describe('getMediaPeriodAtTime', () => {
|
|
|
22
22
|
const timeline = {
|
|
23
23
|
periods: [period1, period2, period3],
|
|
24
24
|
minBufferTime: 2,
|
|
25
|
+
getDuration: () => Promise.resolve(30),
|
|
25
26
|
};
|
|
26
27
|
it('returns the first period for time 0', () => {
|
|
27
28
|
expect(getMediaPeriodAtTime(timeline, 0)).toBe(period1);
|
|
@@ -42,7 +43,11 @@ describe('getMediaPeriodAtTime', () => {
|
|
|
42
43
|
expect(getMediaPeriodAtTime(timeline, -1)).toBeNull();
|
|
43
44
|
});
|
|
44
45
|
it('returns null for empty timeline', () => {
|
|
45
|
-
const empty = {
|
|
46
|
+
const empty = {
|
|
47
|
+
periods: [],
|
|
48
|
+
minBufferTime: 0,
|
|
49
|
+
getDuration: () => Promise.resolve(0),
|
|
50
|
+
};
|
|
46
51
|
expect(getMediaPeriodAtTime(empty, 5)).toBeNull();
|
|
47
52
|
});
|
|
48
53
|
});
|
|
@@ -500,6 +500,7 @@ describe('MseTrack', () => {
|
|
|
500
500
|
},
|
|
501
501
|
],
|
|
502
502
|
minBufferTime: 2,
|
|
503
|
+
getDuration: () => Promise.resolve(Infinity),
|
|
503
504
|
});
|
|
504
505
|
track = createTrack();
|
|
505
506
|
await flushPromises();
|
|
@@ -521,6 +522,7 @@ describe('MseTrack', () => {
|
|
|
521
522
|
},
|
|
522
523
|
],
|
|
523
524
|
minBufferTime: 2,
|
|
525
|
+
getDuration: () => Promise.resolve(Infinity),
|
|
524
526
|
});
|
|
525
527
|
track = createTrack();
|
|
526
528
|
const spy = createEventSpy(track, 'qualitiesChange');
|
|
@@ -555,6 +557,7 @@ describe('MseTrack', () => {
|
|
|
555
557
|
},
|
|
556
558
|
],
|
|
557
559
|
minBufferTime: 2,
|
|
560
|
+
getDuration: () => Promise.resolve(Infinity),
|
|
558
561
|
};
|
|
559
562
|
setTimeline(timeline);
|
|
560
563
|
track = createTrack();
|
|
@@ -587,6 +590,7 @@ describe('MseTrack', () => {
|
|
|
587
590
|
},
|
|
588
591
|
],
|
|
589
592
|
minBufferTime: 2,
|
|
593
|
+
getDuration: () => Promise.resolve(Infinity),
|
|
590
594
|
});
|
|
591
595
|
track = createTrack();
|
|
592
596
|
await flushPromises();
|
|
@@ -76,6 +76,7 @@ describe('SegmentControllerImpl', () => {
|
|
|
76
76
|
},
|
|
77
77
|
],
|
|
78
78
|
minBufferTime: 10,
|
|
79
|
+
getDuration: () => Promise.resolve(100),
|
|
79
80
|
};
|
|
80
81
|
const mockQualitySelector = {
|
|
81
82
|
selectQuality: () => 0,
|
|
@@ -230,6 +231,7 @@ describe('SegmentControllerImpl', () => {
|
|
|
230
231
|
},
|
|
231
232
|
],
|
|
232
233
|
minBufferTime: 10,
|
|
234
|
+
getDuration: () => Promise.resolve(110),
|
|
233
235
|
};
|
|
234
236
|
timelineData.value = Promise.resolve(extendedTimeline);
|
|
235
237
|
await fillPrefetch();
|
|
@@ -330,6 +332,7 @@ describe('SegmentControllerImpl', () => {
|
|
|
330
332
|
},
|
|
331
333
|
],
|
|
332
334
|
minBufferTime: 10,
|
|
335
|
+
getDuration: () => Promise.resolve(100),
|
|
333
336
|
});
|
|
334
337
|
// segmentController is for 'audio', but only 'video' qualities exist
|
|
335
338
|
expect(await segmentController.getSegment(5)).toBeNull();
|
|
@@ -582,39 +585,6 @@ describe('SegmentControllerImpl', () => {
|
|
|
582
585
|
expect(segmentController.startTime).toBe(4);
|
|
583
586
|
});
|
|
584
587
|
});
|
|
585
|
-
describe('duration', () => {
|
|
586
|
-
it('delegates to the media timeline', async () => {
|
|
587
|
-
expect(await segmentController.getDuration()).toBe(100);
|
|
588
|
-
});
|
|
589
|
-
it('returns null for empty timeline', async () => {
|
|
590
|
-
timelineData.value = Promise.resolve({
|
|
591
|
-
periods: [],
|
|
592
|
-
minBufferTime: 0,
|
|
593
|
-
});
|
|
594
|
-
expect(await segmentController.getDuration()).toBeNull();
|
|
595
|
-
});
|
|
596
|
-
it('returns null when last period has Infinity endTime', async () => {
|
|
597
|
-
timelineData.value = Promise.resolve({
|
|
598
|
-
periods: [
|
|
599
|
-
{
|
|
600
|
-
startTime: 0,
|
|
601
|
-
endTime: Infinity,
|
|
602
|
-
qualities: [],
|
|
603
|
-
},
|
|
604
|
-
],
|
|
605
|
-
minBufferTime: 0,
|
|
606
|
-
});
|
|
607
|
-
expect(await segmentController.getDuration()).toBeNull();
|
|
608
|
-
});
|
|
609
|
-
it('uses getDuration from timeline when provided', async () => {
|
|
610
|
-
timelineData.value = Promise.resolve({
|
|
611
|
-
periods: [],
|
|
612
|
-
minBufferTime: 0,
|
|
613
|
-
getDuration: () => Promise.resolve(42),
|
|
614
|
-
});
|
|
615
|
-
expect(await segmentController.getDuration()).toBe(42);
|
|
616
|
-
});
|
|
617
|
-
});
|
|
618
588
|
describe('fetchedTime', () => {
|
|
619
589
|
it('returns the number of seconds currently prefetched', async () => {
|
|
620
590
|
segmentController.configure(defaultConfigOptions);
|
|
@@ -566,6 +566,79 @@ describe('QualitySelectorImpl', () => {
|
|
|
566
566
|
expect(selector.selectQuality(videoQualities, videoState)).toEqual(0);
|
|
567
567
|
});
|
|
568
568
|
});
|
|
569
|
+
describe('maxBandwidth', () => {
|
|
570
|
+
const qualities = [
|
|
571
|
+
{
|
|
572
|
+
...createEmptyMediaQualityMetadata(),
|
|
573
|
+
bandwidth: 1000,
|
|
574
|
+
bandwidthTotal: 1000,
|
|
575
|
+
qualityId: '0',
|
|
576
|
+
},
|
|
577
|
+
{
|
|
578
|
+
...createEmptyMediaQualityMetadata(),
|
|
579
|
+
bandwidth: 500,
|
|
580
|
+
bandwidthTotal: 500,
|
|
581
|
+
qualityId: '1',
|
|
582
|
+
},
|
|
583
|
+
{
|
|
584
|
+
...createEmptyMediaQualityMetadata(),
|
|
585
|
+
bandwidth: 100,
|
|
586
|
+
bandwidthTotal: 100,
|
|
587
|
+
qualityId: '2',
|
|
588
|
+
},
|
|
589
|
+
];
|
|
590
|
+
const prefetchState = {
|
|
591
|
+
fetchedTime: 0,
|
|
592
|
+
previousQuality: null,
|
|
593
|
+
active: false,
|
|
594
|
+
};
|
|
595
|
+
beforeEach(() => {
|
|
596
|
+
// Plenty of bandwidth for the highest quality.
|
|
597
|
+
metrics.estimatedDownlinkBandwidth.ewmaLow = 5000;
|
|
598
|
+
});
|
|
599
|
+
it('caps the selectable quality to the configured bandwidth', () => {
|
|
600
|
+
options.value = { ...options.value, maxBandwidth: 500 };
|
|
601
|
+
// Highest quality at or below the cap is index 1 (500).
|
|
602
|
+
expect(selector.selectQuality(qualities, prefetchState)).toEqual(1);
|
|
603
|
+
});
|
|
604
|
+
it('falls back to the lowest quality when all exceed the cap', () => {
|
|
605
|
+
options.value = { ...options.value, maxBandwidth: 50 };
|
|
606
|
+
// No quality fits — selectQuality falls back to the last (lowest) entry.
|
|
607
|
+
expect(selector.selectQuality(qualities, prefetchState)).toEqual(2);
|
|
608
|
+
});
|
|
609
|
+
it('pins to the lowest quality when set to 0', () => {
|
|
610
|
+
options.value = { ...options.value, maxBandwidth: 0 };
|
|
611
|
+
expect(selector.selectQuality(qualities, prefetchState)).toEqual(2);
|
|
612
|
+
});
|
|
613
|
+
it('treats null as no cap', () => {
|
|
614
|
+
options.value = { ...options.value, maxBandwidth: null };
|
|
615
|
+
expect(selector.selectQuality(qualities, prefetchState)).toEqual(0);
|
|
616
|
+
});
|
|
617
|
+
it('does not raise the bandwidth budget above the network estimate', () => {
|
|
618
|
+
// Network estimate is well below the cap; cap should not raise it.
|
|
619
|
+
metrics.estimatedDownlinkBandwidth.ewmaLow = 600;
|
|
620
|
+
options.value = { ...options.value, maxBandwidth: 100_000 };
|
|
621
|
+
expect(selector.selectQuality(qualities, prefetchState)).toEqual(1);
|
|
622
|
+
});
|
|
623
|
+
it('has no effect when strategy is LOWEST', () => {
|
|
624
|
+
options.value = {
|
|
625
|
+
...options.value,
|
|
626
|
+
strategy: AbrStrategy.LOWEST,
|
|
627
|
+
maxBandwidth: 100_000,
|
|
628
|
+
};
|
|
629
|
+
// LOWEST always returns the last index, regardless of the cap.
|
|
630
|
+
expect(selector.selectQuality(qualities, prefetchState)).toEqual(qualities.length - 1);
|
|
631
|
+
});
|
|
632
|
+
it('has no effect when strategy is HIGHEST', () => {
|
|
633
|
+
options.value = {
|
|
634
|
+
...options.value,
|
|
635
|
+
strategy: AbrStrategy.HIGHEST,
|
|
636
|
+
maxBandwidth: 50,
|
|
637
|
+
};
|
|
638
|
+
// HIGHEST always returns 0, regardless of the cap.
|
|
639
|
+
expect(selector.selectQuality(qualities, prefetchState)).toEqual(0);
|
|
640
|
+
});
|
|
641
|
+
});
|
|
569
642
|
describe('toString', () => {
|
|
570
643
|
it('returns a string', () => {
|
|
571
644
|
expect(selector.toString()).toContain('QualitySelectorImpl');
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { flushPromises, useMockTime } from '@amazon/vinyl-util/browserTestUtil';
|
|
6
6
|
import { MockMediaSourceController, MockPlaybackController, MockSegmentController, MockSourceBufferController, } from '@amazon/vinyl/vinylTestUtil';
|
|
7
|
-
import { BufferingControllerImpl, clearSourceBufferQuota, createEmptyMediaQualityMetadata, DEFAULT_MAX_APPEND_SIZE,
|
|
7
|
+
import { BufferingControllerImpl, clearSourceBufferQuota, createEmptyMediaQualityMetadata, DEFAULT_MAX_APPEND_SIZE, getSourceBufferQuota, MIN_APPEND_SIZE, POLL_BUFFER_THROTTLE, QUOTA_REACHED_SCALE, SEGMENT_START_AFFORDANCE, } from '@amazon/vinyl';
|
|
8
8
|
import { Abort, AbortError, Deferred, floorToNearest, LogLevel, } from '@amazon/vinyl-util';
|
|
9
9
|
import { createEventSpy, useMockLogger } from '@amazon/vinyl-util/testUtil';
|
|
10
10
|
var any = jasmine.any;
|
|
@@ -86,7 +86,6 @@ describe('BufferingControllerImpl', () => {
|
|
|
86
86
|
}
|
|
87
87
|
beforeEach(() => {
|
|
88
88
|
mediaSourceController = new MockMediaSourceController();
|
|
89
|
-
mediaSourceController.duration = Number.NaN;
|
|
90
89
|
playbackController = new MockPlaybackController();
|
|
91
90
|
segmentController = new MockSegmentController();
|
|
92
91
|
segmentController.getSegment.and.callFake((time) => {
|
|
@@ -512,45 +511,6 @@ describe('BufferingControllerImpl', () => {
|
|
|
512
511
|
expect(bufferingController.getBufferedTime()).toBe(10);
|
|
513
512
|
});
|
|
514
513
|
});
|
|
515
|
-
describe('duration', () => {
|
|
516
|
-
beforeEach(() => {
|
|
517
|
-
bufferingController = createBufferingController();
|
|
518
|
-
bufferingController.activate();
|
|
519
|
-
});
|
|
520
|
-
describe('when the media source is open and the segment controller is not updating', () => {
|
|
521
|
-
it('is set to the segment controller provided value', async () => {
|
|
522
|
-
segmentController.getDuration.and.resolveTo(33);
|
|
523
|
-
await open();
|
|
524
|
-
expect(mediaSourceController.duration).toEqual(33 + DURATION_PADDING);
|
|
525
|
-
});
|
|
526
|
-
describe('when segment controller duration resolves to null', () => {
|
|
527
|
-
it('sets mediaSource duration to LIVE_DURATION', async () => {
|
|
528
|
-
segmentController.getDuration.and.resolveTo(null);
|
|
529
|
-
await open();
|
|
530
|
-
expect(mediaSourceController.duration).toEqual(LIVE_DURATION);
|
|
531
|
-
});
|
|
532
|
-
});
|
|
533
|
-
});
|
|
534
|
-
describe('when segment controller emits a change event', () => {
|
|
535
|
-
it('refreshes duration', async () => {
|
|
536
|
-
segmentController.getDuration.and.resolveTo(42);
|
|
537
|
-
await open();
|
|
538
|
-
expect(mediaSourceController.duration).toEqual(42 + DURATION_PADDING);
|
|
539
|
-
segmentController.getDuration.and.resolveTo(54);
|
|
540
|
-
segmentController.dispatch('change', {});
|
|
541
|
-
await nextPollImmediate();
|
|
542
|
-
expect(mediaSourceController.duration).toEqual(54 + DURATION_PADDING);
|
|
543
|
-
});
|
|
544
|
-
describe('and mediaSource is not open', () => {
|
|
545
|
-
it('does nothing', () => {
|
|
546
|
-
// Closed
|
|
547
|
-
segmentController.getDuration.and.resolveTo(52);
|
|
548
|
-
segmentController.dispatch('change', {});
|
|
549
|
-
expect(mediaSourceController.duration).toBeNaN();
|
|
550
|
-
});
|
|
551
|
-
});
|
|
552
|
-
});
|
|
553
|
-
});
|
|
554
514
|
describe('playbackQuality', () => {
|
|
555
515
|
// The time to simulate a quality change from q1 to q2:
|
|
556
516
|
let changeTime;
|