@amazon/vinyl 1.1.1 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (446) hide show
  1. package/dist/index.cjs +276 -200
  2. package/dist/index.cjs.map +4 -4
  3. package/dist/index.js +280 -203
  4. package/dist/index.js.map +4 -4
  5. package/dist/test/benchmark.es5.js +169 -232
  6. package/dist/test/benchmark.js +1475 -1933
  7. package/dist/test/benchmark.js.map +4 -4
  8. package/dist/test/integ.es5.js +771 -394
  9. package/dist/test/integ.js +6063 -5273
  10. package/dist/test/integ.js.map +4 -4
  11. package/dist/test/jasmineHtml.es5.js +8 -8
  12. package/dist/test/jasmineHtml.js +8 -4
  13. package/dist/test/jasmineHtml.js.map +3 -3
  14. package/dist/types/current/client/Capabilities.d.ts.map +1 -1
  15. package/dist/types/current/client/CapabilitiesImpl.d.ts.map +1 -1
  16. package/dist/types/current/drm/DrmController.d.ts +2 -2
  17. package/dist/types/current/drm/DrmController.d.ts.map +1 -1
  18. package/dist/types/current/drm/DrmControllerImpl.d.ts +3 -3
  19. package/dist/types/current/drm/DrmControllerImpl.d.ts.map +1 -1
  20. package/dist/types/current/drm/DrmControllerImpl.js +7 -7
  21. package/dist/types/current/drm/DrmKeySystemResolver.d.ts +1 -1
  22. package/dist/types/current/drm/DrmKeySystemResolver.d.ts.map +1 -1
  23. package/dist/types/current/drm/DrmKeySystemResolver.js +1 -1
  24. package/dist/types/current/drm/DrmOptions.d.ts +1 -1
  25. package/dist/types/current/drm/DrmOptions.d.ts.map +1 -1
  26. package/dist/types/current/drm/DrmOptions.js +1 -1
  27. package/dist/types/current/drm/commonEme/CommonEme.d.ts +2 -2
  28. package/dist/types/current/drm/commonEme/CommonEme.d.ts.map +1 -1
  29. package/dist/types/current/drm/commonEme/CommonEmeFactory.d.ts +1 -1
  30. package/dist/types/current/drm/commonEme/CommonEmeFactory.d.ts.map +1 -1
  31. package/dist/types/current/drm/commonEme/MsCommonEme.d.ts +1 -1
  32. package/dist/types/current/drm/commonEme/MsCommonEme.d.ts.map +1 -1
  33. package/dist/types/current/drm/commonEme/MsCommonEme.js +1 -1
  34. package/dist/types/current/drm/commonEme/StandardCommonEme.d.ts +1 -1
  35. package/dist/types/current/drm/commonEme/StandardCommonEme.d.ts.map +1 -1
  36. package/dist/types/current/drm/commonEme/WebKitCommonEme.d.ts +2 -2
  37. package/dist/types/current/drm/commonEme/WebKitCommonEme.d.ts.map +1 -1
  38. package/dist/types/current/drm/commonEme/WebKitCommonEme.js +1 -1
  39. package/dist/types/current/drm/commonEme/createDrmErrorHandler.js +1 -1
  40. package/dist/types/current/drm/licenseProvider/LicenseProvider.d.ts +1 -1
  41. package/dist/types/current/drm/licenseProvider/LicenseProvider.d.ts.map +1 -1
  42. package/dist/types/current/global/environment.d.ts +6 -2
  43. package/dist/types/current/global/environment.d.ts.map +1 -1
  44. package/dist/types/current/global/environment.js +4 -3
  45. package/dist/types/current/global/initializeVinylGlobal.js +1 -1
  46. package/dist/types/current/patch/media/MediaElementPatchOptions.js +1 -1
  47. package/dist/types/current/patch/media/patchMediaElement.js +1 -1
  48. package/dist/types/current/patch/media/patches/createPreventStallsPatch.d.ts +1 -1
  49. package/dist/types/current/patch/media/patches/createPreventStallsPatch.d.ts.map +1 -1
  50. package/dist/types/current/patch/media/patches/createUnreliablePlaybackEventsPatch.d.ts +1 -1
  51. package/dist/types/current/patch/media/patches/createUnreliablePlaybackEventsPatch.d.ts.map +1 -1
  52. package/dist/types/current/playback/PlaybackControllerImpl.d.ts +1 -1
  53. package/dist/types/current/playback/PlaybackControllerImpl.d.ts.map +1 -1
  54. package/dist/types/current/playback/PlaybackControllerImpl.js +4 -4
  55. package/dist/types/current/playback/ReadonlyPlaybackController.d.ts.map +1 -1
  56. package/dist/types/current/playback/error/ReportableMediaError.js +1 -1
  57. package/dist/types/current/playback/logging/playbackStateLoggingHandler.d.ts +1 -1
  58. package/dist/types/current/playback/logging/playbackStateLoggingHandler.d.ts.map +1 -1
  59. package/dist/types/current/playback/logging/playbackStateLoggingHandler.js +1 -1
  60. package/dist/types/current/playback/nextHasMetadata.d.ts +1 -1
  61. package/dist/types/current/playback/nextHasMetadata.d.ts.map +1 -1
  62. package/dist/types/current/streaming/ContentStream.d.ts +4 -4
  63. package/dist/types/current/streaming/ContentStream.d.ts.map +1 -1
  64. package/dist/types/current/streaming/ContentStreamingOptions.d.ts +2 -2
  65. package/dist/types/current/streaming/ContentStreamingOptions.d.ts.map +1 -1
  66. package/dist/types/current/streaming/MediaQualityMetadata.d.ts +2 -2
  67. package/dist/types/current/streaming/MediaQualityMetadata.d.ts.map +1 -1
  68. package/dist/types/current/streaming/MediaQualityMetadata.js +1 -1
  69. package/dist/types/current/streaming/MediaTimeline.d.ts +6 -5
  70. package/dist/types/current/streaming/MediaTimeline.d.ts.map +1 -1
  71. package/dist/types/current/streaming/SegmentController.d.ts +2 -7
  72. package/dist/types/current/streaming/SegmentController.d.ts.map +1 -1
  73. package/dist/types/current/streaming/SegmentControllerImpl.d.ts +5 -6
  74. package/dist/types/current/streaming/SegmentControllerImpl.d.ts.map +1 -1
  75. package/dist/types/current/streaming/SegmentControllerImpl.js +5 -15
  76. package/dist/types/current/streaming/SegmentReference.d.ts +1 -1
  77. package/dist/types/current/streaming/SegmentReference.d.ts.map +1 -1
  78. package/dist/types/current/streaming/StreamingEventMap.d.ts +1 -1
  79. package/dist/types/current/streaming/StreamingEventMap.d.ts.map +1 -1
  80. package/dist/types/current/streaming/abr/QualitySelector.d.ts +1 -1
  81. package/dist/types/current/streaming/abr/QualitySelector.d.ts.map +1 -1
  82. package/dist/types/current/streaming/abr/QualitySelectorImpl.d.ts +18 -3
  83. package/dist/types/current/streaming/abr/QualitySelectorImpl.d.ts.map +1 -1
  84. package/dist/types/current/streaming/abr/QualitySelectorImpl.js +8 -2
  85. package/dist/types/current/streaming/buffering/BufferingController.d.ts +3 -13
  86. package/dist/types/current/streaming/buffering/BufferingController.d.ts.map +1 -1
  87. package/dist/types/current/streaming/buffering/BufferingController.js +1 -24
  88. package/dist/types/current/streaming/buffering/MediaSourceController.d.ts +41 -15
  89. package/dist/types/current/streaming/buffering/MediaSourceController.d.ts.map +1 -1
  90. package/dist/types/current/streaming/buffering/MediaSourceController.js +74 -17
  91. package/dist/types/current/streaming/buffering/SourceBufferController.d.ts +1 -1
  92. package/dist/types/current/streaming/buffering/SourceBufferController.d.ts.map +1 -1
  93. package/dist/types/current/streaming/createDefaultMediaTimelineTransformer.d.ts +1 -1
  94. package/dist/types/current/streaming/createDefaultMediaTimelineTransformer.d.ts.map +1 -1
  95. package/dist/types/current/streaming/createDefaultMediaTimelineTransformer.js +2 -2
  96. package/dist/types/current/streaming/mediaTimelineFilter.d.ts +3 -3
  97. package/dist/types/current/streaming/mediaTimelineFilter.d.ts.map +1 -1
  98. package/dist/types/current/streaming/mediaTimelineFilter.js +1 -1
  99. package/dist/types/current/streaming/mediaTimelineLanguageFilter.d.ts +1 -1
  100. package/dist/types/current/streaming/mediaTimelineLanguageFilter.d.ts.map +1 -1
  101. package/dist/types/current/streaming/util/segment.d.ts +1 -1
  102. package/dist/types/current/streaming/util/segment.d.ts.map +1 -1
  103. package/dist/types/current/track/AutoResetController.d.ts +37 -12
  104. package/dist/types/current/track/AutoResetController.d.ts.map +1 -1
  105. package/dist/types/current/track/AutoResetController.js +38 -28
  106. package/dist/types/current/track/Track.d.ts.map +1 -1
  107. package/dist/types/current/track/TrackBase.d.ts.map +1 -1
  108. package/dist/types/current/track/TrackController.d.ts +2 -2
  109. package/dist/types/current/track/TrackController.d.ts.map +1 -1
  110. package/dist/types/current/track/TrackFactory.d.ts +1 -1
  111. package/dist/types/current/track/TrackFactory.d.ts.map +1 -1
  112. package/dist/types/current/track/createSegmentDataProvider.d.ts.map +1 -1
  113. package/dist/types/current/track/createVinylTrackFactories.d.ts +5 -5
  114. package/dist/types/current/track/createVinylTrackFactories.d.ts.map +1 -1
  115. package/dist/types/current/track/createVinylTrackFactories.js +4 -4
  116. package/dist/types/current/track/dash/DashManifestController.d.ts +1 -1
  117. package/dist/types/current/track/dash/DashManifestController.d.ts.map +1 -1
  118. package/dist/types/current/track/dash/DashMediaQualityMetadataResolver.d.ts.map +1 -1
  119. package/dist/types/current/track/dash/DashMediaQualityMetadataResolver.js +1 -1
  120. package/dist/types/current/track/dash/DashTrack.d.ts +4 -4
  121. package/dist/types/current/track/dash/DashTrack.d.ts.map +1 -1
  122. package/dist/types/current/track/dash/DashTrack.js +2 -2
  123. package/dist/types/current/track/dash/buildDashMediaTimeline.d.ts +2 -2
  124. package/dist/types/current/track/dash/buildDashMediaTimeline.d.ts.map +1 -1
  125. package/dist/types/current/track/dash/buildDashMediaTimeline.js +2 -2
  126. package/dist/types/current/track/dash/createDashContentStreamFactories.d.ts.map +1 -1
  127. package/dist/types/current/track/dash/createDashContentTypesValue.d.ts +2 -2
  128. package/dist/types/current/track/dash/createDashContentTypesValue.d.ts.map +1 -1
  129. package/dist/types/current/track/dash/createDashContentTypesValue.js +1 -1
  130. package/dist/types/current/track/dash/createDashFactories.d.ts +12 -12
  131. package/dist/types/current/track/dash/createDashFactories.d.ts.map +1 -1
  132. package/dist/types/current/track/dash/createDashFactories.js +8 -8
  133. package/dist/types/current/track/dash/createDashManifestProvider.d.ts +1 -1
  134. package/dist/types/current/track/dash/createDashManifestProvider.d.ts.map +1 -1
  135. package/dist/types/current/track/dash/createDashManifestProvider.js +1 -1
  136. package/dist/types/current/track/dash/createDefaultDashManifestTransformer.d.ts +1 -1
  137. package/dist/types/current/track/dash/createDefaultDashManifestTransformer.d.ts.map +1 -1
  138. package/dist/types/current/track/dash/createDefaultDashManifestTransformer.js +1 -1
  139. package/dist/types/current/track/dash/createSegmentControllerFactory.d.ts.map +1 -1
  140. package/dist/types/current/track/dash/manifestTransformUtils.d.ts +1 -1
  141. package/dist/types/current/track/dash/manifestTransformUtils.d.ts.map +1 -1
  142. package/dist/types/current/track/dash/timeline/DashRepresentationSegmentProvider.d.ts +3 -3
  143. package/dist/types/current/track/dash/timeline/DashRepresentationSegmentProvider.d.ts.map +1 -1
  144. package/dist/types/current/track/dash/timeline/DashRepresentationSegmentProvider.js +3 -3
  145. package/dist/types/current/track/dash/urlDashManifestProvider.d.ts +1 -1
  146. package/dist/types/current/track/dash/urlDashManifestProvider.d.ts.map +1 -1
  147. package/dist/types/current/track/dash/util/mimeType.d.ts.map +1 -1
  148. package/dist/types/current/track/dash/util/mimeType.js +1 -1
  149. package/dist/types/current/track/dash/util/mpd.d.ts +3 -2
  150. package/dist/types/current/track/dash/util/mpd.d.ts.map +1 -1
  151. package/dist/types/current/track/dash/util/mpd.js +13 -3
  152. package/dist/types/current/track/dash/util/uriResolution.js +1 -1
  153. package/dist/types/current/track/filters/keySystemFilter.d.ts.map +1 -1
  154. package/dist/types/current/track/filters/resourceTypeFilter.d.ts.map +1 -1
  155. package/dist/types/current/track/filters/sampleRateFilter.d.ts.map +1 -1
  156. package/dist/types/current/track/hls/HlsTrack.d.ts.map +1 -1
  157. package/dist/types/current/track/hls/buildHlsMediaTimeline.d.ts +3 -3
  158. package/dist/types/current/track/hls/buildHlsMediaTimeline.d.ts.map +1 -1
  159. package/dist/types/current/track/hls/buildHlsMediaTimeline.js +16 -14
  160. package/dist/types/current/track/hls/createDefaultHlsManifestTransformer.d.ts +1 -1
  161. package/dist/types/current/track/hls/createDefaultHlsManifestTransformer.d.ts.map +1 -1
  162. package/dist/types/current/track/hls/createHlsContentStreamFactories.d.ts.map +1 -1
  163. package/dist/types/current/track/hls/util/hlsSegmentTime.d.ts +1 -1
  164. package/dist/types/current/track/hls/util/hlsSegmentTime.d.ts.map +1 -1
  165. package/dist/types/current/track/hls/util/hlsSegmentTime.js +1 -1
  166. package/dist/types/current/track/mse/MseTrack.d.ts +2 -2
  167. package/dist/types/current/track/mse/MseTrack.d.ts.map +1 -1
  168. package/dist/types/current/track/mse/MseTrack.js +2 -1
  169. package/dist/types/current/track/mse/codec.d.ts.map +1 -1
  170. package/dist/types/current/track/source/FixedPlaybackQuality.d.ts +1 -1
  171. package/dist/types/current/track/source/FixedPlaybackQuality.d.ts.map +1 -1
  172. package/dist/types/current/track/source/SourceObjectTrack.d.ts +4 -4
  173. package/dist/types/current/track/source/SourceObjectTrack.d.ts.map +1 -1
  174. package/dist/types/current/track/source/SourceObjectTrack.js +2 -2
  175. package/dist/types/current/track/source/SourceTrack.d.ts +4 -4
  176. package/dist/types/current/track/source/SourceTrack.d.ts.map +1 -1
  177. package/dist/types/current/track/source/SourceTrack.js +2 -2
  178. package/dist/types/current/track/source/SourceTrackBase.d.ts +2 -2
  179. package/dist/types/current/track/source/SourceTrackBase.d.ts.map +1 -1
  180. package/dist/types/current/track/source/SourceTrackBase.js +2 -2
  181. package/dist/types/current/tsconfig.tsbuildinfo +1 -1
  182. package/dist/types/current/vinyl/ReadonlyPlaybackStreamingState.d.ts.map +1 -1
  183. package/dist/types/current/vinyl/VinylDeps.d.ts +1 -1
  184. package/dist/types/current/vinyl/VinylDeps.d.ts.map +1 -1
  185. package/dist/types/current/vinyl/VinylOptions.d.ts.map +1 -1
  186. package/dist/types/current/vinyl/VinylPatchOptions.d.ts.map +1 -1
  187. package/dist/types/current/vinyl/VinylPlayer.d.ts +26 -2
  188. package/dist/types/current/vinyl/VinylPlayer.d.ts.map +1 -1
  189. package/dist/types/current/vinyl/VinylPlayer.js +18 -3
  190. package/dist/types/current/vinyl/createVinylFactories.d.ts +9 -11
  191. package/dist/types/current/vinyl/createVinylFactories.d.ts.map +1 -1
  192. package/dist/types/current/vinyl/createVinylFactories.js +2 -2
  193. package/dist/types/ts3.7/drm/DrmController.d.ts +2 -2
  194. package/dist/types/ts3.7/drm/DrmControllerImpl.d.ts +3 -3
  195. package/dist/types/ts3.7/drm/DrmKeySystemResolver.d.ts +1 -1
  196. package/dist/types/ts3.7/drm/DrmOptions.d.ts +1 -1
  197. package/dist/types/ts3.7/drm/commonEme/CommonEme.d.ts +2 -2
  198. package/dist/types/ts3.7/drm/commonEme/CommonEmeFactory.d.ts +1 -1
  199. package/dist/types/ts3.7/drm/commonEme/MsCommonEme.d.ts +1 -1
  200. package/dist/types/ts3.7/drm/commonEme/StandardCommonEme.d.ts +1 -1
  201. package/dist/types/ts3.7/drm/commonEme/WebKitCommonEme.d.ts +2 -2
  202. package/dist/types/ts3.7/drm/licenseProvider/LicenseProvider.d.ts +1 -1
  203. package/dist/types/ts3.7/global/environment.d.ts +6 -2
  204. package/dist/types/ts3.7/patch/media/patches/createPreventStallsPatch.d.ts +1 -1
  205. package/dist/types/ts3.7/patch/media/patches/createUnreliablePlaybackEventsPatch.d.ts +1 -1
  206. package/dist/types/ts3.7/playback/PlaybackControllerImpl.d.ts +1 -1
  207. package/dist/types/ts3.7/playback/logging/playbackStateLoggingHandler.d.ts +1 -1
  208. package/dist/types/ts3.7/playback/nextHasMetadata.d.ts +1 -1
  209. package/dist/types/ts3.7/streaming/ContentStream.d.ts +4 -4
  210. package/dist/types/ts3.7/streaming/ContentStreamingOptions.d.ts +2 -2
  211. package/dist/types/ts3.7/streaming/MediaQualityMetadata.d.ts +2 -2
  212. package/dist/types/ts3.7/streaming/MediaTimeline.d.ts +6 -5
  213. package/dist/types/ts3.7/streaming/SegmentController.d.ts +2 -7
  214. package/dist/types/ts3.7/streaming/SegmentControllerImpl.d.ts +5 -6
  215. package/dist/types/ts3.7/streaming/SegmentReference.d.ts +1 -1
  216. package/dist/types/ts3.7/streaming/StreamingEventMap.d.ts +1 -1
  217. package/dist/types/ts3.7/streaming/abr/QualitySelector.d.ts +1 -1
  218. package/dist/types/ts3.7/streaming/abr/QualitySelectorImpl.d.ts +18 -3
  219. package/dist/types/ts3.7/streaming/buffering/BufferingController.d.ts +3 -13
  220. package/dist/types/ts3.7/streaming/buffering/MediaSourceController.d.ts +41 -15
  221. package/dist/types/ts3.7/streaming/buffering/SourceBufferController.d.ts +1 -1
  222. package/dist/types/ts3.7/streaming/createDefaultMediaTimelineTransformer.d.ts +1 -1
  223. package/dist/types/ts3.7/streaming/mediaTimelineFilter.d.ts +3 -3
  224. package/dist/types/ts3.7/streaming/mediaTimelineLanguageFilter.d.ts +1 -1
  225. package/dist/types/ts3.7/streaming/util/segment.d.ts +1 -1
  226. package/dist/types/ts3.7/track/AutoResetController.d.ts +37 -12
  227. package/dist/types/ts3.7/track/TrackController.d.ts +2 -2
  228. package/dist/types/ts3.7/track/TrackFactory.d.ts +1 -1
  229. package/dist/types/ts3.7/track/createVinylTrackFactories.d.ts +5 -5
  230. package/dist/types/ts3.7/track/dash/DashManifestController.d.ts +1 -1
  231. package/dist/types/ts3.7/track/dash/DashTrack.d.ts +4 -4
  232. package/dist/types/ts3.7/track/dash/buildDashMediaTimeline.d.ts +2 -2
  233. package/dist/types/ts3.7/track/dash/createDashContentTypesValue.d.ts +2 -2
  234. package/dist/types/ts3.7/track/dash/createDashFactories.d.ts +12 -12
  235. package/dist/types/ts3.7/track/dash/createDashManifestProvider.d.ts +1 -1
  236. package/dist/types/ts3.7/track/dash/createDefaultDashManifestTransformer.d.ts +1 -1
  237. package/dist/types/ts3.7/track/dash/manifestTransformUtils.d.ts +1 -1
  238. package/dist/types/ts3.7/track/dash/timeline/DashRepresentationSegmentProvider.d.ts +3 -3
  239. package/dist/types/ts3.7/track/dash/urlDashManifestProvider.d.ts +1 -1
  240. package/dist/types/ts3.7/track/dash/util/mpd.d.ts +3 -2
  241. package/dist/types/ts3.7/track/hls/buildHlsMediaTimeline.d.ts +3 -3
  242. package/dist/types/ts3.7/track/hls/createDefaultHlsManifestTransformer.d.ts +1 -1
  243. package/dist/types/ts3.7/track/hls/util/hlsSegmentTime.d.ts +1 -1
  244. package/dist/types/ts3.7/track/mse/MseTrack.d.ts +2 -2
  245. package/dist/types/ts3.7/track/source/FixedPlaybackQuality.d.ts +1 -1
  246. package/dist/types/ts3.7/track/source/SourceObjectTrack.d.ts +4 -4
  247. package/dist/types/ts3.7/track/source/SourceTrack.d.ts +4 -4
  248. package/dist/types/ts3.7/track/source/SourceTrackBase.d.ts +2 -2
  249. package/dist/types/ts3.7/vinyl/VinylDeps.d.ts +1 -1
  250. package/dist/types/ts3.7/vinyl/VinylPlayer.d.ts +18 -2
  251. package/dist/types/ts3.7/vinyl/createVinylFactories.d.ts +9 -11
  252. package/dist/types/ts4.1/drm/DrmController.d.ts +2 -2
  253. package/dist/types/ts4.1/drm/DrmControllerImpl.d.ts +3 -3
  254. package/dist/types/ts4.1/drm/DrmKeySystemResolver.d.ts +1 -1
  255. package/dist/types/ts4.1/drm/DrmOptions.d.ts +1 -1
  256. package/dist/types/ts4.1/drm/commonEme/CommonEme.d.ts +2 -2
  257. package/dist/types/ts4.1/drm/commonEme/CommonEmeFactory.d.ts +1 -1
  258. package/dist/types/ts4.1/drm/commonEme/MsCommonEme.d.ts +1 -1
  259. package/dist/types/ts4.1/drm/commonEme/StandardCommonEme.d.ts +1 -1
  260. package/dist/types/ts4.1/drm/commonEme/WebKitCommonEme.d.ts +2 -2
  261. package/dist/types/ts4.1/drm/licenseProvider/LicenseProvider.d.ts +1 -1
  262. package/dist/types/ts4.1/global/environment.d.ts +6 -2
  263. package/dist/types/ts4.1/patch/media/patches/createPreventStallsPatch.d.ts +1 -1
  264. package/dist/types/ts4.1/patch/media/patches/createUnreliablePlaybackEventsPatch.d.ts +1 -1
  265. package/dist/types/ts4.1/playback/PlaybackControllerImpl.d.ts +1 -1
  266. package/dist/types/ts4.1/playback/logging/playbackStateLoggingHandler.d.ts +1 -1
  267. package/dist/types/ts4.1/playback/nextHasMetadata.d.ts +1 -1
  268. package/dist/types/ts4.1/streaming/ContentStream.d.ts +4 -4
  269. package/dist/types/ts4.1/streaming/ContentStreamingOptions.d.ts +2 -2
  270. package/dist/types/ts4.1/streaming/MediaQualityMetadata.d.ts +2 -2
  271. package/dist/types/ts4.1/streaming/MediaTimeline.d.ts +6 -5
  272. package/dist/types/ts4.1/streaming/SegmentController.d.ts +2 -7
  273. package/dist/types/ts4.1/streaming/SegmentControllerImpl.d.ts +5 -6
  274. package/dist/types/ts4.1/streaming/SegmentReference.d.ts +1 -1
  275. package/dist/types/ts4.1/streaming/StreamingEventMap.d.ts +1 -1
  276. package/dist/types/ts4.1/streaming/abr/QualitySelector.d.ts +1 -1
  277. package/dist/types/ts4.1/streaming/abr/QualitySelectorImpl.d.ts +18 -3
  278. package/dist/types/ts4.1/streaming/buffering/BufferingController.d.ts +3 -13
  279. package/dist/types/ts4.1/streaming/buffering/MediaSourceController.d.ts +41 -15
  280. package/dist/types/ts4.1/streaming/buffering/SourceBufferController.d.ts +1 -1
  281. package/dist/types/ts4.1/streaming/createDefaultMediaTimelineTransformer.d.ts +1 -1
  282. package/dist/types/ts4.1/streaming/mediaTimelineFilter.d.ts +3 -3
  283. package/dist/types/ts4.1/streaming/mediaTimelineLanguageFilter.d.ts +1 -1
  284. package/dist/types/ts4.1/streaming/util/segment.d.ts +1 -1
  285. package/dist/types/ts4.1/track/AutoResetController.d.ts +37 -12
  286. package/dist/types/ts4.1/track/TrackController.d.ts +2 -2
  287. package/dist/types/ts4.1/track/TrackFactory.d.ts +1 -1
  288. package/dist/types/ts4.1/track/createVinylTrackFactories.d.ts +5 -5
  289. package/dist/types/ts4.1/track/dash/DashManifestController.d.ts +1 -1
  290. package/dist/types/ts4.1/track/dash/DashTrack.d.ts +4 -4
  291. package/dist/types/ts4.1/track/dash/buildDashMediaTimeline.d.ts +2 -2
  292. package/dist/types/ts4.1/track/dash/createDashContentTypesValue.d.ts +2 -2
  293. package/dist/types/ts4.1/track/dash/createDashFactories.d.ts +12 -12
  294. package/dist/types/ts4.1/track/dash/createDashManifestProvider.d.ts +1 -1
  295. package/dist/types/ts4.1/track/dash/createDefaultDashManifestTransformer.d.ts +1 -1
  296. package/dist/types/ts4.1/track/dash/manifestTransformUtils.d.ts +1 -1
  297. package/dist/types/ts4.1/track/dash/timeline/DashRepresentationSegmentProvider.d.ts +3 -3
  298. package/dist/types/ts4.1/track/dash/urlDashManifestProvider.d.ts +1 -1
  299. package/dist/types/ts4.1/track/dash/util/mpd.d.ts +3 -2
  300. package/dist/types/ts4.1/track/hls/buildHlsMediaTimeline.d.ts +3 -3
  301. package/dist/types/ts4.1/track/hls/createDefaultHlsManifestTransformer.d.ts +1 -1
  302. package/dist/types/ts4.1/track/hls/util/hlsSegmentTime.d.ts +1 -1
  303. package/dist/types/ts4.1/track/mse/MseTrack.d.ts +3 -3
  304. package/dist/types/ts4.1/track/source/FixedPlaybackQuality.d.ts +1 -1
  305. package/dist/types/ts4.1/track/source/SourceObjectTrack.d.ts +5 -5
  306. package/dist/types/ts4.1/track/source/SourceTrack.d.ts +5 -5
  307. package/dist/types/ts4.1/track/source/SourceTrackBase.d.ts +3 -3
  308. package/dist/types/ts4.1/vinyl/VinylDeps.d.ts +1 -1
  309. package/dist/types/ts4.1/vinyl/VinylPlayer.d.ts +18 -2
  310. package/dist/types/ts4.1/vinyl/createVinylFactories.d.ts +9 -11
  311. package/dist/types/ts4.7/drm/DrmController.d.ts +2 -2
  312. package/dist/types/ts4.7/drm/DrmControllerImpl.d.ts +3 -3
  313. package/dist/types/ts4.7/drm/DrmKeySystemResolver.d.ts +1 -1
  314. package/dist/types/ts4.7/drm/DrmOptions.d.ts +1 -1
  315. package/dist/types/ts4.7/drm/commonEme/CommonEme.d.ts +2 -2
  316. package/dist/types/ts4.7/drm/commonEme/CommonEmeFactory.d.ts +1 -1
  317. package/dist/types/ts4.7/drm/commonEme/MsCommonEme.d.ts +1 -1
  318. package/dist/types/ts4.7/drm/commonEme/StandardCommonEme.d.ts +1 -1
  319. package/dist/types/ts4.7/drm/commonEme/WebKitCommonEme.d.ts +2 -2
  320. package/dist/types/ts4.7/drm/licenseProvider/LicenseProvider.d.ts +1 -1
  321. package/dist/types/ts4.7/global/environment.d.ts +6 -2
  322. package/dist/types/ts4.7/patch/media/patches/createPreventStallsPatch.d.ts +1 -1
  323. package/dist/types/ts4.7/patch/media/patches/createUnreliablePlaybackEventsPatch.d.ts +1 -1
  324. package/dist/types/ts4.7/playback/PlaybackControllerImpl.d.ts +1 -1
  325. package/dist/types/ts4.7/playback/logging/playbackStateLoggingHandler.d.ts +1 -1
  326. package/dist/types/ts4.7/playback/nextHasMetadata.d.ts +1 -1
  327. package/dist/types/ts4.7/streaming/ContentStream.d.ts +4 -4
  328. package/dist/types/ts4.7/streaming/ContentStreamingOptions.d.ts +2 -2
  329. package/dist/types/ts4.7/streaming/MediaQualityMetadata.d.ts +2 -2
  330. package/dist/types/ts4.7/streaming/MediaTimeline.d.ts +6 -5
  331. package/dist/types/ts4.7/streaming/SegmentController.d.ts +2 -7
  332. package/dist/types/ts4.7/streaming/SegmentControllerImpl.d.ts +5 -6
  333. package/dist/types/ts4.7/streaming/SegmentReference.d.ts +1 -1
  334. package/dist/types/ts4.7/streaming/StreamingEventMap.d.ts +1 -1
  335. package/dist/types/ts4.7/streaming/abr/QualitySelector.d.ts +1 -1
  336. package/dist/types/ts4.7/streaming/abr/QualitySelectorImpl.d.ts +18 -3
  337. package/dist/types/ts4.7/streaming/buffering/BufferingController.d.ts +3 -13
  338. package/dist/types/ts4.7/streaming/buffering/MediaSourceController.d.ts +41 -15
  339. package/dist/types/ts4.7/streaming/buffering/SourceBufferController.d.ts +1 -1
  340. package/dist/types/ts4.7/streaming/createDefaultMediaTimelineTransformer.d.ts +1 -1
  341. package/dist/types/ts4.7/streaming/mediaTimelineFilter.d.ts +3 -3
  342. package/dist/types/ts4.7/streaming/mediaTimelineLanguageFilter.d.ts +1 -1
  343. package/dist/types/ts4.7/streaming/util/segment.d.ts +1 -1
  344. package/dist/types/ts4.7/track/AutoResetController.d.ts +37 -12
  345. package/dist/types/ts4.7/track/TrackController.d.ts +2 -2
  346. package/dist/types/ts4.7/track/TrackFactory.d.ts +1 -1
  347. package/dist/types/ts4.7/track/createVinylTrackFactories.d.ts +5 -5
  348. package/dist/types/ts4.7/track/dash/DashManifestController.d.ts +1 -1
  349. package/dist/types/ts4.7/track/dash/DashTrack.d.ts +4 -4
  350. package/dist/types/ts4.7/track/dash/buildDashMediaTimeline.d.ts +2 -2
  351. package/dist/types/ts4.7/track/dash/createDashContentTypesValue.d.ts +2 -2
  352. package/dist/types/ts4.7/track/dash/createDashFactories.d.ts +12 -12
  353. package/dist/types/ts4.7/track/dash/createDashManifestProvider.d.ts +1 -1
  354. package/dist/types/ts4.7/track/dash/createDefaultDashManifestTransformer.d.ts +1 -1
  355. package/dist/types/ts4.7/track/dash/manifestTransformUtils.d.ts +1 -1
  356. package/dist/types/ts4.7/track/dash/timeline/DashRepresentationSegmentProvider.d.ts +3 -3
  357. package/dist/types/ts4.7/track/dash/urlDashManifestProvider.d.ts +1 -1
  358. package/dist/types/ts4.7/track/dash/util/mpd.d.ts +3 -2
  359. package/dist/types/ts4.7/track/hls/buildHlsMediaTimeline.d.ts +3 -3
  360. package/dist/types/ts4.7/track/hls/createDefaultHlsManifestTransformer.d.ts +1 -1
  361. package/dist/types/ts4.7/track/hls/util/hlsSegmentTime.d.ts +1 -1
  362. package/dist/types/ts4.7/track/mse/MseTrack.d.ts +2 -2
  363. package/dist/types/ts4.7/track/source/FixedPlaybackQuality.d.ts +1 -1
  364. package/dist/types/ts4.7/track/source/SourceObjectTrack.d.ts +4 -4
  365. package/dist/types/ts4.7/track/source/SourceTrack.d.ts +4 -4
  366. package/dist/types/ts4.7/track/source/SourceTrackBase.d.ts +2 -2
  367. package/dist/types/ts4.7/vinyl/VinylDeps.d.ts +1 -1
  368. package/dist/types/ts4.7/vinyl/VinylPlayer.d.ts +26 -2
  369. package/dist/types/ts4.7/vinyl/createVinylFactories.d.ts +9 -11
  370. package/dist/unit/types/current/streaming/MediaTimeline.test.js +6 -1
  371. package/dist/unit/types/current/streaming/MseTrack.test.js +4 -0
  372. package/dist/unit/types/current/streaming/SegmentControllerImpl.test.js +3 -33
  373. package/dist/unit/types/current/streaming/abr/QualitySelectorImpl.test.js +73 -0
  374. package/dist/unit/types/current/streaming/buffering/BufferingController.test.js +1 -41
  375. package/dist/unit/types/current/streaming/buffering/MediaSourceController.test.js +97 -17
  376. package/dist/unit/types/current/streaming/createDefaultMediaTimelineTransformer.test.js +6 -0
  377. package/dist/unit/types/current/streaming/mediaTimelineFilter.test.js +2 -0
  378. package/dist/unit/types/current/streaming/mediaTimelineLanguageFilter.test.js +7 -0
  379. package/dist/unit/types/current/track/AutoResetController.test.js +134 -22
  380. package/dist/unit/types/current/track/dash/createDashContentStreamFactories.test.js +5 -1
  381. package/dist/unit/types/current/track/dash/createSegmentControllerFactory.test.js +5 -1
  382. package/dist/unit/types/current/track/dash/util/mpd.test.js +29 -0
  383. package/dist/unit/types/current/track/hls/buildHlsMediaTimeline.test.js +16 -8
  384. package/dist/unit/types/current/track/hls/createHlsContentStreamFactories.test.js +5 -1
  385. package/dist/unit/types/current/tsconfig.tsbuildinfo +1 -1
  386. package/dist/unit/types/current/vinyl/VinylPlayer.test.js +35 -0
  387. package/dist/vinylTestUtil/index.js +20 -14
  388. package/dist/vinylTestUtil/index.js.map +2 -2
  389. package/dist/vinylTestUtil/types/current/media/FrequencyAnalyzer.js +1 -1
  390. package/dist/vinylTestUtil/types/current/mediaSource/ControlledMediaSource.d.ts.map +1 -1
  391. package/dist/vinylTestUtil/types/current/mock/dash/mockDashManifest.d.ts +12 -12
  392. package/dist/vinylTestUtil/types/current/mock/dom/ms/MockMSMediaKeySession.d.ts +2 -2
  393. package/dist/vinylTestUtil/types/current/mock/dom/webkit/MockWebKitMediaKeySession.d.ts +2 -2
  394. package/dist/vinylTestUtil/types/current/mock/player/MockVinylPlayerDependencies.d.ts +6 -6
  395. package/dist/vinylTestUtil/types/current/mock/player/MockVinylPlayerDependencies.d.ts.map +1 -1
  396. package/dist/vinylTestUtil/types/current/mock/player/MockVinylPlayerDependencies.js +7 -7
  397. package/dist/vinylTestUtil/types/current/mock/streaming/MockSegmentController.d.ts +0 -1
  398. package/dist/vinylTestUtil/types/current/mock/streaming/MockSegmentController.d.ts.map +1 -1
  399. package/dist/vinylTestUtil/types/current/mock/streaming/MockSegmentController.js +0 -1
  400. package/dist/vinylTestUtil/types/current/mock/streaming/buffering/MockMediaSourceController.d.ts +0 -1
  401. package/dist/vinylTestUtil/types/current/mock/streaming/buffering/MockMediaSourceController.d.ts.map +1 -1
  402. package/dist/vinylTestUtil/types/current/mock/streaming/buffering/MockMediaSourceController.js +0 -1
  403. package/dist/vinylTestUtil/types/current/mock/track/MockAutoResetController.d.ts +1 -0
  404. package/dist/vinylTestUtil/types/current/mock/track/MockAutoResetController.d.ts.map +1 -1
  405. package/dist/vinylTestUtil/types/current/mock/track/MockAutoResetController.js +1 -0
  406. package/dist/vinylTestUtil/types/current/mock/track/dash/createMockDashDependencies.d.ts +5 -5
  407. package/dist/vinylTestUtil/types/current/mock/track/dash/createMockDashDependencies.d.ts.map +1 -1
  408. package/dist/vinylTestUtil/types/current/mock/track/dash/createMockDashDependencies.js +11 -7
  409. package/dist/vinylTestUtil/types/current/mock/track/hls/createMockHlsDependencies.d.ts +5 -5
  410. package/dist/vinylTestUtil/types/current/mock/track/hls/createMockHlsDependencies.d.ts.map +1 -1
  411. package/dist/vinylTestUtil/types/current/mock/track/hls/createMockHlsDependencies.js +11 -7
  412. package/dist/vinylTestUtil/types/current/player/createVinylSuite.js +1 -1
  413. package/dist/vinylTestUtil/types/current/tsconfig.tsbuildinfo +1 -1
  414. package/dist/vinylTestUtil/types/current/util/playback/expectTrackCanSeek.js +1 -1
  415. package/dist/vinylTestUtil/types/current/util/playback/expectTrackPlays.js +2 -2
  416. package/dist/vinylTestUtil/types/current/util/playback/expectTrackPlaysUntil.d.ts.map +1 -1
  417. package/dist/vinylTestUtil/types/current/util/playback/expectTrackPlaysUntil.js +1 -2
  418. package/dist/vinylTestUtil/types/ts3.7/mock/dash/mockDashManifest.d.ts +12 -12
  419. package/dist/vinylTestUtil/types/ts3.7/mock/dom/ms/MockMSMediaKeySession.d.ts +2 -2
  420. package/dist/vinylTestUtil/types/ts3.7/mock/dom/webkit/MockWebKitMediaKeySession.d.ts +2 -2
  421. package/dist/vinylTestUtil/types/ts3.7/mock/player/MockVinylPlayerDependencies.d.ts +6 -6
  422. package/dist/vinylTestUtil/types/ts3.7/mock/streaming/MockSegmentController.d.ts +0 -1
  423. package/dist/vinylTestUtil/types/ts3.7/mock/streaming/buffering/MockMediaSourceController.d.ts +0 -1
  424. package/dist/vinylTestUtil/types/ts3.7/mock/track/MockAutoResetController.d.ts +1 -0
  425. package/dist/vinylTestUtil/types/ts3.7/mock/track/dash/createMockDashDependencies.d.ts +5 -5
  426. package/dist/vinylTestUtil/types/ts3.7/mock/track/hls/createMockHlsDependencies.d.ts +5 -5
  427. package/dist/vinylTestUtil/types/ts4.1/mock/dash/mockDashManifest.d.ts +12 -12
  428. package/dist/vinylTestUtil/types/ts4.1/mock/dom/ms/MockMSMediaKeySession.d.ts +2 -2
  429. package/dist/vinylTestUtil/types/ts4.1/mock/dom/webkit/MockWebKitMediaKeySession.d.ts +2 -2
  430. package/dist/vinylTestUtil/types/ts4.1/mock/player/MockVinylPlayerDependencies.d.ts +6 -6
  431. package/dist/vinylTestUtil/types/ts4.1/mock/streaming/MockSegmentController.d.ts +0 -1
  432. package/dist/vinylTestUtil/types/ts4.1/mock/streaming/buffering/MockMediaSourceController.d.ts +0 -1
  433. package/dist/vinylTestUtil/types/ts4.1/mock/track/MockAutoResetController.d.ts +1 -0
  434. package/dist/vinylTestUtil/types/ts4.1/mock/track/dash/createMockDashDependencies.d.ts +5 -5
  435. package/dist/vinylTestUtil/types/ts4.1/mock/track/hls/createMockHlsDependencies.d.ts +5 -5
  436. package/dist/vinylTestUtil/types/ts4.7/mock/dash/mockDashManifest.d.ts +12 -12
  437. package/dist/vinylTestUtil/types/ts4.7/mock/dom/ms/MockMSMediaKeySession.d.ts +2 -2
  438. package/dist/vinylTestUtil/types/ts4.7/mock/dom/webkit/MockWebKitMediaKeySession.d.ts +2 -2
  439. package/dist/vinylTestUtil/types/ts4.7/mock/player/MockVinylPlayerDependencies.d.ts +6 -6
  440. package/dist/vinylTestUtil/types/ts4.7/mock/streaming/MockSegmentController.d.ts +0 -1
  441. package/dist/vinylTestUtil/types/ts4.7/mock/streaming/buffering/MockMediaSourceController.d.ts +0 -1
  442. package/dist/vinylTestUtil/types/ts4.7/mock/track/MockAutoResetController.d.ts +1 -0
  443. package/dist/vinylTestUtil/types/ts4.7/mock/track/dash/createMockDashDependencies.d.ts +5 -5
  444. package/dist/vinylTestUtil/types/ts4.7/mock/track/hls/createMockHlsDependencies.d.ts +5 -5
  445. package/docs/USAGE.md +33 -0
  446. package/package.json +13 -15
