@amazon/vinyl 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +11 -2
- package/dist/index.cjs.map +2 -2
- package/dist/index.js +15 -4
- package/dist/index.js.map +3 -3
- package/dist/test/integ.es5.js +43 -43
- package/dist/test/integ.js +70 -2
- package/dist/test/integ.js.map +2 -2
- package/dist/types/current/ad/AdBreakInfo.d.ts +160 -0
- package/dist/types/current/ad/AdBreakInfo.d.ts.map +1 -0
- package/dist/types/current/ad/AdBreakInfo.js +5 -0
- package/dist/types/current/ad/AdController.d.ts +229 -0
- package/dist/types/current/ad/AdController.d.ts.map +1 -0
- package/dist/types/current/ad/AdController.js +19 -0
- package/dist/types/current/ad/AdControllerImpl.d.ts +146 -0
- package/dist/types/current/ad/AdControllerImpl.d.ts.map +1 -0
- package/dist/types/current/ad/AdControllerImpl.js +705 -0
- package/dist/types/current/ad/AdError.d.ts +6 -0
- package/dist/types/current/ad/AdError.d.ts.map +1 -0
- package/dist/types/current/ad/AdError.js +14 -0
- package/dist/types/current/ad/AdsProvider.d.ts +28 -0
- package/dist/types/current/ad/AdsProvider.d.ts.map +1 -0
- package/dist/types/current/ad/AdsProvider.js +5 -0
- package/dist/types/current/ad/defaultAdLoadOptionsResolver.d.ts +12 -0
- package/dist/types/current/ad/defaultAdLoadOptionsResolver.d.ts.map +1 -0
- package/dist/types/current/ad/defaultAdLoadOptionsResolver.js +26 -0
- package/dist/types/current/ad/discoverHlsInterstitials.d.ts +22 -0
- package/dist/types/current/ad/discoverHlsInterstitials.d.ts.map +1 -0
- package/dist/types/current/ad/discoverHlsInterstitials.js +246 -0
- package/dist/types/current/drm/DrmControllerImpl.d.ts.map +1 -1
- package/dist/types/current/drm/DrmControllerImpl.js +11 -1
- package/dist/types/current/playback/PlaybackControllerImpl.d.ts +1 -1
- package/dist/types/current/streaming/AudioOptions.d.ts +39 -0
- package/dist/types/current/streaming/AudioOptions.d.ts.map +1 -0
- package/dist/types/current/streaming/AudioOptions.js +15 -0
- package/dist/types/current/streaming/LoadMetric.d.ts +58 -0
- package/dist/types/current/streaming/LoadMetric.d.ts.map +1 -0
- package/dist/types/current/streaming/LoadMetric.js +5 -0
- package/dist/types/current/streaming/ManifestControllerImpl.d.ts +43 -0
- package/dist/types/current/streaming/ManifestControllerImpl.d.ts.map +1 -0
- package/dist/types/current/streaming/ManifestControllerImpl.js +104 -0
- package/dist/types/current/streaming/buffering/codecDenylist.d.ts +23 -0
- package/dist/types/current/streaming/buffering/codecDenylist.d.ts.map +1 -0
- package/dist/types/current/streaming/buffering/codecDenylist.js +62 -0
- package/dist/types/current/streaming/createAllowedContentTypesValue.d.ts +30 -0
- package/dist/types/current/streaming/createAllowedContentTypesValue.d.ts.map +1 -0
- package/dist/types/current/streaming/createAllowedContentTypesValue.js +43 -0
- package/dist/types/current/streaming/mediaTimelineAccessibilityFilter.d.ts +35 -0
- package/dist/types/current/streaming/mediaTimelineAccessibilityFilter.d.ts.map +1 -0
- package/dist/types/current/streaming/mediaTimelineAccessibilityFilter.js +75 -0
- package/dist/types/current/text/HtmlTextTrackRenderer.d.ts +60 -0
- package/dist/types/current/text/HtmlTextTrackRenderer.d.ts.map +1 -0
- package/dist/types/current/text/HtmlTextTrackRenderer.js +231 -0
- package/dist/types/current/text/SidecarTextTrackController.d.ts +103 -0
- package/dist/types/current/text/SidecarTextTrackController.d.ts.map +1 -0
- package/dist/types/current/text/SidecarTextTrackController.js +250 -0
- package/dist/types/current/text/SidecarTextTrackLoader.d.ts +65 -0
- package/dist/types/current/text/SidecarTextTrackLoader.d.ts.map +1 -0
- package/dist/types/current/text/SidecarTextTrackLoader.js +150 -0
- package/dist/types/current/text/TextTrack.d.ts +179 -0
- package/dist/types/current/text/TextTrack.d.ts.map +1 -0
- package/dist/types/current/text/TextTrack.js +29 -0
- package/dist/types/current/text/TextTrackRenderer.d.ts +24 -0
- package/dist/types/current/text/TextTrackRenderer.d.ts.map +1 -0
- package/dist/types/current/text/TextTrackRenderer.js +5 -0
- package/dist/types/current/text/VttCueStyle.d.ts +41 -0
- package/dist/types/current/text/VttCueStyle.d.ts.map +1 -0
- package/dist/types/current/text/VttCueStyle.js +45 -0
- package/dist/types/current/text/discoverDashTextTracks.d.ts +24 -0
- package/dist/types/current/text/discoverDashTextTracks.d.ts.map +1 -0
- package/dist/types/current/text/discoverDashTextTracks.js +109 -0
- package/dist/types/current/text/discoverHlsTextTracks.d.ts +19 -0
- package/dist/types/current/text/discoverHlsTextTracks.d.ts.map +1 -0
- package/dist/types/current/text/discoverHlsTextTracks.js +49 -0
- package/dist/types/current/text/mediaTextTrackProvider.d.ts +34 -0
- package/dist/types/current/text/mediaTextTrackProvider.d.ts.map +1 -0
- package/dist/types/current/text/mediaTextTrackProvider.js +42 -0
- package/dist/types/current/text/parseWebVtt.d.ts +60 -0
- package/dist/types/current/text/parseWebVtt.d.ts.map +1 -0
- package/dist/types/current/text/parseWebVtt.js +248 -0
- package/dist/types/current/text/pickPreferredTextTrack.d.ts +15 -0
- package/dist/types/current/text/pickPreferredTextTrack.d.ts.map +1 -0
- package/dist/types/current/text/pickPreferredTextTrack.js +71 -0
- package/dist/types/current/track/SeekRange.d.ts +9 -0
- package/dist/types/current/track/SeekRange.d.ts.map +1 -0
- package/dist/types/current/track/SeekRange.js +5 -0
- package/dist/types/current/track/hls/HlsManifestData.d.ts +19 -0
- package/dist/types/current/track/hls/HlsManifestData.d.ts.map +1 -0
- package/dist/types/current/track/hls/HlsManifestData.js +5 -0
- package/dist/types/current/track/hls/createHlsManifestProvider.d.ts +6 -0
- package/dist/types/current/track/hls/createHlsManifestProvider.d.ts.map +1 -0
- package/dist/types/current/track/hls/createHlsManifestProvider.js +9 -0
- package/dist/types/current/track/inferLoadOptionsFromUri.d.ts +15 -0
- package/dist/types/current/track/inferLoadOptionsFromUri.d.ts.map +1 -0
- package/dist/types/current/track/inferLoadOptionsFromUri.js +55 -0
- package/dist/types/current/tsconfig.tsbuildinfo +1 -1
- package/dist/types/current/util/media/codecOverrides.d.ts +33 -0
- package/dist/types/current/util/media/codecOverrides.d.ts.map +1 -0
- package/dist/types/current/util/media/codecOverrides.js +37 -0
- package/dist/types/current/util/media/codecSupport.d.ts +6 -0
- package/dist/types/current/util/media/codecSupport.d.ts.map +1 -0
- package/dist/types/current/util/media/codecSupport.js +17 -0
- 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/ts3.7/ad/AdBreakInfo.d.ts +160 -0
- package/dist/types/ts3.7/ad/AdController.d.ts +243 -0
- package/dist/types/ts3.7/ad/AdControllerImpl.d.ts +146 -0
- package/dist/types/ts3.7/ad/AdError.d.ts +6 -0
- package/dist/types/ts3.7/ad/AdsProvider.d.ts +28 -0
- package/dist/types/ts3.7/ad/defaultAdLoadOptionsResolver.d.ts +12 -0
- package/dist/types/ts3.7/ad/discoverHlsInterstitials.d.ts +22 -0
- package/dist/types/ts3.7/playback/PlaybackControllerImpl.d.ts +1 -1
- package/dist/types/ts3.7/streaming/AudioOptions.d.ts +39 -0
- package/dist/types/ts3.7/streaming/LoadMetric.d.ts +58 -0
- package/dist/types/ts3.7/streaming/ManifestControllerImpl.d.ts +40 -0
- package/dist/types/ts3.7/streaming/buffering/codecDenylist.d.ts +23 -0
- package/dist/types/ts3.7/streaming/createAllowedContentTypesValue.d.ts +30 -0
- package/dist/types/ts3.7/streaming/mediaTimelineAccessibilityFilter.d.ts +35 -0
- package/dist/types/ts3.7/text/HtmlTextTrackRenderer.d.ts +60 -0
- package/dist/types/ts3.7/text/SidecarTextTrackController.d.ts +103 -0
- package/dist/types/ts3.7/text/SidecarTextTrackLoader.d.ts +65 -0
- package/dist/types/ts3.7/text/TextTrack.d.ts +183 -0
- package/dist/types/ts3.7/text/TextTrackRenderer.d.ts +24 -0
- package/dist/types/ts3.7/text/VttCueStyle.d.ts +41 -0
- package/dist/types/ts3.7/text/discoverDashTextTracks.d.ts +24 -0
- package/dist/types/ts3.7/text/discoverHlsTextTracks.d.ts +19 -0
- package/dist/types/ts3.7/text/mediaTextTrackProvider.d.ts +34 -0
- package/dist/types/ts3.7/text/parseWebVtt.d.ts +60 -0
- package/dist/types/ts3.7/text/pickPreferredTextTrack.d.ts +15 -0
- package/dist/types/ts3.7/track/SeekRange.d.ts +9 -0
- package/dist/types/ts3.7/track/hls/HlsManifestData.d.ts +19 -0
- package/dist/types/ts3.7/track/hls/createHlsManifestProvider.d.ts +6 -0
- package/dist/types/ts3.7/track/inferLoadOptionsFromUri.d.ts +15 -0
- package/dist/types/ts3.7/util/media/codecOverrides.d.ts +33 -0
- package/dist/types/ts3.7/util/media/codecSupport.d.ts +6 -0
- package/dist/types/ts3.7/util/media/mimeType.d.ts +8 -0
- package/dist/types/ts4.1/ad/AdBreakInfo.d.ts +160 -0
- package/dist/types/ts4.1/ad/AdController.d.ts +243 -0
- package/dist/types/ts4.1/ad/AdControllerImpl.d.ts +146 -0
- package/dist/types/ts4.1/ad/AdError.d.ts +6 -0
- package/dist/types/ts4.1/ad/AdsProvider.d.ts +28 -0
- package/dist/types/ts4.1/ad/defaultAdLoadOptionsResolver.d.ts +12 -0
- package/dist/types/ts4.1/ad/discoverHlsInterstitials.d.ts +22 -0
- package/dist/types/ts4.1/playback/PlaybackControllerImpl.d.ts +1 -1
- package/dist/types/ts4.1/streaming/AudioOptions.d.ts +39 -0
- package/dist/types/ts4.1/streaming/LoadMetric.d.ts +58 -0
- package/dist/types/ts4.1/streaming/ManifestControllerImpl.d.ts +40 -0
- package/dist/types/ts4.1/streaming/buffering/codecDenylist.d.ts +23 -0
- package/dist/types/ts4.1/streaming/createAllowedContentTypesValue.d.ts +30 -0
- package/dist/types/ts4.1/streaming/mediaTimelineAccessibilityFilter.d.ts +35 -0
- package/dist/types/ts4.1/text/HtmlTextTrackRenderer.d.ts +60 -0
- package/dist/types/ts4.1/text/SidecarTextTrackController.d.ts +104 -0
- package/dist/types/ts4.1/text/SidecarTextTrackLoader.d.ts +65 -0
- package/dist/types/ts4.1/text/TextTrack.d.ts +183 -0
- package/dist/types/ts4.1/text/TextTrackRenderer.d.ts +24 -0
- package/dist/types/ts4.1/text/VttCueStyle.d.ts +41 -0
- package/dist/types/ts4.1/text/discoverDashTextTracks.d.ts +24 -0
- package/dist/types/ts4.1/text/discoverHlsTextTracks.d.ts +19 -0
- package/dist/types/ts4.1/text/mediaTextTrackProvider.d.ts +34 -0
- package/dist/types/ts4.1/text/parseWebVtt.d.ts +60 -0
- package/dist/types/ts4.1/text/pickPreferredTextTrack.d.ts +15 -0
- package/dist/types/ts4.1/track/SeekRange.d.ts +9 -0
- package/dist/types/ts4.1/track/hls/HlsManifestData.d.ts +19 -0
- package/dist/types/ts4.1/track/hls/createHlsManifestProvider.d.ts +6 -0
- package/dist/types/ts4.1/track/inferLoadOptionsFromUri.d.ts +15 -0
- package/dist/types/ts4.1/util/media/codecOverrides.d.ts +33 -0
- package/dist/types/ts4.1/util/media/codecSupport.d.ts +6 -0
- package/dist/types/ts4.1/util/media/mimeType.d.ts +8 -0
- package/dist/types/ts4.7/ad/AdBreakInfo.d.ts +160 -0
- package/dist/types/ts4.7/ad/AdController.d.ts +243 -0
- package/dist/types/ts4.7/ad/AdControllerImpl.d.ts +146 -0
- package/dist/types/ts4.7/ad/AdError.d.ts +6 -0
- package/dist/types/ts4.7/ad/AdsProvider.d.ts +28 -0
- package/dist/types/ts4.7/ad/defaultAdLoadOptionsResolver.d.ts +12 -0
- package/dist/types/ts4.7/ad/discoverHlsInterstitials.d.ts +22 -0
- package/dist/types/ts4.7/playback/PlaybackControllerImpl.d.ts +1 -1
- package/dist/types/ts4.7/streaming/AudioOptions.d.ts +39 -0
- package/dist/types/ts4.7/streaming/LoadMetric.d.ts +58 -0
- package/dist/types/ts4.7/streaming/ManifestControllerImpl.d.ts +43 -0
- package/dist/types/ts4.7/streaming/buffering/codecDenylist.d.ts +23 -0
- package/dist/types/ts4.7/streaming/createAllowedContentTypesValue.d.ts +30 -0
- package/dist/types/ts4.7/streaming/mediaTimelineAccessibilityFilter.d.ts +35 -0
- package/dist/types/ts4.7/text/HtmlTextTrackRenderer.d.ts +60 -0
- package/dist/types/ts4.7/text/SidecarTextTrackController.d.ts +103 -0
- package/dist/types/ts4.7/text/SidecarTextTrackLoader.d.ts +65 -0
- package/dist/types/ts4.7/text/TextTrack.d.ts +183 -0
- package/dist/types/ts4.7/text/TextTrackRenderer.d.ts +24 -0
- package/dist/types/ts4.7/text/VttCueStyle.d.ts +41 -0
- package/dist/types/ts4.7/text/discoverDashTextTracks.d.ts +24 -0
- package/dist/types/ts4.7/text/discoverHlsTextTracks.d.ts +19 -0
- package/dist/types/ts4.7/text/mediaTextTrackProvider.d.ts +34 -0
- package/dist/types/ts4.7/text/parseWebVtt.d.ts +60 -0
- package/dist/types/ts4.7/text/pickPreferredTextTrack.d.ts +15 -0
- package/dist/types/ts4.7/track/SeekRange.d.ts +9 -0
- package/dist/types/ts4.7/track/hls/HlsManifestData.d.ts +19 -0
- package/dist/types/ts4.7/track/hls/createHlsManifestProvider.d.ts +6 -0
- package/dist/types/ts4.7/track/inferLoadOptionsFromUri.d.ts +15 -0
- package/dist/types/ts4.7/util/media/codecOverrides.d.ts +33 -0
- package/dist/types/ts4.7/util/media/codecSupport.d.ts +6 -0
- package/dist/types/ts4.7/util/media/mimeType.d.ts +8 -0
- package/dist/unit/types/current/ad/AdController.test.d.ts +2 -0
- package/dist/unit/types/current/ad/AdController.test.d.ts.map +1 -0
- package/dist/unit/types/current/ad/AdController.test.js +10 -0
- package/dist/unit/types/current/ad/AdControllerImpl.test.d.ts +2 -0
- package/dist/unit/types/current/ad/AdControllerImpl.test.d.ts.map +1 -0
- package/dist/unit/types/current/ad/AdControllerImpl.test.js +1456 -0
- package/dist/unit/types/current/ad/defaultAdLoadOptionsResolver.test.d.ts +2 -0
- package/dist/unit/types/current/ad/defaultAdLoadOptionsResolver.test.d.ts.map +1 -0
- package/dist/unit/types/current/ad/defaultAdLoadOptionsResolver.test.js +56 -0
- package/dist/unit/types/current/ad/discoverHlsInterstitials.test.d.ts +2 -0
- package/dist/unit/types/current/ad/discoverHlsInterstitials.test.d.ts.map +1 -0
- package/dist/unit/types/current/ad/discoverHlsInterstitials.test.js +756 -0
- package/dist/unit/types/current/drm/DrmControllerImpl.test.js +66 -1
- package/dist/unit/types/current/streaming/ManifestControllerImpl.test.d.ts +2 -0
- package/dist/unit/types/current/streaming/ManifestControllerImpl.test.d.ts.map +1 -0
- package/dist/unit/types/current/streaming/ManifestControllerImpl.test.js +197 -0
- package/dist/unit/types/current/streaming/buffering/codecDenylist.test.d.ts +2 -0
- package/dist/unit/types/current/streaming/buffering/codecDenylist.test.d.ts.map +1 -0
- package/dist/unit/types/current/streaming/buffering/codecDenylist.test.js +56 -0
- package/dist/unit/types/current/streaming/createAllowedContentTypesValue.test.d.ts +2 -0
- package/dist/unit/types/current/streaming/createAllowedContentTypesValue.test.d.ts.map +1 -0
- package/dist/unit/types/current/streaming/createAllowedContentTypesValue.test.js +77 -0
- package/dist/unit/types/current/streaming/mediaTimelineAccessibilityFilter.test.d.ts +2 -0
- package/dist/unit/types/current/streaming/mediaTimelineAccessibilityFilter.test.d.ts.map +1 -0
- package/dist/unit/types/current/streaming/mediaTimelineAccessibilityFilter.test.js +99 -0
- package/dist/unit/types/current/text/HtmlTextTrackRenderer.test.d.ts +2 -0
- package/dist/unit/types/current/text/HtmlTextTrackRenderer.test.d.ts.map +1 -0
- package/dist/unit/types/current/text/HtmlTextTrackRenderer.test.js +231 -0
- package/dist/unit/types/current/text/SidecarTextTrackController.test.d.ts +2 -0
- package/dist/unit/types/current/text/SidecarTextTrackController.test.d.ts.map +1 -0
- package/dist/unit/types/current/text/SidecarTextTrackController.test.js +686 -0
- package/dist/unit/types/current/text/SidecarTextTrackLoader.test.d.ts +2 -0
- package/dist/unit/types/current/text/SidecarTextTrackLoader.test.d.ts.map +1 -0
- package/dist/unit/types/current/text/SidecarTextTrackLoader.test.js +365 -0
- package/dist/unit/types/current/text/VttCueStyle.test.d.ts +2 -0
- package/dist/unit/types/current/text/VttCueStyle.test.d.ts.map +1 -0
- package/dist/unit/types/current/text/VttCueStyle.test.js +76 -0
- package/dist/unit/types/current/text/discoverDashTextTracks.test.d.ts +2 -0
- package/dist/unit/types/current/text/discoverDashTextTracks.test.d.ts.map +1 -0
- package/dist/unit/types/current/text/discoverDashTextTracks.test.js +199 -0
- package/dist/unit/types/current/text/discoverHlsTextTracks.test.d.ts +2 -0
- package/dist/unit/types/current/text/discoverHlsTextTracks.test.d.ts.map +1 -0
- package/dist/unit/types/current/text/discoverHlsTextTracks.test.js +177 -0
- package/dist/unit/types/current/text/mediaTextTrackProvider.test.d.ts +2 -0
- package/dist/unit/types/current/text/mediaTextTrackProvider.test.d.ts.map +1 -0
- package/dist/unit/types/current/text/mediaTextTrackProvider.test.js +86 -0
- package/dist/unit/types/current/text/parseWebVtt.test.d.ts +2 -0
- package/dist/unit/types/current/text/parseWebVtt.test.d.ts.map +1 -0
- package/dist/unit/types/current/text/parseWebVtt.test.js +393 -0
- package/dist/unit/types/current/text/pickPreferredTextTrack.test.d.ts +2 -0
- package/dist/unit/types/current/text/pickPreferredTextTrack.test.d.ts.map +1 -0
- package/dist/unit/types/current/text/pickPreferredTextTrack.test.js +78 -0
- package/dist/unit/types/current/track/inferLoadOptionsFromUri.test.d.ts +2 -0
- package/dist/unit/types/current/track/inferLoadOptionsFromUri.test.d.ts.map +1 -0
- package/dist/unit/types/current/track/inferLoadOptionsFromUri.test.js +165 -0
- package/dist/unit/types/current/tsconfig.tsbuildinfo +1 -1
- package/dist/unit/types/current/util/media/codecOverrides.test.d.ts +2 -0
- package/dist/unit/types/current/util/media/codecOverrides.test.d.ts.map +1 -0
- package/dist/unit/types/current/util/media/codecOverrides.test.js +42 -0
- package/dist/unit/types/current/util/media/codecSupport.test.d.ts +2 -0
- package/dist/unit/types/current/util/media/codecSupport.test.d.ts.map +1 -0
- package/dist/unit/types/current/util/media/codecSupport.test.js +26 -0
- 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/VinylPlayerAdBreaks.test.d.ts +2 -0
- package/dist/unit/types/current/vinyl/VinylPlayerAdBreaks.test.d.ts.map +1 -0
- package/dist/unit/types/current/vinyl/VinylPlayerAdBreaks.test.js +142 -0
- package/dist/unit/types/current/vinyl/VinylPlayerTextTracks.test.d.ts +2 -0
- package/dist/unit/types/current/vinyl/VinylPlayerTextTracks.test.d.ts.map +1 -0
- package/dist/unit/types/current/vinyl/VinylPlayerTextTracks.test.js +188 -0
- package/dist/vinylTestUtil/types/current/mock/ad/MockAdController.d.ts +15 -0
- package/dist/vinylTestUtil/types/current/mock/ad/MockAdController.d.ts.map +1 -0
- package/dist/vinylTestUtil/types/current/mock/ad/MockAdController.js +26 -0
- package/dist/vinylTestUtil/types/current/mock/dash/mockDashManifest.d.ts +84 -84
- package/dist/vinylTestUtil/types/current/mock/text/MockTextTrackController.d.ts +10 -0
- package/dist/vinylTestUtil/types/current/mock/text/MockTextTrackController.d.ts.map +1 -0
- package/dist/vinylTestUtil/types/current/mock/text/MockTextTrackController.js +14 -0
- package/dist/vinylTestUtil/types/current/tsconfig.tsbuildinfo +1 -1
- package/dist/vinylTestUtil/types/ts3.7/mock/ad/MockAdController.d.ts +15 -0
- package/dist/vinylTestUtil/types/ts3.7/mock/dash/mockDashManifest.d.ts +84 -84
- package/dist/vinylTestUtil/types/ts3.7/mock/text/MockTextTrackController.d.ts +10 -0
- package/dist/vinylTestUtil/types/ts4.1/mock/ad/MockAdController.d.ts +15 -0
- package/dist/vinylTestUtil/types/ts4.1/mock/dash/mockDashManifest.d.ts +84 -84
- package/dist/vinylTestUtil/types/ts4.1/mock/text/MockTextTrackController.d.ts +10 -0
- package/dist/vinylTestUtil/types/ts4.7/mock/ad/MockAdController.d.ts +15 -0
- package/dist/vinylTestUtil/types/ts4.7/mock/dash/mockDashManifest.d.ts +84 -84
- package/dist/vinylTestUtil/types/ts4.7/mock/text/MockTextTrackController.d.ts +10 -0
- package/package.json +10 -11
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
import { data } from '@amazon/vinyl-observable';
|
|
6
|
+
import { createAbortSlot, createDisposer, EventHostImpl, logDebug, } from '@amazon/vinyl-util';
|
|
7
|
+
export class ManifestControllerImpl {
|
|
8
|
+
deps;
|
|
9
|
+
get [Symbol.toStringTag]() {
|
|
10
|
+
return 'ManifestControllerImpl';
|
|
11
|
+
}
|
|
12
|
+
get logPrefix() {
|
|
13
|
+
return 'ManifestControllerImpl';
|
|
14
|
+
}
|
|
15
|
+
_data;
|
|
16
|
+
_error = null;
|
|
17
|
+
abortSlot = createAbortSlot();
|
|
18
|
+
disposer = createDisposer();
|
|
19
|
+
events = new EventHostImpl();
|
|
20
|
+
manifestSpanArmed = true;
|
|
21
|
+
constructor(deps) {
|
|
22
|
+
this.deps = deps;
|
|
23
|
+
// Kick off the initial manifest request. requestManifest() attaches its
|
|
24
|
+
// own rejection handler, so the stored promise never rejects unhandled.
|
|
25
|
+
this._data = data(this.requestManifest());
|
|
26
|
+
}
|
|
27
|
+
on(type, handler, options) {
|
|
28
|
+
return this.events.on(type, handler, options);
|
|
29
|
+
}
|
|
30
|
+
hasAnyListeners() {
|
|
31
|
+
return this.events.hasAnyListeners();
|
|
32
|
+
}
|
|
33
|
+
hasListeners(type) {
|
|
34
|
+
return this.events.hasListeners(type);
|
|
35
|
+
}
|
|
36
|
+
__eventMapType = this.events.__eventMapType;
|
|
37
|
+
/**
|
|
38
|
+
* The most recent error from the manifest provider, or null.
|
|
39
|
+
*/
|
|
40
|
+
get error() {
|
|
41
|
+
return this._error;
|
|
42
|
+
}
|
|
43
|
+
refresh() {
|
|
44
|
+
logDebug(this, 'refresh');
|
|
45
|
+
this._data.value = this.requestManifest();
|
|
46
|
+
}
|
|
47
|
+
requestManifest() {
|
|
48
|
+
this.abortSlot.abort();
|
|
49
|
+
this._error = null;
|
|
50
|
+
const promise = this.deps.manifestProvider(this.abortSlot.value);
|
|
51
|
+
this.measureLoadSpan(promise);
|
|
52
|
+
promise.catch((error) => {
|
|
53
|
+
this._error = error;
|
|
54
|
+
});
|
|
55
|
+
return promise;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Measures the initial manifest fetch as a load span, re-arming on failure
|
|
59
|
+
* so a recovered load is still measured.
|
|
60
|
+
*/
|
|
61
|
+
measureLoadSpan(promise) {
|
|
62
|
+
if (!this.manifestSpanArmed)
|
|
63
|
+
return;
|
|
64
|
+
this.manifestSpanArmed = false;
|
|
65
|
+
const startTime = Date.now();
|
|
66
|
+
promise.then(() => this.events.dispatch('loadSpanMeasured', {
|
|
67
|
+
kind: 'manifest',
|
|
68
|
+
startTime,
|
|
69
|
+
endTime: Date.now(),
|
|
70
|
+
}), () => (this.manifestSpanArmed = true));
|
|
71
|
+
}
|
|
72
|
+
reset() {
|
|
73
|
+
logDebug(this, 'reset');
|
|
74
|
+
if (this._error) {
|
|
75
|
+
this.refresh();
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
get value() {
|
|
79
|
+
return this._data.value;
|
|
80
|
+
}
|
|
81
|
+
get changeId() {
|
|
82
|
+
return this._data.changeId;
|
|
83
|
+
}
|
|
84
|
+
getValue() {
|
|
85
|
+
return this._data.getValue();
|
|
86
|
+
}
|
|
87
|
+
onData(callback) {
|
|
88
|
+
return this._data.onData(callback);
|
|
89
|
+
}
|
|
90
|
+
map(fn) {
|
|
91
|
+
return this._data.map(fn);
|
|
92
|
+
}
|
|
93
|
+
pick(key) {
|
|
94
|
+
return this._data.pick(key);
|
|
95
|
+
}
|
|
96
|
+
get disposed() {
|
|
97
|
+
return this.disposer.disposed;
|
|
98
|
+
}
|
|
99
|
+
dispose() {
|
|
100
|
+
this.abortSlot.abort();
|
|
101
|
+
this.disposer.dispose();
|
|
102
|
+
this.events.dispose();
|
|
103
|
+
}
|
|
104
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Records every codec in the given mimeType as denylisted. Returns true if any
|
|
3
|
+
* codec was newly added (i.e. was not already denylisted), false if all codecs
|
|
4
|
+
* were already present. The return value lets callers bound retry loops: a
|
|
5
|
+
* repeat failure for an already-denylisted codec should not trigger another
|
|
6
|
+
* fallback attempt.
|
|
7
|
+
*/
|
|
8
|
+
export declare function denylistCodecsFromMimeType(mimeType: string): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Returns true when any codec in the given mimeType has been denylisted.
|
|
11
|
+
*/
|
|
12
|
+
export declare function isMimeTypeDenylisted(mimeType: string): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Returns the currently denylisted codec strings (lowercased). Primarily for
|
|
15
|
+
* diagnostics and testing.
|
|
16
|
+
*/
|
|
17
|
+
export declare function getDenylistedCodecs(): readonly string[];
|
|
18
|
+
/**
|
|
19
|
+
* Clears the runtime codec denylist. Intended for tests and for re-detecting
|
|
20
|
+
* support (e.g. after an environment change).
|
|
21
|
+
*/
|
|
22
|
+
export declare function clearCodecDenylist(): void;
|
|
23
|
+
//# sourceMappingURL=codecDenylist.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codecDenylist.d.ts","sourceRoot":"","sources":["../../../../../src/streaming/buffering/codecDenylist.ts"],"names":[],"mappings":"AAyBA;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAWpE;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAG9D;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,SAAS,MAAM,EAAE,CAEvD;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,IAAI,CAEzC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
import { extractCodecs } from '../../util/media/codecSupport';
|
|
6
|
+
/**
|
|
7
|
+
* A runtime denylist of media codecs that failed to decode after a SourceBuffer
|
|
8
|
+
* append, despite the browser reporting them as supported.
|
|
9
|
+
*
|
|
10
|
+
* Some browsers report a codec as supported via `MediaSource.isTypeSupported`
|
|
11
|
+
* yet fail to decode it (e.g. HEVC on Chromium without a platform decoder),
|
|
12
|
+
* surfacing as an append/decode error only once media is fed to the
|
|
13
|
+
* SourceBuffer. When that happens, the failing codec is recorded here so that
|
|
14
|
+
* quality selection avoids it and playback can fall back to a codec that does
|
|
15
|
+
* decode.
|
|
16
|
+
*
|
|
17
|
+
* This mirrors the runtime {@link getSourceBufferQuota} learning: it is a
|
|
18
|
+
* process-wide singleton learned from real append failures, with a reset hook
|
|
19
|
+
* for tests and re-detection. Entries are the individual RFC 6381 codec
|
|
20
|
+
* strings (e.g. `hvc1.2.20000000.L123.B0`), stored lowercased.
|
|
21
|
+
*/
|
|
22
|
+
const denylistedCodecs = new Set();
|
|
23
|
+
/**
|
|
24
|
+
* Records every codec in the given mimeType as denylisted. Returns true if any
|
|
25
|
+
* codec was newly added (i.e. was not already denylisted), false if all codecs
|
|
26
|
+
* were already present. The return value lets callers bound retry loops: a
|
|
27
|
+
* repeat failure for an already-denylisted codec should not trigger another
|
|
28
|
+
* fallback attempt.
|
|
29
|
+
*/
|
|
30
|
+
export function denylistCodecsFromMimeType(mimeType) {
|
|
31
|
+
const codecs = extractCodecs(mimeType);
|
|
32
|
+
let added = false;
|
|
33
|
+
for (const codec of codecs) {
|
|
34
|
+
const lower = codec.toLowerCase();
|
|
35
|
+
if (!denylistedCodecs.has(lower)) {
|
|
36
|
+
denylistedCodecs.add(lower);
|
|
37
|
+
added = true;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return added;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Returns true when any codec in the given mimeType has been denylisted.
|
|
44
|
+
*/
|
|
45
|
+
export function isMimeTypeDenylisted(mimeType) {
|
|
46
|
+
const codecs = extractCodecs(mimeType);
|
|
47
|
+
return codecs.some((c) => denylistedCodecs.has(c.toLowerCase()));
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Returns the currently denylisted codec strings (lowercased). Primarily for
|
|
51
|
+
* diagnostics and testing.
|
|
52
|
+
*/
|
|
53
|
+
export function getDenylistedCodecs() {
|
|
54
|
+
return [...denylistedCodecs];
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Clears the runtime codec denylist. Intended for tests and for re-detecting
|
|
58
|
+
* support (e.g. after an environment change).
|
|
59
|
+
*/
|
|
60
|
+
export function clearCodecDenylist() {
|
|
61
|
+
denylistedCodecs.clear();
|
|
62
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { RestrictableContentType } from './MediaQualityMetadata';
|
|
2
|
+
import type { ContentTypesValue } from './ContentTypesValue';
|
|
3
|
+
import type { ObservableValue } from '@amazon/vinyl-observable';
|
|
4
|
+
export interface AllowedContentTypesValueDeps {
|
|
5
|
+
/**
|
|
6
|
+
* The unfiltered content types present in the manifest.
|
|
7
|
+
*/
|
|
8
|
+
readonly baseContentTypesValue: ContentTypesValue;
|
|
9
|
+
/**
|
|
10
|
+
* The player options. The `allowedContentTypes` allow list restricts which
|
|
11
|
+
* media content types are streamed; `null` means no restriction.
|
|
12
|
+
*/
|
|
13
|
+
readonly options: ObservableValue<{
|
|
14
|
+
readonly allowedContentTypes: readonly RestrictableContentType[] | null;
|
|
15
|
+
}>;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Wraps a {@link ContentTypesValue} with the `allowedContentTypes` allow list
|
|
19
|
+
* from the player options. When the allow list is set, only media content
|
|
20
|
+
* types (`'audio'`, `'video'`) in the list are emitted; other media streams
|
|
21
|
+
* are ignored. When it is `null`, the underlying content types pass through
|
|
22
|
+
* unchanged. Text is never restricted by the allow list and always passes
|
|
23
|
+
* through (captions are governed by caption selection).
|
|
24
|
+
*
|
|
25
|
+
* Because the result is derived from the `allowedContentTypes` option via
|
|
26
|
+
* {@link combineData}, changing the option re-emits a newly filtered set, which
|
|
27
|
+
* reloads the track using only the allowed content types.
|
|
28
|
+
*/
|
|
29
|
+
export declare function createAllowedContentTypesValue(deps: AllowedContentTypesValueDeps): ContentTypesValue;
|
|
30
|
+
//# sourceMappingURL=createAllowedContentTypesValue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createAllowedContentTypesValue.d.ts","sourceRoot":"","sources":["../../../../src/streaming/createAllowedContentTypesValue.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAER,uBAAuB,EAC1B,MAAM,wBAAwB,CAAA;AAC/B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAI/D,MAAM,WAAW,4BAA4B;IACzC;;OAEG;IACH,QAAQ,CAAC,qBAAqB,EAAE,iBAAiB,CAAA;IAEjD;;;OAGG;IACH,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC;QAC9B,QAAQ,CAAC,mBAAmB,EAAE,SAAS,uBAAuB,EAAE,GAAG,IAAI,CAAA;KAC1E,CAAC,CAAA;CACL;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,8BAA8B,CAC1C,IAAI,EAAE,4BAA4B,GACnC,iBAAiB,CAOnB"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
import { combineData } from '@amazon/vinyl-observable';
|
|
6
|
+
/**
|
|
7
|
+
* Wraps a {@link ContentTypesValue} with the `allowedContentTypes` allow list
|
|
8
|
+
* from the player options. When the allow list is set, only media content
|
|
9
|
+
* types (`'audio'`, `'video'`) in the list are emitted; other media streams
|
|
10
|
+
* are ignored. When it is `null`, the underlying content types pass through
|
|
11
|
+
* unchanged. Text is never restricted by the allow list and always passes
|
|
12
|
+
* through (captions are governed by caption selection).
|
|
13
|
+
*
|
|
14
|
+
* Because the result is derived from the `allowedContentTypes` option via
|
|
15
|
+
* {@link combineData}, changing the option re-emits a newly filtered set, which
|
|
16
|
+
* reloads the track using only the allowed content types.
|
|
17
|
+
*/
|
|
18
|
+
export function createAllowedContentTypesValue(deps) {
|
|
19
|
+
return combineData({
|
|
20
|
+
contentTypes: deps.baseContentTypesValue,
|
|
21
|
+
allowedContentTypes: deps.options.pick('allowedContentTypes'),
|
|
22
|
+
}).map(async ({ contentTypes, allowedContentTypes }) => {
|
|
23
|
+
return filterContentTypes(await contentTypes, allowedContentTypes);
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Returns the subset of `contentTypes` permitted by the `allowedContentTypes`
|
|
28
|
+
* allow list. A `null` allow list permits everything. Text always passes
|
|
29
|
+
* through regardless of the allow list.
|
|
30
|
+
*/
|
|
31
|
+
function filterContentTypes(contentTypes, allowedContentTypes) {
|
|
32
|
+
if (allowedContentTypes == null)
|
|
33
|
+
return contentTypes;
|
|
34
|
+
const allowed = new Set(allowedContentTypes);
|
|
35
|
+
const filtered = new Set();
|
|
36
|
+
for (const contentType of contentTypes) {
|
|
37
|
+
// Text is not subject to the allow list; keep it regardless.
|
|
38
|
+
if (contentType === 'text' || allowed.has(contentType)) {
|
|
39
|
+
filtered.add(contentType);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return filtered;
|
|
43
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { MediaQualityMetadata } from './MediaQualityMetadata';
|
|
2
|
+
import type { FilterPredicate } from '@amazon/vinyl-util';
|
|
3
|
+
/**
|
|
4
|
+
* Thrown if the audio-description filter ever emptied a period's audio. The
|
|
5
|
+
* filter keeps at least one audio rendition per period by design, so this is a
|
|
6
|
+
* defensive guard rather than an expected path.
|
|
7
|
+
*/
|
|
8
|
+
export declare function throwNoPlayableAudio(): never;
|
|
9
|
+
/**
|
|
10
|
+
* Characteristics that mark an audio rendition as an audio description (a.k.a.
|
|
11
|
+
* described video / DVS) — narration of on-screen action for viewers who cannot
|
|
12
|
+
* see it. HLS signals this with the `public.accessibility.describes-video`
|
|
13
|
+
* CHARACTERISTIC; DASH with a `description` Role. Such renditions must not be
|
|
14
|
+
* chosen as the default audio; they are an accessibility opt-in.
|
|
15
|
+
*/
|
|
16
|
+
export declare const AUDIO_DESCRIPTION_CHARACTERISTICS: readonly string[];
|
|
17
|
+
/**
|
|
18
|
+
* Whether an audio quality is an audio-description rendition.
|
|
19
|
+
*/
|
|
20
|
+
export declare function isAudioDescription(quality: MediaQualityMetadata): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Creates a filter that keeps audio-description renditions out of (or, when
|
|
23
|
+
* opted in, restricts audio to) the audio selection.
|
|
24
|
+
*
|
|
25
|
+
* - `preferDescription: false` (default): drop audio-description renditions
|
|
26
|
+
* from each period *when a non-description audio alternative exists*, so the
|
|
27
|
+
* main audio is chosen by default instead of the description track. If a
|
|
28
|
+
* period has only description audio, it is kept (playback is never stranded).
|
|
29
|
+
* - `preferDescription: true`: keep only description renditions when the period
|
|
30
|
+
* has any; otherwise keep all (again, never strand playback).
|
|
31
|
+
*
|
|
32
|
+
* Non-audio qualities are always kept.
|
|
33
|
+
*/
|
|
34
|
+
export declare function createAudioDescriptionFilter(preferDescription: boolean): FilterPredicate<MediaQualityMetadata>;
|
|
35
|
+
//# sourceMappingURL=mediaTimelineAccessibilityFilter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mediaTimelineAccessibilityFilter.d.ts","sourceRoot":"","sources":["../../../../src/streaming/mediaTimelineAccessibilityFilter.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAClE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAGzD;;;;GAIG;AACH,wBAAgB,oBAAoB,IAAI,KAAK,CAE5C;AAED;;;;;;GAMG;AACH,eAAO,MAAM,iCAAiC,EAAE,SAAS,MAAM,EAG9D,CAAA;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAIzE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,4BAA4B,CACxC,iBAAiB,EAAE,OAAO,GAC3B,eAAe,CAAC,oBAAoB,CAAC,CA8BvC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
import { MediaUnsupportedError, memoize } from '@amazon/vinyl-util';
|
|
6
|
+
/**
|
|
7
|
+
* Thrown if the audio-description filter ever emptied a period's audio. The
|
|
8
|
+
* filter keeps at least one audio rendition per period by design, so this is a
|
|
9
|
+
* defensive guard rather than an expected path.
|
|
10
|
+
*/
|
|
11
|
+
export function throwNoPlayableAudio() {
|
|
12
|
+
throw new MediaUnsupportedError('No playable audio rendition', 'audio');
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Characteristics that mark an audio rendition as an audio description (a.k.a.
|
|
16
|
+
* described video / DVS) — narration of on-screen action for viewers who cannot
|
|
17
|
+
* see it. HLS signals this with the `public.accessibility.describes-video`
|
|
18
|
+
* CHARACTERISTIC; DASH with a `description` Role. Such renditions must not be
|
|
19
|
+
* chosen as the default audio; they are an accessibility opt-in.
|
|
20
|
+
*/
|
|
21
|
+
export const AUDIO_DESCRIPTION_CHARACTERISTICS = [
|
|
22
|
+
'public.accessibility.describes-video',
|
|
23
|
+
'description',
|
|
24
|
+
];
|
|
25
|
+
/**
|
|
26
|
+
* Whether an audio quality is an audio-description rendition.
|
|
27
|
+
*/
|
|
28
|
+
export function isAudioDescription(quality) {
|
|
29
|
+
return quality.characteristics.some((c) => AUDIO_DESCRIPTION_CHARACTERISTICS.includes(c));
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Creates a filter that keeps audio-description renditions out of (or, when
|
|
33
|
+
* opted in, restricts audio to) the audio selection.
|
|
34
|
+
*
|
|
35
|
+
* - `preferDescription: false` (default): drop audio-description renditions
|
|
36
|
+
* from each period *when a non-description audio alternative exists*, so the
|
|
37
|
+
* main audio is chosen by default instead of the description track. If a
|
|
38
|
+
* period has only description audio, it is kept (playback is never stranded).
|
|
39
|
+
* - `preferDescription: true`: keep only description renditions when the period
|
|
40
|
+
* has any; otherwise keep all (again, never strand playback).
|
|
41
|
+
*
|
|
42
|
+
* Non-audio qualities are always kept.
|
|
43
|
+
*/
|
|
44
|
+
export function createAudioDescriptionFilter(preferDescription) {
|
|
45
|
+
// Per period (per unique array reference): does it have description audio,
|
|
46
|
+
// and does it have non-description ("main") audio?
|
|
47
|
+
const periodFlags = memoize((array) => {
|
|
48
|
+
let hasDescription = false;
|
|
49
|
+
let hasMain = false;
|
|
50
|
+
for (const quality of Array.from(array)) {
|
|
51
|
+
if (quality.contentType !== 'audio')
|
|
52
|
+
continue;
|
|
53
|
+
if (isAudioDescription(quality))
|
|
54
|
+
hasDescription = true;
|
|
55
|
+
else
|
|
56
|
+
hasMain = true;
|
|
57
|
+
}
|
|
58
|
+
return { hasDescription, hasMain };
|
|
59
|
+
}, (array) => array, 1);
|
|
60
|
+
return (quality, _index, array) => {
|
|
61
|
+
if (quality.contentType !== 'audio')
|
|
62
|
+
return true;
|
|
63
|
+
const { hasDescription, hasMain } = periodFlags(array);
|
|
64
|
+
if (preferDescription) {
|
|
65
|
+
// Nothing to prefer; keep all rather than strand playback.
|
|
66
|
+
if (!hasDescription)
|
|
67
|
+
return true;
|
|
68
|
+
return isAudioDescription(quality);
|
|
69
|
+
}
|
|
70
|
+
// No main alternative; keep all rather than strand playback.
|
|
71
|
+
if (!hasMain)
|
|
72
|
+
return true;
|
|
73
|
+
return !isAudioDescription(quality);
|
|
74
|
+
};
|
|
75
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { Disposable } from '@amazon/vinyl-util';
|
|
2
|
+
import type { TextTrackRenderer } from './TextTrackRenderer';
|
|
3
|
+
/**
|
|
4
|
+
* The subset of a `VTTCue`'s positioning properties {@link computeCueLayout}
|
|
5
|
+
* reads. A native `VTTCue` satisfies this; a plain `TextTrackCue` (platforms
|
|
6
|
+
* without `VTTCue`) leaves them undefined and falls back to defaults.
|
|
7
|
+
*/
|
|
8
|
+
export interface CueGeometry {
|
|
9
|
+
readonly align?: string | null;
|
|
10
|
+
readonly line?: number | AutoKeyword;
|
|
11
|
+
readonly lineAlign?: LineAlignSetting;
|
|
12
|
+
readonly position?: number | AutoKeyword;
|
|
13
|
+
readonly positionAlign?: PositionAlignSetting;
|
|
14
|
+
readonly size?: number;
|
|
15
|
+
readonly snapToLines?: boolean;
|
|
16
|
+
readonly vertical?: DirectionSetting;
|
|
17
|
+
}
|
|
18
|
+
/** Inline styles (camelCase CSS properties) to apply to a rendered cue box. */
|
|
19
|
+
export type CueLayout = Record<string, string>;
|
|
20
|
+
/**
|
|
21
|
+
* Maps a cue's WebVTT positioning settings to inline CSS. Pure and DOM-free so
|
|
22
|
+
* the (branchy) placement logic is unit-testable in isolation.
|
|
23
|
+
*
|
|
24
|
+
* A cue with neither `line` nor `position` set flows in the renderer's
|
|
25
|
+
* bottom-anchored, centered container (the common subtitle case). Otherwise it
|
|
26
|
+
* is absolutely positioned: `size` → width, `position`/`positionAlign` →
|
|
27
|
+
* horizontal, `line`/`lineAlign`/`snapToLines` → vertical (percentage lines, or
|
|
28
|
+
* whole rows counted from the bottom for negative integers), `align` → text
|
|
29
|
+
* alignment, `vertical` → writing mode.
|
|
30
|
+
*/
|
|
31
|
+
export declare function computeCueLayout(cue: CueGeometry): CueLayout;
|
|
32
|
+
/**
|
|
33
|
+
* Renders a cue's text payload as safe HTML. Text is escaped (so it can't
|
|
34
|
+
* inject nodes); newlines become `<br>`; and WebVTT cue tags are converted:
|
|
35
|
+
* `<c.foo>`→`<span class="foo">`, `<i>/<b>/<u>/<ruby>/<rt>` pass through,
|
|
36
|
+
* `<v Name>`→`<span title>`, `<lang xx>`→`<span lang>`, timestamp tags are
|
|
37
|
+
* dropped. Class-based styling requires matching app CSS (STYLE blocks in the
|
|
38
|
+
* VTT are not applied).
|
|
39
|
+
*/
|
|
40
|
+
export declare function renderCueText(text: string): string;
|
|
41
|
+
/**
|
|
42
|
+
* A {@link TextTrackRenderer} that paints cues as HTML into {@link element}.
|
|
43
|
+
* Mount `element` over the video; it stacks cues at the bottom, centered, and
|
|
44
|
+
* positions any cue that carries explicit WebVTT settings. The DOM track is
|
|
45
|
+
* expected to be `'hidden'` so only this renderer paints.
|
|
46
|
+
*/
|
|
47
|
+
export declare class HtmlTextTrackRenderer implements TextTrackRenderer, Disposable {
|
|
48
|
+
/** The overlay container to mount over the video. */
|
|
49
|
+
readonly element: HTMLElement;
|
|
50
|
+
private track;
|
|
51
|
+
private readonly styleElement;
|
|
52
|
+
private readonly onCueChange;
|
|
53
|
+
constructor();
|
|
54
|
+
setTextTrack(track: TextTrack | null): void;
|
|
55
|
+
setStyles(styles: readonly string[]): void;
|
|
56
|
+
dispose(): void;
|
|
57
|
+
private renderActiveCues;
|
|
58
|
+
private createCueBox;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=HtmlTextTrackRenderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HtmlTextTrackRenderer.d.ts","sourceRoot":"","sources":["../../../../src/text/HtmlTextTrackRenderer.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAE5D;;;;GAIG;AACH,MAAM,WAAW,WAAW;IACxB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,WAAW,CAAA;IACpC,QAAQ,CAAC,SAAS,CAAC,EAAE,gBAAgB,CAAA;IACrC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,WAAW,CAAA;IACxC,QAAQ,CAAC,aAAa,CAAC,EAAE,oBAAoB,CAAA;IAC7C,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAA;IAC9B,QAAQ,CAAC,QAAQ,CAAC,EAAE,gBAAgB,CAAA;CACvC;AAED,+EAA+E;AAC/E,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;AAK9C;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,WAAW,GAAG,SAAS,CAmD5D;AAmDD;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAoBlD;AAeD;;;;;GAKG;AACH,qBAAa,qBAAsB,YAAW,iBAAiB,EAAE,UAAU;IACvE,qDAAqD;IACrD,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAA;IAE7B,OAAO,CAAC,KAAK,CAAyB;IAGtC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAkB;IAC/C,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAgC;;IAgB5D,YAAY,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI,GAAG,IAAI;IAe3C,SAAS,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI;IAI1C,OAAO,IAAI,IAAI;IAIf,OAAO,CAAC,gBAAgB;IAWxB,OAAO,CAAC,YAAY;CAOvB"}
|