@amazon/vinyl 1.2.0 → 1.2.2
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 +24 -6
- package/dist/index.cjs.map +2 -2
- package/dist/index.js +33 -13
- package/dist/index.js.map +3 -3
- package/dist/test/integ.es5.js +62 -62
- package/dist/test/integ.js +119 -6
- 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 +162 -0
- package/dist/types/current/ad/AdControllerImpl.d.ts.map +1 -0
- package/dist/types/current/ad/AdControllerImpl.js +741 -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 +248 -0
- package/dist/types/current/drm/DrmControllerImpl.d.ts +6 -0
- package/dist/types/current/drm/DrmControllerImpl.d.ts.map +1 -1
- package/dist/types/current/drm/DrmControllerImpl.js +23 -1
- package/dist/types/current/playback/PlaybackControllerImpl.d.ts +1 -1
- package/dist/types/current/playback/createStallDetector.d.ts +43 -0
- package/dist/types/current/playback/createStallDetector.d.ts.map +1 -0
- package/dist/types/current/playback/createStallDetector.js +101 -0
- package/dist/types/current/playback/createStallMonitor.d.ts +45 -0
- package/dist/types/current/playback/createStallMonitor.d.ts.map +1 -0
- package/dist/types/current/playback/createStallMonitor.js +99 -0
- package/dist/types/current/streaming/AudioOptions.d.ts +66 -0
- package/dist/types/current/streaming/AudioOptions.d.ts.map +1 -0
- package/dist/types/current/streaming/AudioOptions.js +19 -0
- package/dist/types/current/streaming/LoadMetric.d.ts +72 -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/createTimelineContentTypesValue.d.ts +21 -0
- package/dist/types/current/streaming/createTimelineContentTypesValue.d.ts.map +1 -0
- package/dist/types/current/streaming/createTimelineContentTypesValue.js +25 -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 +110 -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 +249 -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/track/mse/MseTrack.d.ts +0 -1
- package/dist/types/current/track/mse/MseTrack.d.ts.map +1 -1
- package/dist/types/current/track/mse/MseTrack.js +4 -5
- 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 +162 -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/drm/DrmControllerImpl.d.ts +6 -0
- package/dist/types/ts3.7/playback/PlaybackControllerImpl.d.ts +1 -1
- package/dist/types/ts3.7/playback/createStallDetector.d.ts +43 -0
- package/dist/types/ts3.7/playback/createStallMonitor.d.ts +45 -0
- package/dist/types/ts3.7/streaming/AudioOptions.d.ts +66 -0
- package/dist/types/ts3.7/streaming/LoadMetric.d.ts +72 -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/createTimelineContentTypesValue.d.ts +21 -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/track/mse/MseTrack.d.ts +0 -1
- 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 +162 -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/drm/DrmControllerImpl.d.ts +6 -0
- package/dist/types/ts4.1/playback/PlaybackControllerImpl.d.ts +1 -1
- package/dist/types/ts4.1/playback/createStallDetector.d.ts +43 -0
- package/dist/types/ts4.1/playback/createStallMonitor.d.ts +45 -0
- package/dist/types/ts4.1/streaming/AudioOptions.d.ts +66 -0
- package/dist/types/ts4.1/streaming/LoadMetric.d.ts +72 -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/createTimelineContentTypesValue.d.ts +21 -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/track/mse/MseTrack.d.ts +0 -1
- 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 +162 -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/drm/DrmControllerImpl.d.ts +6 -0
- package/dist/types/ts4.7/playback/PlaybackControllerImpl.d.ts +1 -1
- package/dist/types/ts4.7/playback/createStallDetector.d.ts +43 -0
- package/dist/types/ts4.7/playback/createStallMonitor.d.ts +45 -0
- package/dist/types/ts4.7/streaming/AudioOptions.d.ts +66 -0
- package/dist/types/ts4.7/streaming/LoadMetric.d.ts +72 -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/createTimelineContentTypesValue.d.ts +21 -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/track/mse/MseTrack.d.ts +0 -1
- 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 +1654 -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 +757 -0
- package/dist/unit/types/current/drm/DrmControllerImpl.test.js +96 -2
- package/dist/unit/types/current/playback/createStallDetector.test.d.ts +2 -0
- package/dist/unit/types/current/playback/createStallDetector.test.d.ts.map +1 -0
- package/dist/unit/types/current/playback/createStallDetector.test.js +163 -0
- package/dist/unit/types/current/playback/createStallMonitor.test.d.ts +2 -0
- package/dist/unit/types/current/playback/createStallMonitor.test.d.ts.map +1 -0
- package/dist/unit/types/current/playback/createStallMonitor.test.js +163 -0
- 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/MseTrack.test.js +15 -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/createTimelineContentTypesValue.test.d.ts +2 -0
- package/dist/unit/types/current/streaming/createTimelineContentTypesValue.test.d.ts.map +1 -0
- package/dist/unit/types/current/streaming/createTimelineContentTypesValue.test.js +57 -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/TextTrack.test.d.ts +2 -0
- package/dist/unit/types/current/text/TextTrack.test.d.ts.map +1 -0
- package/dist/unit/types/current/text/TextTrack.test.js +12 -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 +216 -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 +419 -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,60 @@
|
|
|
1
|
+
import { Disposable } from '@amazon/vinyl-util';
|
|
2
|
+
import { TextTrackRenderer } from './TextTrackRenderer';
|
|
3
|
+
/**
|
|
4
|
+
* The subset of a `VTTCue`'s positioning properties {@link computeCueLayout}
|
|
5
|
+
* reads. A native `VTTCue` satisfies this; a plain `TextTrackCue` (platforms
|
|
6
|
+
* without `VTTCue`) leaves them undefined and falls back to defaults.
|
|
7
|
+
*/
|
|
8
|
+
export interface CueGeometry {
|
|
9
|
+
readonly align?: string | null;
|
|
10
|
+
readonly line?: number | AutoKeyword;
|
|
11
|
+
readonly lineAlign?: LineAlignSetting;
|
|
12
|
+
readonly position?: number | AutoKeyword;
|
|
13
|
+
readonly positionAlign?: PositionAlignSetting;
|
|
14
|
+
readonly size?: number;
|
|
15
|
+
readonly snapToLines?: boolean;
|
|
16
|
+
readonly vertical?: DirectionSetting;
|
|
17
|
+
}
|
|
18
|
+
/** Inline styles (camelCase CSS properties) to apply to a rendered cue box. */
|
|
19
|
+
export type CueLayout = Record<string, string>;
|
|
20
|
+
/**
|
|
21
|
+
* Maps a cue's WebVTT positioning settings to inline CSS. Pure and DOM-free so
|
|
22
|
+
* the (branchy) placement logic is unit-testable in isolation.
|
|
23
|
+
*
|
|
24
|
+
* A cue with neither `line` nor `position` set flows in the renderer's
|
|
25
|
+
* bottom-anchored, centered container (the common subtitle case). Otherwise it
|
|
26
|
+
* is absolutely positioned: `size` → width, `position`/`positionAlign` →
|
|
27
|
+
* horizontal, `line`/`lineAlign`/`snapToLines` → vertical (percentage lines, or
|
|
28
|
+
* whole rows counted from the bottom for negative integers), `align` → text
|
|
29
|
+
* alignment, `vertical` → writing mode.
|
|
30
|
+
*/
|
|
31
|
+
export declare function computeCueLayout(cue: CueGeometry): CueLayout;
|
|
32
|
+
/**
|
|
33
|
+
* Renders a cue's text payload as safe HTML. Text is escaped (so it can't
|
|
34
|
+
* inject nodes); newlines become `<br>`; and WebVTT cue tags are converted:
|
|
35
|
+
* `<c.foo>`→`<span class="foo">`, `<i>/<b>/<u>/<ruby>/<rt>` pass through,
|
|
36
|
+
* `<v Name>`→`<span title>`, `<lang xx>`→`<span lang>`, timestamp tags are
|
|
37
|
+
* dropped. Class-based styling requires matching app CSS (STYLE blocks in the
|
|
38
|
+
* VTT are not applied).
|
|
39
|
+
*/
|
|
40
|
+
export declare function renderCueText(text: string): string;
|
|
41
|
+
/**
|
|
42
|
+
* A {@link TextTrackRenderer} that paints cues as HTML into {@link element}.
|
|
43
|
+
* Mount `element` over the video; it stacks cues at the bottom, centered, and
|
|
44
|
+
* positions any cue that carries explicit WebVTT settings. The DOM track is
|
|
45
|
+
* expected to be `'hidden'` so only this renderer paints.
|
|
46
|
+
*/
|
|
47
|
+
export declare class HtmlTextTrackRenderer implements TextTrackRenderer, Disposable {
|
|
48
|
+
/** The overlay container to mount over the video. */
|
|
49
|
+
readonly element: HTMLElement;
|
|
50
|
+
private track;
|
|
51
|
+
private readonly styleElement;
|
|
52
|
+
private readonly onCueChange;
|
|
53
|
+
constructor();
|
|
54
|
+
setTextTrack(track: TextTrack | null): void;
|
|
55
|
+
setStyles(styles: readonly string[]): void;
|
|
56
|
+
dispose(): void;
|
|
57
|
+
private renderActiveCues;
|
|
58
|
+
private createCueBox;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=HtmlTextTrackRenderer.d.ts.map
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { EventHostImpl, Maybe, RequestInitOptions } from '@amazon/vinyl-util';
|
|
2
|
+
import { TextTrackController, TextTrackControllerOptions, TextTrackEventMap, TextTrackInfo } from './TextTrack';
|
|
3
|
+
import { ObservableValue } from '@amazon/vinyl-observable';
|
|
4
|
+
import { MediaTextTrackProvider } from './mediaTextTrackProvider';
|
|
5
|
+
import { ReadonlyPlaybackController } from '../playback/ReadonlyPlaybackController';
|
|
6
|
+
import { TextTrackRenderer } from './TextTrackRenderer';
|
|
7
|
+
export interface SidecarTextTrackControllerDeps {
|
|
8
|
+
/**
|
|
9
|
+
* Hands out (memoized) DOM text tracks. Text tracks can only be created on a
|
|
10
|
+
* media element and never removed, so the provider reuses one track per
|
|
11
|
+
* rendition rather than accumulating them.
|
|
12
|
+
*/
|
|
13
|
+
readonly textTrackProvider: MediaTextTrackProvider;
|
|
14
|
+
/**
|
|
15
|
+
* Optional request init options forwarded with each VTT fetch (e.g. CORS).
|
|
16
|
+
*/
|
|
17
|
+
readonly requestInit?: Maybe<RequestInitOptions>;
|
|
18
|
+
/**
|
|
19
|
+
* The discovered text tracks, re-emitted whenever the manifest changes.
|
|
20
|
+
*/
|
|
21
|
+
readonly textTracks: ObservableValue<Promise<readonly TextTrackInfo[]>>;
|
|
22
|
+
/**
|
|
23
|
+
* Declarative selection / rendering configuration. Re-applied on change.
|
|
24
|
+
*/
|
|
25
|
+
readonly options: ObservableValue<TextTrackControllerOptions>;
|
|
26
|
+
/**
|
|
27
|
+
* Supplies the current playhead used to fetch caption segments in a window
|
|
28
|
+
* around it.
|
|
29
|
+
*/
|
|
30
|
+
readonly playbackController: ReadonlyPlaybackController;
|
|
31
|
+
/**
|
|
32
|
+
* Optional renderer that paints cues itself (HTML overlay). When provided,
|
|
33
|
+
* the DOM text track is kept `'hidden'` (timing only) and the renderer is
|
|
34
|
+
* handed the active track; without one, the track renders natively
|
|
35
|
+
* (`'showing'`).
|
|
36
|
+
*/
|
|
37
|
+
readonly textTrackRenderer?: Maybe<TextTrackRenderer>;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Selects the text track that matches the given options, or null for none.
|
|
41
|
+
*
|
|
42
|
+
* The `enabled` mode gates everything: `'off'` renders nothing (default is
|
|
43
|
+
* `'forced'`). Otherwise an explicit {@link TextTrackSelection.id} wins; else
|
|
44
|
+
* the best language match is chosen among tracks filtered by kind and
|
|
45
|
+
* forced-ness. Forced-ness comes from {@link TextTrackSelection.forced} when
|
|
46
|
+
* set, otherwise from the mode (`'forced'` keeps only forced tracks, `'on'`
|
|
47
|
+
* only full tracks).
|
|
48
|
+
*
|
|
49
|
+
* @private
|
|
50
|
+
*/
|
|
51
|
+
export declare function resolveSelectedTrack(tracks: readonly TextTrackInfo[], options: TextTrackControllerOptions): TextTrackInfo | null;
|
|
52
|
+
/**
|
|
53
|
+
* Manages a sidecar WebVTT-based text track lifecycle:
|
|
54
|
+
*
|
|
55
|
+
* - tracks the discovered {@link TextTrackInfo} list (from the `textTracks`
|
|
56
|
+
* observable) and the current selection (from the `options` observable)
|
|
57
|
+
* - on selection, fetches the chosen track's WebVTT and pushes cues to a DOM
|
|
58
|
+
* `TextTrack` obtained from the {@link MediaTextTrackProvider}
|
|
59
|
+
* - clears cues and hides the DOM track when the selection changes or clears
|
|
60
|
+
*
|
|
61
|
+
* The controller is agnostic of HLS/DASH discovery details; its inputs are the
|
|
62
|
+
* observables supplied by the manifest layer.
|
|
63
|
+
*/
|
|
64
|
+
export declare class SidecarTextTrackController extends EventHostImpl<TextTrackEventMap> implements TextTrackController {
|
|
65
|
+
private readonly deps;
|
|
66
|
+
get [Symbol.toStringTag](): string;
|
|
67
|
+
private _active;
|
|
68
|
+
private _tracks;
|
|
69
|
+
private _activeTextTrack;
|
|
70
|
+
private _ref;
|
|
71
|
+
private readonly loadAbort;
|
|
72
|
+
private readonly disposer;
|
|
73
|
+
constructor(deps: SidecarTextTrackControllerDeps);
|
|
74
|
+
get textTracks(): readonly TextTrackInfo[];
|
|
75
|
+
get activeTextTrack(): (TextTrackInfo | null);
|
|
76
|
+
get active(): boolean;
|
|
77
|
+
get disposed(): boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Replaces the discovered track list, emits `textTracksChange`, then
|
|
80
|
+
* re-applies the current selection against the new list.
|
|
81
|
+
*/
|
|
82
|
+
private setTracks;
|
|
83
|
+
/**
|
|
84
|
+
* Recomputes the selection from the current options and track list,
|
|
85
|
+
* emitting `activeTextTrackChange` on change and (re)rendering when active.
|
|
86
|
+
*/
|
|
87
|
+
private refreshSelection;
|
|
88
|
+
deactivate(): void;
|
|
89
|
+
activate(): void;
|
|
90
|
+
private startLoad;
|
|
91
|
+
private appendCues;
|
|
92
|
+
/**
|
|
93
|
+
* Clears cues from the current DOM track and hides it, keeping the track for
|
|
94
|
+
* later reuse via the provider.
|
|
95
|
+
*/
|
|
96
|
+
private hideCurrent;
|
|
97
|
+
/**
|
|
98
|
+
* Cancels any in-flight load, hides the DOM text track, and resets state.
|
|
99
|
+
* Called by the host when the underlying media is unloaded.
|
|
100
|
+
*/
|
|
101
|
+
dispose(): void;
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=SidecarTextTrackController.d.ts.map
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { Maybe, ReadonlyAbort, RequestInitOptions } from '@amazon/vinyl-util';
|
|
2
|
+
import { WebVttCue } from './parseWebVtt';
|
|
3
|
+
/**
|
|
4
|
+
* Seconds ahead of the playhead to keep cues buffered. Mirrors the media
|
|
5
|
+
* pipeline's default HLS `minBufferTime` so captions stay in step with the
|
|
6
|
+
* audio/video buffer.
|
|
7
|
+
*/
|
|
8
|
+
export declare const DEFAULT_TEXT_LOOK_AHEAD = 10;
|
|
9
|
+
/**
|
|
10
|
+
* Seconds behind the playhead to keep cues buffered. Small window so that a
|
|
11
|
+
* short rewind (e.g. accidental skip-back) doesn't force a refetch.
|
|
12
|
+
*/
|
|
13
|
+
export declare const DEFAULT_TEXT_LOOK_BEHIND = 2;
|
|
14
|
+
export interface LoadWebVttCuesOptions {
|
|
15
|
+
readonly abort?: Maybe<ReadonlyAbort>;
|
|
16
|
+
readonly requestInit?: Maybe<RequestInitOptions>;
|
|
17
|
+
/**
|
|
18
|
+
* HLS EXT-X-DEFINE variables to make available for `IMPORT` and for
|
|
19
|
+
* substitution of segment URIs when loading from an HLS media playlist.
|
|
20
|
+
*/
|
|
21
|
+
readonly variables?: Maybe<Readonly<Record<string, string>>>;
|
|
22
|
+
/**
|
|
23
|
+
* Invoked with each batch of cues as soon as they are parsed. Called once
|
|
24
|
+
* per HLS segment, or once for a direct `.vtt` document.
|
|
25
|
+
*/
|
|
26
|
+
readonly onCues: (cues: readonly WebVttCue[]) => void;
|
|
27
|
+
/**
|
|
28
|
+
* Invoked with the CSS body of any `STYLE` blocks parsed from a document.
|
|
29
|
+
* Only called when a document actually declares styles.
|
|
30
|
+
*/
|
|
31
|
+
readonly onStyles?: Maybe<(styles: readonly string[]) => void>;
|
|
32
|
+
/**
|
|
33
|
+
* Returns the current playback time (seconds on the presentation
|
|
34
|
+
* timeline). Used to fetch caption segments in a window around the
|
|
35
|
+
* playhead rather than draining the entire playlist up front.
|
|
36
|
+
*/
|
|
37
|
+
readonly getCurrentTime: () => number;
|
|
38
|
+
/**
|
|
39
|
+
* Seconds ahead of the playhead to keep buffered. Default 10s.
|
|
40
|
+
*/
|
|
41
|
+
readonly lookAhead?: Maybe<number>;
|
|
42
|
+
/**
|
|
43
|
+
* Seconds behind the playhead to keep buffered. Default 2s.
|
|
44
|
+
*/
|
|
45
|
+
readonly lookBehind?: Maybe<number>;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Loads WebVTT cues from a URI, streaming them by playhead position.
|
|
49
|
+
*
|
|
50
|
+
* Two URI shapes are accepted:
|
|
51
|
+
* - Direct `.vtt` document: fetched once and delivered via `onCues`.
|
|
52
|
+
* - HLS media playlist (`.m3u8`): the playlist is parsed, then segments
|
|
53
|
+
* whose time range overlaps the buffer window around `getCurrentTime()`
|
|
54
|
+
* are fetched (closest to the playhead first), one at a time. Each
|
|
55
|
+
* segment's cues are delivered via `onCues` as it is parsed.
|
|
56
|
+
*
|
|
57
|
+
* Cue start/end times are expected to already be on the presentation
|
|
58
|
+
* timeline (Shaka packager's default WebVTT output), so segments are joined
|
|
59
|
+
* without offset.
|
|
60
|
+
*
|
|
61
|
+
* The returned promise resolves once every segment has been fetched, or the
|
|
62
|
+
* abort signal fires. Fetch failures reject the promise.
|
|
63
|
+
*/
|
|
64
|
+
export declare function loadWebVttCues(uri: string, options: LoadWebVttCuesOptions): Promise<void>;
|
|
65
|
+
//# sourceMappingURL=SidecarTextTrackLoader.d.ts.map
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import { ChangeEvent } from '../event/ChangeEvent';
|
|
2
|
+
import { ReadonlyEventHost } from '@amazon/vinyl-util';
|
|
3
|
+
import { ObjectSchema } from '@amazon/vinyl-validation';
|
|
4
|
+
/**
|
|
5
|
+
* Categorizes the role of a text track. Mirrors HTMLMediaElement.TextTrackKind.
|
|
6
|
+
*/
|
|
7
|
+
export type TextTrackKind = 'subtitles' | 'captions' | 'descriptions' | 'chapters' | 'metadata';
|
|
8
|
+
/**
|
|
9
|
+
* Identifies and describes an available text track.
|
|
10
|
+
* One TextTrackInfo is produced per discovered subtitle rendition.
|
|
11
|
+
*/
|
|
12
|
+
export interface TextTrackInfo {
|
|
13
|
+
/**
|
|
14
|
+
* A stable, unique identifier within the current media presentation.
|
|
15
|
+
*/
|
|
16
|
+
readonly id: string;
|
|
17
|
+
/**
|
|
18
|
+
* The text track kind. Defaults to 'subtitles' when not otherwise specified.
|
|
19
|
+
*/
|
|
20
|
+
readonly kind: TextTrackKind;
|
|
21
|
+
/**
|
|
22
|
+
* The BCP 47 language tag for the cues in this track, or null if unknown.
|
|
23
|
+
*/
|
|
24
|
+
readonly language: string | null;
|
|
25
|
+
/**
|
|
26
|
+
* A human-readable label for the track.
|
|
27
|
+
*/
|
|
28
|
+
readonly label: string;
|
|
29
|
+
/**
|
|
30
|
+
* Set when the source manifest signals this track as the default selection.
|
|
31
|
+
*/
|
|
32
|
+
readonly default: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Whether this is a forced track: it carries essential text (e.g.
|
|
35
|
+
* translations of foreign-language dialogue) meant to be shown even when
|
|
36
|
+
* the user has not enabled subtitles. Two tracks may share a language and
|
|
37
|
+
* differ only by this flag, so selection must distinguish them.
|
|
38
|
+
*/
|
|
39
|
+
readonly forced: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Media characteristics / accessibility roles describing the track, e.g.
|
|
42
|
+
* `public.accessibility.transcribes-spoken-dialog` (HLS CHARACTERISTICS) or
|
|
43
|
+
* a DASH role/accessibility scheme value. Empty when none are signaled.
|
|
44
|
+
*/
|
|
45
|
+
readonly characteristics: readonly string[];
|
|
46
|
+
/**
|
|
47
|
+
* The full URL of the underlying text resource (typically a WebVTT file).
|
|
48
|
+
*/
|
|
49
|
+
readonly uri: string;
|
|
50
|
+
/**
|
|
51
|
+
* The MIME type signaled by the source manifest, when known.
|
|
52
|
+
*/
|
|
53
|
+
readonly mimeType: string | null;
|
|
54
|
+
/**
|
|
55
|
+
* HLS EXT-X-DEFINE variables inherited from the parent multivariant
|
|
56
|
+
* playlist. Sidecar text-track media playlists commonly `IMPORT` these
|
|
57
|
+
* names and reference them in segment URIs. Present only for HLS-sourced
|
|
58
|
+
* tracks whose parent playlist declared any variables.
|
|
59
|
+
*/
|
|
60
|
+
readonly variables?: Readonly<Record<string, string>>;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Events dispatched by a {@link TextTrackController}.
|
|
64
|
+
*/
|
|
65
|
+
export interface TextTrackEventMap {
|
|
66
|
+
/**
|
|
67
|
+
* Emitted when the available text tracks change.
|
|
68
|
+
*/
|
|
69
|
+
readonly textTracksChange: ChangeEvent<readonly TextTrackInfo[]>;
|
|
70
|
+
/**
|
|
71
|
+
* Emitted when the active text track changes.
|
|
72
|
+
*/
|
|
73
|
+
readonly activeTextTrackChange: ChangeEvent<TextTrackInfo | null>;
|
|
74
|
+
/**
|
|
75
|
+
* Emitted when an error occurs while loading or activating a text track.
|
|
76
|
+
*/
|
|
77
|
+
readonly textTrackError: TextTrackErrorEvent;
|
|
78
|
+
}
|
|
79
|
+
export interface TextTrackErrorEvent {
|
|
80
|
+
readonly track: TextTrackInfo;
|
|
81
|
+
readonly error: Error;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Which captions render:
|
|
85
|
+
* - `'off'` — nothing renders (not even forced narrative captions).
|
|
86
|
+
* - `'forced'` — only forced (narrative) tracks, so nothing shows unless the
|
|
87
|
+
* content carries a forced track for the preferred language.
|
|
88
|
+
* - `'on'` — the full (non-forced) subtitle track for the preferred language.
|
|
89
|
+
*/
|
|
90
|
+
export type CaptionMode = 'on' | 'off' | 'forced';
|
|
91
|
+
/**
|
|
92
|
+
* Criteria used to pick which text track to render. Applied in priority order:
|
|
93
|
+
* an explicit {@link id} wins; otherwise the best {@link language} match is
|
|
94
|
+
* chosen among tracks filtered by {@link kind} and by forced-ness (from
|
|
95
|
+
* {@link forced} when set, else from the controller's
|
|
96
|
+
* {@link TextTrackControllerOptions.enabled} mode).
|
|
97
|
+
*/
|
|
98
|
+
export interface TextTrackSelection {
|
|
99
|
+
/**
|
|
100
|
+
* Selects the text track with this exact identifier, ignoring the other
|
|
101
|
+
* criteria (but still gated by the `'off'` mode). If no track has this id,
|
|
102
|
+
* nothing is selected.
|
|
103
|
+
*/
|
|
104
|
+
readonly id?: string | null;
|
|
105
|
+
/**
|
|
106
|
+
* Restricts selection to tracks of this kind (e.g. `'captions'`). Unset
|
|
107
|
+
* considers all kinds.
|
|
108
|
+
*/
|
|
109
|
+
readonly kind?: TextTrackKind | null;
|
|
110
|
+
/**
|
|
111
|
+
* Preferred caption language(s), most-preferred first, as RFC 5646 tags.
|
|
112
|
+
* When unset (or empty) selection falls back to the platform's
|
|
113
|
+
* `navigator.languages`.
|
|
114
|
+
*/
|
|
115
|
+
readonly language?: string | readonly string[] | null;
|
|
116
|
+
/**
|
|
117
|
+
* Explicit forced-ness filter. When set, only tracks whose `forced` flag
|
|
118
|
+
* equals this value are considered, overriding the forced/full split
|
|
119
|
+
* implied by the `enabled` mode. Unset means the mode decides.
|
|
120
|
+
*/
|
|
121
|
+
readonly forced?: boolean | null;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Declarative configuration for a {@link TextTrackController}. Rendering is
|
|
125
|
+
* driven entirely by this value (via `VinylOptions.text`); there is no
|
|
126
|
+
* imperative track-select call.
|
|
127
|
+
*/
|
|
128
|
+
export interface TextTrackControllerOptions {
|
|
129
|
+
/**
|
|
130
|
+
* Which captions render (see {@link CaptionMode}). Unset defaults to
|
|
131
|
+
* `'forced'`.
|
|
132
|
+
*/
|
|
133
|
+
readonly enabled?: CaptionMode | null;
|
|
134
|
+
/**
|
|
135
|
+
* The selection criteria (language / id / kind). When unset, the preferred
|
|
136
|
+
* languages fall back to the platform's `navigator.languages`.
|
|
137
|
+
*/
|
|
138
|
+
readonly selection?: TextTrackSelection | null;
|
|
139
|
+
}
|
|
140
|
+
export declare const textTrackControllerOptionsValidator: ObjectSchema<TextTrackControllerOptions>;
|
|
141
|
+
export declare const ALL_TEXT_TRACK_EVENTS: readonly [
|
|
142
|
+
"textTracksChange",
|
|
143
|
+
"activeTextTrackChange",
|
|
144
|
+
"textTrackError"
|
|
145
|
+
];
|
|
146
|
+
/**
|
|
147
|
+
* Read-only view of available text tracks and the active selection.
|
|
148
|
+
*/
|
|
149
|
+
export interface ReadonlyTextTrackController extends ReadonlyEventHost<TextTrackEventMap> {
|
|
150
|
+
/**
|
|
151
|
+
* The list of currently discovered text tracks.
|
|
152
|
+
*/
|
|
153
|
+
readonly textTracks: readonly TextTrackInfo[];
|
|
154
|
+
/**
|
|
155
|
+
* The currently active text track, or null if none is active.
|
|
156
|
+
*/
|
|
157
|
+
readonly activeTextTrack: TextTrackInfo | null;
|
|
158
|
+
/*
|
|
159
|
+
* Returns true if this text track controller is active.
|
|
160
|
+
*/
|
|
161
|
+
readonly active: boolean;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Full controller for the current media's text tracks. Selection is driven
|
|
165
|
+
* declaratively through the controller's options (`VinylOptions.text`); this
|
|
166
|
+
* interface only adds the render lifecycle used by the owning media track.
|
|
167
|
+
*/
|
|
168
|
+
export interface TextTrackController extends ReadonlyTextTrackController {
|
|
169
|
+
/**
|
|
170
|
+
* Suspends cue rendering without changing the active selection: cancels any
|
|
171
|
+
* in-flight load and hides the DOM text track (so its cues stop showing).
|
|
172
|
+
* Called when the owning media track is deactivated — e.g. while an ad
|
|
173
|
+
* plays over the suspended content. {@link activate} rebuilds it.
|
|
174
|
+
*/
|
|
175
|
+
deactivate(): void;
|
|
176
|
+
/**
|
|
177
|
+
* Resumes rendering the active selection after a {@link deactivate},
|
|
178
|
+
* reloading its cues. No-op when nothing is selected or already rendering.
|
|
179
|
+
* Called when the owning media track is reactivated.
|
|
180
|
+
*/
|
|
181
|
+
activate(): void;
|
|
182
|
+
}
|
|
183
|
+
//# sourceMappingURL=TextTrack.d.ts.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Renders a text track's cues. Injected into the player so an application can
|
|
3
|
+
* paint captions itself (as HTML) instead of relying on the browser's native
|
|
4
|
+
* `TextTrack` rendering — giving full control over styling and placement.
|
|
5
|
+
*
|
|
6
|
+
* The controller hands the renderer the DOM `TextTrack` (set to `'hidden'`, so
|
|
7
|
+
* the browser tracks cue timing but does not paint); the renderer listens for
|
|
8
|
+
* the track's active cues and draws them. See {@link HtmlTextTrackRenderer} for
|
|
9
|
+
* the built-in HTML implementation.
|
|
10
|
+
*/
|
|
11
|
+
export interface TextTrackRenderer {
|
|
12
|
+
/**
|
|
13
|
+
* Renders the active cues of `track`, listening for cue changes. Passing
|
|
14
|
+
* `null` clears anything rendered and detaches from the previous track.
|
|
15
|
+
*/
|
|
16
|
+
setTextTrack(track: TextTrack | null): void;
|
|
17
|
+
/**
|
|
18
|
+
* Supplies the CSS bodies of the track's WebVTT `STYLE` blocks (which carry
|
|
19
|
+
* `::cue` rules), so the renderer can style cue classes. Optional — a
|
|
20
|
+
* renderer may ignore authored styles.
|
|
21
|
+
*/
|
|
22
|
+
setStyles?(styles: readonly string[]): void;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=TextTrackRenderer.d.ts.map
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { ObjectSchema } from '@amazon/vinyl-validation';
|
|
2
|
+
/**
|
|
3
|
+
* Layout style applied to each rendered WebVTT cue, mirroring the settable
|
|
4
|
+
* positioning properties of the DOM `VTTCue`. Only the properties that are set
|
|
5
|
+
* are applied; the rest keep the browser defaults.
|
|
6
|
+
*
|
|
7
|
+
* These are the WebVTT cue-box layout controls (not text color/font, which are
|
|
8
|
+
* only reachable via the non-configurable `::cue` pseudo-element). See
|
|
9
|
+
* {@link https://developer.mozilla.org/docs/Web/API/VTTCue}.
|
|
10
|
+
*/
|
|
11
|
+
export interface VttCueStyle {
|
|
12
|
+
/** Text alignment within the cue box. */
|
|
13
|
+
readonly align?: AlignSetting;
|
|
14
|
+
/** Line (vertical) position, as a line number/percentage or `'auto'`. */
|
|
15
|
+
readonly line?: number | AutoKeyword;
|
|
16
|
+
/** How `line` is anchored. */
|
|
17
|
+
readonly lineAlign?: LineAlignSetting;
|
|
18
|
+
/** Inline position of the cue box, as a percentage or `'auto'`. */
|
|
19
|
+
readonly position?: number | AutoKeyword;
|
|
20
|
+
/** How `position` is anchored. */
|
|
21
|
+
readonly positionAlign?: PositionAlignSetting;
|
|
22
|
+
/** Size of the cue box as a percentage of the video dimension. */
|
|
23
|
+
readonly size?: number;
|
|
24
|
+
/** Whether `line` is a line number (true) or a percentage (false). */
|
|
25
|
+
readonly snapToLines?: boolean;
|
|
26
|
+
/** Writing direction. */
|
|
27
|
+
readonly vertical?: DirectionSetting;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Type guard for a DOM cue that is a `VTTCue` (and so carries the WebVTT layout
|
|
31
|
+
* properties). On platforms without `VTTCue`, cues are plain `TextTrackCue`s
|
|
32
|
+
* that cannot be styled.
|
|
33
|
+
*/
|
|
34
|
+
export declare function isVttCue(cue: TextTrackCue): cue is VTTCue;
|
|
35
|
+
/**
|
|
36
|
+
* Applies the configured layout style to a `VTTCue`, setting only the
|
|
37
|
+
* properties present in `style`.
|
|
38
|
+
*/
|
|
39
|
+
export declare function applyVttCueStyle(cue: VTTCue, style: VttCueStyle): void;
|
|
40
|
+
export declare const vttCueStyleValidator: ObjectSchema<VttCueStyle>;
|
|
41
|
+
//# sourceMappingURL=VttCueStyle.d.ts.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { DashManifest } from '@amazon/vinyl-mpd-parser';
|
|
2
|
+
import { TextTrackInfo } from './TextTrack';
|
|
3
|
+
/**
|
|
4
|
+
* Discovers sidecar text tracks from a DASH manifest.
|
|
5
|
+
*
|
|
6
|
+
* Considers an `<AdaptationSet>` to carry text when one of:
|
|
7
|
+
* - `contentType="text"`
|
|
8
|
+
* - its `mimeType`, or that of one of its `<Representation>`s, starts with
|
|
9
|
+
* `text/` (e.g. `text/vtt`)
|
|
10
|
+
*
|
|
11
|
+
* Within a text adaptation set, each `<Representation>` becomes one
|
|
12
|
+
* {@link TextTrackInfo}. The `BaseURL` chain (MPD → Period → AdaptationSet →
|
|
13
|
+
* Representation) is resolved against the supplied `baseUrl`.
|
|
14
|
+
*
|
|
15
|
+
* Only sidecar (single-file) WebVTT renditions are surfaced. Segmented text
|
|
16
|
+
* tracks (`stpp`/`wvtt` codecs) are ignored - they would require streaming
|
|
17
|
+
* through MSE which the sidecar pipeline does not support.
|
|
18
|
+
*
|
|
19
|
+
* @param manifest The parsed DASH manifest.
|
|
20
|
+
* @param baseUrl The URL of the manifest, used as the root for `BaseURL`
|
|
21
|
+
* resolution.
|
|
22
|
+
*/
|
|
23
|
+
export declare function discoverDashTextTracks(manifest: DashManifest, baseUrl: string): readonly TextTrackInfo[];
|
|
24
|
+
//# sourceMappingURL=discoverDashTextTracks.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { HlsMainPlaylist } from '@amazon/vinyl-hls-parser';
|
|
2
|
+
import { TextTrackInfo } from './TextTrack';
|
|
3
|
+
/**
|
|
4
|
+
* Discovers sidecar text tracks from an HLS multivariant playlist.
|
|
5
|
+
*
|
|
6
|
+
* Per RFC 8216 §4.3.4.2, subtitle renditions are signaled with
|
|
7
|
+
* `EXT-X-MEDIA:TYPE=SUBTITLES` and (when usable as sidecar) carry a `URI`
|
|
8
|
+
* attribute pointing at a media playlist or, in the simplified single-file
|
|
9
|
+
* case, a `.vtt` file directly.
|
|
10
|
+
*
|
|
11
|
+
* Closed captions (`TYPE=CLOSED-CAPTIONS`) are intentionally excluded - they
|
|
12
|
+
* are delivered in-band with the video stream and are surfaced by the browser
|
|
13
|
+
* automatically, not through a sidecar fetch.
|
|
14
|
+
*
|
|
15
|
+
* @param mainPlaylist The parsed HLS main playlist.
|
|
16
|
+
* @param baseUrl The URL of the main playlist, used to resolve relative URIs.
|
|
17
|
+
*/
|
|
18
|
+
export declare function discoverHlsTextTracks(mainPlaylist: HlsMainPlaylist, baseUrl: string): readonly TextTrackInfo[];
|
|
19
|
+
//# sourceMappingURL=discoverHlsTextTracks.d.ts.map
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { TextTrackKind } from './TextTrack';
|
|
2
|
+
/**
|
|
3
|
+
* A handle to a DOM {@link TextTrack} created on the media element, plus a way
|
|
4
|
+
* to clear its cues.
|
|
5
|
+
*/
|
|
6
|
+
export interface TextTrackRef {
|
|
7
|
+
readonly track: TextTrack;
|
|
8
|
+
/**
|
|
9
|
+
* Removes all cues from the track. Must be called while the track is not
|
|
10
|
+
* `disabled` — `TextTrack.cues` reads null in the disabled state, so
|
|
11
|
+
* clearing a disabled track silently leaves its cues attached.
|
|
12
|
+
*/
|
|
13
|
+
clear(): void;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Creates and hands out DOM text tracks for a media element, memoized per
|
|
17
|
+
* `(kind, label, language)`.
|
|
18
|
+
*
|
|
19
|
+
* `HTMLMediaElement.addTextTrack` tracks can never be removed, so creating a
|
|
20
|
+
* fresh one per activation would accumulate tracks — and any left in `showing`
|
|
21
|
+
* mode renders alongside the active one (captions "bleed through"). Reusing one
|
|
22
|
+
* track per key keeps exactly one track per distinct rendition.
|
|
23
|
+
*/
|
|
24
|
+
export interface MediaTextTrackProvider {
|
|
25
|
+
getOrCreate(kind: TextTrackKind, label?: string, language?: string): TextTrackRef;
|
|
26
|
+
}
|
|
27
|
+
export declare function createMediaTextTrackProvider(deps: {
|
|
28
|
+
/**
|
|
29
|
+
* The HTML media element on which to attach the in-band TextTrack
|
|
30
|
+
* representation.
|
|
31
|
+
*/
|
|
32
|
+
readonly media: HTMLMediaElement;
|
|
33
|
+
}): MediaTextTrackProvider;
|
|
34
|
+
//# sourceMappingURL=mediaTextTrackProvider.d.ts.map
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { VttCueStyle } from './VttCueStyle';
|
|
2
|
+
/**
|
|
3
|
+
* A single WebVTT cue.
|
|
4
|
+
*
|
|
5
|
+
* @see https://www.w3.org/TR/webvtt1/
|
|
6
|
+
*/
|
|
7
|
+
export interface WebVttCue {
|
|
8
|
+
/**
|
|
9
|
+
* Optional cue identifier, the line that appears before the timing line.
|
|
10
|
+
*/
|
|
11
|
+
readonly id: string | null;
|
|
12
|
+
/**
|
|
13
|
+
* Cue start time in seconds.
|
|
14
|
+
*/
|
|
15
|
+
readonly startTime: number;
|
|
16
|
+
/**
|
|
17
|
+
* Cue end time in seconds.
|
|
18
|
+
*/
|
|
19
|
+
readonly endTime: number;
|
|
20
|
+
/**
|
|
21
|
+
* The cue text payload, with line breaks preserved as `\n`.
|
|
22
|
+
*/
|
|
23
|
+
readonly text: string;
|
|
24
|
+
/**
|
|
25
|
+
* The authored cue settings from the timing line (position/line/size/
|
|
26
|
+
* align/vertical), when any were present. Preserved so a renderer can
|
|
27
|
+
* position the cue faithfully. Absent when the cue declared no settings.
|
|
28
|
+
*/
|
|
29
|
+
readonly settings?: VttCueStyle;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* The result of parsing a WebVTT document.
|
|
33
|
+
*/
|
|
34
|
+
export interface WebVttDocument {
|
|
35
|
+
/**
|
|
36
|
+
* Parsed cues in document order.
|
|
37
|
+
*/
|
|
38
|
+
readonly cues: readonly WebVttCue[];
|
|
39
|
+
/**
|
|
40
|
+
* The raw CSS body of each `STYLE` block, in document order. These carry
|
|
41
|
+
* `::cue` rules (e.g. `::cue(.loud) { font-weight: bold }`) an HTML renderer
|
|
42
|
+
* can apply. Empty when the document declared no styles.
|
|
43
|
+
*/
|
|
44
|
+
readonly styles: readonly string[];
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Parses a WebVTT document into a list of cues.
|
|
48
|
+
*
|
|
49
|
+
* Implements a forgiving subset of the WebVTT 1.0 specification: header
|
|
50
|
+
* detection, comment blocks (lines starting with `NOTE`), styling/region
|
|
51
|
+
* blocks (STYLE bodies are captured, REGION skipped), cue identifiers, and
|
|
52
|
+
* HH:MM:SS.mmm or MM:SS.mmm timestamps with optional cue settings.
|
|
53
|
+
*
|
|
54
|
+
* @param input The raw WebVTT document text. Both LF and CRLF line endings
|
|
55
|
+
* are supported, and a leading BOM is stripped if present.
|
|
56
|
+
* @throws ValidationError if the input is missing the WEBVTT header.
|
|
57
|
+
* @see https://www.w3.org/TR/webvtt1/#webvtt-timestamp
|
|
58
|
+
*/
|
|
59
|
+
export declare function parseWebVtt(input: string): WebVttDocument;
|
|
60
|
+
//# sourceMappingURL=parseWebVtt.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TextTrackInfo } from './TextTrack';
|
|
2
|
+
import { Maybe } from '@amazon/vinyl-util';
|
|
3
|
+
/**
|
|
4
|
+
* Chooses the text track that best matches the preferred language(s), or null
|
|
5
|
+
* when none relate (or there is no preference / no tracks).
|
|
6
|
+
*
|
|
7
|
+
* Language dominates: a track is ranked first by which preference it relates to
|
|
8
|
+
* (earlier entries win) and how closely (see {@link languageRelatedness}).
|
|
9
|
+
* Within a single language, a full track is preferred over a forced-only track
|
|
10
|
+
* (a user asking for a caption language wants the full captions, not just the
|
|
11
|
+
* forced foreign-dialogue cues), and a manifest-default track breaks any
|
|
12
|
+
* remaining tie.
|
|
13
|
+
*/
|
|
14
|
+
export declare function pickPreferredTextTrack(tracks: readonly TextTrackInfo[], preferred: Maybe<string | readonly string[]>): TextTrackInfo | null;
|
|
15
|
+
//# sourceMappingURL=pickPreferredTextTrack.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { HlsMainPlaylist, HlsMediaPlaylist } from '@amazon/vinyl-hls-parser';
|
|
2
|
+
export interface HlsManifestData {
|
|
3
|
+
/**
|
|
4
|
+
* The main HLS playlist manifest.
|
|
5
|
+
* Use getMediaPlaylist to resolve bitrate manifests.
|
|
6
|
+
*/
|
|
7
|
+
readonly mainPlaylist: HlsMainPlaylist;
|
|
8
|
+
/**
|
|
9
|
+
* The URL to be used for relative requests. Guaranteed to be absolute.
|
|
10
|
+
*
|
|
11
|
+
* Media with relative paths in the manifests will be resolved relative to this URL.
|
|
12
|
+
*/
|
|
13
|
+
readonly baseUrl: string;
|
|
14
|
+
/**
|
|
15
|
+
* Lazily fetches and caches a media playlist by variant URI.
|
|
16
|
+
*/
|
|
17
|
+
readonly getMediaPlaylist: (uri: string) => Promise<HlsMediaPlaylist>;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=HlsManifestData.d.ts.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { HlsTrackLoadOptions } from './HlsTrack';
|
|
2
|
+
import { ManifestProvider } from '../../streaming/ManifestController';
|
|
3
|
+
import { HlsManifestData } from './HlsManifestData';
|
|
4
|
+
export declare function createHlsManifestProvider(loadOptions: HlsTrackLoadOptions): HlsManifestProvider;
|
|
5
|
+
export type HlsManifestProvider = ManifestProvider<HlsManifestData>;
|
|
6
|
+
//# sourceMappingURL=createHlsManifestProvider.d.ts.map
|