@@ -1,11 +1,11 @@
1
- import type { DashTrackLoadOptions } from '../../track/dash/DashTrack';
1
+ import type { DashTrackLoadOptions } from './DashTrack';
2
2
  import { type Maybe, type RequestInterceptor } from '@amazon/vinyl-util';
3
- import { createDefaultDashManifestTransformer } from '../../track/dash/createDefaultDashManifestTransformer';
3
+ import { createDefaultDashManifestTransformer } from './createDefaultDashManifestTransformer';
4
4
  import { createMediaSource } from '../../util/media/mediaSource';
5
- import { type DashMediaQualityMetadataResolverDeps } from '../../track/dash/DashMediaQualityMetadataResolver';
5
+ import { type DashMediaQualityMetadataResolverDeps } from './DashMediaQualityMetadataResolver';
6
6
  import { MediaSourceControllerImpl, type MediaSourceControllerImplDeps } from '../../streaming/buffering/MediaSourceController';
7
7
  import type { PlaybackController } from '../../playback/PlaybackController';
8
- import { type DashManifestController, type DashManifestControllerImplDeps } from '../../track/dash/DashManifestController';
8
+ import { type DashManifestController, type DashManifestControllerImplDeps } from './DashManifestController';
9
9
  import type { DrmKeySystemResolver } from '../../drm/DrmKeySystemResolver';
