@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 @@
|
|
|
1
|
+
{"version":3,"file":"SidecarTextTrackLoader.test.d.ts","sourceRoot":"","sources":["../../../../../test/unit/text/SidecarTextTrackLoader.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,365 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
import { loadWebVttCues } from '@amazon/vinyl';
|
|
6
|
+
import { Abort, requesterWithRetryRef } from '@amazon/vinyl-util';
|
|
7
|
+
import { MockRequester } from '@amazon/vinyl-util/testUtil';
|
|
8
|
+
describe('loadWebVttCues', () => {
|
|
9
|
+
let requester;
|
|
10
|
+
beforeEach(() => {
|
|
11
|
+
requester = new MockRequester();
|
|
12
|
+
requesterWithRetryRef.set(() => requester);
|
|
13
|
+
});
|
|
14
|
+
function respondText(body, contentType, url) {
|
|
15
|
+
const headers = contentType
|
|
16
|
+
? new Headers({ 'content-type': contentType })
|
|
17
|
+
: new Headers();
|
|
18
|
+
const response = new Response(body, { headers });
|
|
19
|
+
if (url) {
|
|
20
|
+
Object.defineProperty(response, 'url', { value: url });
|
|
21
|
+
}
|
|
22
|
+
return Promise.resolve(response);
|
|
23
|
+
}
|
|
24
|
+
// Common options: a callback receiving cues, and a playhead that keeps
|
|
25
|
+
// moving forward so the buffer window advances past every segment.
|
|
26
|
+
function streamingOpts(overrides = {}) {
|
|
27
|
+
let now = 0;
|
|
28
|
+
const batches = [];
|
|
29
|
+
return {
|
|
30
|
+
batches,
|
|
31
|
+
options: {
|
|
32
|
+
onCues: (cs) => batches.push(cs.map((c) => ({ text: c.text }))),
|
|
33
|
+
getCurrentTime: () => now,
|
|
34
|
+
advanceTime: (t) => {
|
|
35
|
+
now = t;
|
|
36
|
+
},
|
|
37
|
+
...overrides,
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
it('parses a direct .vtt response with no content-type header', async () => {
|
|
42
|
+
const response = new Response(`WEBVTT\n\n00:00:01.000 --> 00:00:02.000\nplain`, { headers: new Headers() });
|
|
43
|
+
response.headers.delete('content-type');
|
|
44
|
+
requester.request.and.resolveTo(response);
|
|
45
|
+
const { batches, options } = streamingOpts();
|
|
46
|
+
await loadWebVttCues('https://x.test/sub.vtt', options);
|
|
47
|
+
expect(batches.flat().map((c) => c.text)).toEqual(['plain']);
|
|
48
|
+
});
|
|
49
|
+
it('parses a direct .vtt response', async () => {
|
|
50
|
+
const body = `WEBVTT\n\n00:00:01.000 --> 00:00:02.000\ndirect`;
|
|
51
|
+
requester.request.and.resolveTo(respondText(body, 'text/vtt'));
|
|
52
|
+
const { batches, options } = streamingOpts();
|
|
53
|
+
await loadWebVttCues('https://x.test/sub.vtt', options);
|
|
54
|
+
expect(batches.flat().map((c) => c.text)).toEqual(['direct']);
|
|
55
|
+
});
|
|
56
|
+
it('treats application/x-mpegurl content-type as a media playlist', async () => {
|
|
57
|
+
const playlistText = `#EXTM3U
|
|
58
|
+
#EXT-X-VERSION:3
|
|
59
|
+
#EXT-X-TARGETDURATION:10
|
|
60
|
+
#EXTINF:10.0,
|
|
61
|
+
seg.vtt
|
|
62
|
+
#EXT-X-ENDLIST
|
|
63
|
+
`;
|
|
64
|
+
const segmentText = `WEBVTT\n\n00:00:01.000 --> 00:00:02.000\nfrom-segment`;
|
|
65
|
+
let call = 0;
|
|
66
|
+
requester.request.and.callFake(() => {
|
|
67
|
+
call++;
|
|
68
|
+
if (call === 1) {
|
|
69
|
+
return respondText(playlistText, 'application/vnd.apple.mpegurl', 'https://x.test/sub.m3u8');
|
|
70
|
+
}
|
|
71
|
+
return respondText(segmentText, 'text/vtt');
|
|
72
|
+
});
|
|
73
|
+
const { batches, options } = streamingOpts();
|
|
74
|
+
await loadWebVttCues('https://x.test/sub.txt', options);
|
|
75
|
+
expect(batches.flat().map((c) => c.text)).toEqual(['from-segment']);
|
|
76
|
+
});
|
|
77
|
+
it('forwards STYLE blocks parsed from a segment via onStyles', async () => {
|
|
78
|
+
const playlistText = `#EXTM3U
|
|
79
|
+
#EXT-X-TARGETDURATION:10
|
|
80
|
+
#EXTINF:10.0,
|
|
81
|
+
seg.vtt
|
|
82
|
+
#EXT-X-ENDLIST
|
|
83
|
+
`;
|
|
84
|
+
const segmentText = `WEBVTT
|
|
85
|
+
|
|
86
|
+
STYLE
|
|
87
|
+
::cue { color: red }
|
|
88
|
+
|
|
89
|
+
00:00:01.000 --> 00:00:02.000
|
|
90
|
+
from-segment`;
|
|
91
|
+
let call = 0;
|
|
92
|
+
requester.request.and.callFake(() => {
|
|
93
|
+
call++;
|
|
94
|
+
if (call === 1) {
|
|
95
|
+
return respondText(playlistText, 'application/vnd.apple.mpegurl', 'https://x.test/sub.m3u8');
|
|
96
|
+
}
|
|
97
|
+
return respondText(segmentText, 'text/vtt');
|
|
98
|
+
});
|
|
99
|
+
const styleBatches = [];
|
|
100
|
+
const { options } = streamingOpts({
|
|
101
|
+
onStyles: (styles) => styleBatches.push([...styles]),
|
|
102
|
+
});
|
|
103
|
+
await loadWebVttCues('https://x.test/sub.m3u8', options);
|
|
104
|
+
expect(styleBatches).toEqual([['::cue { color: red }']]);
|
|
105
|
+
});
|
|
106
|
+
it('falls back to the request URI when response.url is empty (body sniffed)', async () => {
|
|
107
|
+
const playlistText = `#EXTM3U
|
|
108
|
+
#EXT-X-VERSION:3
|
|
109
|
+
#EXT-X-TARGETDURATION:10
|
|
110
|
+
#EXTINF:10.0,
|
|
111
|
+
0.vtt
|
|
112
|
+
#EXT-X-ENDLIST
|
|
113
|
+
`;
|
|
114
|
+
const segText = `WEBVTT\n\n00:00:00.000 --> 00:00:01.000\nfb`;
|
|
115
|
+
let call = 0;
|
|
116
|
+
requester.request.and.callFake(() => {
|
|
117
|
+
call++;
|
|
118
|
+
if (call === 1)
|
|
119
|
+
return respondText(playlistText, 'application/vnd.apple.mpegurl');
|
|
120
|
+
return respondText(segText);
|
|
121
|
+
});
|
|
122
|
+
// No .m3u8 extension → sniffed via body. Response.url omitted so the
|
|
123
|
+
// fallback branch (response.url || uri) is exercised.
|
|
124
|
+
const { batches, options } = streamingOpts();
|
|
125
|
+
await loadWebVttCues('https://x.test/playlist', options);
|
|
126
|
+
expect(batches.flat().map((c) => c.text)).toEqual(['fb']);
|
|
127
|
+
});
|
|
128
|
+
it('uses response.url when set (m3u8 fetch redirect)', async () => {
|
|
129
|
+
const playlistText = `#EXTM3U
|
|
130
|
+
#EXT-X-VERSION:3
|
|
131
|
+
#EXT-X-TARGETDURATION:10
|
|
132
|
+
#EXTINF:10.0,
|
|
133
|
+
0.vtt
|
|
134
|
+
#EXT-X-ENDLIST
|
|
135
|
+
`;
|
|
136
|
+
const segText = `WEBVTT\n\n00:00:00.000 --> 00:00:01.000\nseg`;
|
|
137
|
+
let call = 0;
|
|
138
|
+
requester.request.and.callFake(() => {
|
|
139
|
+
call++;
|
|
140
|
+
if (call === 1) {
|
|
141
|
+
return respondText(playlistText, 'application/vnd.apple.mpegurl', 'https://cdn.example.com/redirected/sub.m3u8');
|
|
142
|
+
}
|
|
143
|
+
return respondText(segText);
|
|
144
|
+
});
|
|
145
|
+
const { options } = streamingOpts();
|
|
146
|
+
await loadWebVttCues('https://x.test/sub.m3u8', options);
|
|
147
|
+
const segUrl = requester.request.calls.argsFor(1)[0];
|
|
148
|
+
expect(String(segUrl)).toBe('https://cdn.example.com/redirected/0.vtt');
|
|
149
|
+
});
|
|
150
|
+
it('uses response.url when set (sniffed body)', async () => {
|
|
151
|
+
const playlistText = `#EXTM3U
|
|
152
|
+
#EXT-X-VERSION:3
|
|
153
|
+
#EXT-X-TARGETDURATION:10
|
|
154
|
+
#EXTINF:10.0,
|
|
155
|
+
0.vtt
|
|
156
|
+
#EXT-X-ENDLIST
|
|
157
|
+
`;
|
|
158
|
+
const segText = `WEBVTT\n\n00:00:00.000 --> 00:00:01.000\nseg`;
|
|
159
|
+
let call = 0;
|
|
160
|
+
requester.request.and.callFake(() => {
|
|
161
|
+
call++;
|
|
162
|
+
if (call === 1) {
|
|
163
|
+
return respondText(playlistText, undefined, 'https://cdn.example.com/redirected/sub');
|
|
164
|
+
}
|
|
165
|
+
return respondText(segText);
|
|
166
|
+
});
|
|
167
|
+
const { options } = streamingOpts();
|
|
168
|
+
await loadWebVttCues('https://x.test/sub', options);
|
|
169
|
+
const segUrl = requester.request.calls.argsFor(1)[0];
|
|
170
|
+
expect(String(segUrl)).toBe('https://cdn.example.com/redirected/0.vtt');
|
|
171
|
+
});
|
|
172
|
+
it('detects a media playlist by .m3u8 URL extension', async () => {
|
|
173
|
+
const playlistText = `#EXTM3U
|
|
174
|
+
#EXT-X-VERSION:3
|
|
175
|
+
#EXT-X-TARGETDURATION:10
|
|
176
|
+
#EXTINF:10.0,
|
|
177
|
+
0.vtt
|
|
178
|
+
#EXT-X-ENDLIST
|
|
179
|
+
`;
|
|
180
|
+
const segText = `WEBVTT\n\n00:00:01.000 --> 00:00:02.000\nseg`;
|
|
181
|
+
let call = 0;
|
|
182
|
+
requester.request.and.callFake(() => {
|
|
183
|
+
call++;
|
|
184
|
+
if (call === 1) {
|
|
185
|
+
return respondText(playlistText, 'application/vnd.apple.mpegurl');
|
|
186
|
+
}
|
|
187
|
+
return respondText(segText);
|
|
188
|
+
});
|
|
189
|
+
const { batches, options } = streamingOpts();
|
|
190
|
+
await loadWebVttCues('https://x.test/sub.m3u8', options);
|
|
191
|
+
expect(batches.flat().map((c) => c.text)).toEqual(['seg']);
|
|
192
|
+
});
|
|
193
|
+
it('fetches segments incrementally in playhead-first order', async () => {
|
|
194
|
+
// 4 segments × 5s each. Playhead at 12s selects segment c (10-15s)
|
|
195
|
+
// first because its midpoint is closest to the playhead.
|
|
196
|
+
const playlistBody = `#EXTM3U
|
|
197
|
+
#EXT-X-TARGETDURATION:5
|
|
198
|
+
#EXTINF:5.0,
|
|
199
|
+
a.vtt
|
|
200
|
+
#EXTINF:5.0,
|
|
201
|
+
b.vtt
|
|
202
|
+
#EXTINF:5.0,
|
|
203
|
+
c.vtt
|
|
204
|
+
#EXTINF:5.0,
|
|
205
|
+
d.vtt
|
|
206
|
+
#EXT-X-ENDLIST
|
|
207
|
+
`;
|
|
208
|
+
const fetched = [];
|
|
209
|
+
let call = 0;
|
|
210
|
+
requester.request.and.callFake((url) => {
|
|
211
|
+
call++;
|
|
212
|
+
if (call === 1)
|
|
213
|
+
return respondText(playlistBody);
|
|
214
|
+
const path = String(url).split('/').pop();
|
|
215
|
+
fetched.push(path);
|
|
216
|
+
return respondText(`WEBVTT\n\n00:00:00.000 --> 00:00:01.000\n${path}`);
|
|
217
|
+
});
|
|
218
|
+
const abort = new Abort();
|
|
219
|
+
const batches = [];
|
|
220
|
+
const promise = loadWebVttCues('https://x.test/sub.m3u8', {
|
|
221
|
+
onCues: (cs) => batches.push(cs.map((c) => c.text)),
|
|
222
|
+
getCurrentTime: () => 12,
|
|
223
|
+
abort,
|
|
224
|
+
});
|
|
225
|
+
// Let the loader consume every segment in the window, then abort.
|
|
226
|
+
await new Promise((r) => setTimeout(r, 50));
|
|
227
|
+
abort.abort();
|
|
228
|
+
await promise;
|
|
229
|
+
expect(fetched[0]).toBe('c.vtt');
|
|
230
|
+
expect(batches[0]).toEqual(['c.vtt']);
|
|
231
|
+
});
|
|
232
|
+
it('substitutes EXT-X-DEFINE:IMPORT variables in segment URIs', async () => {
|
|
233
|
+
const playlistBody = `#EXTM3U
|
|
234
|
+
#EXT-X-DEFINE:IMPORT="prefix"
|
|
235
|
+
#EXT-X-TARGETDURATION:5
|
|
236
|
+
#EXTINF:5.0,
|
|
237
|
+
{$prefix}0.vtt
|
|
238
|
+
#EXT-X-ENDLIST
|
|
239
|
+
`;
|
|
240
|
+
const segText = `WEBVTT\n\n00:00:00.000 --> 00:00:05.000\nhello`;
|
|
241
|
+
let call = 0;
|
|
242
|
+
requester.request.and.callFake((url) => {
|
|
243
|
+
call++;
|
|
244
|
+
if (call === 1)
|
|
245
|
+
return respondText(playlistBody);
|
|
246
|
+
expect(String(url)).toBe('https://cdn.example.com/0.vtt');
|
|
247
|
+
return respondText(segText);
|
|
248
|
+
});
|
|
249
|
+
const { batches, options } = streamingOpts();
|
|
250
|
+
await loadWebVttCues('https://x.test/sub.m3u8', {
|
|
251
|
+
...options,
|
|
252
|
+
variables: { prefix: 'https://cdn.example.com/' },
|
|
253
|
+
});
|
|
254
|
+
expect(batches.flat().map((c) => c.text)).toEqual(['hello']);
|
|
255
|
+
});
|
|
256
|
+
it('re-evaluates playhead between segment fetches for seek responsiveness', async () => {
|
|
257
|
+
const playlistBody = `#EXTM3U
|
|
258
|
+
#EXT-X-TARGETDURATION:5
|
|
259
|
+
#EXTINF:5.0,
|
|
260
|
+
a.vtt
|
|
261
|
+
#EXTINF:5.0,
|
|
262
|
+
b.vtt
|
|
263
|
+
#EXTINF:5.0,
|
|
264
|
+
c.vtt
|
|
265
|
+
#EXTINF:5.0,
|
|
266
|
+
d.vtt
|
|
267
|
+
#EXT-X-ENDLIST
|
|
268
|
+
`;
|
|
269
|
+
const fetched = [];
|
|
270
|
+
let currentTime = 0;
|
|
271
|
+
let call = 0;
|
|
272
|
+
requester.request.and.callFake((url) => {
|
|
273
|
+
call++;
|
|
274
|
+
if (call === 1)
|
|
275
|
+
return respondText(playlistBody);
|
|
276
|
+
const path = String(url).split('/').pop();
|
|
277
|
+
fetched.push(path);
|
|
278
|
+
// Seek to the end after seg0; abort will fire after seg3.
|
|
279
|
+
if (fetched.length === 1)
|
|
280
|
+
currentTime = 17;
|
|
281
|
+
return respondText(`WEBVTT\n\n00:00:00.000 --> 00:00:01.000\n${path}`);
|
|
282
|
+
});
|
|
283
|
+
const abort = new Abort();
|
|
284
|
+
const promise = loadWebVttCues('https://x.test/sub.m3u8', {
|
|
285
|
+
onCues: () => { },
|
|
286
|
+
getCurrentTime: () => currentTime,
|
|
287
|
+
abort,
|
|
288
|
+
});
|
|
289
|
+
// Let the loader fetch until it idles (no segments in window).
|
|
290
|
+
await new Promise((r) => setTimeout(r, 50));
|
|
291
|
+
abort.abort();
|
|
292
|
+
await promise;
|
|
293
|
+
// First fetch was seg0 (nearest 0s). Then seek → 17s makes seg3
|
|
294
|
+
// (mid=17.5) the closest of the remaining {1, 2, 3}.
|
|
295
|
+
expect(fetched[0]).toBe('a.vtt');
|
|
296
|
+
expect(fetched[1]).toBe('d.vtt');
|
|
297
|
+
});
|
|
298
|
+
it('honors abort during idle polling when playhead is outside every window', async () => {
|
|
299
|
+
// 2 segments at 10s+ but playhead sits at 100s (well past). No
|
|
300
|
+
// segment intersects the [-2, +10] buffer window, so the loader
|
|
301
|
+
// idles. Aborting must resolve the load promptly.
|
|
302
|
+
const playlistBody = `#EXTM3U
|
|
303
|
+
#EXT-X-TARGETDURATION:5
|
|
304
|
+
#EXTINF:5.0,
|
|
305
|
+
a.vtt
|
|
306
|
+
#EXTINF:5.0,
|
|
307
|
+
b.vtt
|
|
308
|
+
#EXT-X-ENDLIST
|
|
309
|
+
`;
|
|
310
|
+
let call = 0;
|
|
311
|
+
requester.request.and.callFake(() => {
|
|
312
|
+
call++;
|
|
313
|
+
if (call === 1)
|
|
314
|
+
return respondText(playlistBody);
|
|
315
|
+
fail('no segment fetch expected');
|
|
316
|
+
return respondText('');
|
|
317
|
+
});
|
|
318
|
+
const abort = new Abort();
|
|
319
|
+
const promise = loadWebVttCues('https://x.test/sub.m3u8', {
|
|
320
|
+
onCues: () => { },
|
|
321
|
+
getCurrentTime: () => 100,
|
|
322
|
+
abort,
|
|
323
|
+
});
|
|
324
|
+
// Give the polling loop a moment to enter its wait.
|
|
325
|
+
await new Promise((r) => setTimeout(r, 20));
|
|
326
|
+
abort.abort();
|
|
327
|
+
await promise; // should not hang
|
|
328
|
+
expect(call).toBe(1);
|
|
329
|
+
});
|
|
330
|
+
it('respects a custom lookAhead window', async () => {
|
|
331
|
+
// With lookAhead=1, only segment 0 (0..5s) overlaps [-2, 1].
|
|
332
|
+
// Segment 1 (5..10s) is outside the window and never fetched
|
|
333
|
+
// because the playhead never advances.
|
|
334
|
+
const playlistBody = `#EXTM3U
|
|
335
|
+
#EXT-X-TARGETDURATION:5
|
|
336
|
+
#EXTINF:5.0,
|
|
337
|
+
a.vtt
|
|
338
|
+
#EXTINF:5.0,
|
|
339
|
+
b.vtt
|
|
340
|
+
#EXT-X-ENDLIST
|
|
341
|
+
`;
|
|
342
|
+
let call = 0;
|
|
343
|
+
const fetched = [];
|
|
344
|
+
requester.request.and.callFake((url) => {
|
|
345
|
+
call++;
|
|
346
|
+
if (call === 1)
|
|
347
|
+
return respondText(playlistBody);
|
|
348
|
+
fetched.push(String(url).split('/').pop());
|
|
349
|
+
return respondText(`WEBVTT\n\n00:00:00.000 --> 00:00:01.000\nx`);
|
|
350
|
+
});
|
|
351
|
+
const abort = new Abort();
|
|
352
|
+
const promise = loadWebVttCues('https://x.test/sub.m3u8', {
|
|
353
|
+
onCues: () => { },
|
|
354
|
+
getCurrentTime: () => 0,
|
|
355
|
+
lookAhead: 1,
|
|
356
|
+
abort,
|
|
357
|
+
});
|
|
358
|
+
// Let a.vtt fetch, then let the loader enter its idle poll before
|
|
359
|
+
// aborting so the remaining segment stays pending.
|
|
360
|
+
await new Promise((r) => setTimeout(r, 20));
|
|
361
|
+
abort.abort();
|
|
362
|
+
await promise;
|
|
363
|
+
expect(fetched).toEqual(['a.vtt']);
|
|
364
|
+
});
|
|
365
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextTrack.test.d.ts","sourceRoot":"","sources":["../../../../../test/unit/text/TextTrack.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
import { expectTypeStrictlyEquals } from '@amazon/vinyl-util/browserTestUtil';
|
|
6
|
+
describe('ALL_TEXT_TRACK_EVENTS', () => {
|
|
7
|
+
it('provides a comprehensive list of all text track events', () => {
|
|
8
|
+
// The player redispatches exactly these; an omission silently stops an
|
|
9
|
+
// event reaching consumers, and `satisfies` alone does not catch it.
|
|
10
|
+
expectTypeStrictlyEquals(true);
|
|
11
|
+
});
|
|
12
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VttCueStyle.test.d.ts","sourceRoot":"","sources":["../../../../../test/unit/text/VttCueStyle.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
import { applyVttCueStyle, isVttCue } from '@amazon/vinyl';
|
|
6
|
+
describe('VttCueStyle', () => {
|
|
7
|
+
describe('isVttCue', () => {
|
|
8
|
+
let original;
|
|
9
|
+
beforeEach(() => {
|
|
10
|
+
original = globalThis.VTTCue;
|
|
11
|
+
});
|
|
12
|
+
afterEach(() => {
|
|
13
|
+
;
|
|
14
|
+
globalThis.VTTCue = original;
|
|
15
|
+
});
|
|
16
|
+
it('is true for a VTTCue instance', () => {
|
|
17
|
+
class FakeVttCue {
|
|
18
|
+
}
|
|
19
|
+
;
|
|
20
|
+
globalThis.VTTCue = FakeVttCue;
|
|
21
|
+
expect(isVttCue(new FakeVttCue())).toBe(true);
|
|
22
|
+
});
|
|
23
|
+
it('is false for a non-VTTCue cue', () => {
|
|
24
|
+
class FakeVttCue {
|
|
25
|
+
}
|
|
26
|
+
;
|
|
27
|
+
globalThis.VTTCue = FakeVttCue;
|
|
28
|
+
expect(isVttCue({})).toBe(false);
|
|
29
|
+
});
|
|
30
|
+
it('is false when VTTCue is unavailable', () => {
|
|
31
|
+
;
|
|
32
|
+
globalThis.VTTCue = undefined;
|
|
33
|
+
expect(isVttCue({})).toBe(false);
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
describe('applyVttCueStyle', () => {
|
|
37
|
+
it('applies every provided property', () => {
|
|
38
|
+
const cue = {};
|
|
39
|
+
const style = {
|
|
40
|
+
align: 'start',
|
|
41
|
+
line: 5,
|
|
42
|
+
lineAlign: 'center',
|
|
43
|
+
position: 10,
|
|
44
|
+
positionAlign: 'center',
|
|
45
|
+
size: 90,
|
|
46
|
+
snapToLines: false,
|
|
47
|
+
vertical: 'rl',
|
|
48
|
+
};
|
|
49
|
+
applyVttCueStyle(cue, style);
|
|
50
|
+
expect(cue).toEqual({
|
|
51
|
+
align: 'start',
|
|
52
|
+
line: 5,
|
|
53
|
+
lineAlign: 'center',
|
|
54
|
+
position: 10,
|
|
55
|
+
positionAlign: 'center',
|
|
56
|
+
size: 90,
|
|
57
|
+
snapToLines: false,
|
|
58
|
+
vertical: 'rl',
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
it('accepts the `auto` keyword for line and position', () => {
|
|
62
|
+
const cue = {};
|
|
63
|
+
applyVttCueStyle(cue, {
|
|
64
|
+
line: 'auto',
|
|
65
|
+
position: 'auto',
|
|
66
|
+
});
|
|
67
|
+
expect(cue.line).toBe('auto');
|
|
68
|
+
expect(cue.position).toBe('auto');
|
|
69
|
+
});
|
|
70
|
+
it('leaves unset properties untouched', () => {
|
|
71
|
+
const cue = { size: 100 };
|
|
72
|
+
applyVttCueStyle(cue, {});
|
|
73
|
+
expect(cue).toEqual({ size: 100 });
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discoverDashTextTracks.test.d.ts","sourceRoot":"","sources":["../../../../../test/unit/text/discoverDashTextTracks.test.ts"],"names":[],"mappings":""}
|