10
10
  import type { DrmController } from '../../drm/DrmController';
11
11
  import type { Capabilities } from '../../client/Capabilities';
@@ -13,12 +13,12 @@ import { QualitySelectorImpl, type QualitySelectorImplOptions } from '../../stre
13
13
  import type { PlaybackSource } from '../../playback/PlaybackSource';
14
14
  import { createContentStreamFactory } from '../../streaming/ContentStream';
15
15
  import type { ContentStreamingOptions } from '../../streaming/ContentStreamingOptions';
16
- import { createDashContentTypesValue } from '../../track/dash/createDashContentTypesValue';
16
+ import { createDashContentTypesValue } from './createDashContentTypesValue';
17
17
  import type { ObservableValue } from '@amazon/vinyl-observable';
18
18
  import type { VinylOptions } from '../../vinyl/VinylOptions';
19
- import { type BuildDashMediaTimelineDeps } from '../../track/dash/buildDashMediaTimeline';
19
+ import { type BuildDashMediaTimelineDeps } from './buildDashMediaTimeline';
20
20
  import { createDefaultMediaTimelineTransformer } from '../../streaming/createDefaultMediaTimelineTransformer';
21
- import type { DashManifestData } from '../../track/dash/DashManifestProvider';
21
+ import type { DashManifestData } from './DashManifestProvider';
22
22
  /**
23
23
  * Player-level dependencies needed for the Dash-specific factories.
24
24
  */
@@ -43,20 +43,20 @@ export type DashInitOptions = {
43
43
  */
44
44
  export declare function createDashFactories(options: Maybe<DashInitOptions>): (deps: DashFactoryDeps) => (loadOptions: DashTrackLoadOptions) => {
45
45
  contentTypesValue: typeof createDashContentTypesValue;
46
- baseUrlSelector: () => import("../../track/dash/util/uriResolution").BaseUrlSelector;
46
+ baseUrlSelector: () => import("./util/uriResolution").BaseUrlSelector;
47
47
  segmentRequestInit: () => Maybe<Readonly<Omit<RequestInit, "signal">>>;
48
48
  manifestProvider: (deps: {
49
49
  readonly requestInterceptor: RequestInterceptor;
50
- }) => import("../../track/dash/DashManifestProvider").DashManifestProvider;
50
+ }) => import("./DashManifestProvider").DashManifestProvider;
51
51
  manifestController: (deps: DashManifestControllerImplDeps) => DashManifestController;
52
52
  mediaSourceFactory: () => typeof createMediaSource;
53
- mediaQualityMetadataResolver: (deps: DashMediaQualityMetadataResolverDeps) => import("../../track/dash/DashMediaQualityMetadataResolver").DashMediaQualityMetadataResolver;
53
+ mediaQualityMetadataResolver: (deps: DashMediaQualityMetadataResolverDeps) => import("./DashMediaQualityMetadataResolver").DashMediaQualityMetadataResolver;
54
54
  mediaSourceController: (deps: MediaSourceControllerImplDeps) => MediaSourceControllerImpl;
55
- createContentStreamFactories: (deps: import("../../track/dash/createDashContentStreamFactories").DashContentStreamTrackDeps) => import("@amazon/vinyl-util").MemoizedFunction & ((contentType: import("../..").ContentType) => {
55
+ createContentStreamFactories: (deps: import("./createDashContentStreamFactories").DashContentStreamTrackDeps) => import("@amazon/vinyl-util").MemoizedFunction & ((contentType: import("../..").ContentType) => {
56
56
  sourceBufferControllerFactory: (deps: import("../..").SourceBufferControllerImplDeps) => () => import("../..").SourceBufferControllerImpl;
57
57
  bufferingController: (deps: import("../..").BufferingControllerImplDeps) => import("../..").BufferingControllerImpl;
58
58
  segmentController: (deps: import("../..").SegmentControllerImplDeps) => import("../..").SegmentControllerImpl;
59
- mediaSourceController: import("@amazon/vinyl-di").Factory<import("../../streaming/buffering/MediaSourceController").MediaSourceController>;
59
+ mediaSourceController: import("@amazon/vinyl-di").Factory<import("../..").MediaSourceController>;
60
60
  playbackController: import("@amazon/vinyl-di").Factory<PlaybackController>;
61
61
  mediaTimelineTransformed: import("@amazon/vinyl-di").Factory<ObservableValue<Promise<import("../..").MediaTimeline>>>;
62
62
  qualitySelector: import("@amazon/vinyl-di").Factory<import("../..").QualitySelector>;
@@ -1,4 +1,4 @@
1
- import type { DashTrackLoadOptions } from '../../track/dash/DashTrack';
1
+ import type { DashTrackLoadOptions } from './DashTrack';
2
2
  import type { RequestInterceptor } from '@amazon/vinyl-util';
3
3
  /**
4
4
  * Creates a DashManifestProvider which uses the manifestProvider set on the loadOptions, or a urlDashManifestProvider
@@ -1,5 +1,5 @@
1
1
  import type { ObservableValue } from '@amazon/vinyl-observable';
2
- import type { DashManifestData } from '../../track/dash/DashManifestProvider';
2
+ import type { DashManifestData } from './DashManifestProvider';
3
3
  import type { AdaptationSetType, RepresentationType } from '@amazon/vinyl-mpd-parser';
4
4
  import { type Comparator } from '@amazon/vinyl-util';
5
5
  export interface DashManifestTransformerDeps {
@@ -1,5 +1,5 @@
1
1
  import type { AdaptationSetType, DashManifest, RepresentationType } from '@amazon/vinyl-mpd-parser';
2
- import type { DashManifestData } from '../../track/dash/DashManifestProvider';
2
+ import type { DashManifestData } from './DashManifestProvider';
3
3
  import type { ObservableValue } from '@amazon/vinyl-observable';
4
4
  import { type Comparator, type FilterPredicate, type MaybePromise } from '@amazon/vinyl-util';
5
5
  /**
@@ -1,9 +1,9 @@
1
1
  import type { RepresentationType } from '@amazon/vinyl-mpd-parser';
2
- import { type DashUriResolveDeps } from '../../../track/dash/util/uriResolution';
3
- import { type CreateSegmentDataProviderDeps } from '../../../track/createSegmentDataProvider';
2
+ import { type DashUriResolveDeps } from '../util/uriResolution';
3
+ import { type CreateSegmentDataProviderDeps } from '../../createSegmentDataProvider';
4
4
  import type { SegmentReference } from '../../../streaming/SegmentReference';
5
5
  import type { SegmentDataProvider } from '../../../streaming/SegmentDataSlot';
6
- import type { DashMediaQualityMetadataResolver } from '../../../track/dash/DashMediaQualityMetadataResolver';
6
+ import type { DashMediaQualityMetadataResolver } from '../DashMediaQualityMetadataResolver';
7
7
  export interface DashSegmentProviderDeps extends DashUriResolveDeps, CreateSegmentDataProviderDeps {
8
8
  /**
9
9
  * Produces abstract metadata from a dash representation.
@@ -1,7 +1,7 @@
1
1
  import type { Maybe } from '@amazon/vinyl-util';
2
2
  import type { RequestInitOptions } from '@amazon/vinyl-util';
3
3
  import type { RequestInterceptor } from '@amazon/vinyl-util';
4
- import type { DashManifestProvider } from '../../track/dash/DashManifestProvider';
4
+ import type { DashManifestProvider } from './DashManifestProvider';
5
5
  /**
6
6
  * Creates a DashManifestProvider which performs a request to retrieve a dash manifest.
7
7
  * Can be a relative path.
@@ -74,7 +74,8 @@ export declare function getPeriodAtTime(manifest: DashManifest, time: number): P
74
74
  export declare function flattenRepresentations(period: PeriodType): RepresentationType[];
75
75
  /**
76
76
  * Calculates the manifest duration, either from the mediaPresentationDuration or the last period end time.
77
- * @param manifest
77
+ * Returns `Infinity` for live (dynamic) presentations.
78
+ * Throws if duration cannot be determined.
78
79
  */
79
- export declare function calculateDuration(manifest: DashManifest): number | null;
80
+ export declare function calculateDuration(manifest: DashManifest): number;
80
81
  //# sourceMappingURL=mpd.d.ts.map
@@ -1,7 +1,7 @@
1
- import type { HlsManifestData } from '../../track/hls/HlsManifestProvider';
2
- import type { HlsMediaQualityMetadataResolver } from '../../track/hls/HlsMediaQualityMetadataResolver';
1
+ import type { HlsManifestData } from './HlsManifestProvider';
2
+ import type { HlsMediaQualityMetadataResolver } from './HlsMediaQualityMetadataResolver';
3
3
  import type { MediaTimeline } from '../../streaming/MediaTimeline';
4
- import { type CreateSegmentDataProviderDeps } from '../../track/createSegmentDataProvider';
4
+ import { type CreateSegmentDataProviderDeps } from '../createSegmentDataProvider';
5
5
  export interface BuildHlsMediaTimelineDeps extends CreateSegmentDataProviderDeps {
6
6
  readonly mediaQualityMetadataResolver: HlsMediaQualityMetadataResolver;
7
7
  }
@@ -1,5 +1,5 @@
1
1
  import type { ObservableValue } from '@amazon/vinyl-observable';
2
- import type { HlsManifestData } from '../../track/hls/HlsManifestProvider';
2
+ import type { HlsManifestData } from './HlsManifestProvider';
3
3
  export interface HlsManifestTransformerDeps {
4
4
  readonly manifestController: ObservableValue<Promise<HlsManifestData>>;
5
5
  }
@@ -1,7 +1,7 @@
1
1
  import type { HlsSegment } from '@amazon/vinyl-hls-parser';
2
2
  import type { MediaSegmentReference } from '../../../streaming/SegmentReference';
3
3
  import type { SegmentDataProvider } from '../../../streaming/SegmentDataSlot';
4
- import { type CreateSegmentDataProviderDeps } from '../../../track/createSegmentDataProvider';
4
+ import { type CreateSegmentDataProviderDeps } from '../../createSegmentDataProvider';
5
5
  /**
6
6
  * Builds a timeline of MediaSegmentReferences from an HLS media playlist's
7
7
  * segment list. Cumulative durations are used to compute start/end times.
@@ -1,6 +1,6 @@
1
- import { TrackBase, type TrackBaseDeps, type TrackBaseOptions } from '../../track/TrackBase';
1
+ import { TrackBase, type TrackBaseDeps, type TrackBaseOptions } from '../TrackBase';
2
2
  import { type ReadonlyRanges, type ReadonlySet } from '@amazon/vinyl-util';
3
- import type { TrackPreloadOptions, TrackTypeId, TrackUri } from '../../track/Track';
3
+ import type { TrackPreloadOptions, TrackTypeId, TrackUri } from '../Track';
4
4
  import type { ContentType, MediaQualityMetadata } from '../../streaming/MediaQualityMetadata';
5
5
  import { type Factories } from '@amazon/vinyl-di';
6
6
  import type { ContentStream } from '../../streaming/ContentStream';
@@ -1,4 +1,4 @@
1
- import type { TrackEventMap } from '../../track/Track';
1
+ import type { TrackEventMap } from '../Track';
2
2
  import { EventHostImpl, type ReadonlySet } from '@amazon/vinyl-util';
3
3
  import type { PlaybackController } from '../../playback/PlaybackController';
4
4
  import type { ContentType, MediaQualityMetadata } from '../../streaming/MediaQualityMetadata';
@@ -1,9 +1,9 @@
1
1
  import type { PlaybackSource } from '../../playback/PlaybackSource';
2
- import type { TrackTypeId, TrackUri } from '../../track/Track';
3
- import { type TrackBaseDeps } from '../../track/TrackBase';
4
- import { type TrackFactory, type TrackLoadOptions } from '../../track/TrackFactory';
2
+ import type { TrackTypeId, TrackUri } from '../Track';
3
+ import { type TrackBaseDeps } from '../TrackBase';
4
+ import { type TrackFactory, type TrackLoadOptions } from '../TrackFactory';
5
5
  import { type Maybe } from '@amazon/vinyl-util';
6
- import { SourceTrackBase, type SourceTrackBaseOptions } from '../../track/source/SourceTrackBase';
6
+ import { SourceTrackBase, type SourceTrackBaseOptions } from './SourceTrackBase';
7
7
  /**
8
8
  * Dependencies for a SourceObjectTrack.
9
9
  */
@@ -1,8 +1,8 @@
1
- import type { TrackTypeId, TrackUri } from '../../track/Track';
2
- import { type TrackBaseDeps } from '../../track/TrackBase';
3
- import { type TrackFactory, type TrackLoadOptions } from '../../track/TrackFactory';
1
+ import type { TrackTypeId, TrackUri } from '../Track';
2
+ import { type TrackBaseDeps } from '../TrackBase';
3
+ import { type TrackFactory, type TrackLoadOptions } from '../TrackFactory';
4
4
  import { type Maybe } from '@amazon/vinyl-util';
5
- import { SourceTrackBase, type SourceTrackBaseOptions } from '../../track/source/SourceTrackBase';
5
+ import { SourceTrackBase, type SourceTrackBaseOptions } from './SourceTrackBase';
6
6
  import type { PlaybackSource } from '../../playback/PlaybackSource';
7
7
  /**
8
8
  * Dependencies for a SourceTrack.
@@ -1,5 +1,5 @@
1
- import { TrackBase, type TrackBaseDeps, type TrackBaseOptions } from '../../track/TrackBase';
2
- import type { TrackEventMap, TrackPreloadOptions, TrackTypeId, TrackUri } from '../../track/Track';
1
+ import { TrackBase, type TrackBaseDeps, type TrackBaseOptions } from '../TrackBase';
2
+ import type { TrackEventMap, TrackPreloadOptions, TrackTypeId, TrackUri } from '../Track';
3
3
  import { type Maybe, type ReadonlySet } from '@amazon/vinyl-util';
4
4
  import { type ContentType, type MediaQualityMetadata } from '../../streaming/MediaQualityMetadata';
5
5
  import type { ObjectSchema } from '@amazon/vinyl-validation';
@@ -7,7 +7,7 @@ import type { TrackLoadOptions } from '../track/TrackFactory';
7
7
  import type { DrmController } from '../drm/DrmController';
8
8
  import type { AutoResetController } from '../track/AutoResetController';
9
9
  import type { MutableValue } from '@amazon/vinyl-observable';
10
- import type { VinylOptions } from '../vinyl/VinylOptions';
10
+ import type { VinylOptions } from './VinylOptions';
11
11
  export interface VinylDeps<TrackLoadOptionsType extends TrackLoadOptions = VinylTrackLoadOptions, OptionsType = VinylOptions> {
12
12
  /**
13
13
  * A mutable provider for configuration options.
@@ -11,14 +11,28 @@ import type { DefaultVinylFactories, InferVinylOverrideDependencyType, VinylDepe
11
11
  import type { VinylDeps } from './VinylDeps';
12
12
  import type { Capabilities } from '../client/Capabilities';
13
13
  import { type ContentType, type MediaQualityMetadata } from '../streaming/MediaQualityMetadata';
14
- import type { ReadonlyPlaybackStreamingState } from '../vinyl/ReadonlyPlaybackStreamingState';
14
+ import type { ReadonlyPlaybackStreamingState } from './ReadonlyPlaybackStreamingState';
15
15
  import { type StreamingEventMap } from '../streaming/StreamingEventMap';
16
16
  import type { InferObservableValueType } from '@amazon/vinyl-observable';
17
- import type { VinylOptions } from '../vinyl/VinylOptions';
17
+ import type { VinylOptions } from './VinylOptions';
18
+ import type { ChangeEvent } from '../event/ChangeEvent';
18
19
  /**
19
20
  * Events the Vinyl Player emits.
20
21
  */
21
22
  export interface VinylPlayerEventMap<TrackLoadOptionsType extends TrackLoadOptions = VinylTrackLoadOptions> extends PlaybackControllerEventMap, TrackControllerEventMap<TrackLoadOptionsType>, StreamingEventMap {
23
+ /**
24
+ * Dispatched when {@link VinylPlayer.resetPending} changes.
25
+ *
26
+ * `current` is true when the player has hit a transient, potentially
27
+ * recoverable error (e.g. a network outage) and an automatic reset
28
+ * attempt is scheduled. `current` is false once the pending reset is
29
+ * emitted, the error is cleared, or all retries are exhausted.
30
+ *
31
+ * If `resetPending` becomes false while {@link VinylPlayer.error} is
32
+ * still non-null, all automatic reset attempts have been exhausted
33
+ * and playback will not recover without user action.
34
+ */
35
+ readonly resetPendingChange: ChangeEvent<boolean>;
22
36
  }
23
37
  /**
24
38
  * A Vinyl Media Player.
@@ -32,6 +46,7 @@ export declare class VinylPlayer<TrackLoadOptionsType extends TrackLoadOptions =
32
46
  private get drmController();
33
47
  private get playbackController();
34
48
  private get trackController();
49
+ private get autoResetController();
35
50
  /**
36
51
  * Provides information about the client, such as device and browser capabilities.
37
52
  */
@@ -81,6 +96,15 @@ export declare class VinylPlayer<TrackLoadOptionsType extends TrackLoadOptions =
81
96
  * The last error reported.
82
97
  */
83
98
  get error(): Error | null;
99
+ /**
100
+ * True when an error has interrupted playback and an automatic reset
101
+ * is scheduled. This distinguishes transient, potentially recoverable
102
+ * errors (such as a brief network outage) from terminal errors that
103
+ * will not trigger a reset on their own.
104
+ *
105
+ * Listen to `resetPendingChange` events for changes.
106
+ */
107
+ get resetPending(): boolean;
84
108
  get hasMetadata(): boolean;
85
109
  get loop(): boolean;
86
110
  set loop(value: boolean);
@@ -18,7 +18,7 @@ import { LoudnessNormalizationControllerImpl } from '../playback/loudness/Loudne
18
18
  import { AutoResetControllerImpl, type AutoResetControllerImplDeps, type AutoResetControllerImplOptions } from '../track/AutoResetController';
19
19
  import type { Dependencies, Factories } from '@amazon/vinyl-di';
20
20
  import type { ContentStreamingOptions } from '../streaming/ContentStreamingOptions';
21
- import { type VinylOptions } from '../vinyl/VinylOptions';
21
+ import { type VinylOptions } from './VinylOptions';
22
22
  import type { ObservableValue } from '@amazon/vinyl-observable';
23
23
  /**
24
24
  * Configuration used by the default dependency factories for Vinyl.
@@ -81,15 +81,13 @@ export declare function createVinylFactories(options: VinylDependencyOptions): {
81
81
  }) => LoudnessNormalizationControllerImpl;
82
82
  capabilities: (deps: CapabilitiesImplDeps) => CapabilitiesImpl;
83
83
  requestInterceptor: () => typeof noop;
84
- trackFactory: (deps: VinylTrackFactoryDeps) => import("../track/TrackFactory").TrackFactory<import("..").SourceObjectTrackLoadOptions | import("..").SourceTrackLoadOptions | import("..").DashTrackLoadOptions | import("..").HlsTrackLoadOptions>;
84
+ trackFactory: (deps: VinylTrackFactoryDeps) => import("..").TrackFactory<import("..").SourceObjectTrackLoadOptions | import("..").SourceTrackLoadOptions | import("..").DashTrackLoadOptions | import("..").HlsTrackLoadOptions>;
85
85
  trackController: (deps: TrackControllerImplDeps<any>) => TrackControllerImpl<any>;
86
- drmKeySystemResolver: () => import("../drm/DrmKeySystemResolver").DrmKeySystemResolver;
86
+ drmKeySystemResolver: () => import("..").DrmKeySystemResolver;
87
87
  drmController: (deps: DrmControllerImplDeps) => DrmControllerImpl;
88
88
  commonEme: typeof commonEmeFactory;
89
89
  autoResetController: (deps: AutoResetControllerImplDeps) => AutoResetControllerImpl;
90
- createDashFactories: (deps: import("../track/dash/createDashFactories").DashFactoryDeps) => (/**
91
- * Configuration for segmented streaming tracks (hls / dash).
92
- */ loadOptions: import("..").DashTrackLoadOptions) => {
90
+ createDashFactories: (deps: import("..").DashFactoryDeps) => (loadOptions: import("..").DashTrackLoadOptions) => {
93
91
  contentTypesValue: typeof import("..").createDashContentTypesValue;
94
92
  baseUrlSelector: () => import("..").BaseUrlSelector;
95
93
  segmentRequestInit: () => import("@amazon/vinyl-util").Maybe<Readonly<Omit<RequestInit, "signal">>>;
@@ -112,7 +110,7 @@ export declare function createVinylFactories(options: VinylDependencyOptions): {
112
110
  contentStreamFactory: typeof import("..").createContentStreamFactory;
113
111
  qualitySelector: (deps: {
114
112
  options: ObservableValue<Pick<VinylOptions, "abr">>;
115
- }) => import("../streaming/abr/QualitySelectorImpl").QualitySelectorImpl;
113
+ }) => import("..").QualitySelectorImpl;
116
114
  manifestTransformed: typeof import("..").createDefaultDashManifestTransformer;
117
115
  mediaTimeline: (deps: import("..").BuildDashMediaTimelineDeps & {
118
116
  readonly manifestTransformed: ObservableValue<Promise<import("..").DashManifestData>>;
@@ -124,12 +122,12 @@ export declare function createVinylFactories(options: VinylDependencyOptions): {
124
122
  }>>;
125
123
  playbackController: import("@amazon/vinyl-di").Factory<import("..").PlaybackController>;
126
124
  playbackSource: import("@amazon/vinyl-di").Factory<import("..").PlaybackSource>;
127
- drmKeySystemResolver: import("@amazon/vinyl-di").Factory<import("../drm/DrmKeySystemResolver").DrmKeySystemResolver>;
125
+ drmKeySystemResolver: import("@amazon/vinyl-di").Factory<import("..").DrmKeySystemResolver>;
128
126
  requestInterceptor: import("@amazon/vinyl-di").Factory<import("@amazon/vinyl-util").RequestInterceptor>;
129
127
  drmController: import("@amazon/vinyl-di").Factory<import("..").DrmController>;
130
128
  capabilities: import("@amazon/vinyl-di").Factory<import("..").Capabilities>;
131
129
  };
132
- createHlsFactories: (deps: import("../track/hls/createHlsFactories").HlsFactoryDeps) => (loadOptions: import("..").HlsTrackLoadOptions) => {
130
+ createHlsFactories: (deps: import("..").HlsFactoryDeps) => (loadOptions: import("..").HlsTrackLoadOptions) => {
133
131
  contentTypesValue: typeof import("..").createHlsContentTypesValue;
134
132
  manifestController: () => import("..").HlsManifestControllerImpl;
135
133
  manifestTransformed: typeof import("..").createDefaultHlsManifestTransformer;
@@ -149,7 +147,7 @@ export declare function createVinylFactories(options: VinylDependencyOptions): {
149
147
  contentStreamFactory: typeof import("..").createContentStreamFactory;
150
148
  qualitySelector: (deps: {
151
149
  options: ObservableValue<Pick<VinylOptions, "abr">>;
152
- }) => import("../streaming/abr/QualitySelectorImpl").QualitySelectorImpl;
150
+ }) => import("..").QualitySelectorImpl;
153
151
  mediaTimeline: (deps: import("..").BuildHlsMediaTimelineDeps & {
154
152
  readonly manifestTransformed: ObservableValue<Promise<import("..").HlsManifestData>>;
155
153
  }) => ObservableValue<Promise<import("..").MediaTimeline>>;
@@ -160,7 +158,7 @@ export declare function createVinylFactories(options: VinylDependencyOptions): {
160
158
  }>>;
161
159
  playbackController: import("@amazon/vinyl-di").Factory<import("..").PlaybackController>;
162
160
  playbackSource: import("@amazon/vinyl-di").Factory<import("..").PlaybackSource>;
163
- drmKeySystemResolver: import("@amazon/vinyl-di").Factory<import("../drm/DrmKeySystemResolver").DrmKeySystemResolver>;
161
+ drmKeySystemResolver: import("@amazon/vinyl-di").Factory<import("..").DrmKeySystemResolver>;
164
162
  requestInterceptor: import("@amazon/vinyl-di").Factory<import("@amazon/vinyl-util").RequestInterceptor>;
165
163
  drmController: import("@amazon/vinyl-di").Factory<import("..").DrmController>;
166
164
  capabilities: import("@amazon/vinyl-di").Factory<import("..").Capabilities>;
@@ -22,6 +22,7 @@ describe('getMediaPeriodAtTime', () => {
22
22
  const timeline = {
23
23
  periods: [period1, period2, period3],
24
24
  minBufferTime: 2,
25
+ getDuration: () => Promise.resolve(30),
25
26
  };
26
27
  it('returns the first period for time 0', () => {
27
28
  expect(getMediaPeriodAtTime(timeline, 0)).toBe(period1);
@@ -42,7 +43,11 @@ describe('getMediaPeriodAtTime', () => {
42
43
  expect(getMediaPeriodAtTime(timeline, -1)).toBeNull();
43
44
  });
44
45
  it('returns null for empty timeline', () => {
45
- const empty = { periods: [], minBufferTime: 0 };
46
+ const empty = {
47
+ periods: [],
48
+ minBufferTime: 0,
49
+ getDuration: () => Promise.resolve(0),
50
+ };
46
51
  expect(getMediaPeriodAtTime(empty, 5)).toBeNull();
47
52
  });
48
53
  });
@@ -500,6 +500,7 @@ describe('MseTrack', () => {
500
500
  },
501
501
  ],
502
502
  minBufferTime: 2,
503
+ getDuration: () => Promise.resolve(Infinity),
503
504
  });
504
505
  track = createTrack();
505
506
  await flushPromises();
@@ -521,6 +522,7 @@ describe('MseTrack', () => {
521
522
  },
522
523
  ],
523
524
  minBufferTime: 2,
525
+ getDuration: () => Promise.resolve(Infinity),
524
526
  });
525
527
  track = createTrack();
526
528
  const spy = createEventSpy(track, 'qualitiesChange');
@@ -555,6 +557,7 @@ describe('MseTrack', () => {
555
557
  },
556
558
  ],
557
559
  minBufferTime: 2,
560
+ getDuration: () => Promise.resolve(Infinity),
558
561
  };
559
562
  setTimeline(timeline);
560
563
  track = createTrack();
@@ -587,6 +590,7 @@ describe('MseTrack', () => {
587
590
  },
588
591
  ],
589
592
  minBufferTime: 2,
593
+ getDuration: () => Promise.resolve(Infinity),
590
594
  });
591
595
  track = createTrack();
592
596
  await flushPromises();
@@ -76,6 +76,7 @@ describe('SegmentControllerImpl', () => {
76
76
  },
77
77
  ],
78
78
  minBufferTime: 10,
79
+ getDuration: () => Promise.resolve(100),
79
80
  };
80
81
  const mockQualitySelector = {
81
82
  selectQuality: () => 0,
@@ -230,6 +231,7 @@ describe('SegmentControllerImpl', () => {
230
231
  },
231
232
  ],
232
233
  minBufferTime: 10,
234
+ getDuration: () => Promise.resolve(110),
233
235
  };
234
236
  timelineData.value = Promise.resolve(extendedTimeline);
235
237
  await fillPrefetch();
@@ -330,6 +332,7 @@ describe('SegmentControllerImpl', () => {
330
332
  },
331
333
  ],
332
334
  minBufferTime: 10,
335
+ getDuration: () => Promise.resolve(100),
333
336
  });
334
337
  // segmentController is for 'audio', but only 'video' qualities exist
335
338
  expect(await segmentController.getSegment(5)).toBeNull();
@@ -582,39 +585,6 @@ describe('SegmentControllerImpl', () => {
582
585
  expect(segmentController.startTime).toBe(4);
583
586
  });
584
587
  });
585
- describe('duration', () => {
586
- it('delegates to the media timeline', async () => {
587
- expect(await segmentController.getDuration()).toBe(100);
588
- });
589
- it('returns null for empty timeline', async () => {
590
- timelineData.value = Promise.resolve({
591
- periods: [],
592
- minBufferTime: 0,
593
- });
594
- expect(await segmentController.getDuration()).toBeNull();
595
- });
596
- it('returns null when last period has Infinity endTime', async () => {
597
- timelineData.value = Promise.resolve({
598
- periods: [
599
- {
600
- startTime: 0,
601
- endTime: Infinity,
602
- qualities: [],
603
- },
604
- ],
605
- minBufferTime: 0,
606
- });
607
- expect(await segmentController.getDuration()).toBeNull();
608
- });
609
- it('uses getDuration from timeline when provided', async () => {
610
- timelineData.value = Promise.resolve({
611
- periods: [],
612
- minBufferTime: 0,
613
- getDuration: () => Promise.resolve(42),
614
- });
615
- expect(await segmentController.getDuration()).toBe(42);
616
- });
617
- });
618
588
  describe('fetchedTime', () => {
619
589
  it('returns the number of seconds currently prefetched', async () => {
620
590
  segmentController.configure(defaultConfigOptions);
@@ -566,6 +566,79 @@ describe('QualitySelectorImpl', () => {
566
566
  expect(selector.selectQuality(videoQualities, videoState)).toEqual(0);
567
567
  });
568
568
  });
569
+ describe('maxBandwidth', () => {
570
+ const qualities = [
571
+ {
572
+ ...createEmptyMediaQualityMetadata(),
573
+ bandwidth: 1000,
574
+ bandwidthTotal: 1000,
575
+ qualityId: '0',
576
+ },
577
+ {
578
+ ...createEmptyMediaQualityMetadata(),
579
+ bandwidth: 500,
580
+ bandwidthTotal: 500,
581
+ qualityId: '1',
582
+ },
583
+ {
584
+ ...createEmptyMediaQualityMetadata(),
585
+ bandwidth: 100,
586
+ bandwidthTotal: 100,
587
+ qualityId: '2',
588
+ },
589
+ ];
590
+ const prefetchState = {
591
+ fetchedTime: 0,
592
+ previousQuality: null,
593
+ active: false,
594
+ };
595
+ beforeEach(() => {
596
+ // Plenty of bandwidth for the highest quality.
597
+ metrics.estimatedDownlinkBandwidth.ewmaLow = 5000;
598
+ });
599
+ it('caps the selectable quality to the configured bandwidth', () => {
600
+ options.value = { ...options.value, maxBandwidth: 500 };
601
+ // Highest quality at or below the cap is index 1 (500).
602
+ expect(selector.selectQuality(qualities, prefetchState)).toEqual(1);
603
+ });
604
+ it('falls back to the lowest quality when all exceed the cap', () => {
605
+ options.value = { ...options.value, maxBandwidth: 50 };
606
+ // No quality fits — selectQuality falls back to the last (lowest) entry.
607
+ expect(selector.selectQuality(qualities, prefetchState)).toEqual(2);
608
+ });
609
+ it('pins to the lowest quality when set to 0', () => {
610
+ options.value = { ...options.value, maxBandwidth: 0 };
611
+ expect(selector.selectQuality(qualities, prefetchState)).toEqual(2);
612
+ });
613
+ it('treats null as no cap', () => {
614
+ options.value = { ...options.value, maxBandwidth: null };
615
+ expect(selector.selectQuality(qualities, prefetchState)).toEqual(0);
616
+ });
617
+ it('does not raise the bandwidth budget above the network estimate', () => {
618
+ // Network estimate is well below the cap; cap should not raise it.
619
+ metrics.estimatedDownlinkBandwidth.ewmaLow = 600;
620
+ options.value = { ...options.value, maxBandwidth: 100_000 };
621
+ expect(selector.selectQuality(qualities, prefetchState)).toEqual(1);
622
+ });
623
+ it('has no effect when strategy is LOWEST', () => {
624
+ options.value = {
625
+ ...options.value,
626
+ strategy: AbrStrategy.LOWEST,
627
+ maxBandwidth: 100_000,
628
+ };
629
+ // LOWEST always returns the last index, regardless of the cap.
630
+ expect(selector.selectQuality(qualities, prefetchState)).toEqual(qualities.length - 1);
631
+ });
632
+ it('has no effect when strategy is HIGHEST', () => {
633
+ options.value = {
634
+ ...options.value,
635
+ strategy: AbrStrategy.HIGHEST,
636
+ maxBandwidth: 50,
637
+ };
638
+ // HIGHEST always returns 0, regardless of the cap.
639
+ expect(selector.selectQuality(qualities, prefetchState)).toEqual(0);
640
+ });
641
+ });
569
642
  describe('toString', () => {
570
643
  it('returns a string', () => {
571
644
  expect(selector.toString()).toContain('QualitySelectorImpl');
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import { flushPromises, useMockTime } from '@amazon/vinyl-util/browserTestUtil';
6
6
  import { MockMediaSourceController, MockPlaybackController, MockSegmentController, MockSourceBufferController, } from '@amazon/vinyl/vinylTestUtil';
7
- import { BufferingControllerImpl, clearSourceBufferQuota, createEmptyMediaQualityMetadata, DEFAULT_MAX_APPEND_SIZE, DURATION_PADDING, getSourceBufferQuota, LIVE_DURATION, MIN_APPEND_SIZE, POLL_BUFFER_THROTTLE, QUOTA_REACHED_SCALE, SEGMENT_START_AFFORDANCE, } from '@amazon/vinyl';
7
+ import { BufferingControllerImpl, clearSourceBufferQuota, createEmptyMediaQualityMetadata, DEFAULT_MAX_APPEND_SIZE, getSourceBufferQuota, MIN_APPEND_SIZE, POLL_BUFFER_THROTTLE, QUOTA_REACHED_SCALE, SEGMENT_START_AFFORDANCE, } from '@amazon/vinyl';
8
8
  import { Abort, AbortError, Deferred, floorToNearest, LogLevel, } from '@amazon/vinyl-util';
9
9
  import { createEventSpy, useMockLogger } from '@amazon/vinyl-util/testUtil';
10
10
  var any = jasmine.any;
@@ -86,7 +86,6 @@ describe('BufferingControllerImpl', () => {
86
86
  }
87
87
  beforeEach(() => {
88
88
  mediaSourceController = new MockMediaSourceController();
89
- mediaSourceController.duration = Number.NaN;
90
89
  playbackController = new MockPlaybackController();
91
90
  segmentController = new MockSegmentController();
92
91
  segmentController.getSegment.and.callFake((time) => {
@@ -512,45 +511,6 @@ describe('BufferingControllerImpl', () => {
512
511
  expect(bufferingController.getBufferedTime()).toBe(10);
513
512
  });
514
513
  });
515
- describe('duration', () => {
516
- beforeEach(() => {
517
- bufferingController = createBufferingController();
518
- bufferingController.activate();
519
- });
520
- describe('when the media source is open and the segment controller is not updating', () => {
521
- it('is set to the segment controller provided value', async () => {
522
- segmentController.getDuration.and.resolveTo(33);
523
- await open();
524
- expect(mediaSourceController.duration).toEqual(33 + DURATION_PADDING);
525
- });
526
- describe('when segment controller duration resolves to null', () => {
527
- it('sets mediaSource duration to LIVE_DURATION', async () => {
528
- segmentController.getDuration.and.resolveTo(null);
529
- await open();
530
- expect(mediaSourceController.duration).toEqual(LIVE_DURATION);
531
- });
532
- });
533
- });
534
- describe('when segment controller emits a change event', () => {
535
- it('refreshes duration', async () => {
536
- segmentController.getDuration.and.resolveTo(42);
537
- await open();
538
- expect(mediaSourceController.duration).toEqual(42 + DURATION_PADDING);
539
- segmentController.getDuration.and.resolveTo(54);
540
- segmentController.dispatch('change', {});
541
- await nextPollImmediate();
542
- expect(mediaSourceController.duration).toEqual(54 + DURATION_PADDING);
543
- });
544
- describe('and mediaSource is not open', () => {
545
- it('does nothing', () => {
546
- // Closed
547
- segmentController.getDuration.and.resolveTo(52);
548
- segmentController.dispatch('change', {});
549
- expect(mediaSourceController.duration).toBeNaN();
550
- });
551
- });
552
- });
553
- });
554
514
  describe('playbackQuality', () => {
555
515
  // The time to simulate a quality change from q1 to q2:
556
516
  let changeTime;