@videojs/html 10.0.0-beta.28 → 10.0.0-beta.29
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/cdn/{adapter-XTen-YVQ.js → adapter-CEnNWvii.js} +17 -4
- package/cdn/adapter-CEnNWvii.js.map +1 -0
- package/cdn/adapter-DaKW8NzI.js +2 -0
- package/cdn/adapter-DaKW8NzI.js.map +1 -0
- package/cdn/audio-headless.dev.js +1 -1
- package/cdn/audio-headless.js +1 -1
- package/cdn/audio-minimal-ui.dev.js +2 -2
- package/cdn/audio-minimal-ui.js +1 -1
- package/cdn/audio-minimal.dev.js +5 -5
- package/cdn/audio-minimal.dev.js.map +1 -1
- package/cdn/audio-minimal.js +1 -1
- package/cdn/audio-minimal.js.map +1 -1
- package/cdn/audio-ui.dev.js +2 -2
- package/cdn/audio-ui.js +1 -1
- package/cdn/audio.dev.js +5 -5
- package/cdn/audio.dev.js.map +1 -1
- package/cdn/audio.js +1 -1
- package/cdn/audio.js.map +1 -1
- package/cdn/background.dev.js +1 -1
- package/cdn/background.js +1 -1
- package/cdn/background.js.map +1 -1
- package/cdn/compounds-C4YYLyL2.js +8 -0
- package/cdn/compounds-C4YYLyL2.js.map +1 -0
- package/cdn/{compounds-nk9RJtBK.js → compounds-C73u1MeO.js} +63 -59
- package/cdn/compounds-C73u1MeO.js.map +1 -0
- package/cdn/create-player-BU8LDJDL.js +2 -0
- package/cdn/create-player-BU8LDJDL.js.map +1 -0
- package/cdn/{create-player-DK9WOywd.js → create-player-Db1CIvlK.js} +58 -46
- package/cdn/create-player-Db1CIvlK.js.map +1 -0
- package/cdn/{default-BqQDVloS.js → default-A3aM0skz.js} +2 -2
- package/cdn/default-A3aM0skz.js.map +1 -0
- package/cdn/default-BDyhiTCm.js +2 -0
- package/cdn/default-BDyhiTCm.js.map +1 -0
- package/cdn/{default-I2LasfxC.js → default-C1_k1NeB.js} +2 -2
- package/cdn/default-C1_k1NeB.js.map +1 -0
- package/cdn/default-DHrMd4ie.js +2 -0
- package/cdn/default-DHrMd4ie.js.map +1 -0
- package/cdn/error-surface-BID4D3DW.js +59 -0
- package/cdn/error-surface-BID4D3DW.js.map +1 -0
- package/cdn/{select-tracks-nRPBa1NC.js → error-surface-D0bo71gD.js} +442 -48
- package/cdn/error-surface-D0bo71gD.js.map +1 -0
- package/cdn/gesture-element-CeRy1IVs.js +2 -0
- package/cdn/gesture-element-CeRy1IVs.js.map +1 -0
- package/cdn/{gesture-element-6Ld1YwIL.js → gesture-element-DB67OYCE.js} +3 -3
- package/cdn/gesture-element-DB67OYCE.js.map +1 -0
- package/cdn/{hls-js-C4P_b2tT.js → hls-js-CiE4wOrG.js} +2 -2
- package/cdn/{hls-js-C4P_b2tT.js.map → hls-js-CiE4wOrG.js.map} +1 -1
- package/cdn/{hls-js-CATW7NBm.js → hls-js-DBKRCbQm.js} +2 -2
- package/cdn/{hls-js-CATW7NBm.js.map → hls-js-DBKRCbQm.js.map} +1 -1
- package/cdn/{hls-js-BEuVm0u9.js → hls-js-DX2NGCAr.js} +2 -2
- package/cdn/{hls-js-BEuVm0u9.js.map → hls-js-DX2NGCAr.js.map} +1 -1
- package/cdn/{hls-js-WCNy9MVh.js → hls-js-JeH8yvsP.js} +2 -2
- package/cdn/{hls-js-WCNy9MVh.js.map → hls-js-JeH8yvsP.js.map} +1 -1
- package/cdn/i18n-CpBDXf6M.js +2 -0
- package/cdn/{i18n-Dc7WM2xd.js.map → i18n-CpBDXf6M.js.map} +1 -1
- package/cdn/{i18n-Ch4t6EjV.js → i18n-D0nhPa0m.js} +2 -2
- package/cdn/{i18n-Ch4t6EjV.js.map → i18n-D0nhPa0m.js.map} +1 -1
- package/cdn/{live-button-element-DaHgnYdw.js → live-button-element-Co8z2LkI.js} +2 -2
- package/cdn/{live-button-element-DaHgnYdw.js.map → live-button-element-Co8z2LkI.js.map} +1 -1
- package/cdn/{live-button-element-Bae44kBN.js → live-button-element-zE-8uoR2.js} +3 -3
- package/cdn/{live-button-element-Bae44kBN.js.map → live-button-element-zE-8uoR2.js.map} +1 -1
- package/cdn/live-video-minimal.dev.js +11 -9
- package/cdn/live-video-minimal.dev.js.map +1 -1
- package/cdn/live-video-minimal.js +1 -1
- package/cdn/live-video-minimal.js.map +1 -1
- package/cdn/live-video.dev.js +12 -10
- package/cdn/live-video.dev.js.map +1 -1
- package/cdn/live-video.js +1 -1
- package/cdn/live-video.js.map +1 -1
- package/cdn/media/hls-audio.dev.js +1 -1
- package/cdn/media/hls-audio.js +1 -1
- package/cdn/media/hls-background-video.dev.js +1 -1
- package/cdn/media/hls-background-video.js +1 -1
- package/cdn/media/hls-video.dev.js +1 -1
- package/cdn/media/hls-video.js +1 -1
- package/cdn/media/mux-audio/hls-js.dev.js +1 -1
- package/cdn/media/mux-audio/hls-js.js +1 -1
- package/cdn/media/mux-audio/spf.dev.js +2 -2
- package/cdn/media/mux-audio/spf.js +1 -1
- package/cdn/media/mux-audio.dev.js +1 -1
- package/cdn/media/mux-audio.js +1 -1
- package/cdn/media/mux-background-video.dev.js +1 -1
- package/cdn/media/mux-background-video.js +1 -1
- package/cdn/media/mux-data.dev.js +1 -1
- package/cdn/media/mux-data.dev.js.map +1 -1
- package/cdn/media/mux-data.js +1 -1
- package/cdn/media/mux-data.js.map +1 -1
- package/cdn/media/mux-video/hls-js.dev.js +1 -1
- package/cdn/media/mux-video/hls-js.js +1 -1
- package/cdn/media/mux-video/spf.dev.js +2 -2
- package/cdn/media/mux-video/spf.js +1 -1
- package/cdn/media/mux-video.dev.js +1 -1
- package/cdn/media/mux-video.js +1 -1
- package/cdn/media/vimeo-video.dev.js +27 -5
- package/cdn/media/vimeo-video.dev.js.map +1 -1
- package/cdn/media/vimeo-video.js +1 -1
- package/cdn/media/vimeo-video.js.map +1 -1
- package/cdn/{media-Uxm0d3Vx.js → media-BI8caj07.js} +3 -3
- package/cdn/{media-Uxm0d3Vx.js.map → media-BI8caj07.js.map} +1 -1
- package/cdn/{media-COIe3uI5.js → media-BNuI0Im7.js} +19 -6
- package/cdn/media-BNuI0Im7.js.map +1 -0
- package/cdn/media-CQxFuDcv.js +2 -0
- package/cdn/{media-CPVSKLdk.js.map → media-CQxFuDcv.js.map} +1 -1
- package/cdn/media-D4tG62L5.js +2 -0
- package/cdn/{media-BTipOcKo.js.map → media-D4tG62L5.js.map} +1 -1
- package/cdn/{media-oa3nyL2o.js → media-DI6DvYm3.js} +3 -3
- package/cdn/{media-oa3nyL2o.js.map → media-DI6DvYm3.js.map} +1 -1
- package/cdn/media-DU3Xf5XR.js +2 -0
- package/cdn/media-DU3Xf5XR.js.map +1 -0
- package/cdn/media-mYKOAsk3.js +825 -0
- package/cdn/media-mYKOAsk3.js.map +1 -0
- package/cdn/media-zReLnePj.js +2 -0
- package/cdn/media-zReLnePj.js.map +1 -0
- package/cdn/{minimal-DQCLKRyR.js → minimal-3OmH0xQS.js} +2 -2
- package/cdn/minimal-3OmH0xQS.js.map +1 -0
- package/cdn/{minimal-DLosvq31.js → minimal-6w_Vyyl9.js} +2 -2
- package/cdn/minimal-6w_Vyyl9.js.map +1 -0
- package/cdn/minimal-BWLTn7oQ.js +2 -0
- package/cdn/minimal-BWLTn7oQ.js.map +1 -0
- package/cdn/minimal-DIGrklyh.js +2 -0
- package/cdn/minimal-DIGrklyh.js.map +1 -0
- package/cdn/{minimal-ui-CRKvUmB8.js → minimal-ui-BCIESK8f.js} +8 -8
- package/cdn/{minimal-ui-CRKvUmB8.js.map → minimal-ui-BCIESK8f.js.map} +1 -1
- package/cdn/minimal-ui-BXrq3z4U.js +2 -0
- package/cdn/{minimal-ui-Et2Wcn7r.js.map → minimal-ui-BXrq3z4U.js.map} +1 -1
- package/cdn/{minimal-ui-BpHxIo4z.js → minimal-ui-DEalpMk6.js} +4 -4
- package/cdn/{minimal-ui-BpHxIo4z.js.map → minimal-ui-DEalpMk6.js.map} +1 -1
- package/cdn/{minimal-ui-8iRZf_72.js → minimal-ui-vY3QgohH.js} +2 -2
- package/cdn/{minimal-ui-8iRZf_72.js.map → minimal-ui-vY3QgohH.js.map} +1 -1
- package/cdn/{player-DM9rUXg-.js → player-B3GlPF90.js} +2 -2
- package/cdn/{player-DM9rUXg-.js.map → player-B3GlPF90.js.map} +1 -1
- package/cdn/player-CtTC7qa5.js +2 -0
- package/cdn/{player-rCFqzWrA.js.map → player-CtTC7qa5.js.map} +1 -1
- package/cdn/player-DKkph8UM.js +2 -0
- package/cdn/{player-BRQLp5bX.js.map → player-DKkph8UM.js.map} +1 -1
- package/cdn/{player-CKTAtwit.js → player-DPDmTRvg.js} +2 -2
- package/cdn/{player-CKTAtwit.js.map → player-DPDmTRvg.js.map} +1 -1
- package/cdn/player-DrDd7LJi.js +2 -0
- package/cdn/{player-BloX4l6F.js.map → player-DrDd7LJi.js.map} +1 -1
- package/cdn/{player-B2oraRyD.js → player-L5UpZmT4.js} +2 -2
- package/cdn/{player-B2oraRyD.js.map → player-L5UpZmT4.js.map} +1 -1
- package/cdn/{poster-element-BGr1VQJB.js → poster-element-B5tdJ2ub.js} +179 -38
- package/cdn/poster-element-B5tdJ2ub.js.map +1 -0
- package/cdn/poster-element-B8QwXSU_.js +2 -0
- package/cdn/poster-element-B8QwXSU_.js.map +1 -0
- package/cdn/{error-surface-drmCvBVW.js → relocation-pipelines-Dh8CcgHw.js} +5 -343
- package/cdn/relocation-pipelines-Dh8CcgHw.js.map +1 -0
- package/cdn/relocation-pipelines-DunE4gcV.js +2 -0
- package/cdn/relocation-pipelines-DunE4gcV.js.map +1 -0
- package/cdn/{seek-button-element-XMTLIxZj.js → seek-button-element-5co-k0Dx.js} +4 -4
- package/cdn/seek-button-element-5co-k0Dx.js.map +1 -0
- package/cdn/{seek-button-element-FlgBVoGM.js → seek-button-element-B8TkILg-.js} +2 -2
- package/cdn/{seek-button-element-FlgBVoGM.js.map → seek-button-element-B8TkILg-.js.map} +1 -1
- package/cdn/shallow-equal-C7S8rj2f.js +16 -0
- package/cdn/shallow-equal-C7S8rj2f.js.map +1 -0
- package/cdn/shallow-equal-KV1zFqZi.js +2 -0
- package/cdn/shallow-equal-KV1zFqZi.js.map +1 -0
- package/cdn/{skin-element-DL-Kqa5f.js → skin-element-DrkI8xuM.js} +2 -2
- package/cdn/{skin-element-DL-Kqa5f.js.map → skin-element-DrkI8xuM.js.map} +1 -1
- package/cdn/{skin-element-DNytI-uu.js → skin-element-DvX6Bxsv.js} +2 -2
- package/cdn/{skin-element-DNytI-uu.js.map → skin-element-DvX6Bxsv.js.map} +1 -1
- package/cdn/{text-element-DeWBNKXb.js → text-element-BoY6AhMn.js} +2 -2
- package/cdn/{text-element-DeWBNKXb.js.map → text-element-BoY6AhMn.js.map} +1 -1
- package/cdn/{text-element-D88ArbZz.js → text-element-cg6l21cd.js} +2 -2
- package/cdn/{text-element-D88ArbZz.js.map → text-element-cg6l21cd.js.map} +1 -1
- package/cdn/time-slider-chapters-element-BfLjdnU4.js +2 -0
- package/cdn/time-slider-chapters-element-BfLjdnU4.js.map +1 -0
- package/cdn/{time-slider-chapters-element-DJ0abZXI.js → time-slider-chapters-element-CznFQWFm.js} +5 -5
- package/cdn/time-slider-chapters-element-CznFQWFm.js.map +1 -0
- package/cdn/{ui-BU3_2gDQ.js → ui-BwzqkJNK.js} +7 -7
- package/cdn/{ui-BU3_2gDQ.js.map → ui-BwzqkJNK.js.map} +1 -1
- package/cdn/ui-DayfItun.js +2 -0
- package/cdn/{ui-C0isALTQ.js.map → ui-DayfItun.js.map} +1 -1
- package/cdn/ui-PSnD-pv8.js +2 -0
- package/cdn/{ui-DVpkE1MN.js.map → ui-PSnD-pv8.js.map} +1 -1
- package/cdn/{ui-BsaWWE4y.js → ui-fnKp94a7.js} +9 -9
- package/cdn/{ui-BsaWWE4y.js.map → ui-fnKp94a7.js.map} +1 -1
- package/cdn/video-headless.dev.js +1 -1
- package/cdn/video-headless.js +1 -1
- package/cdn/video-minimal-ui.dev.js +2 -2
- package/cdn/video-minimal-ui.js +1 -1
- package/cdn/video-minimal.dev.js +8 -6
- package/cdn/video-minimal.dev.js.map +1 -1
- package/cdn/video-minimal.js +1 -1
- package/cdn/video-minimal.js.map +1 -1
- package/cdn/video-ui.dev.js +2 -2
- package/cdn/video-ui.js +1 -1
- package/cdn/video.dev.js +9 -7
- package/cdn/video.dev.js.map +1 -1
- package/cdn/video.js +1 -1
- package/cdn/video.js.map +1 -1
- package/dist/default/__generated__/skins/default-video/styles/buttons.css +132 -18
- package/dist/default/__generated__/skins/default-video/styles/captions.css +22 -0
- package/dist/default/__generated__/skins/default-video/styles/container.css +121 -8
- package/dist/default/__generated__/skins/default-video/styles/controls.css +436 -21
- package/dist/default/__generated__/skins/default-video/styles/dialog.css +169 -0
- package/dist/default/__generated__/skins/default-video/styles/indicator.css +459 -0
- package/dist/default/__generated__/skins/default-video/styles/menus.css +254 -0
- package/dist/default/__generated__/skins/default-video/styles/overlays.css +26 -2
- package/dist/default/__generated__/skins/default-video/styles/popups.css +338 -12
- package/dist/default/__generated__/skins/default-video/styles/poster.css +4 -4
- package/dist/default/__generated__/skins/default-video/styles/sliders.css +355 -31
- package/dist/default/__generated__/skins/default-video/styles/styles.css +2455 -216
- package/dist/default/__generated__/skins/default-video/styles/theme.css +4 -19
- package/dist/default/__generated__/skins/default-video/styles/video.css +29 -0
- package/dist/default/__generated__/skins/minimal-video/styles/base.css +25 -0
- package/dist/default/__generated__/skins/minimal-video/styles/buttons.css +266 -0
- package/dist/default/__generated__/skins/minimal-video/styles/captions.css +22 -0
- package/dist/default/__generated__/skins/minimal-video/styles/container.css +158 -0
- package/dist/default/__generated__/skins/minimal-video/styles/controls.css +182 -0
- package/dist/default/__generated__/skins/minimal-video/styles/dialog.css +77 -0
- package/dist/default/__generated__/skins/minimal-video/styles/indicator.css +322 -0
- package/dist/default/__generated__/skins/minimal-video/styles/menus.css +254 -0
- package/dist/default/__generated__/skins/minimal-video/styles/overlays.css +35 -0
- package/dist/default/__generated__/skins/minimal-video/styles/popups.css +371 -0
- package/dist/default/__generated__/skins/minimal-video/styles/poster.css +47 -0
- package/dist/default/__generated__/skins/minimal-video/styles/sliders.css +436 -0
- package/dist/default/__generated__/skins/minimal-video/styles/styles.css +2246 -0
- package/dist/default/__generated__/skins/minimal-video/styles/theme.css +7 -0
- package/dist/default/__generated__/skins/minimal-video/styles/video.css +29 -0
- package/dist/default/_virtual/inline-css_src/define/audio/minimal-skin.js +1 -1
- package/dist/default/_virtual/inline-css_src/define/audio/minimal-skin.js.map +1 -1
- package/dist/default/_virtual/inline-css_src/define/audio/skin.js +1 -1
- package/dist/default/_virtual/inline-css_src/define/audio/skin.js.map +1 -1
- package/dist/default/_virtual/inline-css_src/define/live-audio/minimal-skin.js +1 -1
- package/dist/default/_virtual/inline-css_src/define/live-audio/minimal-skin.js.map +1 -1
- package/dist/default/_virtual/inline-css_src/define/live-audio/skin.js +1 -1
- package/dist/default/_virtual/inline-css_src/define/live-audio/skin.js.map +1 -1
- package/dist/default/_virtual/inline-css_src/define/live-video/minimal-skin.js +1 -1
- package/dist/default/_virtual/inline-css_src/define/live-video/minimal-skin.js.map +1 -1
- package/dist/default/_virtual/inline-css_src/define/live-video/skin.js +1 -1
- package/dist/default/_virtual/inline-css_src/define/live-video/skin.js.map +1 -1
- package/dist/default/_virtual/inline-css_src/define/video/minimal-skin.js +1 -1
- package/dist/default/_virtual/inline-css_src/define/video/minimal-skin.js.map +1 -1
- package/dist/default/_virtual/inline-css_src/define/video/skin.js +1 -1
- package/dist/default/_virtual/inline-css_src/define/video/skin.js.map +1 -1
- package/dist/default/define/audio/minimal-skin.css +103 -101
- package/dist/default/define/audio/skin.css +68 -69
- package/dist/default/define/live-audio/minimal-skin.css +103 -101
- package/dist/default/define/live-audio/skin.css +68 -69
- package/dist/default/define/live-video/minimal-skin.css +140 -120
- package/dist/default/define/live-video/minimal-skin.js +1 -1
- package/dist/default/define/live-video/minimal-skin.js.map +1 -1
- package/dist/default/define/live-video/minimal-skin.tailwind.js +1 -1
- package/dist/default/define/live-video/minimal-skin.tailwind.js.map +1 -1
- package/dist/default/define/live-video/skin.css +89 -76
- package/dist/default/define/live-video/skin.js +1 -1
- package/dist/default/define/live-video/skin.js.map +1 -1
- package/dist/default/define/live-video/skin.tailwind.js +1 -1
- package/dist/default/define/live-video/skin.tailwind.js.map +1 -1
- package/dist/default/define/ui/gesture.js +7 -0
- package/dist/default/define/ui/gesture.js.map +1 -0
- package/dist/default/define/video/minimal-skin.css +140 -120
- package/dist/default/define/video/minimal-skin.js +1 -1
- package/dist/default/define/video/minimal-skin.js.map +1 -1
- package/dist/default/define/video/minimal-skin.tailwind.js +1 -1
- package/dist/default/define/video/minimal-skin.tailwind.js.map +1 -1
- package/dist/default/define/video/skin.css +89 -76
- package/dist/default/define/video/skin.js +1 -1
- package/dist/default/define/video/skin.js.map +1 -1
- package/dist/default/define/video/skin.tailwind.js +1 -1
- package/dist/default/define/video/skin.tailwind.js.map +1 -1
- package/dist/default/icons/dist/element/default/icons.js +1 -1
- package/dist/default/icons/dist/element/default/icons.js.map +1 -1
- package/dist/default/icons/dist/element/minimal/icons.js +1 -1
- package/dist/default/icons/dist/element/minimal/icons.js.map +1 -1
- package/dist/default/icons/dist/html/default/airplay-exit.js +1 -1
- package/dist/default/icons/dist/html/default/airplay-exit.js.map +1 -1
- package/dist/default/icons/dist/html/minimal/airplay-exit.js +1 -1
- package/dist/default/icons/dist/html/minimal/airplay-exit.js.map +1 -1
- package/dist/default/icons/dist/render/default/index.js +1 -1
- package/dist/default/icons/dist/render/default/index.js.map +1 -1
- package/dist/default/icons/dist/render/minimal/index.js +1 -1
- package/dist/default/icons/dist/render/minimal/index.js.map +1 -1
- package/dist/default/media/hls-background-video/media.js +18 -0
- package/dist/default/media/hls-background-video/media.js.map +1 -1
- package/dist/default/skins/dist/default/default/tailwind/components/button.js +3 -1
- package/dist/default/skins/dist/default/default/tailwind/components/button.js.map +1 -1
- package/dist/default/skins/dist/default/default/tailwind/components/poster.js +8 -1
- package/dist/default/skins/dist/default/default/tailwind/components/poster.js.map +1 -1
- package/dist/default/skins/dist/default/default/tailwind/components/slider.js +10 -10
- package/dist/default/skins/dist/default/default/tailwind/components/slider.js.map +1 -1
- package/dist/default/skins/dist/default/default/tailwind/components/thumbnail.js +1 -1
- package/dist/default/skins/dist/default/default/tailwind/components/thumbnail.js.map +1 -1
- package/dist/default/skins/dist/default/default/tailwind/video.tailwind.js +2 -2
- package/dist/default/skins/dist/default/default/tailwind/video.tailwind.js.map +1 -1
- package/dist/default/skins/dist/default/minimal/tailwind/components/poster.js +8 -1
- package/dist/default/skins/dist/default/minimal/tailwind/components/poster.js.map +1 -1
- package/dist/default/skins/dist/default/minimal/tailwind/components/slider.js +13 -12
- package/dist/default/skins/dist/default/minimal/tailwind/components/slider.js.map +1 -1
- package/dist/default/skins/dist/default/minimal/tailwind/components/thumbnail.js +1 -1
- package/dist/default/skins/dist/default/minimal/tailwind/components/thumbnail.js.map +1 -1
- package/dist/default/skins/dist/default/minimal/tailwind/video.tailwind.js +6 -5
- package/dist/default/skins/dist/default/minimal/tailwind/video.tailwind.js.map +1 -1
- package/dist/default/skins/dist/default/shared/tailwind/icon-state.js +4 -4
- package/dist/default/skins/dist/default/shared/tailwind/icon-state.js.map +1 -1
- package/dist/default/store/provider-mixin.js +22 -8
- package/dist/default/store/provider-mixin.js.map +1 -1
- package/dist/default/ui/audio-track-radio-group/audio-track-radio-group-element.js +1 -1
- package/dist/default/ui/audio-track-radio-group/audio-track-radio-group-element.js.map +1 -1
- package/dist/default/ui/captions-radio-group/captions-radio-group-element.js +1 -1
- package/dist/default/ui/captions-radio-group/captions-radio-group-element.js.map +1 -1
- package/dist/default/ui/gesture/gesture-element.js.map +1 -1
- package/dist/default/ui/hotkey/hotkey-element.js.map +1 -1
- package/dist/default/ui/menu/context.js.map +1 -1
- package/dist/default/ui/menu/menu-element.js +28 -27
- package/dist/default/ui/menu/menu-element.js.map +1 -1
- package/dist/default/ui/menu/menu-radio-group-element.js +14 -14
- package/dist/default/ui/menu/menu-radio-group-element.js.map +1 -1
- package/dist/default/ui/playback-rate-radio-group/playback-rate-radio-group-element.js +1 -1
- package/dist/default/ui/playback-rate-radio-group/playback-rate-radio-group-element.js.map +1 -1
- package/dist/default/ui/poster/poster-element.js +138 -8
- package/dist/default/ui/poster/poster-element.js.map +1 -1
- package/dist/default/ui/quality-radio-group/quality-radio-group-element.js +1 -1
- package/dist/default/ui/quality-radio-group/quality-radio-group-element.js.map +1 -1
- package/dist/default/ui/slider/slider-preview-element.js.map +1 -1
- package/dist/dev/__generated__/skins/default-video/styles/buttons.css +132 -18
- package/dist/dev/__generated__/skins/default-video/styles/captions.css +22 -0
- package/dist/dev/__generated__/skins/default-video/styles/container.css +121 -8
- package/dist/dev/__generated__/skins/default-video/styles/controls.css +436 -21
- package/dist/dev/__generated__/skins/default-video/styles/dialog.css +169 -0
- package/dist/dev/__generated__/skins/default-video/styles/indicator.css +459 -0
- package/dist/dev/__generated__/skins/default-video/styles/menus.css +254 -0
- package/dist/dev/__generated__/skins/default-video/styles/overlays.css +26 -2
- package/dist/dev/__generated__/skins/default-video/styles/popups.css +338 -12
- package/dist/dev/__generated__/skins/default-video/styles/poster.css +4 -4
- package/dist/dev/__generated__/skins/default-video/styles/sliders.css +355 -31
- package/dist/dev/__generated__/skins/default-video/styles/styles.css +2455 -216
- package/dist/dev/__generated__/skins/default-video/styles/theme.css +4 -19
- package/dist/dev/__generated__/skins/default-video/styles/video.css +29 -0
- package/dist/dev/__generated__/skins/minimal-video/styles/base.css +25 -0
- package/dist/dev/__generated__/skins/minimal-video/styles/buttons.css +266 -0
- package/dist/dev/__generated__/skins/minimal-video/styles/captions.css +22 -0
- package/dist/dev/__generated__/skins/minimal-video/styles/container.css +158 -0
- package/dist/dev/__generated__/skins/minimal-video/styles/controls.css +182 -0
- package/dist/dev/__generated__/skins/minimal-video/styles/dialog.css +77 -0
- package/dist/dev/__generated__/skins/minimal-video/styles/indicator.css +322 -0
- package/dist/dev/__generated__/skins/minimal-video/styles/menus.css +254 -0
- package/dist/dev/__generated__/skins/minimal-video/styles/overlays.css +35 -0
- package/dist/dev/__generated__/skins/minimal-video/styles/popups.css +371 -0
- package/dist/dev/__generated__/skins/minimal-video/styles/poster.css +47 -0
- package/dist/dev/__generated__/skins/minimal-video/styles/sliders.css +436 -0
- package/dist/dev/__generated__/skins/minimal-video/styles/styles.css +2246 -0
- package/dist/dev/__generated__/skins/minimal-video/styles/theme.css +7 -0
- package/dist/dev/__generated__/skins/minimal-video/styles/video.css +29 -0
- package/dist/dev/_virtual/inline-css_src/define/audio/minimal-skin.js +1 -1
- package/dist/dev/_virtual/inline-css_src/define/audio/minimal-skin.js.map +1 -1
- package/dist/dev/_virtual/inline-css_src/define/audio/skin.js +1 -1
- package/dist/dev/_virtual/inline-css_src/define/audio/skin.js.map +1 -1
- package/dist/dev/_virtual/inline-css_src/define/live-audio/minimal-skin.js +1 -1
- package/dist/dev/_virtual/inline-css_src/define/live-audio/minimal-skin.js.map +1 -1
- package/dist/dev/_virtual/inline-css_src/define/live-audio/skin.js +1 -1
- package/dist/dev/_virtual/inline-css_src/define/live-audio/skin.js.map +1 -1
- package/dist/dev/_virtual/inline-css_src/define/live-video/minimal-skin.js +1 -1
- package/dist/dev/_virtual/inline-css_src/define/live-video/minimal-skin.js.map +1 -1
- package/dist/dev/_virtual/inline-css_src/define/live-video/skin.js +1 -1
- package/dist/dev/_virtual/inline-css_src/define/live-video/skin.js.map +1 -1
- package/dist/dev/_virtual/inline-css_src/define/video/minimal-skin.js +1 -1
- package/dist/dev/_virtual/inline-css_src/define/video/minimal-skin.js.map +1 -1
- package/dist/dev/_virtual/inline-css_src/define/video/skin.js +1 -1
- package/dist/dev/_virtual/inline-css_src/define/video/skin.js.map +1 -1
- package/dist/dev/define/audio/minimal-skin.css +103 -101
- package/dist/dev/define/audio/skin.css +68 -69
- package/dist/dev/define/live-audio/minimal-skin.css +103 -101
- package/dist/dev/define/live-audio/skin.css +68 -69
- package/dist/dev/define/live-video/minimal-skin.css +140 -120
- package/dist/dev/define/live-video/minimal-skin.d.ts.map +1 -1
- package/dist/dev/define/live-video/minimal-skin.js +3 -1
- package/dist/dev/define/live-video/minimal-skin.js.map +1 -1
- package/dist/dev/define/live-video/minimal-skin.tailwind.d.ts.map +1 -1
- package/dist/dev/define/live-video/minimal-skin.tailwind.js +3 -1
- package/dist/dev/define/live-video/minimal-skin.tailwind.js.map +1 -1
- package/dist/dev/define/live-video/skin.css +89 -76
- package/dist/dev/define/live-video/skin.d.ts.map +1 -1
- package/dist/dev/define/live-video/skin.js +3 -1
- package/dist/dev/define/live-video/skin.js.map +1 -1
- package/dist/dev/define/live-video/skin.tailwind.d.ts.map +1 -1
- package/dist/dev/define/live-video/skin.tailwind.js +4 -2
- package/dist/dev/define/live-video/skin.tailwind.js.map +1 -1
- package/dist/dev/define/ui/gesture.d.ts +8 -0
- package/dist/dev/define/ui/gesture.d.ts.map +1 -0
- package/dist/dev/define/ui/gesture.js +7 -0
- package/dist/dev/define/ui/gesture.js.map +1 -0
- package/dist/dev/define/video/minimal-skin.css +140 -120
- package/dist/dev/define/video/minimal-skin.d.ts.map +1 -1
- package/dist/dev/define/video/minimal-skin.js +3 -1
- package/dist/dev/define/video/minimal-skin.js.map +1 -1
- package/dist/dev/define/video/minimal-skin.tailwind.d.ts.map +1 -1
- package/dist/dev/define/video/minimal-skin.tailwind.js +3 -1
- package/dist/dev/define/video/minimal-skin.tailwind.js.map +1 -1
- package/dist/dev/define/video/skin.css +89 -76
- package/dist/dev/define/video/skin.d.ts.map +1 -1
- package/dist/dev/define/video/skin.js +3 -1
- package/dist/dev/define/video/skin.js.map +1 -1
- package/dist/dev/define/video/skin.tailwind.d.ts.map +1 -1
- package/dist/dev/define/video/skin.tailwind.js +4 -2
- package/dist/dev/define/video/skin.tailwind.js.map +1 -1
- package/dist/dev/media/hls-background-video/media.d.ts +16 -0
- package/dist/dev/media/hls-background-video/media.d.ts.map +1 -1
- package/dist/dev/media/hls-background-video/media.js +18 -0
- package/dist/dev/media/hls-background-video/media.js.map +1 -1
- package/dist/dev/packages/icons/dist/element/default/icons.js +1 -1
- package/dist/dev/packages/icons/dist/element/default/icons.js.map +1 -1
- package/dist/dev/packages/icons/dist/element/minimal/icons.js +1 -1
- package/dist/dev/packages/icons/dist/element/minimal/icons.js.map +1 -1
- package/dist/dev/packages/icons/dist/html/default/airplay-exit.js +1 -1
- package/dist/dev/packages/icons/dist/html/default/airplay-exit.js.map +1 -1
- package/dist/dev/packages/icons/dist/html/minimal/airplay-exit.js +1 -1
- package/dist/dev/packages/icons/dist/html/minimal/airplay-exit.js.map +1 -1
- package/dist/dev/packages/icons/dist/render/default/index.js +1 -1
- package/dist/dev/packages/icons/dist/render/default/index.js.map +1 -1
- package/dist/dev/packages/icons/dist/render/minimal/index.js +1 -1
- package/dist/dev/packages/icons/dist/render/minimal/index.js.map +1 -1
- package/dist/dev/packages/skins/dist/default/default/tailwind/components/button.js +3 -1
- package/dist/dev/packages/skins/dist/default/default/tailwind/components/button.js.map +1 -1
- package/dist/dev/packages/skins/dist/default/default/tailwind/components/poster.js +8 -1
- package/dist/dev/packages/skins/dist/default/default/tailwind/components/poster.js.map +1 -1
- package/dist/dev/packages/skins/dist/default/default/tailwind/components/slider.js +10 -10
- package/dist/dev/packages/skins/dist/default/default/tailwind/components/slider.js.map +1 -1
- package/dist/dev/packages/skins/dist/default/default/tailwind/components/thumbnail.js +1 -1
- package/dist/dev/packages/skins/dist/default/default/tailwind/components/thumbnail.js.map +1 -1
- package/dist/dev/packages/skins/dist/default/default/tailwind/video.tailwind.js +2 -2
- package/dist/dev/packages/skins/dist/default/default/tailwind/video.tailwind.js.map +1 -1
- package/dist/dev/packages/skins/dist/default/minimal/tailwind/components/poster.js +8 -1
- package/dist/dev/packages/skins/dist/default/minimal/tailwind/components/poster.js.map +1 -1
- package/dist/dev/packages/skins/dist/default/minimal/tailwind/components/slider.js +13 -12
- package/dist/dev/packages/skins/dist/default/minimal/tailwind/components/slider.js.map +1 -1
- package/dist/dev/packages/skins/dist/default/minimal/tailwind/components/thumbnail.js +1 -1
- package/dist/dev/packages/skins/dist/default/minimal/tailwind/components/thumbnail.js.map +1 -1
- package/dist/dev/packages/skins/dist/default/minimal/tailwind/video.tailwind.js +6 -5
- package/dist/dev/packages/skins/dist/default/minimal/tailwind/video.tailwind.js.map +1 -1
- package/dist/dev/packages/skins/dist/default/shared/tailwind/icon-state.js +4 -4
- package/dist/dev/packages/skins/dist/default/shared/tailwind/icon-state.js.map +1 -1
- package/dist/dev/store/provider-mixin.d.ts.map +1 -1
- package/dist/dev/store/provider-mixin.js +24 -8
- package/dist/dev/store/provider-mixin.js.map +1 -1
- package/dist/dev/store/types.d.ts +2 -2
- package/dist/dev/store/types.d.ts.map +1 -1
- package/dist/dev/ui/audio-track-radio-group/audio-track-radio-group-element.js +1 -1
- package/dist/dev/ui/audio-track-radio-group/audio-track-radio-group-element.js.map +1 -1
- package/dist/dev/ui/captions-radio-group/captions-radio-group-element.js +1 -1
- package/dist/dev/ui/captions-radio-group/captions-radio-group-element.js.map +1 -1
- package/dist/dev/ui/gesture/gesture-element.d.ts +7 -7
- package/dist/dev/ui/gesture/gesture-element.d.ts.map +1 -1
- package/dist/dev/ui/gesture/gesture-element.js.map +1 -1
- package/dist/dev/ui/hotkey/hotkey-element.d.ts +6 -6
- package/dist/dev/ui/hotkey/hotkey-element.d.ts.map +1 -1
- package/dist/dev/ui/hotkey/hotkey-element.js.map +1 -1
- package/dist/dev/ui/menu/context.d.ts +8 -8
- package/dist/dev/ui/menu/context.d.ts.map +1 -1
- package/dist/dev/ui/menu/context.js.map +1 -1
- package/dist/dev/ui/menu/menu-element.d.ts.map +1 -1
- package/dist/dev/ui/menu/menu-element.js +28 -27
- package/dist/dev/ui/menu/menu-element.js.map +1 -1
- package/dist/dev/ui/menu/menu-radio-group-element.d.ts +1 -1
- package/dist/dev/ui/menu/menu-radio-group-element.d.ts.map +1 -1
- package/dist/dev/ui/menu/menu-radio-group-element.js +14 -14
- package/dist/dev/ui/menu/menu-radio-group-element.js.map +1 -1
- package/dist/dev/ui/playback-rate-radio-group/playback-rate-radio-group-element.js +1 -1
- package/dist/dev/ui/playback-rate-radio-group/playback-rate-radio-group-element.js.map +1 -1
- package/dist/dev/ui/poster/poster-element.d.ts +20 -18
- package/dist/dev/ui/poster/poster-element.d.ts.map +1 -1
- package/dist/dev/ui/poster/poster-element.js +145 -8
- package/dist/dev/ui/poster/poster-element.js.map +1 -1
- package/dist/dev/ui/quality-radio-group/quality-radio-group-element.js +1 -1
- package/dist/dev/ui/quality-radio-group/quality-radio-group-element.js.map +1 -1
- package/dist/dev/ui/slider/slider-preview-element.d.ts +2 -2
- package/dist/dev/ui/slider/slider-preview-element.d.ts.map +1 -1
- package/dist/dev/ui/slider/slider-preview-element.js.map +1 -1
- package/docs/README.md +1 -1
- package/docs/concepts/skins.md +91 -78
- package/docs/how-to/customize-skins.md +411 -377
- package/docs/reference/menu.md +3 -19
- package/docs/reference/popover.md +2 -2
- package/docs/reference/poster.md +211 -21
- package/docs/reference/slider.md +1 -1
- package/docs/reference/time-slider.md +1 -1
- package/docs/reference/tooltip.md +6 -6
- package/docs/reference/volume-slider.md +1 -1
- package/package.json +14 -9
- package/cdn/adapter-Bk03SAxn.js +0 -2
- package/cdn/adapter-Bk03SAxn.js.map +0 -1
- package/cdn/adapter-XTen-YVQ.js.map +0 -1
- package/cdn/compounds-BEO1d3ZM.js +0 -8
- package/cdn/compounds-BEO1d3ZM.js.map +0 -1
- package/cdn/compounds-nk9RJtBK.js.map +0 -1
- package/cdn/create-player-DK9WOywd.js.map +0 -1
- package/cdn/create-player-hSdQMP5p.js +0 -2
- package/cdn/create-player-hSdQMP5p.js.map +0 -1
- package/cdn/default-BqQDVloS.js.map +0 -1
- package/cdn/default-CXWVp2oG.js +0 -2
- package/cdn/default-CXWVp2oG.js.map +0 -1
- package/cdn/default-Dw6cIEqT.js +0 -2
- package/cdn/default-Dw6cIEqT.js.map +0 -1
- package/cdn/default-I2LasfxC.js.map +0 -1
- package/cdn/error-surface-DCT1m2p1.js +0 -2
- package/cdn/error-surface-DCT1m2p1.js.map +0 -1
- package/cdn/error-surface-drmCvBVW.js.map +0 -1
- package/cdn/gesture-element-6Ld1YwIL.js.map +0 -1
- package/cdn/gesture-element-BC48ucj9.js +0 -2
- package/cdn/gesture-element-BC48ucj9.js.map +0 -1
- package/cdn/i18n-Dc7WM2xd.js +0 -2
- package/cdn/media-BTipOcKo.js +0 -2
- package/cdn/media-Bmablv4g.js +0 -2
- package/cdn/media-Bmablv4g.js.map +0 -1
- package/cdn/media-COIe3uI5.js.map +0 -1
- package/cdn/media-CPVSKLdk.js +0 -2
- package/cdn/media-Dq4zmIJa.js +0 -2
- package/cdn/media-Dq4zmIJa.js.map +0 -1
- package/cdn/media-suYcjCG2.js +0 -445
- package/cdn/media-suYcjCG2.js.map +0 -1
- package/cdn/minimal-BedCvMBG.js +0 -2
- package/cdn/minimal-BedCvMBG.js.map +0 -1
- package/cdn/minimal-BoP112ye.js +0 -2
- package/cdn/minimal-BoP112ye.js.map +0 -1
- package/cdn/minimal-DLosvq31.js.map +0 -1
- package/cdn/minimal-DQCLKRyR.js.map +0 -1
- package/cdn/minimal-ui-Et2Wcn7r.js +0 -2
- package/cdn/player-BRQLp5bX.js +0 -2
- package/cdn/player-BloX4l6F.js +0 -2
- package/cdn/player-rCFqzWrA.js +0 -2
- package/cdn/poster-element-BGr1VQJB.js.map +0 -1
- package/cdn/poster-element-DBmgOyep.js +0 -2
- package/cdn/poster-element-DBmgOyep.js.map +0 -1
- package/cdn/seek-button-element-XMTLIxZj.js.map +0 -1
- package/cdn/select-tracks-nRPBa1NC.js.map +0 -1
- package/cdn/select-tracks-xV1s28xD.js +0 -59
- package/cdn/select-tracks-xV1s28xD.js.map +0 -1
- package/cdn/time-slider-chapters-element-DJ0abZXI.js.map +0 -1
- package/cdn/time-slider-chapters-element-DW8YyJn8.js +0 -2
- package/cdn/time-slider-chapters-element-DW8YyJn8.js.map +0 -1
- package/cdn/ui-C0isALTQ.js +0 -2
- package/cdn/ui-DVpkE1MN.js +0 -2
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"error-surface-drmCvBVW.js","names":["deriveState","deriveState"],"sources":["../../spf/dist/dev/media/errors.js","../../spf/dist/dev/playback/behaviors/dom/track-load-triggers.js","../../spf/dist/dev/playback/behaviors/establish-start-media-time.js","../../spf/dist/dev/media/dom/capabilities.js","../../spf/dist/dev/playback/behaviors/derive-cdn-priority.js","../../spf/dist/dev/playback/behaviors/dom/airplay.js","../../spf/dist/dev/playback/behaviors/dom/apply-start-position.js","../../spf/dist/dev/playback/behaviors/dom/recover-end-stall.js","../../spf/dist/dev/playback/behaviors/setup-failover-monitor.js","../../spf/dist/dev/playback/behaviors/sync-preload.js","../../spf/dist/dev/media/abr/quality-selection.js","../../spf/dist/dev/playback/behaviors/track-switching.js","../../spf/dist/dev/media/text/parse-vtt-timestamp-map.js","../../spf/dist/dev/media/text/resolve-vtt-metadata.js","../../spf/dist/dev/playback/primitives/text-segment-load-pipeline.js","../../spf/dist/dev/media/mp4/box.js","../../spf/dist/dev/media/mp4/timestamp-origin.js","../../spf/dist/dev/playback/primitives/head-peek.js","../../spf/dist/dev/playback/primitives/relocation-pipelines.js","../../spf/dist/dev/playback/primitives/report-track-conditions.js","../../spf/dist/dev/playback/primitives/error-messages.js","../../spf/dist/dev/playback/adapters/hls-video/error-surface.js"],"sourcesContent":["//#region src/media/errors.ts\n/** SVTA 1 [Media Content] 004 — the video is in a format we can't play (e.g. an MPEG-TS container). */\nconst SVTA_UNSUPPORTED_VIDEO_FORMAT = 1004;\n/** SVTA 1 [Media Content] 005 — the audio counterpart of {@link SVTA_UNSUPPORTED_VIDEO_FORMAT}. */\nconst SVTA_UNSUPPORTED_AUDIO_FORMAT = 1005;\n/**\n* SVTA 4 [Content Protection] 008 — unsupported or unavailable DRM system. Used\n* for \"this source is encrypted and we have no decryption pipeline,\" which is\n* detection, not a license failure.\n*/\nconst SVTA_UNSUPPORTED_DRM_SYSTEM = 4008;\n/**\n* SVTA 2 [Playback] 011 — no video track the environment can play. For a source\n* that *has* video renditions where every one was excluded as unplayable.\n*/\nconst SVTA_NO_SUPPORTED_VIDEO_TRACK = 2011;\n/** SVTA 2 [Playback] 012 — the audio counterpart of {@link SVTA_NO_SUPPORTED_VIDEO_TRACK}. */\nconst SVTA_NO_SUPPORTED_AUDIO_TRACK = 2012;\n/**\n* SVTA 99 [Custom] 001 — this engine has no pipeline for something the source\n* requires, so the source is unplayable *here* rather than broken.\n*\n* Custom rather than standard because the standard codes available describe\n* either narrower or wider things. The causes (1004/1005 unsupported format,\n* 4008 unsupported DRM) say what one rendition hit; the verdicts (2011/2012 no\n* supported track) say a type emptied without saying why it's unfixable. And\n* 2039 \"Manifest feature unsupported\" covers features that are unsupported but\n* still *playable* — LL-HLS degrading to standard live is a 2039 — so\n* overloading it for a fatal condition would make it useless for the notices it\n* belongs on.\n*\n* Index `001`: the spec defines only `99000` (Unknown) for the custom category\n* and leaves the rest to the publisher, so this is the first code we define.\n*\n* Five digits, and deliberately not special-cased anywhere: {@link svtaCategory}\n* and {@link svtaIndex} decompose it correctly by arithmetic alone, because\n* every standard category is below `8000` and custom starts at `99000`.\n*/\nconst SVTA_UNSUPPORTED_PLAYBACK_FEATURE = 99001;\n/**\n* The error's domain — `code / 1000`, per the spec's \"divide by one thousand to\n* obtain the error category\". Works uniformly across the four-digit native form\n* and the five-digit form embedding an external standard: `\"03404\"` is\n* numerically 3404, which decomposes identically. That also makes a numeric code\n* immune to the spec's inconsistent zero-padding (§Approach writes a\n* category-unknown network error as `\"0300\"` where the error index implies\n* category 3 / index 000).\n*/\nfunction svtaCategory(code) {\n\treturn Math.floor(code / 1e3);\n}\n/**\n* The specific error within its category — `code % 1000`. For a five-digit code\n* this is the embedded external value (an HTTP status, a VAST code).\n*/\nfunction svtaIndex(code) {\n\treturn code % 1e3;\n}\n//#endregion\nexport { SVTA_NO_SUPPORTED_AUDIO_TRACK, SVTA_NO_SUPPORTED_VIDEO_TRACK, SVTA_UNSUPPORTED_AUDIO_FORMAT, SVTA_UNSUPPORTED_DRM_SYSTEM, SVTA_UNSUPPORTED_PLAYBACK_FEATURE, SVTA_UNSUPPORTED_VIDEO_FORMAT, svtaCategory, svtaIndex };\n\n//# sourceMappingURL=errors.js.map","import { computed } from \"../../../core/signals/primitives.js\";\nimport { defineBehavior } from \"../../../core/composition/create-composition.js\";\nimport { createMachineReactor } from \"../../../core/reactors/create-machine-reactor.js\";\nimport { listen } from \"@videojs/utils/dom\";\n//#region src/playback/behaviors/dom/track-load-triggers.ts\n/**\n* Slot-driven FSM. The slot `loadActivated` is the canonical externally-\n* observable state; `deriveState` reads it (and the preconditions) to\n* derive the local FSM state. The slot is *both* the state and the data —\n* no separate internal bookkeeping.\n*\n* ```\n* 'preconditions-unmet' ⟷ 'monitoring' ⟷ 'load-active'\n*\n* preconditions-unmet → monitoring element + URL appear\n* monitoring → load-active slot flips true (listener fires\n* or external write)\n* load-active → monitoring within-state cleanup resets slot\n* (URL or element identity change)\n* any → preconditions-unmet element or URL → undefined\n*\n* any state → destroying → destroyed on destroy()\n* ```\n*/\nfunction deriveState(presentation, mediaElement, loadActivated) {\n\tif (!mediaElement || !presentation?.url) return \"preconditions-unmet\";\n\tif (loadActivated) return \"load-active\";\n\treturn \"monitoring\";\n}\n/**\n* Track preload-overriding events per source.\n*\n* Writes `state.loadActivated = true` the first time a `play` or `seeking`\n* event fires on the attached media element for the current source — or\n* immediately on entry if the element is already committed to loading\n* (`el.autoplay`, `!el.paused`, or `el.seeking`), covering autoplay,\n* native-controls, and direct-DOM-`play()` scenarios.\n*\n* Sticky-true *within a source identity*: subsequent play/pause/seek\n* cycles don't flip back. Source identity = (mediaElement, presentation\n* URL). Either changing — including direct in-place swap with no\n* `undefined` intermediate — resets the slot to `false`.\n*\n* Multi-writer with `hls/adapter.ts:play()` (which writes `true` directly\n* on programmatic play) is intentional — different domains. The adapter\n* records programmatic intent; this behavior is the DOM-side observer.\n* Pre-existing `true` writes are honored because `deriveState` reads the\n* slot — a `true` value routes directly to `'load-active'` without\n* entering `'monitoring'`.\n*\n* @example\n* const reactor = trackLoadTriggers.setup({ state, context });\n* // later:\n* reactor.destroy();\n*/\nfunction trackLoadTriggersSetup({ state, context }) {\n\tconst derivedStateSignal = computed(() => deriveState(state.presentation.get(), context.mediaElement.get(), state.loadActivated.get()));\n\tconst urlSignal = computed(() => state.presentation.get()?.url);\n\treturn createMachineReactor({\n\t\tinitial: \"preconditions-unmet\",\n\t\tmonitor: () => derivedStateSignal.get(),\n\t\tstates: {\n\t\t\t\"preconditions-unmet\": {},\n\t\t\tmonitoring: { effects: () => {\n\t\t\t\tconst el = context.mediaElement.get();\n\t\t\t\tconst setLoadActivated = () => state.loadActivated.set(true);\n\t\t\t\tif (el.autoplay || !el.paused || el.seeking) {\n\t\t\t\t\tsetLoadActivated();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst cleanupPlay = listen(el, \"play\", setLoadActivated);\n\t\t\t\tconst cleanupSeeking = listen(el, \"seeking\", setLoadActivated);\n\t\t\t\treturn () => {\n\t\t\t\t\tcleanupPlay();\n\t\t\t\t\tcleanupSeeking();\n\t\t\t\t};\n\t\t\t} },\n\t\t\t\"load-active\": { effects: () => {\n\t\t\t\tcontext.mediaElement.get();\n\t\t\t\turlSignal.get();\n\t\t\t\treturn () => state.loadActivated.set(false);\n\t\t\t} }\n\t\t}\n\t});\n}\nconst trackLoadTriggers = defineBehavior({\n\tstateKeys: [\"loadActivated\", \"presentation\"],\n\tcontextKeys: [\"mediaElement\"],\n\tsetup: trackLoadTriggersSetup\n});\n//#endregion\nexport { trackLoadTriggers };\n\n//# sourceMappingURL=track-load-triggers.js.map","import { update } from \"../../core/signals/primitives.js\";\nimport { createMachineReactor } from \"../../core/reactors/create-machine-reactor.js\";\nimport { isResolvedPresentation, isResolvedTrack } from \"../../media/types/index.js\";\nimport { findTrackById } from \"../../media/utils/tracks.js\";\n//#region src/playback/behaviors/establish-start-media-time.ts\n/**\n* A single type's own media-timeline origin:\n* `baseMediaDecodeTime/timescale − segmentStartTime` (the `segmentStartTime` term\n* makes it the stream origin even when the first loaded segment isn't the 0th).\n* `undefined` until timescale + baseMediaDecodeTime + segmentStartTime are all present.\n*/\nfunction ownOrigin(data) {\n\tconst { timescale, baseMediaDecodeTime, segmentStartTime } = data ?? {};\n\treturn timescale != null && baseMediaDecodeTime != null && segmentStartTime != null ? baseMediaDecodeTime / timescale - segmentStartTime : void 0;\n}\n/** Snap a below-threshold (incl. negative) origin to `0` so it isn't relocated. */\nfunction thresholdOrigin(origin) {\n\treturn origin < 1 ? 0 : origin;\n}\n/**\n* The **default** — relocate the whole presentation by one shared origin: the `min`\n* across the *selected* A/V tracks' own origins, denormalized onto every type. This\n* single reduce subsumes the \"per-type\" and \"shared\" tiers:\n* - **aligned A/V** — `min` equals each origin (they're equal), so it matches per-type;\n* - **skewed A/V** (e.g. Apple's 44ms audio-lead) — `min` keeps every track's earliest\n* DTS ≥ 0 (relocating by ≤ each own origin never drives one negative) *and* preserves\n* the real skew (per-type would flatten it, desyncing A/V);\n* - **single type / muxed** — `min` of the one origin is that origin.\n*\n* Returns `undefined` for every type until all *selected* types have a complete origin\n* (the shared-`min` barrier). Which types must contribute is read from `ctx` (the\n* selected v/a ids); with no selection context it coordinates across whatever types\n* have data. A shared origin below {@link NEAR_ZERO_ORIGIN_THRESHOLD} is returned as `0`\n* (native — ordinary ~0-PTS VOD isn't relocated).\n*/\nconst deriveSharedMinStartMediaTime = (containerData, ctx) => {\n\tconst contributingTypes = [];\n\tif (ctx.selectedVideoTrackId != null) contributingTypes.push(\"video\");\n\tif (ctx.selectedAudioTrackId != null) contributingTypes.push(\"audio\");\n\tconst origins = (contributingTypes.length > 0 ? contributingTypes : Object.keys(containerData)).map((type) => ownOrigin(containerData[type]));\n\tif (origins.length === 0 || origins.some((origin) => origin === void 0)) return {};\n\tconst shared = thresholdOrigin(Math.min(...origins));\n\tconst out = {};\n\tfor (const type of Object.keys(containerData)) out[type] = shared;\n\treturn out;\n};\n/**\n* Coordination-axis *off* — each type relocates by its own origin, independently. Not\n* the default: it flattens real A/V skew (see {@link deriveSharedMinStartMediaTime}).\n* Kept as an opt-in for compositions that know their A/V is aligned and want to skip\n* the shared-`min` barrier (each type stamps as soon as its own origin is discovered).\n*\n* Caution: {@link NEAR_ZERO_ORIGIN_THRESHOLD} applies independently per type here — if\n* two types' origins straddle it, one snaps to `0` and the other doesn't, injecting up\n* to a threshold's worth of A/V offset. Safe for the intended aligned-A/V opt-in; see\n* `internal/design/spf/live-presentation-timeline-model.md` (collision 5).\n*/\nconst derivePerTypeStartMediaTime = (containerData) => {\n\tconst out = {};\n\tfor (const [type, data] of Object.entries(containerData)) {\n\t\tconst origin = ownOrigin(data);\n\t\tout[type] = origin === void 0 ? void 0 : thresholdOrigin(origin);\n\t}\n\treturn out;\n};\n/**\n* The anchor-source track: the selected video track, falling back to audio\n* (audio-only). Deterministic — never \"first resolved\", which is race-dependent\n* under concurrent resolves.\n*/\nfunction referenceTrackId(ctx) {\n\treturn ctx.selectedVideoTrackId ?? ctx.selectedAudioTrackId;\n}\n/**\n* The live-anchor first-parse gate (the \"parses align\" step of the establishment\n* order). Open for the reference track itself — its local-from-0 placement *is*\n* the presentation timeline (presentation-0 = the join point). Every other track\n* holds until the reference's first parse settles the anchor question: no PDT →\n* local placement is already correct, proceed; PDT anchor → hold until the\n* establishment reactor stamps it onto this track, so the parse takes the\n* `placeOnAnchor` path. Establishment is sticky-once, so an unanchored first\n* parse would be permanently misaligned — that's the race this gate closes.\n*\n* Pairs with the {@link establishStartMediaTime} reactor (the stamp that opens\n* the anchored branch); wire both or neither.\n*/\nconst gateFirstParseOnAnchor = (presentation, ctx, trackId) => {\n\tconst referenceId = referenceTrackId(ctx);\n\tif (referenceId === void 0 || referenceId === trackId) return true;\n\tif (!isResolvedPresentation(presentation)) return false;\n\tconst reference = findTrackById(presentation, referenceId);\n\tif (!reference) return true;\n\tif (!isResolvedTrack(reference)) return false;\n\tif (reference.startDate === void 0) return true;\n\treturn findTrackById(presentation, trackId)?.startDate !== void 0;\n};\n/**\n* Stamp the frozen wall-clock anchor as `startDate` onto every track that lacks\n* one (idempotent — same reference when nothing moved). Unresolved shells pick\n* it up as the `placeOnAnchor` preset; covering *all* tracks in one pass means\n* any track selected later — an ABR rung, another audio language, late captions\n* — resolves already anchored. The reference track's own parser-computed\n* `startDate` reads back as the anchor, so it's naturally left untouched.\n*/\nfunction stampStartDates(presentation, anchor) {\n\tlet changed = false;\n\tconst selectionSets = presentation.selectionSets.map((selectionSet) => ({\n\t\t...selectionSet,\n\t\tswitchingSets: selectionSet.switchingSets.map((switchingSet) => ({\n\t\t\t...switchingSet,\n\t\t\ttracks: switchingSet.tracks.map((track) => {\n\t\t\t\tif (track.startDate !== void 0) return track;\n\t\t\t\tchanged = true;\n\t\t\t\treturn {\n\t\t\t\t\t...track,\n\t\t\t\t\tstartDate: anchor\n\t\t\t\t};\n\t\t\t})\n\t\t}))\n\t}));\n\treturn changed ? {\n\t\t...presentation,\n\t\tselectionSets\n\t} : presentation;\n}\n/** Stamp the derived per-track `startMediaTime` onto the model (idempotent — same reference when nothing moved). */\nfunction stampTracks(presentation, startMediaTimes) {\n\tlet changed = false;\n\tconst selectionSets = presentation.selectionSets.map((selectionSet) => ({\n\t\t...selectionSet,\n\t\tswitchingSets: selectionSet.switchingSets.map((switchingSet) => ({\n\t\t\t...switchingSet,\n\t\t\ttracks: switchingSet.tracks.map((track) => {\n\t\t\t\tconst startMediaTime = startMediaTimes[track.type];\n\t\t\t\tif (startMediaTime === void 0 || track.startMediaTime === startMediaTime) return track;\n\t\t\t\tchanged = true;\n\t\t\t\treturn {\n\t\t\t\t\t...track,\n\t\t\t\t\tstartMediaTime\n\t\t\t\t};\n\t\t\t})\n\t\t}))\n\t}));\n\treturn changed ? {\n\t\t...presentation,\n\t\tselectionSets\n\t} : presentation;\n}\nfunction establishStartMediaTimeSetup({ state, config = {} }) {\n\tconst derive = config.deriveStartMediaTime ?? deriveSharedMinStartMediaTime;\n\tconst selectionContext = () => ({\n\t\tselectedVideoTrackId: state.selectedVideoTrackId?.get(),\n\t\tselectedAudioTrackId: state.selectedAudioTrackId?.get()\n\t});\n\t/** Established once the selected A/V tracks (whichever exist) carry `startMediaTime`. */\n\tconst established = () => {\n\t\tconst presentation = state.presentation.get();\n\t\tif (!isResolvedPresentation(presentation)) return false;\n\t\tconst ids = [state.selectedVideoTrackId?.get(), state.selectedAudioTrackId?.get()].filter((id) => id !== void 0);\n\t\treturn ids.length > 0 && ids.every((id) => findTrackById(presentation, id)?.startMediaTime !== void 0);\n\t};\n\treturn createMachineReactor({\n\t\tinitial: \"inactive\",\n\t\tmonitor: () => {\n\t\t\tif (!isResolvedPresentation(state.presentation.get())) return \"inactive\";\n\t\t\treturn established() ? \"established\" : \"monitoring\";\n\t\t},\n\t\tstates: {\n\t\t\tinactive: { entry: () => state.mediaContainerData.set(void 0) },\n\t\t\tmonitoring: { effects: [() => {\n\t\t\t\tconst presentation = state.presentation.get();\n\t\t\t\tif (!isResolvedPresentation(presentation)) return;\n\t\t\t\tconst referenceId = referenceTrackId(selectionContext());\n\t\t\t\tconst reference = referenceId === void 0 ? void 0 : findTrackById(presentation, referenceId);\n\t\t\t\tif (!reference || !isResolvedTrack(reference)) return;\n\t\t\t\tconst anchor = reference.startDate;\n\t\t\t\tif (anchor === void 0) return;\n\t\t\t\tupdate(state.presentation, (current) => stampStartDates(current, anchor));\n\t\t\t}, () => {\n\t\t\t\tconst containerData = state.mediaContainerData.get();\n\t\t\t\tif (!containerData) return;\n\t\t\t\tconst startMediaTimes = derive(containerData, selectionContext());\n\t\t\t\tupdate(state.presentation, (current) => stampTracks(current, startMediaTimes));\n\t\t\t}] },\n\t\t\testablished: {}\n\t\t}\n\t});\n}\nconst establishStartMediaTime = {\n\tstateKeys: [\"presentation\", \"mediaContainerData\"],\n\tcontextKeys: [],\n\tsetup: establishStartMediaTimeSetup\n};\n//#endregion\nexport { derivePerTypeStartMediaTime, deriveSharedMinStartMediaTime, establishStartMediaTime, gateFirstParseOnAnchor };\n\n//# sourceMappingURL=establish-start-media-time.js.map","import { getMediaPlaylistMetadata } from \"../types/index.js\";\nimport { NON_FMP4_CONTAINER_MIMES } from \"../hls/parse-media-playlist.js\";\nimport { buildMimeCodec, isCodecSupported } from \"./mse/mediasource-setup.js\";\n//#region src/media/dom/capabilities.ts\n/**\n* Capability probing — the engine's foundation for asking the browser what it\n* can actually decode before committing a rendition to the pipeline.\n*\n* Today this is the synchronous codec half: `canPlayTrack` answers \"can this\n* environment play this track?\" by building the track's MIME codec string and\n* passing it to `MediaSource.isTypeSupported` (via `isCodecSupported`). It's the\n* DOM implementation of the DOM-free `CanPlayTrack` predicate the\n* track-switching hard-constraint pre-pass consumes — injected through engine\n* config so the (DOM-free) behavior never imports a DOM API directly.\n*\n* Results are memoized by built MIME string: codec support is a pure function\n* of (codec, environment) and never changes after load, so probing is lazy\n* (per candidate, at constraint-apply time) but each unique MIME is asked once.\n*\n* Future cluster-D phases (async `requestMediaKeySystemAccess` key-system\n* probing, `SourceBuffer.changeType()` availability) extend this surface; the\n* async ones land as a state-slot writer behavior rather than a config\n* predicate, since their verdict resolves asynchronously.\n*/\nconst codecSupportCache = /* @__PURE__ */ new Map();\n/**\n* Whether the environment can decode `track`, by codec. Builds the track's\n* MIME codec string and checks `MediaSource.isTypeSupported`, memoized by MIME.\n* A track without enough to probe — no `mimeType`, or no declared `codecs`\n* (CODECS is optional per the HLS spec) — is unprobeable and passes through as\n* playable (`true`) rather than being dropped; the late `createSourceBuffer`\n* check stays as the backstop for those.\n*\n* Detected non-fMP4 containers (`video/mp2t`, `audio/aac`) are asserted\n* unsupported regardless of the probe, so they're pruned before selection\n* (the type makes no pick) instead of failing/stalling deep in the pipeline.\n* Two different reasons, neither UA-based:\n*\n* - **MPEG-TS** can't be played at all here: `isTypeSupported('video/mp2t…')` is\n* a genuine false positive on Chromium (reports `true` but appends produce no\n* buffered range), and this engine has no TS transmux pipeline.\n* - **Raw ADTS AAC** is a *temporary* limitation. The browser genuinely\n* supports it (Chrome/Safari decode `audio/aac`; Firefox doesn't), so it could\n* be made playable — but our segment actors / loading behaviors / append\n* pipeline assume every rendition has an `EXT-X-MAP` init segment (e.g. an\n* `append-init` task with an empty URL, fMP4-shaped append handling). Until\n* that init-segment assumption is removed, ADTS would fetch but never buffer\n* (a silent stall), so we assert it unplayable for now. FOLLOW-UP: drop the\n* init-required assumption in the pipeline and switch this to a bare-MIME\n* probe (`buildMimeCodec` would project `audio/aac` with no codecs) so it\n* plays where the browser supports it.\n*\n* Override via the engine's `canPlayTrack` config when those pipelines land.\n*/\nconst canPlayTrack = (track) => {\n\tif (track.mimeType && NON_FMP4_CONTAINER_MIMES.has(track.mimeType)) return false;\n\tif (getMediaPlaylistMetadata(track)?.encrypted) return false;\n\tif (!track.mimeType || !track.codecs?.length) return true;\n\tconst mimeCodec = buildMimeCodec({\n\t\tmimeType: track.mimeType,\n\t\tcodecs: track.codecs\n\t});\n\tconst cached = codecSupportCache.get(mimeCodec);\n\tif (cached !== void 0) return cached;\n\tconst supported = isCodecSupported(mimeCodec);\n\tcodecSupportCache.set(mimeCodec, supported);\n\treturn supported;\n};\n//#endregion\nexport { canPlayTrack };\n\n//# sourceMappingURL=capabilities.js.map","import { computed, peek } from \"../../core/signals/primitives.js\";\nimport { defineBehavior } from \"../../core/composition/create-composition.js\";\nimport { createMachineReactor } from \"../../core/reactors/create-machine-reactor.js\";\nimport { isResolvedPresentation } from \"../../media/types/index.js\";\nimport { getCdnId, getOrderedCdnIds } from \"../../media/utils/cdn.js\";\n//#region src/playback/behaviors/derive-cdn-priority.ts\n/**\n* **Session-level CDN priority.** While a presentation is resolved, owns the\n* `cdnPriority` signal: the distinct CDNs the source is served from (origin of\n* each track's URL), in manifest priority order — most-preferred first. Cleared\n* on src unload. The name mirrors HLS content steering's `PATHWAY-PRIORITY`.\n*\n* Redundant-stream sources (e.g. Mux's `?redundant_streams=true`) list the same\n* content on multiple hosts, so the candidate tracks already include one variant\n* per CDN. This behavior publishes *which* CDNs exist and their priority; the\n* `preferActiveCdn` scope rule in `track-switching` reads `cdnPriority` and\n* narrows each type's candidates to the first CDN with surviving tracks — so\n* video / audio / text all resolve from one host (the shared list is the\n* per-presentation coherence guarantee).\n*\n* The \"active\" CDN is not stored — it's derived by the scope as the\n* highest-priority entry in `cdnPriority` that still has tracks after the\n* constraints pre-pass. That makes failover a pure consequence of the (future)\n* failed-CDN constraint: when the primary's tracks are pruned during cooldown,\n* the scope falls to the next CDN; when the primary recovers, it snaps back.\n* Content steering, when it lands, reorders `cdnPriority` (pathway priority as a\n* sort key).\n*\n* Lifecycle: `'presentation-unresolved'` ↔ `'presentation-resolved'`, mirroring\n* `setupTrackSwitching`. The resolved state owns the signal; its entry-returned\n* cleanup clears it on exit (canonical cleanup-binds-to-setup per `reactors.md`).\n*/\nconst samePriority = (a, b) => !!a && a.length === b.length && a.every((cdn, i) => cdn === b[i]);\n/**\n* Manage `cdnPriority`: publish the manifest-ordered CDN list on src load, clear\n* on src unload.\n*\n* @example\n* const reactor = deriveCdnPriority.setup({ state });\n*/\nconst deriveCdnPriority = defineBehavior({\n\tstateKeys: [\"presentation\", \"cdnPriority\"],\n\tcontextKeys: [],\n\tsetup: ({ state, config = {} }) => {\n\t\tconst getCdnId$1 = config.getCdnId ?? getCdnId;\n\t\tconst derivedStateSignal = computed(() => isResolvedPresentation(state.presentation.get()) ? \"presentation-resolved\" : \"presentation-unresolved\");\n\t\treturn createMachineReactor({\n\t\t\tinitial: \"presentation-unresolved\",\n\t\t\tmonitor: () => derivedStateSignal.get(),\n\t\t\tstates: {\n\t\t\t\t\"presentation-unresolved\": {},\n\t\t\t\t\"presentation-resolved\": {\n\t\t\t\t\tentry: () => () => state.cdnPriority.set(void 0),\n\t\t\t\t\teffects: [() => {\n\t\t\t\t\t\tconst presentation = state.presentation.get();\n\t\t\t\t\t\tif (!isResolvedPresentation(presentation)) return;\n\t\t\t\t\t\tconst next = getOrderedCdnIds(presentation, getCdnId$1);\n\t\t\t\t\t\tif (!samePriority(peek(state.cdnPriority), next)) state.cdnPriority.set(next);\n\t\t\t\t\t}]\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n});\n//#endregion\nexport { deriveCdnPriority };\n\n//# sourceMappingURL=derive-cdn-priority.js.map","import { computed, peek } from \"../../../core/signals/primitives.js\";\nimport { defineBehavior } from \"../../../core/composition/create-composition.js\";\nimport { effect } from \"../../../core/signals/effect.js\";\nimport { createMachineReactor } from \"../../../core/reactors/create-machine-reactor.js\";\nimport { isWebKitAirPlayCapable, listen } from \"@videojs/utils/dom\";\n//#region src/playback/behaviors/dom/airplay.ts\n/**\n* **Bridge MSE playback to AirPlay on WebKit.**\n* MSE streams can't be handed to an AirPlay receiver directly.\n* The WebKit-recommended workaround is to append a fallback\n* `<source type=\"application/x-mpegURL\">` carrying the original manifest URL:\n* Safari exposes the AirPlay picker and, when a wireless target is selected,\n* plays that native-HLS source on the receiver. The session state (WebKit's\n* wireless flag, falling edge debounced — see `REMOTE_INACTIVE_SETTLE_MS`) is\n* written straight to its policy consequences, declared here so the\n* cause→policy mapping stays with the feature:\n*\n* - `state.loadingSuspended` — held while the session is live. Observed by\n* the `loadXSegments` dispatchers (no fetching alongside the receiver) and\n* by `setupMediaSource` (its post-close rebuild waits — attaching runs\n* `element.load()` under the live receiver, which destroys a session still\n* being established). The suspension this behavior holds doubles as its own\n* session fact — same writer, same edges.\n* - `state.startPosition` — one-shot command: the position is captured from\n* the element at the session's settled end (still receiver-mirrored) and\n* written once the rebuild's `load()` resets the element (its `'emptied'`),\n* so `applyStartPosition` applies it to the rebuilt source — never to the\n* pre-rebuild element — and starts it where the receiver left off. The\n* playing state rides the same snapshot but stays behavior-local: this\n* behavior itself calls `play()` once the command has been *consumed* — i.e.\n* after the seek — when the receiver was playing at session end. The whole\n* restore is bound to the presentation the session owned and retracted if\n* that changes.\n*\n* A source change during a live session releases the hold rather than deferring\n* until the session ends, so the rebuild runs and WebKit switches the receiver\n* to the newly-built AirPlay alternate. Measured, not contracted — see the\n* effect below.\n* https://webkit.org/blog/15036/how-to-use-media-source-extensions-with-airplay/\n*\n* Single-positive-state reactor (`'preconditions-unmet'` ↔ `'airplay-capable'`):\n* gated on a WebKit-AirPlay-capable media element being in scope. The entry —\n* gated on `context.mediaSource` — appends the fallback `<source>` (kept\n* current from `state.presentation`) and enables the AirPlay picker once the\n* MediaSource is open, removing the source the moment the MediaSource detaches\n* so it never survives an MSE teardown. State-exit cleanup (author opt-out,\n* detach, source reset, behavior destroy) removes the source and restores the\n* element's `disableRemotePlayback` default. No-op on non-WebKit platforms\n* (Chromium, Firefox) — `deriveState` never leaves `'preconditions-unmet'`.\n*\n* MMS and AirPlay want *opposite* values of `disableRemotePlayback` on the same\n* element, so it is **sequenced**:\n*\n* - **MMS needs `true` to open.** `setupMediaSource` sets\n* `disableRemotePlayback = true` when it attaches a ManagedMediaSource —\n* Safari won't fire `sourceopen` (and MSE playback never starts) otherwise.\n* - **AirPlay needs `false` to offer the picker.** Flipping to `false` *before*\n* the source opens would prevent `sourceopen`, so the flip is gated on\n* `context.mediaSource` — which `setupMediaSource` publishes exactly once the\n* MS is open. Re-fires per source (the slot clears + republishes on reset).\n* - **Author opt-out wins.** `state.disableRemotePlayback` is the author's\n* intent, written only by the media adapter's IDL property; MMS/programmatic\n* code touch the element's own `disableRemotePlayback` instead. A `true`\n* there is unambiguously the author's choice to disable remote playback, so\n* it holds the machine in `'preconditions-unmet'` and nothing is set up.\n*/\n/**\n* How long WebKit's wireless flag must read *inactive* before the\n* session-driven `loadingSuspended` clears.\n*\n* Measured on Safari 26.4 (macOS): when an AirPlay session engages, Safari\n* closes the ManagedMediaSource and — while its pipeline switches to the\n* native-HLS fallback source — transiently reports\n* `webkitCurrentPlaybackTargetIsWireless === false`, firing the changed\n* event. Trusting an instantaneous inactive reading would release\n* `setupMediaSource`'s rebuild hold mid-handoff; its recovery `load()` then\n* destroys the very session being established. Rising edges apply\n* immediately; only the falling edge waits out this settle window.\n*/\nconst REMOTE_INACTIVE_SETTLE_MS = 1e3;\nfunction deriveState(mediaElement, authorDisabledRemotePlayback) {\n\tif (!mediaElement || !isWebKitAirPlayCapable(mediaElement)) return \"preconditions-unmet\";\n\tif (authorDisabledRemotePlayback) return \"preconditions-unmet\";\n\treturn \"airplay-capable\";\n}\nfunction setupAirPlaySetup({ state, context }) {\n\tconst derivedStateSignal = computed(() => deriveState(context.mediaElement.get(), state.disableRemotePlayback.get()));\n\treturn createMachineReactor({\n\t\tinitial: \"preconditions-unmet\",\n\t\tmonitor: () => derivedStateSignal.get(),\n\t\tstates: {\n\t\t\t\"preconditions-unmet\": {},\n\t\t\t\"airplay-capable\": { entry: () => {\n\t\t\t\tconst mediaElement = context.mediaElement.get();\n\t\t\t\tconst isSessionActive = () => !!mediaElement.webkitCurrentPlaybackTargetIsWireless;\n\t\t\t\tlet settleTimer;\n\t\t\t\tlet sessionPresentationUrl;\n\t\t\t\tlet pendingRestore;\n\t\t\t\t/** Presentation an already-written `state.startPosition` belongs to. */\n\t\t\t\tlet restoreOwnerUrl;\n\t\t\t\tlet resumeWhenRestored = false;\n\t\t\t\tconst sync = () => {\n\t\t\t\t\tif (isSessionActive()) {\n\t\t\t\t\t\tclearTimeout(settleTimer);\n\t\t\t\t\t\tsettleTimer = void 0;\n\t\t\t\t\t\tif (!peek(state.loadingSuspended)) sessionPresentationUrl = peek(state.presentation)?.url;\n\t\t\t\t\t\tstate.loadingSuspended.set(true);\n\t\t\t\t\t} else if (peek(state.loadingSuspended)) settleTimer ??= setTimeout(() => {\n\t\t\t\t\t\tsettleTimer = void 0;\n\t\t\t\t\t\tconst stillActive = isSessionActive();\n\t\t\t\t\t\tif (!stillActive) {\n\t\t\t\t\t\t\tconst ownerUrl = sessionPresentationUrl;\n\t\t\t\t\t\t\tsessionPresentationUrl = void 0;\n\t\t\t\t\t\t\tif (peek(state.presentation)?.url === ownerUrl) pendingRestore = {\n\t\t\t\t\t\t\t\tposition: mediaElement.currentTime,\n\t\t\t\t\t\t\t\twasPlaying: !mediaElement.paused,\n\t\t\t\t\t\t\t\tpresentationUrl: ownerUrl\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstate.loadingSuspended.set(stillActive);\n\t\t\t\t\t}, REMOTE_INACTIVE_SETTLE_MS);\n\t\t\t\t\telse state.loadingSuspended.set(false);\n\t\t\t\t};\n\t\t\t\tconst listenerCleanup = new AbortController();\n\t\t\t\tlisten(mediaElement, \"webkitcurrentplaybacktargetiswirelesschanged\", sync, { signal: listenerCleanup.signal });\n\t\t\t\tlisten(mediaElement, \"emptied\", () => {\n\t\t\t\t\tif (!pendingRestore) return;\n\t\t\t\t\tconst { position, wasPlaying, presentationUrl } = pendingRestore;\n\t\t\t\t\tpendingRestore = void 0;\n\t\t\t\t\tif (peek(state.presentation)?.url !== presentationUrl) return;\n\t\t\t\t\tstate.startPosition.set(position);\n\t\t\t\t\trestoreOwnerUrl = presentationUrl;\n\t\t\t\t\tresumeWhenRestored = wasPlaying;\n\t\t\t\t}, { signal: listenerCleanup.signal });\n\t\t\t\tconst disposeSourceChangeEnd = effect(() => {\n\t\t\t\t\tconst url = state.presentation.get()?.url;\n\t\t\t\t\tif (!peek(state.loadingSuspended) || url === sessionPresentationUrl) return;\n\t\t\t\t\tsessionPresentationUrl = void 0;\n\t\t\t\t\tclearTimeout(settleTimer);\n\t\t\t\t\tsettleTimer = void 0;\n\t\t\t\t\tstate.loadingSuspended.set(false);\n\t\t\t\t});\n\t\t\t\tconst disposeRestoreWatch = effect(() => {\n\t\t\t\t\tconst url = state.presentation.get()?.url;\n\t\t\t\t\tconst position = state.startPosition.get();\n\t\t\t\t\tif (!restoreOwnerUrl) return;\n\t\t\t\t\tif (url !== restoreOwnerUrl) {\n\t\t\t\t\t\trestoreOwnerUrl = void 0;\n\t\t\t\t\t\tresumeWhenRestored = false;\n\t\t\t\t\t\tif (position !== void 0) state.startPosition.set(void 0);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif (position !== void 0) return;\n\t\t\t\t\trestoreOwnerUrl = void 0;\n\t\t\t\t\tif (!resumeWhenRestored) return;\n\t\t\t\t\tresumeWhenRestored = false;\n\t\t\t\t\tmediaElement.play().catch((err) => {\n\t\t\t\t\t\tconsole.warn(\"[setupAirPlay] session-end resume play() rejected — staying paused:\", err);\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t\tlet sourceEl = null;\n\t\t\t\tconst disposeSource = effect(() => {\n\t\t\t\t\tconst hasMediaSource = !!context.mediaSource.get();\n\t\t\t\t\tconst sessionActive = !!state.loadingSuspended.get();\n\t\t\t\t\tconst url = state.presentation.get()?.url ?? \"\";\n\t\t\t\t\tif (!hasMediaSource && !sessionActive) {\n\t\t\t\t\t\tsourceEl?.remove();\n\t\t\t\t\t\tsourceEl = null;\n\t\t\t\t\t} else if (hasMediaSource && (!sourceEl || sourceEl.parentNode !== mediaElement)) {\n\t\t\t\t\t\tsourceEl = document.createElement(\"source\");\n\t\t\t\t\t\tsourceEl.type = \"application/x-mpegURL\";\n\t\t\t\t\t\tmediaElement.append(sourceEl);\n\t\t\t\t\t\tmediaElement.disableRemotePlayback = false;\n\t\t\t\t\t}\n\t\t\t\t\tif (sourceEl) sourceEl.src = url;\n\t\t\t\t});\n\t\t\t\tsync();\n\t\t\t\treturn () => {\n\t\t\t\t\tdisposeSource();\n\t\t\t\t\tdisposeSourceChangeEnd();\n\t\t\t\t\tdisposeRestoreWatch();\n\t\t\t\t\tlistenerCleanup.abort();\n\t\t\t\t\tclearTimeout(settleTimer);\n\t\t\t\t\tsourceEl?.remove();\n\t\t\t\t\tsourceEl = null;\n\t\t\t\t\tmediaElement.disableRemotePlayback = true;\n\t\t\t\t\tstate.loadingSuspended.set(false);\n\t\t\t\t\tif (restoreOwnerUrl) {\n\t\t\t\t\t\trestoreOwnerUrl = void 0;\n\t\t\t\t\t\tresumeWhenRestored = false;\n\t\t\t\t\t\tif (peek(state.startPosition) !== void 0) state.startPosition.set(void 0);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t} }\n\t\t}\n\t});\n}\nconst setupAirPlay = defineBehavior({\n\tstateKeys: [\n\t\t\"presentation\",\n\t\t\"disableRemotePlayback\",\n\t\t\"loadingSuspended\",\n\t\t\"startPosition\"\n\t],\n\tcontextKeys: [\"mediaElement\", \"mediaSource\"],\n\tsetup: setupAirPlaySetup\n});\n//#endregion\nexport { setupAirPlay };\n\n//# sourceMappingURL=airplay.js.map","import { computed } from \"../../../core/signals/primitives.js\";\nimport { defineBehavior } from \"../../../core/composition/create-composition.js\";\nimport { createMachineReactor } from \"../../../core/reactors/create-machine-reactor.js\";\nimport { isResolvedPresentation } from \"../../../media/types/index.js\";\nimport { listen } from \"@videojs/utils/dom\";\nimport { isUndefined } from \"@videojs/utils/predicate\";\n//#region src/playback/behaviors/dom/apply-start-position.ts\n/**\n* **Start playback of a source at a requested position.** `state.startPosition`\n* is a one-shot command — \"when the current source can seek, start there\" —\n* the SPF analogue of hls.js's `startPosition` (and the primitive `EXT-X-START`,\n* resume-where-you-left-off, and MediaSource-recovery restore build on).\n* Consumers (adapters, `setupAirPlay`'s session-end snapshot) write it;\n* this behavior is its sole consumer and clears it after applying, so a\n* stale position can never replay against a later source or rebuild.\n*\n* Single-positive-state reactor (`'preconditions-unmet'` ↔ `'position-pending'`):\n* gated on `mediaElement + resolved presentation + startPosition` defined.\n* The entry applies the command in two steps:\n*\n* 1. **Seed `state.currentTime` immediately.** The segment loaders anchor\n* their load window on `state.currentTime`; seeding points the *first*\n* fetches at the requested position instead of 0. Multi-writer with\n* `trackCurrentTime` (ongoing DOM mirror) — legitimate: different decision\n* domains (element-derived mirror vs one-shot command), and before\n* HAVE_METADATA no `timeupdate`/`seeking` fires to overwrite the seed.\n* Compose this behavior *after* `trackCurrentTime` so the seed lands after\n* the mirror's attach-time sync.\n* 2. **Seek the element at metadata.** `element.currentTime = position` once\n* `readyState >= HAVE_METADATA` (immediately if already there, else on\n* `loadedmetadata`), then clear `startPosition` (consume). The element\n* clamps the seek to its seekable range per spec, and the resulting\n* `seeking` event flows back through `trackCurrentTime` — from here the\n* ordinary seek path owns the position.\n*\n* Position only — playing/paused is deliberately out of scope. The media\n* element load algorithm forces `paused = true`, so a source that was\n* playing before a rebuild comes back paused at the restored position;\n* resume intent belongs to whoever commands the start (e.g. `setupAirPlay`\n* restores its session-end playing state itself).\n*\n* Deliberately NOT relying on the pre-metadata \"default playback start\n* position\" write (setting `currentTime` at HAVE_NOTHING): cross-browser MSE\n* behavior there is inconsistent; the explicit `loadedmetadata` sequencing is\n* deterministic everywhere.\n*\n* State-exit cleanup (source reset, element detach, destroy) drops the\n* pending `loadedmetadata` listener. An *unapplied* command survives a source\n* reset — \"start the source I'm loading at P\" holds while the presentation\n* routes through unresolved — but is consumed the moment it applies.\n*/\nfunction deriveState(presentation, mediaElement, startPosition) {\n\tif (!mediaElement || !isResolvedPresentation(presentation)) return \"preconditions-unmet\";\n\tif (isUndefined(startPosition)) return \"preconditions-unmet\";\n\treturn \"position-pending\";\n}\nfunction applyStartPositionSetup({ state, context }) {\n\tconst derivedStateSignal = computed(() => deriveState(state.presentation.get(), context.mediaElement.get(), state.startPosition.get()));\n\treturn createMachineReactor({\n\t\tinitial: \"preconditions-unmet\",\n\t\tmonitor: () => derivedStateSignal.get(),\n\t\tstates: {\n\t\t\t\"preconditions-unmet\": {},\n\t\t\t\"position-pending\": { entry: () => {\n\t\t\t\tconst mediaElement = context.mediaElement.get();\n\t\t\t\tconst position = state.startPosition.get();\n\t\t\t\tstate.currentTime.set(position);\n\t\t\t\tconst apply = () => {\n\t\t\t\t\tmediaElement.currentTime = position;\n\t\t\t\t\tstate.startPosition.set(void 0);\n\t\t\t\t};\n\t\t\t\tif (mediaElement.readyState >= HTMLMediaElement.HAVE_METADATA) {\n\t\t\t\t\tapply();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\treturn listen(mediaElement, \"loadedmetadata\", apply, { once: true });\n\t\t\t} }\n\t\t}\n\t});\n}\nconst applyStartPosition = defineBehavior({\n\tstateKeys: [\n\t\t\"presentation\",\n\t\t\"startPosition\",\n\t\t\"currentTime\"\n\t],\n\tcontextKeys: [\"mediaElement\"],\n\tsetup: applyStartPositionSetup\n});\n//#endregion\nexport { applyStartPosition };\n\n//# sourceMappingURL=apply-start-position.js.map","import { defineBehavior } from \"../../../core/composition/create-composition.js\";\nimport { effect } from \"../../../core/signals/effect.js\";\nimport { getMinBufferedEnd } from \"../../../media/dom/mse/duration.js\";\nimport { listen } from \"@videojs/utils/dom\";\n//#region src/playback/behaviors/dom/recover-end-stall.ts\n/**\n* Recover the end-of-stream stall that Chrome exhibits on skewed A/V. After\n* `endOfStream`, when the audio and video tracks end a few ms apart (e.g. a source\n* with an A/V PTS skew), Chrome's audio-clock-paced playback freezes the playhead\n* ~50–70ms short of the reachable buffered end and never fires `ended` — so playback\n* hangs at the very end and loop never re-triggers. This behavior watches for the\n* `waiting` event that fires at that freeze and, when the MediaSource is `ended` and\n* the playhead sits at the reachable buffered end, nudges `currentTime` to `duration`\n* to force the native `ended`.\n*\n* **Event-driven, no poll.** `waiting` fires at the instant the playhead stalls\n* (measured ~0ms latency), so there's nothing to gain from polling — and polling would\n* add its interval + a stall threshold before reacting.\n*\n* **Proximity to the *reachable* buffered end** is the discriminator. That end is\n* `getMinBufferedEnd(mediaSource.sourceBuffers)` — the `min` of the per-track (video/audio)\n* SourceBuffer ends, i.e. the furthest point playback can reach — read from the SourceBuffers\n* directly rather than the `mediaElement.buffered` aggregate. Once `endOfStream` is signalled\n* that's the true content end. Requiring the playhead within `endStallNudgeWindow` of it\n* distinguishes the real end-of-stream freeze from a mid-stream buffer-hole stall (which sits\n* far from the buffered end), so we never skip content. The window must exceed the freeze gap;\n* too small would miss the stall (a permanent hang), so the default is generous relative to the\n* measured gap and is config-tunable for empirical tuning.\n*\n* Inert where it shouldn't act: live (the MediaSource never reaches `ended` while the\n* window grows; `duration` is `Infinity`) and streams that end cleanly (no `waiting`).\n*\n* See `internal/decisions/spf/end-of-stream-av-skew-recovery.md`.\n*/\n/** ~2.8× the measured max freeze gap (71ms) — tight, but with headroom against a miss. */\nconst DEFAULT_END_STALL_NUDGE_WINDOW = .2;\n/**\n* Whether a `waiting` should be forced to `ended`: the MediaSource is `ended`, the\n* stream is finite (not live), playback is active (not paused/seeking/already-ended),\n* and the playhead sits within `nudgeWindow` of the reachable buffered end (so it's the\n* true end, not a mid-stream buffer hole). Pure — the behavior supplies the live values.\n*/\nfunction shouldForceEnded(input, nudgeWindow) {\n\tconst { msEnded, durationFinite, paused, seeking, ended, currentTime, bufferedEnd } = input;\n\tif (!msEnded || !durationFinite || paused || seeking || ended || bufferedEnd === void 0) return false;\n\tconst gap = bufferedEnd - currentTime;\n\treturn gap >= 0 && gap < nudgeWindow;\n}\nfunction recoverEndStallSetup({ context, config }) {\n\tconst nudgeWindow = config?.endStallNudgeWindow ?? .2;\n\treturn effect(() => {\n\t\tconst mediaElement = context.mediaElement.get();\n\t\tif (!mediaElement) return;\n\t\tconst onWaiting = () => {\n\t\t\tconst mediaSource = context.mediaSource.get();\n\t\t\tif (shouldForceEnded({\n\t\t\t\tmsEnded: mediaSource?.readyState === \"ended\",\n\t\t\t\tdurationFinite: Number.isFinite(mediaElement.duration),\n\t\t\t\tpaused: mediaElement.paused,\n\t\t\t\tseeking: mediaElement.seeking,\n\t\t\t\tended: mediaElement.ended,\n\t\t\t\tcurrentTime: mediaElement.currentTime,\n\t\t\t\tbufferedEnd: mediaSource ? getMinBufferedEnd(mediaSource.sourceBuffers) : void 0\n\t\t\t}, nudgeWindow)) mediaElement.currentTime = mediaElement.duration;\n\t\t};\n\t\treturn listen(mediaElement, \"waiting\", onWaiting);\n\t});\n}\nconst recoverEndStall = defineBehavior({\n\tstateKeys: [],\n\tcontextKeys: [\"mediaElement\", \"mediaSource\"],\n\tsetup: recoverEndStallSetup\n});\n//#endregion\nexport { DEFAULT_END_STALL_NUDGE_WINDOW, recoverEndStall, shouldForceEnded };\n\n//# sourceMappingURL=recover-end-stall.js.map","import { computed, update } from \"../../core/signals/primitives.js\";\nimport { defineBehavior } from \"../../core/composition/create-composition.js\";\nimport { createMachineReactor } from \"../../core/reactors/create-machine-reactor.js\";\nimport { isResolvedPresentation } from \"../../media/types/index.js\";\n//#region src/playback/behaviors/setup-failover-monitor.ts\n/**\n* **CDN failover cooldown.** The expiry half of multi-CDN failover. Fetch sites\n* own the *trip*: on a failed fetch they add the failing CDN (origin) to the\n* `failedCdns` state signal directly. This behavior owns the *expiry*: while a\n* presentation is resolved, it watches `failedCdns` and, for each CDN that\n* appears, schedules a timer to remove it once its cooldown lapses.\n* `track-switching`'s `excludeFailedCdns` constraint prunes a failed CDN's\n* tracks and the active-CDN scope falls to the next one — and back, once the\n* cooldown removes it here.\n*\n* Lifecycle is per-source: timers + `failedCdns` are cleared on exit (a new\n* source starts with a clean slate). Policy (cooldown) is engine config. This is\n* the minimal `network-resilience` slice — a single failure trips a CDN, since\n* transient blips are the retry layer's job (it sits below the fetch sites, so\n* anything that reaches `failedCdns` is already terminal).\n*/\nconst DEFAULT_FAILOVER_MONITOR_CONFIG = { cooldownMs: 3e5 };\n/**\n* Expire failed CDNs from `failedCdns` once their cooldown lapses, for the\n* resolved source.\n*\n* @example\n* const reactor = setupFailoverMonitor.setup({ state });\n*/\nconst setupFailoverMonitor = defineBehavior({\n\tstateKeys: [\"presentation\", \"failedCdns\"],\n\tcontextKeys: [],\n\tsetup: ({ state, config = {} }) => {\n\t\tconst cooldownMs = config.failover?.cooldownMs ?? DEFAULT_FAILOVER_MONITOR_CONFIG.cooldownMs;\n\t\tconst timers = /* @__PURE__ */ new Map();\n\t\tconst derivedStateSignal = computed(() => isResolvedPresentation(state.presentation.get()) ? \"presentation-resolved\" : \"presentation-unresolved\");\n\t\treturn createMachineReactor({\n\t\t\tinitial: \"presentation-unresolved\",\n\t\t\tmonitor: () => derivedStateSignal.get(),\n\t\t\tstates: {\n\t\t\t\t\"presentation-unresolved\": {},\n\t\t\t\t\"presentation-resolved\": {\n\t\t\t\t\tentry: () => () => {\n\t\t\t\t\t\ttimers.forEach((timer) => clearTimeout(timer));\n\t\t\t\t\t\ttimers.clear();\n\t\t\t\t\t\tstate.failedCdns.set(void 0);\n\t\t\t\t\t},\n\t\t\t\t\teffects: [() => {\n\t\t\t\t\t\t(state.failedCdns.get() ?? []).forEach((cdn) => {\n\t\t\t\t\t\t\tif (timers.has(cdn)) return;\n\t\t\t\t\t\t\tconst timer = setTimeout(() => {\n\t\t\t\t\t\t\t\ttimers.delete(cdn);\n\t\t\t\t\t\t\t\tupdate(state.failedCdns, (current) => current?.filter((c) => c !== cdn));\n\t\t\t\t\t\t\t}, cooldownMs);\n\t\t\t\t\t\t\ttimers.set(cdn, timer);\n\t\t\t\t\t\t});\n\t\t\t\t\t}]\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n});\n//#endregion\nexport { DEFAULT_FAILOVER_MONITOR_CONFIG, setupFailoverMonitor };\n\n//# sourceMappingURL=setup-failover-monitor.js.map","import { computed, peek } from \"../../core/signals/primitives.js\";\nimport { defineBehavior } from \"../../core/composition/create-composition.js\";\nimport { effect } from \"../../core/signals/effect.js\";\nimport { isStandardPreload } from \"../../media/utils/preload.js\";\n//#region src/playback/behaviors/sync-preload.ts\n/**\n* **Bidirectional sync between `state.preload` and `mediaElement.preload`.**\n*\n* Two effects:\n* - **Read (DOM → state)** — on `context.mediaElement` swap or\n* `state.presentation.url` change, copies `mediaElement.preload` into\n* `state.preload` if it's a W3C value and `state.preload` isn't holding\n* an extended (non-W3C) value. When the DOM has no W3C opinion and\n* `state.preload` is undefined, backfills from `config.defaultPreload`\n* (default-default `'metadata'`) so `state.preload` is never undefined\n* in steady state.\n* - **Write (state → DOM)** — on `state.preload` change or\n* `context.mediaElement` swap, writes `state.preload` back to\n* `mediaElement.preload` if the value is W3C.\n*\n* Extended values (e.g. `'canplay'`) written externally to `state.preload`\n* are sticky: read won't overwrite them, write won't push them to the DOM.\n* All writes are deduped to break echo loops and avoid spurious re-triggers\n* downstream (notably `resolvePresentation`, which reads `state.preload`).\n*/\nfunction syncPreloadSetup({ state, context, config }) {\n\tconst defaultPreload = config?.defaultPreload ?? \"metadata\";\n\tconst presentationUrl = computed(() => state.presentation.get()?.url);\n\tconst cleanupRead = effect(() => {\n\t\tpresentationUrl.get();\n\t\tconst mediaElement = context.mediaElement.get();\n\t\tconst current = peek(state.preload);\n\t\tif (current !== void 0 && !isStandardPreload(current)) return;\n\t\tconst target = mediaElement && isStandardPreload(mediaElement.preload) ? mediaElement.preload : current === void 0 ? defaultPreload : void 0;\n\t\tif (target === void 0 || target === current) return;\n\t\tstate.preload.set(target);\n\t});\n\tconst cleanupWrite = effect(() => {\n\t\tconst next = state.preload.get();\n\t\tconst mediaElement = context.mediaElement.get();\n\t\tif (!mediaElement) return;\n\t\tif (!isStandardPreload(next)) return;\n\t\tif (mediaElement.preload === next) return;\n\t\tmediaElement.preload = next;\n\t});\n\treturn () => {\n\t\tcleanupRead();\n\t\tcleanupWrite();\n\t};\n}\nconst syncPreload = defineBehavior({\n\tstateKeys: [\"preload\", \"presentation\"],\n\tcontextKeys: [\"mediaElement\"],\n\tsetup: syncPreloadSetup\n});\n//#endregion\nexport { syncPreload };\n\n//# sourceMappingURL=sync-preload.js.map","//#region src/media/abr/quality-selection.ts\n/**\n* Default quality selection configuration.\n* Values match Shaka Player upgrade threshold (0.85 = 15% headroom).\n*/\nconst DEFAULT_QUALITY_CONFIG = {\n\tsafetyMargin: .85,\n\tupgradeMargin: 1.15\n};\n/**\n* Resolution as a total pixel count (`width × height`), the basis for\n* comparing two tracks at the same bitrate. Missing dimensions count as 0, so\n* tracks without resolution metadata (e.g. audio) area-compare equal.\n*/\nfunction resolutionArea(track) {\n\treturn (track.width ?? 0) * (track.height ?? 0);\n}\n//#endregion\nexport { DEFAULT_QUALITY_CONFIG, resolutionArea };\n\n//# sourceMappingURL=quality-selection.js.map","import { computed, peek } from \"../../core/signals/primitives.js\";\nimport { defineBehavior } from \"../../core/composition/create-composition.js\";\nimport { createMachineReactor } from \"../../core/reactors/create-machine-reactor.js\";\nimport { isResolvedPresentation } from \"../../media/types/index.js\";\nimport { getTracksByType } from \"../../media/utils/tracks.js\";\nimport { SVTA_NO_SUPPORTED_AUDIO_TRACK, SVTA_NO_SUPPORTED_VIDEO_TRACK } from \"../../media/errors.js\";\nimport { emitError } from \"./collect-errors.js\";\nimport { getCdnId } from \"../../media/utils/cdn.js\";\nimport { DEFAULT_BANDWIDTH_CONFIG, getBandwidthEstimate } from \"../../network/bandwidth-estimator.js\";\nimport { DEFAULT_QUALITY_CONFIG, resolutionArea } from \"../../media/abr/quality-selection.js\";\nimport { matchesPartialTrack, pickTextTrackFromTracks } from \"../../media/primitives/select-tracks.js\";\n//#region src/playback/behaviors/track-switching.ts\n/**\n* **Per-type track selection as a rule chain.** While a presentation is\n* resolved, owns that type's `selected{Video,Audio,Text}TrackId` signal: pick a\n* default, react to user intent and algorithmic ranking, and clear it on src\n* unload.\n*\n* Selection runs in two stages. First a **hard-constraints pre-pass**\n* (`applyConstraints`) prunes the unplayable from the candidate set — the\n* failed-CDN constraint (`excludeFailedCdns`, failover cooldown) and the\n* capability constraint (`excludeUnplayableTracks`, codec support). Then a small\n* ordered chain of rules (`applyRules`) picks among the survivors. Each constraint/rule reads the signals it needs at apply\n* time, so the effect subscribes to exactly what was consulted. The chain is\n* three rules, most authoritative first:\n*\n* 1. **user intent** — a soft filter on `user*TrackSelection`: narrow to the\n* partial-track match; an empty match falls through to the full set.\n* 2. **active CDN** — a soft filter on `cdnPriority` (`preferActiveCdn`):\n* narrow to the highest-priority CDN that still has tracks; an empty match\n* falls through. Shared by video and audio, so every type stays on one CDN\n* (`deriveCdnPriority` owns the list). No-op for non-redundant sources.\n* 3. **ranking** — the terminal sort: `rankByBandwidth`, shared by video and\n* audio. Fitting tracks (within the throughput threshold) first, highest\n* bitrate first; over-throughput tracks after, least-over first. Hysteresis\n* via boosting the current track's sort weight by `upgradeMargin`.\n*\n* The composer's early-bail (one survivor → stop) is load-bearing: a user\n* selection that narrows to a single track is the pick without the ranker\n* running, so the bandwidth estimate is never read and the effect doesn't\n* re-fire on bandwidth while that choice holds.\n*\n* Lifecycle: `'presentation-unresolved'` ↔ `'presentation-resolved'`. The\n* resolved state owns the signal; its entry-returned cleanup clears it on exit\n* (canonical cleanup-binds-to-setup per `reactors.md`).\n*\n* The pick is the chain's result mapped to a slot value by `resolveSelection`\n* (default: the head, `applyRules(...)[0]`). Each variant supplies its\n* **constraints + rule chain (+ optional resolveSelection)** via config;\n* `setupTrackSwitching` owns only the lifecycle and runs what it's given. Video\n* and audio run constraints `[excludeFailedCdns, excludeUnplayableTracks]` then\n* rules `[filterByUserSelection, preferActiveCdn, rankByBandwidth]` and take the\n* head; `switchVideoTrack` also accepts ABR tuning config, `switchAudioTrack`\n* takes none. `switchTextTrack` differs — selection is *optional* (captions are\n* opt-in / off-able), so it runs `[excludeFailedCdns]` + `[preferActiveCdn]` and\n* supplies a text terminal (`pickResolvedTextTrack`) that resolves standing user\n* intent (`userTextTrackSelection`, incl. `'off'`) and may yield no selection.\n* (The active-CDN *scope* is the sticky-pick half of multi-CDN; the failed-CDN\n* *constraint* is the failover half — prune the cooled-down CDN, the scope falls\n* to the next.)\n*\n* When the pre-pass prunes a type that *has* tracks to empty, the behavior\n* clears the selection (so a now-unplayable pick can't linger and stall) and\n* reports the type's `noSupportedTrackCode`. Which constraint emptied the set is\n* deliberately not consulted — the behavior reads no constraint's state, so the\n* chain stays composable. A type with no tracks at all is left alone; that's a\n* legitimate source shape, not a failure. The late `createSourceBuffer` check\n* stays as the structural backstop.\n*\n* Deferred: audio's preferred-language / default-track selection as standing\n* soft-filter rules (previously the empty-slot picker, dropped in the move to\n* the rule chain).\n*/\n/** Default initial-bandwidth value before bandwidth measurements arrive. */\nconst DEFAULT_INITIAL_BANDWIDTH = 5e6;\n/**\n* Apply rules to a candidate list in order; the pick is the first survivor.\n* Two responsibilities the rules don't carry: a rule that returns nothing is\n* skipped (fall-through — a preference never empties the set), and once one\n* survivor remains the chain stops (early-bail — later rules, including the\n* bandwidth ranker, never run, so the effect doesn't subscribe to their\n* signals while the choice is fixed).\n*\n* @param rules - Rules to apply, most authoritative first\n* @param tracks - Candidate tracks\n* @param deps - The behavior's `{ state, context, config }`, passed through to each rule\n* @returns The surviving candidates, pick first\n*/\nfunction applyRules(rules, tracks, deps) {\n\tlet current = tracks;\n\tfor (const rule of rules) {\n\t\tconst remaining = rule(current, deps);\n\t\tif (remaining.length === 0) continue;\n\t\tcurrent = remaining;\n\t\tif (current.length === 1) break;\n\t}\n\treturn current;\n}\n/**\n* Apply hard constraints to a candidate list — the pre-pass that runs before the\n* rule chain. A constraint shares a rule's signature but its exclusion is\n* *hard*: it removes the unplayable (a codec the environment can't decode, a CDN\n* in failover cooldown) and a removed track is never attempted. Unlike\n* `applyRules`, this never skips an empty result and never early-bails — every\n* constraint always applies, and an empty survivor set is a real outcome\n* (\"nothing playable here\"), not a fall-through. Because each constraint only\n* removes, the order they run in can't change the result.\n*\n* @param constraints - Constraints to apply (pooled, order-independent)\n* @param tracks - Candidate tracks\n* @param deps - The behavior's `{ state, context, config }`, passed to each constraint\n* @returns The playable survivors (possibly empty)\n*/\nfunction applyConstraints(constraints, tracks, deps) {\n\tlet current = tracks;\n\tfor (const constraint of constraints) current = constraint(current, deps);\n\treturn current;\n}\n/**\n* User intent — a soft filter. Narrows to tracks matching the partial-track\n* selection in `user*TrackSelection`; an empty match falls through (the\n* composer skips it) to the unfiltered set — e.g. a stale id from a previous\n* source.\n*/\nfunction filterByUserSelection(tracks, { state, config }) {\n\tconst key = config.userSelectionKey;\n\tif (!key) return tracks;\n\tconst filter = state[key]?.get();\n\treturn filter ? tracks.filter((track) => matchesPartialTrack(track, filter)) : tracks;\n}\n/**\n* Failed-CDN constraint — a *hard* filter (constraints pre-pass), shared by\n* video and audio. Removes tracks served from a CDN currently in failover\n* cooldown (`failedCdns`, written by the failover monitor). Removed tracks are never\n* attempted; the scope then narrows to the next surviving CDN in `cdnPriority`,\n* and snaps back to the primary once it leaves cooldown.\n*\n* Passes everything through when there's no `failedCdns` signal/value. When it\n* prunes *every* track (all CDNs cooled down), the empty result is preserved\n* (per `applyConstraints`) — \"nothing playable,\" which clears the selection (no\n* pick); a later CDN recovery refills the candidate set and re-picks.\n*/\nfunction excludeFailedCdns(tracks, { state, config }) {\n\tconst failed = state.failedCdns?.get();\n\tif (!failed?.length) return tracks;\n\tconst getCdnId$1 = config.getCdnId ?? getCdnId;\n\tconst failedSet = new Set(failed);\n\treturn tracks.filter((track) => !failedSet.has(getCdnId$1(track.url)));\n}\n/**\n* Capability constraint — a *hard* filter (constraints pre-pass), shared by\n* video and audio. Removes renditions this environment can't decode, probed via\n* the injected `canPlayTrack` (codec → `MediaSource.isTypeSupported`). Moving\n* the check here — before selection — means an unplayable variant (e.g. HEVC on\n* a browser without HEVC) is pruned upstream and never picked, instead of\n* surviving into the pipeline to fail late at `createSourceBuffer`. That late\n* throw stays as a defensive structural guarantee; with this constraint it\n* should rarely fire.\n*\n* Passes everything through when there's no `canPlayTrack` probe (a composition\n* that didn't wire it, or DOM-free tests). When it prunes *every* track (no\n* decodable rendition), the empty result is preserved (per `applyConstraints`)\n* — \"nothing playable,\" so the behavior clears the selection (no pick) and the\n* late `createSourceBuffer` check stays as the backstop.\n*/\nfunction excludeUnplayableTracks(tracks, { config }) {\n\tconst canPlay = config.canPlayTrack;\n\tif (!canPlay) return tracks;\n\treturn tracks.filter((track) => canPlay(track));\n}\n/**\n* Active-CDN scope — a soft filter, shared by video and audio. Narrows to the\n* highest-priority CDN in `cdnPriority` (owned by `deriveCdnPriority`) that\n* still has tracks, so every track type stays on one CDN. A redundant-streams\n* source lists the same renditions on multiple hosts; this keeps the pick on one\n* host rather than letting the ranker drift across them.\n*\n* \"Active\" is derived, not stored: constraints run before the rule chain, so a\n* failed CDN's tracks are already pruned by the time this runs — \"first CDN with\n* survivors\" *is* the active CDN, and it falls through to the next on failover\n* (and snaps back to the primary when it recovers). Content steering reorders\n* `cdnPriority`; this rule just honors the order.\n*\n* Soft-filter semantics: passes through when there's no `cdnPriority` signal/value\n* (no preference) or when nothing matches (`applyRules` skips an empty result).\n* Non-redundant sources have one CDN, so the narrow is a no-op.\n*\n* The CDN-id derivation defaults to origin-based `getCdnId`, overridable via the\n* `getCdnId` config — it must match the one `deriveCdnPriority` used to build\n* `cdnPriority`, or no track's CDN would ever equal an entry.\n*/\nfunction preferActiveCdn(tracks, { state, config }) {\n\tconst cdnPriority = state.cdnPriority?.get();\n\tif (!cdnPriority?.length) return tracks;\n\tconst getCdnId$2 = config.getCdnId ?? getCdnId;\n\tfor (const cdn of cdnPriority) {\n\t\tconst tracksUsingCdn = tracks.filter((track) => getCdnId$2(track.url) === cdn);\n\t\tif (tracksUsingCdn.length) return tracksUsingCdn;\n\t}\n\treturn tracks;\n}\n/**\n* Bandwidth ranking — the terminal sort, shared by video and audio. Orders by\n* the throughput estimate: tracks within the bandwidth threshold first\n* (fitting), highest bitrate first; then over-threshold tracks, least-over\n* first. The head is the best-quality track that fits, falling back to the\n* smallest over-throughput track when nothing fits.\n*\n* Hysteresis without temporal state: the current track's effective bitrate is\n* boosted by `upgradeMargin` in the fitting sort, so a higher track only\n* outranks it once it clears `current.bitrate * upgradeMargin` (no flapping on\n* marginal bandwidth gains). Downgrades fall out for free — a current track\n* over the threshold isn't in the fitting set to be boosted, so the best fit (a\n* downgrade) wins immediately. Equal-bitrate tracks break by resolution (higher\n* `width × height` first), so an equal-bitrate ladder never picks a lower-\n* quality rendition by manifest order; audio tracks carry no dimensions, so\n* they area-compare equal and a stable sort keeps their candidate order (e.g.\n* same-bitrate language variants). Early-bail skips this rule when a prior one\n* narrowed to a single track, so the estimate is neither read nor subscribed\n* while that holds.\n*/\nfunction rankByBandwidth(tracks, { state, config }) {\n\tconst safetyMargin = config.quality?.safetyMargin ?? DEFAULT_QUALITY_CONFIG.safetyMargin;\n\tconst upgradeMargin = config.quality?.upgradeMargin ?? DEFAULT_QUALITY_CONFIG.upgradeMargin;\n\tconst initialBandwidth = config.initialBandwidth ?? 5e6;\n\tconst bandwidthConfig = {\n\t\t...DEFAULT_BANDWIDTH_CONFIG,\n\t\t...config.bandwidth\n\t};\n\tif (!state.bandwidthState) console.debug(\"[track-switching] rankByBandwidth: no bandwidthState signal in composition; ranking on initialBandwidth\");\n\tconst threshold = getBandwidthEstimate(state.bandwidthState?.get(), initialBandwidth, bandwidthConfig) * safetyMargin;\n\tconst currentId = state[config.selectionKey].get();\n\tconst bitrate = (track) => track.bandwidth ?? 0;\n\tconst rank = (track) => track.id === currentId ? bitrate(track) * upgradeMargin : bitrate(track);\n\tconst fitting = tracks.filter((track) => bitrate(track) <= threshold).sort((a, b) => rank(b) - rank(a) || resolutionArea(b) - resolutionArea(a));\n\tconst over = tracks.filter((track) => bitrate(track) > threshold).sort((a, b) => bitrate(a) - bitrate(b) || resolutionArea(b) - resolutionArea(a));\n\treturn [...fitting, ...over];\n}\n/**\n* Default final pick: the chain head. `applyRules` never narrows to nothing and\n* early-bails to a single survivor, so video and audio always converge to a\n* track and the head is the pick.\n*/\nfunction selectChainHead(candidates) {\n\treturn candidates[0].id;\n}\n/**\n* Terminal pick for text — the `resolveSelection` the text variant supplies.\n* Resolves the standing `userTextTrackSelection` intent against the chain's\n* survivors (already CDN-failover-pruned and active-CDN-scoped):\n*\n* - `'off'` → no selection (clear the slot). Sticky through re-evaluation, so a\n* live refresh or failover re-run can't re-assert a default.\n* - explicit `Partial<TextTrack>` → narrow to the match (language-based). A\n* stale pick whose match is gone (e.g. the language dropped on a source\n* change) falls through to the default policy.\n* - auto (`undefined`) → the opt-in default policy (`preferredSubtitleLanguage`\n* → `DEFAULT=YES + AUTOSELECT=YES` → none), shared with `pickTextTrack`.\n*\n* Returning `undefined` is a real outcome (captions are opt-in), which is why the\n* text variant relies on `setupTrackSwitching`'s no-selection seam.\n*/\nfunction pickResolvedTextTrack(candidates, { state, config }) {\n\tconst intent = state.userTextTrackSelection?.get();\n\tif (intent === \"off\") return void 0;\n\tif (intent) {\n\t\tconst matched = candidates.filter((track) => matchesPartialTrack(track, intent));\n\t\tif (matched.length) return matched[0].id;\n\t}\n\treturn pickTextTrackFromTracks(candidates, config);\n}\nfunction setupTrackSwitching(deps) {\n\tconst { state, config } = deps;\n\tconst { selectionKey, getTracks, rules, resolveSelection = selectChainHead, noSupportedTrackCode } = config;\n\tconst derivedStateSignal = computed(() => isResolvedPresentation(state.presentation.get()) ? \"presentation-resolved\" : \"presentation-unresolved\");\n\tconst candidateSet = computed(() => {\n\t\tconst presentation = state.presentation.get();\n\t\tif (!isResolvedPresentation(presentation)) return [];\n\t\treturn applyConstraints(config.constraints ?? [], getTracks(presentation), deps);\n\t}, { equals: (a, b) => a.length === b.length && a.every((track) => b.some((other) => other.id === track.id)) });\n\treturn createMachineReactor({\n\t\tinitial: \"presentation-unresolved\",\n\t\tmonitor: () => derivedStateSignal.get(),\n\t\tstates: {\n\t\t\t\"presentation-unresolved\": {},\n\t\t\t\"presentation-resolved\": {\n\t\t\t\tentry: () => () => state[selectionKey].set(void 0),\n\t\t\t\teffects: [() => {\n\t\t\t\t\tconst tracks = candidateSet.get();\n\t\t\t\t\tif (!tracks.length) {\n\t\t\t\t\t\tconst presentation = peek(state.presentation);\n\t\t\t\t\t\tif (isResolvedPresentation(presentation) && getTracks(presentation).length > 0) {\n\t\t\t\t\t\t\tif (noSupportedTrackCode !== void 0) emitError(state, {\n\t\t\t\t\t\t\t\tcode: noSupportedTrackCode,\n\t\t\t\t\t\t\t\tdata: { selectionKey }\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tstate[selectionKey].set(void 0);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tconst candidates = applyRules(rules, tracks, deps);\n\t\t\t\t\tif (!candidates.length) {\n\t\t\t\t\t\tconsole.error(\"[track-switching] applyRules returned no candidates\");\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tstate[selectionKey].set(resolveSelection(candidates, deps));\n\t\t\t\t}]\n\t\t\t}\n\t\t}\n\t});\n}\n/**\n* Manage `selectedVideoTrackId`: pick a default on src load, dynamically\n* adjust based on bandwidth, clear on src unload. Honors\n* `userVideoTrackSelection` as a partial-track constraint on candidates;\n* short-circuits ABR when the constraint narrows to a single track.\n*\n* @example\n* const reactor = switchVideoTrack.setup({ state });\n*/\nconst switchVideoTrack = defineBehavior({\n\tstateKeys: [\"presentation\", \"selectedVideoTrackId\"],\n\tcontextKeys: [],\n\tsetup: ({ state, config, ...otherProps }) => setupTrackSwitching({\n\t\t...otherProps,\n\t\tstate,\n\t\tconfig: {\n\t\t\t...config,\n\t\t\tselectionKey: \"selectedVideoTrackId\",\n\t\t\tuserSelectionKey: \"userVideoTrackSelection\",\n\t\t\tgetTracks: (presentation) => getTracksByType(presentation, \"video\"),\n\t\t\tconstraints: [excludeFailedCdns, excludeUnplayableTracks],\n\t\t\trules: [\n\t\t\t\tfilterByUserSelection,\n\t\t\t\tpreferActiveCdn,\n\t\t\t\trankByBandwidth\n\t\t\t],\n\t\t\tnoSupportedTrackCode: SVTA_NO_SUPPORTED_VIDEO_TRACK\n\t\t}\n\t})\n});\n/**\n* Manage `selectedAudioTrackId`: pick a default on src load, narrow by\n* `userAudioTrackSelection` filter, re-pick on filter change, clear on\n* src unload.\n*\n* Mid-stream flush on language switch is handled by the segment-loader's\n* `planTasks` (see `playback/actors/dom/segment-loader.ts`) — not this\n* behavior. Same split as the video pipeline: slot owner writes; loader\n* orchestrates segment + flush plans.\n*\n* @example\n* const reactor = switchAudioTrack.setup({ state });\n*/\nconst switchAudioTrack = defineBehavior({\n\tstateKeys: [\"presentation\", \"selectedAudioTrackId\"],\n\tcontextKeys: [],\n\tsetup: ({ state, config, ...otherProps }) => setupTrackSwitching({\n\t\t...otherProps,\n\t\tstate,\n\t\tconfig: {\n\t\t\t...config,\n\t\t\tselectionKey: \"selectedAudioTrackId\",\n\t\t\tuserSelectionKey: \"userAudioTrackSelection\",\n\t\t\tgetTracks: (presentation) => getTracksByType(presentation, \"audio\"),\n\t\t\tconstraints: [excludeFailedCdns, excludeUnplayableTracks],\n\t\t\trules: [\n\t\t\t\tfilterByUserSelection,\n\t\t\t\tpreferActiveCdn,\n\t\t\t\trankByBandwidth\n\t\t\t],\n\t\t\tnoSupportedTrackCode: SVTA_NO_SUPPORTED_AUDIO_TRACK\n\t\t}\n\t})\n});\n/**\n* Manage `selectedTextTrackId` as the single-writer **output** of standing user\n* intent (`userTextTrackSelection`) resolved against the playable, CDN-scoped\n* text renditions: clear on src unload; re-resolve when a CDN fails or recovers.\n*\n* Unlike video/audio, the selection is *optional* — captions are opt-in and the\n* user can turn them off — so the chain skips the bandwidth ranker and the shared\n* user-selection filter, and supplies a text-specific terminal\n* (`pickResolvedTextTrack`) that may resolve to no-selection via\n* `setupTrackSwitching`'s `resolveSelection` seam. Constraints are failed-CDN only\n* (`excludeUnplayableTracks`/`canPlayTrack` is MSE-based — the wrong probe for\n* text, whose playability is SPF-parser support); the active-CDN scope co-locates\n* captions with the surviving CDN on failover.\n*\n* @example\n* const reactor = switchTextTrack.setup({ state, config: { preferredSubtitleLanguage: 'en' } });\n*/\nconst switchTextTrack = defineBehavior({\n\tstateKeys: [\"presentation\", \"selectedTextTrackId\"],\n\tcontextKeys: [],\n\tsetup: ({ state, config, ...otherProps }) => setupTrackSwitching({\n\t\t...otherProps,\n\t\tstate,\n\t\tconfig: {\n\t\t\t...config,\n\t\t\tselectionKey: \"selectedTextTrackId\",\n\t\t\tgetTracks: (presentation) => getTracksByType(presentation, \"text\"),\n\t\t\tconstraints: [excludeFailedCdns],\n\t\t\trules: [preferActiveCdn],\n\t\t\tresolveSelection: pickResolvedTextTrack\n\t\t}\n\t})\n});\n//#endregion\nexport { DEFAULT_INITIAL_BANDWIDTH, applyConstraints, applyRules, setupTrackSwitching, switchAudioTrack, switchTextTrack, switchVideoTrack };\n\n//# sourceMappingURL=track-switching.js.map","//#region src/media/text/parse-vtt-timestamp-map.ts\nconst TIMESTAMP_MAP_PREFIX = \"X-TIMESTAMP-MAP=\";\n/**\n* Scrape a WebVTT segment's `X-TIMESTAMP-MAP` header into a {@link TimestampMap}\n* — the only header line we need to correlate LOCAL cue times with the media\n* presentation timeline. Deliberately *not* a WebVTT parser: cue parsing stays\n* with the browser's native `<track>` parser (which drops this line); this reads\n* just the one header field the native path discards.\n*\n* Returns `undefined` when the segment carries no map (e.g. cues already in\n* absolute presentation time) — per the HLS spec that means LOCAL 0 maps to\n* MPEGTS 0. Tolerant of attribute order and `[HH:]MM:SS.mmm` LOCAL forms.\n*/\nfunction parseVttTimestampMap(text) {\n\tconst timestampMapLine = text.split(/\\r\\n|\\r|\\n/).find((line) => line.startsWith(TIMESTAMP_MAP_PREFIX));\n\treturn timestampMapLine ? parseTimestampMapBody(timestampMapLine.slice(16)) : void 0;\n}\nconst TimeStampMapParserMap = {\n\tLOCAL: parseWebVttTimestamp,\n\tMPEGTS: (v) => +v\n};\nfunction parseTimestampMapBody(body) {\n\treturn Object.fromEntries(body.split(\",\").map((kvStr) => {\n\t\tconst [k, v] = kvStr.split(/:(.*)/).map((kOrV) => kOrV.trim());\n\t\treturn [k?.toLowerCase(), TimeStampMapParserMap[k](v)];\n\t}));\n}\n/** Seconds-per-unit for the `[HH:]MM:SS.mmm` parts, right-aligned so a missing HH just drops the leading weight. */\nconst VTT_TIMESTAMP_WEIGHTS = [\n\t3600,\n\t60,\n\t1,\n\t.001\n];\nfunction parseWebVttTimestamp(value) {\n\tconst parts = value.split(/[:.]/);\n\treturn parts.reduce((acc, val, i) => acc + +val * (VTT_TIMESTAMP_WEIGHTS[i + 4 - parts.length] ?? 0), 0);\n}\n//#endregion\nexport { parseVttTimestampMap };\n\n//# sourceMappingURL=parse-vtt-timestamp-map.js.map","import { parseVttTimestampMap } from \"./parse-vtt-timestamp-map.js\";\n//#region src/media/text/resolve-vtt-metadata.ts\n/**\n* Header-level text-segment metadata — the `X-TIMESTAMP-MAP` correlation scraped from\n* a VTT segment's raw bytes. DOM-free (a plain fetch + regex parse): the native\n* `<track>` parser in `media/dom/text` (`resolveVttSegment`) discards this header, so a\n* caller that needs it (e.g. non-zero-PTS relocation) fetches the bytes itself.\n*/\n/**\n* Fetch a VTT segment and scrape only its header metadata (no cue parsing).\n*\n* The native `<track>` parser (`media/dom/text`'s `resolveVttSegment`) discards\n* `X-TIMESTAMP-MAP`, so reading it requires the raw bytes. This is a separate,\n* caller-controlled fetch — the caller decides *when* metadata is needed (e.g.\n* once per source) rather than paying for it on every segment.\n*/\nasync function resolveVttSegmentMetadata(url) {\n\treturn { timestampMap: parseVttTimestampMap(await fetch(url).then((response) => response.text())) };\n}\n//#endregion\nexport { resolveVttSegmentMetadata };\n\n//# sourceMappingURL=resolve-vtt-metadata.js.map","//#region src/playback/primitives/text-segment-load-pipeline.ts\n/**\n* Base-step view of the loader's wiring, folded into `config` by\n* `createTextTrackSegmentLoaderActor` so base steps read it from the uniform passthrough\n* — present in both composition and standalone use. `config` is loose (`object`), so\n* assert the shape here (mirrors the v/a loader's `stepWiring`). The sink is the\n* structural {@link CueSink}, not the concrete actor.\n*/\nfunction textStepWiring(deps) {\n\treturn deps.config;\n}\n/** Resolve the op's cues (via the injected host primitive) into the frame. The text analog of `fetchStep`. */\nconst resolveCuesStep = async (frame, signal, deps) => {\n\tconst cues = await textStepWiring(deps).resolveSegment(frame.op.segment.url);\n\tif (signal.aborted) return;\n\tframe.cues = cues;\n};\n/** Dispatch the frame's cues to the TextTracksActor as `add-cues`. The text analog of `dispatchStep`. */\nconst dispatchCuesStep = (frame, _signal, deps) => {\n\tconst { op } = frame;\n\ttextStepWiring(deps).textTracksActor.send({\n\t\ttype: \"add-cues\",\n\t\tmeta: {\n\t\t\ttrackId: op.trackId,\n\t\t\tid: op.segment.id,\n\t\t\tstartTime: op.segment.startTime,\n\t\t\tduration: op.segment.duration\n\t\t},\n\t\tcues: frame.cues ?? []\n\t});\n};\n/** Tier 0 default: resolve then dispatch. No relocation vocabulary. */\nconst DEFAULT_TEXT_MESSAGE_PIPELINES = () => [resolveCuesStep, dispatchCuesStep];\n//#endregion\nexport { DEFAULT_TEXT_MESSAGE_PIPELINES, dispatchCuesStep, resolveCuesStep, textStepWiring };\n\n//# sourceMappingURL=text-segment-load-pipeline.js.map","//#region src/media/mp4/box.ts\nfunction toDataView(data) {\n\treturn data instanceof Uint8Array ? new DataView(data.buffer, data.byteOffset, data.byteLength) : new DataView(data);\n}\n/** Read a 4-character box type / FourCC at `offset`. */\nfunction readFourCC(view, offset) {\n\treturn String.fromCharCode(view.getUint8(offset), view.getUint8(offset + 1), view.getUint8(offset + 2), view.getUint8(offset + 3));\n}\n/** Iterate the boxes directly contained in `[start, end)`. */\nfunction* iterateBoxes(view, start = 0, end = view.byteLength) {\n\tlet offset = start;\n\twhile (offset + 8 <= end) {\n\t\tlet size = view.getUint32(offset);\n\t\tconst type = readFourCC(view, offset + 4);\n\t\tlet dataStart = offset + 8;\n\t\tif (size === 1) {\n\t\t\tsize = Number(view.getBigUint64(offset + 8));\n\t\t\tdataStart = offset + 16;\n\t\t} else if (size === 0) size = end - offset;\n\t\tif (size < dataStart - offset) return;\n\t\tyield {\n\t\t\ttype,\n\t\t\tstart: offset,\n\t\t\tdataStart,\n\t\t\tend: offset + size\n\t\t};\n\t\toffset += size;\n\t}\n}\n/** Iterate the direct child boxes of a given `type` within `[start, end)`. */\nfunction* iterateBoxesOfType(view, type, start = 0, end = view.byteLength) {\n\tfor (const box of iterateBoxes(view, start, end)) if (box.type === type) yield box;\n}\n/**\n* Depth-first descent to the first box matching a nested path, e.g.\n* `['moov', 'trak', 'mdia', 'mdhd']`. Returns `undefined` if any level is\n* absent.\n*/\nfunction findBox(view, path, start = 0, end = view.byteLength) {\n\tconst [head, ...rest] = path;\n\tfor (const box of iterateBoxes(view, start, end)) {\n\t\tif (box.type !== head) continue;\n\t\tif (rest.length === 0) return box;\n\t\tconst found = findBox(view, rest, box.dataStart, box.end);\n\t\tif (found) return found;\n\t}\n}\n/**\n* Read the version byte of a FullBox — the `version(1) + flags(3)` header at the\n* start of the payload of `mdhd` / `tkhd` / `tfdt` / `hdlr` / `elst` / etc.\n*/\nfunction readFullBoxVersion(view, dataStart) {\n\treturn view.getUint8(dataStart);\n}\n//#endregion\nexport { findBox, iterateBoxes, iterateBoxesOfType, readFourCC, readFullBoxVersion, toDataView };\n\n//# sourceMappingURL=box.js.map","import { findBox, iterateBoxesOfType, readFourCC, readFullBoxVersion, toDataView } from \"./box.js\";\n//#region src/media/mp4/timestamp-origin.ts\n/**\n* Decode-time origin extraction from fMP4/CMAF segments.\n*\n* Non-zero-PTS sources encode media at a non-zero start time (an instant clip\n* starting at asset second 60, an Apple bipbop asset starting at 10s, …). To\n* relocate such a source onto a 0-based presentation timeline via\n* `SourceBuffer.timestampOffset`, the engine needs that start time — the\n* **decode-time origin** — read straight from the container:\n*\n* - `tfdt.baseMediaDecodeTime` (from a media segment's `moof`) — the decode\n* time of the segment's first sample, in the track's media timescale. This is\n* a DTS: relocating by `−(baseMediaDecodeTime / timescale)` lands the earliest\n* DTS at exactly 0, so a negative-DTS append failure on Chromium is impossible\n* by construction.\n* - `mdhd.timescale` (from the init segment's `moov`) — ticks per second for\n* that track, needed to convert the raw tick count to seconds.\n*\n* ## Presumptive vs. track-selected reads\n*\n* The two variants share only the leaf field-readers (`mdhd` timescale, `tfdt`\n* baseMediaDecodeTime) and the box walker. Everything else differs, and the\n* split is deliberate so the presumptive pair is *proportionally* smaller under\n* tree-shaking:\n*\n* - **Presumptive** — {@link readFirstMediaTimescale} / {@link readFirstBaseMediaDecodeTime}\n* read the first `mdhd` timescale and first `tfdt` baseMediaDecodeTime. There's\n* no `track_id` (nothing to match against) and no `trak`/`traf` iteration — a\n* direct `findBox` to the first leaf. Correct when the init/segment holds a\n* single media track (the common CMAF case). A caption-free platform imports\n* only this pair and tree-shakes away all the matching machinery below.\n* - **Track-selected** — {@link findMediaTrack} / {@link readBaseMediaDecodeTime}.\n* `findMediaTrack` returns `{ trackId, timescale }` for the `trak` whose `hdlr`\n* handler matches; `readBaseMediaDecodeTime` takes that `trackId` and reads the\n* `traf` whose `tfhd.track_id` matches. The `track_id` is the join that ties one\n* track's timescale to the *same* track's baseMediaDecodeTime — required when a\n* source muxes CEA-608/708 captions (a `clcp` track shares the same `moov` and\n* `moof`, each track with its own timescale + baseMediaDecodeTime, so a\n* presumptive read there risks `300000 / 6000 = 50s` instead of\n* `60000 / 6000 = 10s`). This pair adds `trak`/`traf` iteration plus the handler\n* and `track_id` reads. We only ever ask for buffered media handlers\n* (`vide` / `soun`); the caption track is never selected — we read the origin,\n* not the captions (caption *rendering* is out of scope).\n*\n* Both raw values are returned un-divided to leave room for an edit-list (`elst`)\n* presentation-time correction term if a source ever carries one — the validated\n* streams do not.\n*/\n/**\n* The `track_ID` + timescale of the `trak` whose `mdhd` handler matches\n* `handlerType`, skipping a muxed `clcp` caption track. `undefined` if no\n* matching track exists.\n*/\nfunction findMediaTrack(initSegment, handlerType) {\n\tconst view = toDataView(initSegment);\n\tconst moov = findBox(view, [\"moov\"]);\n\tif (!moov) return void 0;\n\tfor (const trak of iterateBoxesOfType(view, \"trak\", moov.dataStart, moov.end)) {\n\t\tif (readTrakHandler(view, trak) !== handlerType) continue;\n\t\tconst tkhd = findBox(view, [\"tkhd\"], trak.dataStart, trak.end);\n\t\tconst mdhd = findBox(view, [\"mdia\", \"mdhd\"], trak.dataStart, trak.end);\n\t\tif (!tkhd || !mdhd) return void 0;\n\t\treturn {\n\t\t\ttrackId: view.getUint32(tkhd.dataStart + 4 + (readFullBoxVersion(view, tkhd.dataStart) === 1 ? 16 : 8)),\n\t\t\ttimescale: readMdhdTimescale(view, mdhd)\n\t\t};\n\t}\n}\n/**\n* `baseMediaDecodeTime` (in the track's media timescale) from the `traf` matching\n* `trackId` (via `tfhd.track_id`) — required for muxed multi-`traf` segments.\n* `undefined` if no matching `tfdt` exists.\n*/\nfunction readBaseMediaDecodeTime(mediaSegment, trackId) {\n\tconst view = toDataView(mediaSegment);\n\tconst moof = findBox(view, [\"moof\"]);\n\tif (!moof) return void 0;\n\tfor (const traf of iterateBoxesOfType(view, \"traf\", moof.dataStart, moof.end)) {\n\t\tif (readTrafTrackId(view, traf) !== trackId) continue;\n\t\tconst tfdt = findBox(view, [\"tfdt\"], traf.dataStart, traf.end);\n\t\treturn tfdt ? readTfdtBaseMediaDecodeTime(view, tfdt) : void 0;\n\t}\n}\n/** `mdhd.timescale`: FullBox version(1)+flags(3) + dates (v0: 4+4, v1: 8+8) + timescale. */\nfunction readMdhdTimescale(view, mdhd) {\n\treturn view.getUint32(mdhd.dataStart + 4 + (readFullBoxVersion(view, mdhd.dataStart) === 1 ? 16 : 8));\n}\n/** `tfdt.baseMediaDecodeTime`: FullBox, then the value — v0: (4), v1: (8). */\nfunction readTfdtBaseMediaDecodeTime(view, tfdt) {\n\tconst at = tfdt.dataStart + 4;\n\treturn readFullBoxVersion(view, tfdt.dataStart) === 1 ? Number(view.getBigUint64(at)) : view.getUint32(at);\n}\n/** `hdlr.handler_type` for a `trak`: FullBox version(1)+flags(3) + pre_defined(4) + handler_type(4). */\nfunction readTrakHandler(view, trak) {\n\tconst hdlr = findBox(view, [\"mdia\", \"hdlr\"], trak.dataStart, trak.end);\n\treturn hdlr ? readFourCC(view, hdlr.dataStart + 8) : void 0;\n}\n/** `tfhd.track_id` for a `traf`: FullBox version(1)+flags(3) + track_id(4). */\nfunction readTrafTrackId(view, traf) {\n\tconst tfhd = findBox(view, [\"tfhd\"], traf.dataStart, traf.end);\n\treturn tfhd ? view.getUint32(tfhd.dataStart + 4) : void 0;\n}\n//#endregion\nexport { findMediaTrack, readBaseMediaDecodeTime };\n\n//# sourceMappingURL=timestamp-origin.js.map","//#region src/playback/primitives/head-peek.ts\n/**\n* Eager head-of-stream peek. Pulls chunks from an async byte stream only until\n* `tryParse` signals it has read what it needs (or the stream ends), then returns\n* a stream that re-emits the pulled head followed by the untouched tail — so\n* reading a head-of-stream mp4 box (`mdhd` / `tfdt`) doesn't break streaming of\n* the append. Once the caller has what it wants, the rest streams as normal.\n*/\nfunction concat(chunks) {\n\tif (chunks.length === 1) return chunks[0];\n\tconst total = chunks.reduce((n, c) => n + c.length, 0);\n\tconst out = new Uint8Array(total);\n\tlet offset = 0;\n\tfor (const chunk of chunks) {\n\t\tout.set(chunk, offset);\n\t\toffset += chunk.length;\n\t}\n\treturn out;\n}\n/** Re-emit the eagerly-pulled head chunks, then stream the untouched tail. */\nasync function* reassemble(head, tail) {\n\tyield* head;\n\tfor (let next = await tail.next(); !next.done; next = await tail.next()) yield next.value;\n}\n/**\n* Pull chunks until `tryParse(accumulatedHead)` returns `true` — it found and read\n* its box — or the stream ends, then return a stream re-emitting the pulled head\n* followed by the untouched tail. `tryParse` is called with the growing head after\n* each chunk; it performs the side effect (publishing the parsed value) and returns\n* whether it's done.\n*/\nasync function peekHead(data, tryParse) {\n\tconst iterator = data[Symbol.asyncIterator]();\n\tconst head = [];\n\tfor (let next = await iterator.next(); !next.done; next = await iterator.next()) {\n\t\thead.push(next.value);\n\t\tif (tryParse(concat(head))) break;\n\t}\n\treturn reassemble(head, iterator);\n}\n//#endregion\nexport { peekHead };\n\n//# sourceMappingURL=head-peek.js.map","import { peek, update } from \"../../core/signals/primitives.js\";\nimport { effect } from \"../../core/signals/effect.js\";\nimport { resolveVttSegmentMetadata } from \"../../media/text/resolve-vtt-metadata.js\";\nimport { findTrackById, getTracksByType } from \"../../media/utils/tracks.js\";\nimport { dispatchCuesStep, textStepWiring } from \"./text-segment-load-pipeline.js\";\nimport { dispatchStep, fetchStep } from \"./segment-load-pipeline.js\";\nimport { findMediaTrack, readBaseMediaDecodeTime } from \"../../media/mp4/timestamp-origin.js\";\nimport { peekHead } from \"./head-peek.js\";\n//#region src/playback/primitives/relocation-pipelines.ts\n/** Assert the relocation state view from the opaque step deps — this module knows the slots the composition provides. */\nfunction relocationState(deps) {\n\treturn deps.state;\n}\nfunction containerSlot(deps) {\n\treturn relocationState(deps).mediaContainerData;\n}\n/** Synchronous RMW of the per-type entry — disjoint keys across producers, so no lost update. */\nfunction writeContainer(slot, trackType, patch) {\n\tupdate(slot, (current) => ({\n\t\t...current,\n\t\t[trackType]: {\n\t\t\t...current?.[trackType],\n\t\t\t...patch\n\t\t}\n\t}));\n}\n/**\n* Resolve once `read()` returns a number. Shared by the A/V stamp (waits for the\n* `derive`d origin — immediate for per-type, the shared-`min` barrier for coordinated)\n* and the text step (waits for the primary A/V origin). No bound: for fMP4 the origin\n* always establishes.\n*/\nfunction awaitDefined(read) {\n\treturn new Promise((resolve) => {\n\t\tlet stop;\n\t\tstop = effect(() => {\n\t\t\tconst value = read();\n\t\t\tif (value !== void 0) {\n\t\t\t\tstop?.();\n\t\t\t\tresolve(value);\n\t\t\t}\n\t\t});\n\t});\n}\n/**\n* Relocation pipelines for one track type — a plain config `messagePipelines`.\n* Keyed by **track type** (`'video'` / `'audio'`), so ABR rungs of a type share the\n* origin (discover skips once the type's value is present). The steps read/write\n* `state.mediaContainerData[trackType]` via their call-time `deps`; the stamp applies\n* the same `derive` seam the reactor uses (pass the composition's resolved\n* `deriveStartMediaTime` so the buffer offset and the model's `startMediaTime` agree).\n*/\nfunction relocationPipelinesFor(trackType, derive) {\n\tconst handlerType = trackType === \"video\" ? \"vide\" : \"soun\";\n\t/**\n\t* Init step: head-peek the buffered media track's `track_id` + `mdhd` timescale into\n\t* `mediaContainerData[trackType]`. Matching by handler (`vide`/`soun`) skips a muxed\n\t* `clcp` caption track, and the `track_id` lets `readSegmentOrigin` read *this*\n\t* track's `tfdt` rather than the first `traf` in the segment.\n\t*/\n\tconst readInitTrackInfo = async (frame, _signal, deps) => {\n\t\tconst { op } = frame;\n\t\tif (op.type !== \"append-init\" || !frame.data) return;\n\t\tconst slot = containerSlot(deps);\n\t\tif (peek(slot)?.[trackType]?.timescale !== void 0) return;\n\t\tframe.data = await peekHead(frame.data, (bytes) => {\n\t\t\tconst track = findMediaTrack(bytes, handlerType);\n\t\t\tif (track === void 0) return false;\n\t\t\twriteContainer(slot, trackType, {\n\t\t\t\ttrackId: track.trackId,\n\t\t\t\ttimescale: track.timescale\n\t\t\t});\n\t\t\treturn true;\n\t\t});\n\t};\n\t/**\n\t* Media-segment step: head-peek the `tfdt` baseMediaDecodeTime of the media track's\n\t* `traf` (matched by the `track_id` discovered from the init), recording the\n\t* segment's 0-based `startTime` with it — the origin is `bmdt/ts − segmentStartTime`,\n\t* so the first *loaded* segment need not be the 0th. Without a discovered `track_id`\n\t* (non-fMP4 / mock init) there's no media track to relocate, so the step no-ops and\n\t* the append stays native.\n\t*/\n\tconst readSegmentOrigin = async (frame, _signal, deps) => {\n\t\tconst { op } = frame;\n\t\tif (op.type !== \"append-segment\" || !frame.data) return;\n\t\tconst slot = containerSlot(deps);\n\t\tconst container = peek(slot)?.[trackType];\n\t\tif (container?.baseMediaDecodeTime !== void 0) return;\n\t\tconst { trackId } = container ?? {};\n\t\tif (trackId === void 0) return;\n\t\tconst segmentStartTime = op.meta.startTime;\n\t\tframe.data = await peekHead(frame.data, (bytes) => {\n\t\t\tconst baseMediaDecodeTime = readBaseMediaDecodeTime(bytes, trackId);\n\t\t\tif (baseMediaDecodeTime === void 0) return false;\n\t\t\twriteContainer(slot, trackType, {\n\t\t\t\tbaseMediaDecodeTime,\n\t\t\t\tsegmentStartTime\n\t\t\t});\n\t\t\treturn true;\n\t\t});\n\t};\n\t/**\n\t* Stamp step — tier-agnostic apply. Relocate by the `derive`d `startMediaTime` for\n\t* this type (`offset = −startMediaTime`). Applies the **same** `derive` the reactor\n\t* uses, over the shared `mediaContainerData` slot — so the buffer offset matches the\n\t* model's stamped `startMediaTime`, and it's robust to `established` + late tracks\n\t* (the slot persists; the model value may not be re-stamped after the reactor goes\n\t* sticky). Awaited: per-type resolves at once (own origin discovered earlier in this\n\t* pipeline); shared-`min` waits until every selected A/V origin is in — the barrier,\n\t* filled by the other type's discover step. A derived `0` (0-PTS / below threshold)\n\t* leaves the append native — setting `timestampOffset` at all can ripple.\n\t*/\n\tconst stampStartMediaTime = async (frame, signal, deps) => {\n\t\tif (frame.op.type !== \"append-segment\") return;\n\t\tconst state = relocationState(deps);\n\t\tconst own = peek(state.mediaContainerData)?.[trackType];\n\t\tif (own?.timescale === void 0 || own.baseMediaDecodeTime === void 0 || own.segmentStartTime === void 0) return;\n\t\tconst startMediaTime = await awaitDefined(() => {\n\t\t\tconst containerData = state.mediaContainerData.get();\n\t\t\tif (!containerData) return void 0;\n\t\t\treturn derive(containerData, {\n\t\t\t\tselectedVideoTrackId: state.selectedVideoTrackId?.get(),\n\t\t\t\tselectedAudioTrackId: state.selectedAudioTrackId?.get()\n\t\t\t})[trackType];\n\t\t});\n\t\tif (signal.aborted || startMediaTime === 0) return;\n\t\tframe.meta = {\n\t\t\t...frame.meta ?? frame.op.meta,\n\t\t\ttimestampOffset: -startMediaTime\n\t\t};\n\t};\n\treturn () => ({\n\t\tremove: [dispatchStep],\n\t\t\"append-init\": [\n\t\t\tfetchStep,\n\t\t\treadInitTrackInfo,\n\t\t\tdispatchStep\n\t\t],\n\t\t\"append-segment\": [\n\t\t\tfetchStep,\n\t\t\treadSegmentOrigin,\n\t\t\tstampStartMediaTime,\n\t\t\tdispatchStep\n\t\t]\n\t});\n}\n/**\n* Resolve step for the relocation text pipeline. Reuses the injected host resolver\n* (the loader's folded `resolveSegment`, via `textStepWiring`) for cues and fetches\n* the `X-TIMESTAMP-MAP` header in parallel, stashing it on `frame.metadata` for\n* `relocateCuesStep`. Replaces the\n* base `resolveCuesStep` (which fetches cues only) — text's native `<track>` parser\n* discards the header, so the map needs its own raw-bytes fetch.\n*/\nconst resolveWithMetadataStep = async (frame, signal, deps) => {\n\tconst [cues, metadata] = await Promise.all([textStepWiring(deps).resolveSegment(frame.op.segment.url), resolveVttSegmentMetadata(frame.op.segment.url)]);\n\tif (signal.aborted) return;\n\tframe.cues = cues;\n\tframe.metadata = metadata;\n};\n/**\n* Relocate step — shifts each cue onto the 0-based presentation timeline:\n* `cueFinal = cueNative − startMediaTime`, where `startMediaTime` is the primary\n* A/V track's origin (selected **video**, else **audio** — the single-anchor rule,\n* and defensive like the reactor's optional selection) and `cueNative` folds in the\n* `X-TIMESTAMP-MAP` correction (`mpegts/90000 − local`) for map-bearing VTT (Apple)\n* or is the absolute cue time (no map, e.g. Mux). Text can resolve before A/V\n* establishes, so the origin is awaited; fMP4 always establishes it (0-PTS → 0),\n* and a text-only source (no A/V selected) simply gets offset 0.\n*/\nconst relocateCuesStep = async (frame, signal, deps) => {\n\tif (!frame.cues?.length) return;\n\tconst state = deps.state;\n\tconst startMediaTime = await awaitDefined(() => {\n\t\tconst presentation = state.presentation.get();\n\t\tif (!presentation) return void 0;\n\t\tconst primaryId = state.selectedVideoTrackId.get() ?? state.selectedAudioTrackId.get();\n\t\tif (primaryId !== void 0) return findTrackById(presentation, primaryId)?.startMediaTime;\n\t\treturn getTracksByType(presentation, \"video\").length > 0 || getTracksByType(presentation, \"audio\").length > 0 ? void 0 : 0;\n\t});\n\tif (signal.aborted) return;\n\tconst { timestampMap } = frame.metadata ?? {};\n\tconst delta = (timestampMap ? timestampMap.mpegts / 9e4 - timestampMap.local : 0) - startMediaTime;\n\tif (delta !== 0) for (const cue of frame.cues) {\n\t\tcue.startTime += delta;\n\t\tcue.endTime += delta;\n\t}\n};\n/**\n* Relocation text pipeline — the text analog of `relocationPipelinesFor(type)`.\n* `resolveWithMetadata` (cues + `X-TIMESTAMP-MAP`) → `relocateCues` (shift by the\n* primary A/V origin) → `dispatchCues`.\n*/\nconst relocatingTextPipelines = () => [\n\tresolveWithMetadataStep,\n\trelocateCuesStep,\n\tdispatchCuesStep\n];\n//#endregion\nexport { relocatingTextPipelines, relocationPipelinesFor };\n\n//# sourceMappingURL=relocation-pipelines.js.map","import { getMediaPlaylistMetadata } from \"../../media/types/index.js\";\nimport { SVTA_UNSUPPORTED_AUDIO_FORMAT, SVTA_UNSUPPORTED_DRM_SYSTEM, SVTA_UNSUPPORTED_VIDEO_FORMAT } from \"../../media/errors.js\";\nimport { NON_FMP4_CONTAINER_MIMES } from \"../../media/hls/parse-media-playlist.js\";\n//#region src/playback/primitives/report-track-conditions.ts\n/**\n* The seam `resolve-track` uses to report conditions discovered in a freshly\n* parsed media playlist.\n*\n* Injected rather than baked in so `resolve-track` stays free of format and\n* policy knowledge: it parses and commits, and whatever the composition wants\n* noticed about the result is this function's business. Which conditions matter,\n* and which codes they carry, therefore vary per composition — a provider that\n* never ships MPEG-TS can drop that check, and future playlist-derived notices\n* (LL-HLS or DVR support that's partial rather than absent) attach here without\n* touching the resolver.\n*\n* Reported **per rendition, as it resolves**, which is why these are causes and\n* not verdicts: one rendition being unplayable doesn't make the source\n* unplayable. The verdict is `track-switching`'s, which reports\n* `SVTA_NO_SUPPORTED_{VIDEO,AUDIO}_TRACK` when a type's candidates actually\n* empty. Keeping the two apart is what lets a mixed source — some renditions\n* encrypted or MPEG-TS, others playable — log its causes and still play.\n*/\n/** Unsupported-format code per type; text has none — absent captions aren't a failure. */\nconst UNSUPPORTED_FORMAT_CODE = {\n\tvideo: SVTA_UNSUPPORTED_VIDEO_FORMAT,\n\taudio: SVTA_UNSUPPORTED_AUDIO_FORMAT\n};\n/**\n* The types a reported cause can legitimately describe: the ones whose candidates\n* `canPlayTrack` actually prunes, via `track-switching`'s `excludeUnplayableTracks`\n* pre-pass.\n*\n* Text is outside it by design — its switching chain runs failed-CDN constraints\n* alone, because an MSE codec probe is the wrong question for a WebVTT rendition\n* (see `track-switching.ts`). So nothing prunes a text rendition, no verdict can\n* follow from one, and a cause reported against it would be an orphan: the\n* adapter's unsupported-feature substitution scans the sequence as a whole, so a\n* lone encrypted subtitle would otherwise recode an unrelated verdict — an\n* all-CDN cooldown among them — as \"this engine can't play the source\".\n*/\nconst CAPABILITY_PRUNED_TYPES = /* @__PURE__ */ new Set([\"video\", \"audio\"]);\n/**\n* The default: report what makes a rendition unplayable *to this engine* — a\n* container MSE can't accept, or encryption with no decryption pipeline. Both\n* mirror what `canPlayTrack` prunes on, so a reported cause always has a\n* corresponding exclusion.\n*\n* A condition carries its code and its context, not copy. `data.mimeType` is\n* what preserves the specificity — the format codes cover every non-fMP4\n* container, so \"which one\" lives there for a consumer that wants to say, rather\n* than being flattened into an English sentence here.\n*\n* Both carry `trackType`, redundantly for the format codes (1004/1005 are\n* already per type) but not for 4008, which isn't per type — SVTA has one\n* content-protection code for both. Nothing branches on the tag: it's diagnostic\n* context, reaching a developer through the logged sequence and `error.data`,\n* which is why it goes on every condition rather than only where the code can't\n* carry it. `trackId` alongside it is what distinguishes two renditions of the\n* same type.\n*/\nfunction reportUnsupportedTrackConditions(track) {\n\tif (!CAPABILITY_PRUNED_TYPES.has(track.type)) return [];\n\tconst conditions = [];\n\tconst data = {\n\t\ttrackType: track.type,\n\t\ttrackId: track.id\n\t};\n\tconst formatCode = UNSUPPORTED_FORMAT_CODE[track.type];\n\tif (formatCode !== void 0 && NON_FMP4_CONTAINER_MIMES.has(track.mimeType)) conditions.push({\n\t\tcode: formatCode,\n\t\tdata: {\n\t\t\t...data,\n\t\t\tmimeType: track.mimeType\n\t\t}\n\t});\n\tif (getMediaPlaylistMetadata(track)?.encrypted) conditions.push({\n\t\tcode: SVTA_UNSUPPORTED_DRM_SYSTEM,\n\t\tdata\n\t});\n\treturn conditions;\n}\n//#endregion\nexport { reportUnsupportedTrackConditions };\n\n//# sourceMappingURL=report-track-conditions.js.map","//#region src/playback/primitives/error-messages.ts\n/**\n* Developer-facing copy for what this engine reports.\n*\n* Everything here reaches a **console**, never a viewer. Viewer-facing copy for\n* a fatal condition is the presentation layer's to compose: the engine reports a\n* code, and a consumer maps that code to localized text it owns.\n*\n* Plain string constants, one export each. Nothing is parameterized — a message\n* that names the engine has to be built at the call site from state the engine\n* carries around solely to say it, which is a lot of plumbing for a console\n* prefix. Separate exports rather than one object so a composition that logs\n* neither notice doesn't carry their bytes.\n*/\n/**\n* Logged when a fatal `SVTA_UNSUPPORTED_PLAYBACK_FEATURE` is surfaced.\n*\n* The developer's half of that event; the viewer gets the localized copy the\n* code maps to. One sentence is enough because the specifics — which container,\n* which rendition, whether it was DRM — stay structured on the reported\n* conditions logged beside it.\n*/\nconst UNSUPPORTED_PLAYBACK_FEATURE_MESSAGE = \"Can't play this source: it requires an unsupported playback feature.\";\n/**\n* LL-HLS delivery, played as standard live. The parser ignores partial segments\n* and the loader fetches whole ones, so latency lands wherever `HOLD-BACK` puts\n* it — the stream plays, just not at the latency it was published for.\n*/\nconst LOW_LATENCY_UNSUPPORTED_MESSAGE = \"Low-Latency HLS is unsupported; playing as standard live at higher latency.\";\n/**\n* `#EXT-X-PLAYLIST-TYPE:EVENT` — a growing window, which is how DVR is\n* delivered. It plays, but the seekable-range and live-edge handling for it is\n* newer and less exercised than sliding-window live.\n*/\nconst DVR_EXPERIMENTAL_MESSAGE = \"DVR support for EVENT playlists is experimental.\";\n//#endregion\nexport { DVR_EXPERIMENTAL_MESSAGE, LOW_LATENCY_UNSUPPORTED_MESSAGE, UNSUPPORTED_PLAYBACK_FEATURE_MESSAGE };\n\n//# sourceMappingURL=error-messages.js.map","import { SVTA_UNSUPPORTED_AUDIO_FORMAT, SVTA_UNSUPPORTED_DRM_SYSTEM, SVTA_UNSUPPORTED_VIDEO_FORMAT } from \"../../../media/errors.js\";\n//#region src/playback/adapters/hls-video/error-surface.ts\n/**\n* `message`, plus the alternative-Media sentence when `media`'s class names one.\n*\n* Read off the class rather than passed in so a subclass can point at a\n* better-equipped sibling — the SPF Mux Medias name the hls.js-backed one, which\n* plays the MPEG-TS and DRM sources SPF doesn't — without either adapter knowing\n* that sibling exists.\n*/\nfunction withAlternativeMediaSuggestion(message, media) {\n\tconst { alternativeMediaSuggestion } = media.constructor;\n\tconst suggestion = alternativeMediaSuggestion?.trim();\n\treturn suggestion ? `${message} ${suggestion}` : message;\n}\n/** The first condition `fatalCodes` covers — the root cause, not its consequences. */\nfunction firstFatal(errors, fatalCodes) {\n\treturn errors?.find((error) => fatalCodes.has(error.code));\n}\n/**\n* The causes that mean the engine has no pipeline for what the source delivers —\n* a container it can't append, or encryption it can't decrypt.\n*\n* What these have in common is that no retry, no other CDN, and no other\n* rendition of the same source fixes them: the source needs a capability this\n* engine doesn't have. That's the distinction the surfaced code exists to draw,\n* and it's why the set is these three rather than \"every cause\".\n*/\nconst UNSUPPORTED_FEATURE_CAUSES = /* @__PURE__ */ new Set([\n\tSVTA_UNSUPPORTED_VIDEO_FORMAT,\n\tSVTA_UNSUPPORTED_AUDIO_FORMAT,\n\tSVTA_UNSUPPORTED_DRM_SYSTEM\n]);\n/**\n* Whether anything in the sequence is a cause of the \"we don't implement this\"\n* kind.\n*\n* Deliberately `some` over the whole sequence rather than a per-type match\n* against the verdict. A verdict means one type's candidates emptied, but the\n* *reason* the source is unplayable can sit on another type — an audio-only\n* source whose sole rendition is encrypted empties the audio candidates, and a\n* video source with encrypted video empties the video ones. Both are the same\n* answer to the viewer, so both get the same code.\n*/\nfunction hasUnsupportedFeatureCause(errors) {\n\treturn errors?.some((error) => UNSUPPORTED_FEATURE_CAUSES.has(error.code)) ?? false;\n}\n//#endregion\nexport { firstFatal, hasUnsupportedFeatureCause, withAlternativeMediaSuggestion };\n\n//# sourceMappingURL=error-surface.js.map"],"mappings":";;;;;;;AAEA,MAAM,gCAAgC;;AAEtC,MAAM,gCAAgC;;;;;;AAMtC,MAAM,8BAA8B;;;;;AAKpC,MAAM,gCAAgC;;AAEtC,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;AAqBtC,MAAM,oCAAoC;;;;;;;;;;;;;;;;;;;;;;;ACd1C,SAASA,cAAY,cAAc,cAAc,eAAe;CAC/D,IAAI,CAAC,gBAAgB,CAAC,cAAc,KAAK,OAAO;CAChD,IAAI,eAAe,OAAO;CAC1B,OAAO;AACR;;;;;;;;;;;;;;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ACD,CAAC;CACD,OAAO;AACR;;;;;;;;;;;;;;;;;;;;;;;;;AC3DA,MAAM,uCAAuC;;;;;;AAM7C,MAAM,kCAAkC;;;;;;AAMxC,MAAM,2BAA2B;;;;;;;;;;;;ACxBjC,SAAS,+BAA+B,SAAS,OAAO;CACvD,MAAM,EAAE,+BAA+B,MAAM;CAC7C,MAAM,aAAa,4BAA4B,KAAK;CACpD,OAAO,aAAa,GAAG,QAAQ,GAAG,eAAe;AAClD;;AAEA,SAAS,WAAW,QAAQ,YAAY;CACvC,OAAO,QAAQ,MAAM,UAAU,WAAW,IAAI,MAAM,IAAI,CAAC;AAC1D;;;;;;;;;;AAUA,MAAM,6CAA6C,IAAI,IAAI;CAC1D;CACA;CACA;AACD,CAAC;;;;;;;;;;;;AAYD,SAAS,2BAA2B,QAAQ;CAC3C,OAAO,QAAQ,MAAM,UAAU,2BAA2B,IAAI,MAAM,IAAI,CAAC,KAAK;AAC/E"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gesture-element-6Ld1YwIL.js","names":["#lastTapTime","#clearTimer","#tapTimer","#player","#container","#register","#unregister","#cleanup"],"sources":["../../core/dist/dev/dom/gesture/actions.js","../../core/dist/dev/dom/gesture/tap.js","../../core/dist/dev/dom/gesture/create-tap-gesture.js","../src/ui/gesture/gesture-element.ts"],"sourcesContent":["import { MEDIA_INPUT_ACTION_OVERRIDES } from \"../media-actions.js\";\nimport { isFunction } from \"@videojs/utils/predicate\";\n//#region src/dom/gesture/actions.ts\n/** Actions that need custom logic beyond `store.state[action]()`. */\nconst GESTURE_ACTION_OVERRIDES = {\n\tseekStep: MEDIA_INPUT_ACTION_OVERRIDES.seekStep,\n\tvolumeStep: MEDIA_INPUT_ACTION_OVERRIDES.volumeStep,\n\tspeedUp: MEDIA_INPUT_ACTION_OVERRIDES.speedUp,\n\tspeedDown: MEDIA_INPUT_ACTION_OVERRIDES.speedDown\n};\nfunction resolveGestureAction(name) {\n\tconst override = GESTURE_ACTION_OVERRIDES[name];\n\tif (override) return override;\n\treturn ({ store }) => {\n\t\tconst method = store.state[name];\n\t\tif (isFunction(method)) method();\n\t\telse console.warn(`[vjs-gesture] Unknown action: \"${name}\"`);\n\t};\n}\n//#endregion\nexport { resolveGestureAction };\n\n//# sourceMappingURL=actions.js.map","//#region src/dom/gesture/tap.ts\nconst DOUBLETAP_WINDOW = 200;\n/**\n* Recognizes tap vs doubletap from quick pointer-up events.\n*\n* Stateful recognizer — tracks tap count and doubletap timing.\n* The coordinator handles pointer-down timing (tap threshold) and\n* calls `handleUp()` only for quick taps that passed the threshold check.\n*/\nvar TapRecognizer = class {\n\t#lastTapTime = 0;\n\t#tapTimer = null;\n\thandleUp(matches, event) {\n\t\tif (matches.resolve(\"doubletap\").length > 0) {\n\t\t\tconst now = Date.now();\n\t\t\tif (now - this.#lastTapTime < DOUBLETAP_WINDOW) {\n\t\t\t\tthis.#clearTimer();\n\t\t\t\tthis.#lastTapTime = 0;\n\t\t\t\tmatches.resolve(\"doubletap\")[0]?.onActivate(event);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.#lastTapTime = now;\n\t\t\tthis.#clearTimer();\n\t\t\tthis.#tapTimer = setTimeout(() => {\n\t\t\t\tthis.#tapTimer = null;\n\t\t\t\tthis.#lastTapTime = 0;\n\t\t\t\tmatches.resolve(\"tap\")[0]?.onActivate(event);\n\t\t\t}, DOUBLETAP_WINDOW);\n\t\t\treturn;\n\t\t}\n\t\tmatches.resolve(\"tap\")[0]?.onActivate(event);\n\t}\n\t#clearTimer() {\n\t\tif (this.#tapTimer !== null) {\n\t\t\tclearTimeout(this.#tapTimer);\n\t\t\tthis.#tapTimer = null;\n\t\t}\n\t}\n\treset() {\n\t\tthis.#clearTimer();\n\t\tthis.#lastTapTime = 0;\n\t}\n};\n//#endregion\nexport { TapRecognizer };\n\n//# sourceMappingURL=tap.js.map","import { getGestureCoordinator } from \"./coordinator.js\";\nimport { TapRecognizer } from \"./tap.js\";\n//#region src/dom/gesture/create-tap-gesture.ts\nconst recognizers = /* @__PURE__ */ new WeakMap();\nfunction getRecognizer(target) {\n\tlet recognizer = recognizers.get(target);\n\tif (recognizer) return recognizer;\n\trecognizer = new TapRecognizer();\n\trecognizers.set(target, recognizer);\n\treturn recognizer;\n}\n/**\n* Register a tap gesture on a target element.\n*\n* @example\n* ```ts\n* const cleanup = createTapGesture(container, (event) => {\n* store.paused ? store.play() : store.pause();\n* }, { pointer: 'mouse' });\n* ```\n*/\nfunction createTapGesture(target, onActivate, options) {\n\treturn getGestureCoordinator(target).add({\n\t\ttype: \"tap\",\n\t\trecognizer: getRecognizer(target),\n\t\tonActivate,\n\t\tpointer: options?.pointer,\n\t\tregion: options?.region,\n\t\tdisabled: options?.disabled,\n\t\taction: options?.action,\n\t\tvalue: options?.value\n\t});\n}\n/**\n* Register a doubletap gesture on a target element.\n*\n* @example\n* ```ts\n* const cleanup = createDoubleTapGesture(container, (event) => {\n* store.fullscreen ? store.exitFullscreen() : store.requestFullscreen();\n* }, { region: 'center' });\n* ```\n*/\nfunction createDoubleTapGesture(target, onActivate, options) {\n\treturn getGestureCoordinator(target).add({\n\t\ttype: \"doubletap\",\n\t\trecognizer: getRecognizer(target),\n\t\tonActivate,\n\t\tpointer: options?.pointer,\n\t\tregion: options?.region,\n\t\tdisabled: options?.disabled,\n\t\taction: options?.action,\n\t\tvalue: options?.value\n\t});\n}\n//#endregion\nexport { createDoubleTapGesture, createTapGesture };\n\n//# sourceMappingURL=create-tap-gesture.js.map","import {\n createDoubleTapGesture,\n createTapGesture,\n type GestureActionName,\n type GesturePointerType,\n type GestureRegion,\n resolveGestureAction,\n} from '@videojs/core/dom';\nimport type { PropertyDeclarationMap, PropertyValues } from '@videojs/element';\nimport { ContextConsumer } from '@videojs/element/context';\n\nimport { containerContext, playerContext } from '../../player/context';\nimport { PlayerController } from '../../player/player-controller';\nimport { MediaElement } from '../media-element';\n\nexport class GestureElement extends MediaElement {\n static readonly tagName = 'media-gesture';\n\n static override properties: PropertyDeclarationMap = {\n type: { type: String },\n action: { type: String },\n value: { type: Number },\n pointer: { type: String },\n region: { type: String },\n disabled: { type: Boolean },\n };\n\n type: 'tap' | 'doubletap' | (string & {}) = '';\n action: GestureActionName | (string & {}) = '';\n value: number | undefined = undefined;\n pointer: GesturePointerType | undefined = undefined;\n region: GestureRegion | undefined = undefined;\n disabled = false;\n\n readonly #player = new PlayerController(this, playerContext);\n readonly #container = new ContextConsumer(this, {\n context: containerContext,\n callback: () => this.requestUpdate(),\n subscribe: true,\n });\n #cleanup: (() => void) | null = null;\n\n override connectedCallback(): void {\n super.connectedCallback();\n this.style.display = 'none';\n this.#register();\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n this.#unregister();\n }\n\n protected override update(changed: PropertyValues): void {\n super.update(changed);\n\n // Re-register when attributes change.\n if (this.isConnected) {\n this.#unregister();\n this.#register();\n }\n }\n\n #register(): void {\n const store = this.#player.value;\n const container = this.#container.value?.container;\n if (!this.type || !this.action || !store || !container) return;\n\n const resolver = resolveGestureAction(this.action);\n if (!resolver) return;\n\n const { value } = this;\n\n const onActivate = (event: PointerEvent) => {\n resolver({ store, value, event });\n };\n\n const options = {\n pointer: this.pointer,\n region: this.region,\n disabled: this.disabled,\n action: this.action,\n value: this.value,\n };\n\n if (this.type === 'doubletap') {\n this.#cleanup = createDoubleTapGesture(container, onActivate, options);\n } else {\n this.#cleanup = createTapGesture(container, onActivate, options);\n }\n }\n\n #unregister(): void {\n this.#cleanup?.();\n this.#cleanup = null;\n }\n}\n"],"mappings":";;;;;;;;AAIA,MAAM,2BAA2B;CAChC,UAAU,6BAA6B;CACvC,YAAY,6BAA6B;CACzC,SAAS,6BAA6B;CACtC,WAAW,6BAA6B;AACzC;AACA,SAAS,qBAAqB,MAAM;CACnC,MAAM,WAAW,yBAAyB;CAC1C,IAAI,UAAU,OAAO;CACrB,QAAQ,EAAE,YAAY;EACrB,MAAM,SAAS,MAAM,MAAM;EAC3B,IAAI,WAAW,M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M;EACjD,IAAI,CAAC,UAAU;EAEf,MAAM,EAAE,UAAU;EAElB,MAAM,cAAc,UAAwB;GAC1C,SAAS;IAAE;IAAO;IAAO;GAAM,CAAC;EAClC;EAEA,MAAM,UAAU;GACd,SAAS,KAAK;GACd,QAAQ,KAAK;GACb,UAAU,KAAK;GACf,QAAQ,KAAK;GACb,OAAO,KAAK;EACd;EAEA,IAAI,KAAK,SAAS,aAChB,KAAKG,WAAW,uBAAuB,WAAW,YAAY,OAAO;OAErE,KAAKA,WAAW,iBAAiB,WAAW,YAAY,OAAO;CAEnE;CAEA,cAAoB;EAClB,KAAKA,WAAW;EAChB,KAAKA,WAAW;CAClB;AACF"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./predicate-LbFu-fPH.js";import{O as t}from"./compounds-BEO1d3ZM.js";import{S as n,n as r}from"./create-player-hSdQMP5p.js";import{n as i,t as a}from"./media-element-Cp5PrNre.js";import{r as o,t as s}from"./context-C2rsoDxk.js";const c={seekStep:t.seekStep,volumeStep:t.volumeStep,speedUp:t.speedUp,speedDown:t.speedDown};function l(t){return c[t]||(({store:n})=>{let r=n.state[t];e(r)&&r()})}var u=class{#e=0;#t=null;handleUp(e,t){if(e.resolve(`doubletap`).length>0){let n=Date.now();if(n-this.#e<200){this.#n(),this.#e=0,e.resolve(`doubletap`)[0]?.onActivate(t);return}this.#e=n,this.#n(),this.#t=setTimeout(()=>{this.#t=null,this.#e=0,e.resolve(`tap`)[0]?.onActivate(t)},200);return}e.resolve(`tap`)[0]?.onActivate(t)}#n(){this.#t!==null&&(clearTimeout(this.#t),this.#t=null)}reset(){this.#n(),this.#e=0}};const d=new WeakMap;function f(e){let t=d.get(e);return t||(t=new u,d.set(e,t),t)}function p(e,t,r){return n(e).add({type:`tap`,recognizer:f(e),onActivate:t,pointer:r?.pointer,region:r?.region,disabled:r?.disabled,action:r?.action,value:r?.value})}function m(e,t,r){return n(e).add({type:`doubletap`,recognizer:f(e),onActivate:t,pointer:r?.pointer,region:r?.region,disabled:r?.disabled,action:r?.action,value:r?.value})}var h=class extends a{constructor(...e){super(...e),this.type=``,this.action=``,this.value=void 0,this.pointer=void 0,this.region=void 0,this.disabled=!1,this.#e=new r(this,o),this.#t=new i(this,{context:s,callback:()=>this.requestUpdate(),subscribe:!0}),this.#n=null}static{this.tagName=`media-gesture`}static{this.properties={type:{type:String},action:{type:String},value:{type:Number},pointer:{type:String},region:{type:String},disabled:{type:Boolean}}}#e;#t;#n;connectedCallback(){super.connectedCallback(),this.style.display=`none`,this.#r()}disconnectedCallback(){super.disconnectedCallback(),this.#i()}update(e){super.update(e),this.isConnected&&(this.#i(),this.#r())}#r(){let e=this.#e.value,t=this.#t.value?.container;if(!this.type||!this.action||!e||!t)return;let n=l(this.action);if(!n)return;let{value:r}=this,i=t=>{n({store:e,value:r,event:t})},a={pointer:this.pointer,region:this.region,disabled:this.disabled,action:this.action,value:this.value};this.type===`doubletap`?this.#n=m(t,i,a):this.#n=p(t,i,a)}#i(){this.#n?.(),this.#n=null}};export{h as t};
|
|
2
|
-
//# sourceMappingURL=gesture-element-BC48ucj9.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gesture-element-BC48ucj9.js","names":["#lastTapTime","#clearTimer","#tapTimer","ContextConsumer","#player","#container","#register","#unregister","#cleanup"],"sources":["../../core/dist/default/dom/gesture/actions.js","../../core/dist/default/dom/gesture/tap.js","../../core/dist/default/dom/gesture/create-tap-gesture.js","../src/ui/gesture/gesture-element.ts"],"sourcesContent":["import { MEDIA_INPUT_ACTION_OVERRIDES } from \"../media-actions.js\";\nimport { isFunction } from \"@videojs/utils/predicate\";\n//#region src/dom/gesture/actions.ts\n/** Actions that need custom logic beyond `store.state[action]()`. */\nconst GESTURE_ACTION_OVERRIDES = {\n\tseekStep: MEDIA_INPUT_ACTION_OVERRIDES.seekStep,\n\tvolumeStep: MEDIA_INPUT_ACTION_OVERRIDES.volumeStep,\n\tspeedUp: MEDIA_INPUT_ACTION_OVERRIDES.speedUp,\n\tspeedDown: MEDIA_INPUT_ACTION_OVERRIDES.speedDown\n};\nfunction resolveGestureAction(name) {\n\tconst override = GESTURE_ACTION_OVERRIDES[name];\n\tif (override) return override;\n\treturn ({ store }) => {\n\t\tconst method = store.state[name];\n\t\tif (isFunction(method)) method();\n\t};\n}\n//#endregion\nexport { resolveGestureAction };\n\n//# sourceMappingURL=actions.js.map","//#region src/dom/gesture/tap.ts\nconst DOUBLETAP_WINDOW = 200;\n/**\n* Recognizes tap vs doubletap from quick pointer-up events.\n*\n* Stateful recognizer — tracks tap count and doubletap timing.\n* The coordinator handles pointer-down timing (tap threshold) and\n* calls `handleUp()` only for quick taps that passed the threshold check.\n*/\nvar TapRecognizer = class {\n\t#lastTapTime = 0;\n\t#tapTimer = null;\n\thandleUp(matches, event) {\n\t\tif (matches.resolve(\"doubletap\").length > 0) {\n\t\t\tconst now = Date.now();\n\t\t\tif (now - this.#lastTapTime < DOUBLETAP_WINDOW) {\n\t\t\t\tthis.#clearTimer();\n\t\t\t\tthis.#lastTapTime = 0;\n\t\t\t\tmatches.resolve(\"doubletap\")[0]?.onActivate(event);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.#lastTapTime = now;\n\t\t\tthis.#clearTimer();\n\t\t\tthis.#tapTimer = setTimeout(() => {\n\t\t\t\tthis.#tapTimer = null;\n\t\t\t\tthis.#lastTapTime = 0;\n\t\t\t\tmatches.resolve(\"tap\")[0]?.onActivate(event);\n\t\t\t}, DOUBLETAP_WINDOW);\n\t\t\treturn;\n\t\t}\n\t\tmatches.resolve(\"tap\")[0]?.onActivate(event);\n\t}\n\t#clearTimer() {\n\t\tif (this.#tapTimer !== null) {\n\t\t\tclearTimeout(this.#tapTimer);\n\t\t\tthis.#tapTimer = null;\n\t\t}\n\t}\n\treset() {\n\t\tthis.#clearTimer();\n\t\tthis.#lastTapTime = 0;\n\t}\n};\n//#endregion\nexport { TapRecognizer };\n\n//# sourceMappingURL=tap.js.map","import { getGestureCoordinator } from \"./coordinator.js\";\nimport { TapRecognizer } from \"./tap.js\";\n//#region src/dom/gesture/create-tap-gesture.ts\nconst recognizers = /* @__PURE__ */ new WeakMap();\nfunction getRecognizer(target) {\n\tlet recognizer = recognizers.get(target);\n\tif (recognizer) return recognizer;\n\trecognizer = new TapRecognizer();\n\trecognizers.set(target, recognizer);\n\treturn recognizer;\n}\n/**\n* Register a tap gesture on a target element.\n*\n* @example\n* ```ts\n* const cleanup = createTapGesture(container, (event) => {\n* store.paused ? store.play() : store.pause();\n* }, { pointer: 'mouse' });\n* ```\n*/\nfunction createTapGesture(target, onActivate, options) {\n\treturn getGestureCoordinator(target).add({\n\t\ttype: \"tap\",\n\t\trecognizer: getRecognizer(target),\n\t\tonActivate,\n\t\tpointer: options?.pointer,\n\t\tregion: options?.region,\n\t\tdisabled: options?.disabled,\n\t\taction: options?.action,\n\t\tvalue: options?.value\n\t});\n}\n/**\n* Register a doubletap gesture on a target element.\n*\n* @example\n* ```ts\n* const cleanup = createDoubleTapGesture(container, (event) => {\n* store.fullscreen ? store.exitFullscreen() : store.requestFullscreen();\n* }, { region: 'center' });\n* ```\n*/\nfunction createDoubleTapGesture(target, onActivate, options) {\n\treturn getGestureCoordinator(target).add({\n\t\ttype: \"doubletap\",\n\t\trecognizer: getRecognizer(target),\n\t\tonActivate,\n\t\tpointer: options?.pointer,\n\t\tregion: options?.region,\n\t\tdisabled: options?.disabled,\n\t\taction: options?.action,\n\t\tvalue: options?.value\n\t});\n}\n//#endregion\nexport { createDoubleTapGesture, createTapGesture };\n\n//# sourceMappingURL=create-tap-gesture.js.map","import {\n createDoubleTapGesture,\n createTapGesture,\n type GestureActionName,\n type GesturePointerType,\n type GestureRegion,\n resolveGestureAction,\n} from '@videojs/core/dom';\nimport type { PropertyDeclarationMap, PropertyValues } from '@videojs/element';\nimport { ContextConsumer } from '@videojs/element/context';\n\nimport { containerContext, playerContext } from '../../player/context';\nimport { PlayerController } from '../../player/player-controller';\nimport { MediaElement } from '../media-element';\n\nexport class GestureElement extends MediaElement {\n static readonly tagName = 'media-gesture';\n\n static override properties: PropertyDeclarationMap = {\n type: { type: String },\n action: { type: String },\n value: { type: Number },\n pointer: { type: String },\n region: { type: String },\n disabled: { type: Boolean },\n };\n\n type: 'tap' | 'doubletap' | (string & {}) = '';\n action: GestureActionName | (string & {}) = '';\n value: number | undefined = undefined;\n pointer: GesturePointerType | undefined = undefined;\n region: GestureRegion | undefined = undefined;\n disabled = false;\n\n readonly #player = new PlayerController(this, playerContext);\n readonly #container = new ContextConsumer(this, {\n context: containerContext,\n callback: () => this.requestUpdate(),\n subscribe: true,\n });\n #cleanup: (() => void) | null = null;\n\n override connectedCallback(): void {\n super.connectedCallback();\n this.style.display = 'none';\n this.#register();\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n this.#unregister();\n }\n\n protected override update(changed: PropertyValues): void {\n super.update(changed);\n\n // Re-register when attributes change.\n if (this.isConnected) {\n this.#unregister();\n this.#register();\n }\n }\n\n #register(): void {\n const store = this.#player.value;\n const container = this.#container.value?.container;\n if (!this.type || !this.action || !store || !container) return;\n\n const resolver = resolveGestureAction(this.action);\n if (!resolver) return;\n\n const { value } = this;\n\n const onActivate = (event: PointerEvent) => {\n resolver({ store, value, event });\n };\n\n const options = {\n pointer: this.pointer,\n region: this.region,\n disabled: this.disabled,\n action: this.action,\n value: this.value,\n };\n\n if (this.type === 'doubletap') {\n this.#cleanup = createDoubleTapGesture(container, onActivate, options);\n } else {\n this.#cleanup = createTapGesture(container, onActivate, options);\n }\n }\n\n #unregister(): void {\n this.#cleanup?.();\n this.#cleanup = null;\n }\n}\n"],"mappings":"uPAIA,MAAM,EAA2B,CAChC,SAAU,EAA6B,SACvC,WAAY,EAA6B,WACzC,QAAS,EAA6B,QACtC,UAAW,EAA6B,SACzC,EACA,SAAS,EAAqB,EAAM,CAGnC,OAFiB,EAAyB,MAElC,CAAE,WAAY,CACrB,IAAM,EAAS,EAAM,MAAM,GAC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AS,CAAE,QAAO,QAAO,OAAM,CAAC,CAClC,EAEM,EAAU,CACd,QAAS,KAAK,QACd,OAAQ,KAAK,OACb,SAAU,KAAK,SACf,OAAQ,KAAK,OACb,MAAO,KAAK,KACd,EAEI,KAAK,OAAS,YAChB,KAAKG,GAAW,EAAuB,EAAW,EAAY,CAAO,EAErE,KAAKA,GAAW,EAAiB,EAAW,EAAY,CAAO,CAEnE,CAEA,IAAoB,CAClB,KAAKA,KAAW,EAChB,KAAKA,GAAW,IAClB,CACF"}
|
package/cdn/i18n-Dc7WM2xd.js
DELETED
package/cdn/media-BTipOcKo.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{$ as e,A as t,C as n,D as r,I as i,L as a,N as o,Q as s,at as c,f as l,j as u,k as d,m as f,p,s as m,u as h}from"./select-tracks-xV1s28xD.js";import{t as g}from"./media-host-CDZTAfUz.js";import{D as _,S as v,T as y,_ as b,b as x,d as S,g as C,h as w,l as T,m as E,n as D,o as O,r as k,s as A,t as j,v as M,w as N,x as P,y as F}from"./error-surface-DCT1m2p1.js";const I=s([`userAudioTrackSelection`,`disableRemotePlayback`]);function L(s={}){let c=s.deriveStartMediaTime??P,g={...s,deriveStartMediaTime:c,attachMediaSource:o,canPlayTrack:s.canPlayTrack??x,reportUnsupportedTrackConditions:s.reportUnsupportedTrackConditions??A,resolveDuration:s.resolveDuration??t,parsePresentation:s.parsePresentation??u,audioMessagePipelines:T(`audio`,c)};return e([E,N,h,F,w,r,S,m,d,p,l,v,f,M,i,b,a,n,C,I],{config:g})}const R={src:``,preload:``,disableRemotePlayback:!1},z=new Set([y]);function B(e){class t extends e{static get alternativeMediaSuggestion(){}#e;#t;#n;#r=R.preload;#i=R.disableRemotePlayback;#a=null;#o=null;#s;#c=null;constructor(...e){super(...e);let{config:t}=e?.[0]??{};this.#t=t,this.#e=this.#d(),this.#s=c(()=>{let e=this.#n.state.errors.get();this.#l(j(e,z),e)})}get error(){return this.#a}#l(e,t){if(!e){this.#a=null,this.#o=null;return}if(this.#o===e.code)return;this.#o=e.code;let n=D(t);n&&console.error(this.#u(O),{conditions:t}),this.#a={code:n?_:e.code,message:e.message??``,...e.data===void 0?{}:{data:e.data}},this.dispatchEvent?.(new Event(`error`))}get engine(){return this.#e}attach(e){super.attach?.(e),this.#n.context.mediaElement.set(e)}detach(){this.#f(),this.#n.context.mediaElement.set(void 0),super.detach?.()}destroy(){this.#f(),this.#s(),this.#e.destroy()}get preload(){return this.#r}set preload(e){this.#r=e,e&&this.#n.state.preload.set(e)}get disableRemotePlayback(){return this.#i}set disableRemotePlayback(e){this.#i=e,this.#n.state.disableRemotePlayback.set(e)}get src(){return this.#n.state.presentation.get()?.url??``}set src(e){e!==this.src&&(this.#f(),this.#n.state.presentation.set(e?{url:e}:void 0))}play(){let e=this.#n.context.mediaElement.get();return e?(this.#n.state.loadActivated.set(!0),e.play().catch(t=>{if(this.src)return new Promise((t,n)=>{let r=()=>{this.#c=null,e.play().then(t,n)};this.#c=r,e.addEventListener(`loadstart`,r,{once:!0})});throw t})):Promise.reject(Error(`HlsAudioMediaElement: no media element attached`))}#u(e){return k(e,this)}#d(){return L({...this.#t,onSignalsReady:e=>{this.#n=e}})}#f(){this.#c&&=(this.#n.context.mediaElement.get()?.removeEventListener(`loadstart`,this.#c),null)}}return t}const V=B(class extends g{});var H=class extends V{};export{H as t};
|
|
2
|
-
//# sourceMappingURL=media-BTipOcKo.js.map
|
package/cdn/media-Bmablv4g.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./media-CanBm0Jh.js";import{a as t,i as n,n as r,o as i,r as a,s as o,t as s}from"./source-BjtVLlkW.js";function c(e){if(!e?.playbackId)return;let{playbackId:t,customDomain:n=s,drm:r}=e,{token:i}=r??{};if(!i||o(i)?.aud!==`d`)return;let c=a({token:i}),l=e=>`https://license.${n}/${e}/${t}${c}`;return{"com.apple.fps":{licenseUrl:l(`license/fairplay`),serverCertificateUrl:l(`appcert/fairplay`)},"com.widevine.alpha":{licenseUrl:l(`license/widevine`)},"com.microsoft.playready":{licenseUrl:l(`license/playready`)}}}const l={src:``,source:null};var u=class extends e{#e=l.source;get src(){return super.src}set src(e){if(super.src===e)return;let{type:t,preferPlayback:n,engine:r,maxAutoResolution:a,capRenditionToPlayerSize:o,minAutoResolution:s}=this.#e??{},c={...t&&{type:t},...n&&{preferPlayback:n},...r&&{engine:r},...a&&{maxAutoResolution:a},...o!==void 0&&{capRenditionToPlayerSize:o},...s&&{minAutoResolution:s},...i(e)??(e?{src:e}:null)};this.source=Object.keys(c).length>0?c:null}get source(){return this.#e}set source(e){let n=e??null;n!==this.#e&&(this.#e=n,super.source=n&&{...n,src:t(n)??n.src??``,...d(n)})}get contentData(){let e=r(this.source),t=n(this.source);return{...e&&{poster:e},...t&&{storyboard:t}}}};function d(e){let{token:t,...n}=e.drm??{},r={...c(e),...n};return{drm:Object.keys(r).length>0?r:void 0}}export{u as t};
|
|
2
|
-
//# sourceMappingURL=media-Bmablv4g.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"media-Bmablv4g.js","names":["#source"],"sources":["../../media/dist/default/dom/mux/drm.js","../../media/dist/default/dom/mux/media.js"],"sourcesContent":["import { MUX_VIDEO_DOMAIN, createMuxQuery } from \"./source/source.js\";\nimport { parseJwt } from \"@videojs/utils/jwt\";\n//#region src/dom/mux/drm.ts\n/**\n* Build the license servers a source describes, keyed by EME key system id —\n* `source.drm` as any other source would name it. Mux signs one license token\n* per playback ID and serves every system from a URL derived from it, so\n* `drm.token` is all a caller provides.\n*\n* Returns `undefined` when no license token is present, or when the token is\n* not scoped to DRM — an unsigned license request is always rejected, so there\n* is nothing useful to configure.\n*\n* Separate from `./source` because it is the one part of the Mux source an\n* engine that licenses differently — or, like SPF today, doesn't license at\n* all — has nothing to do with.\n*\n* @internal\n*/\nfunction createMuxDrmSystems(source) {\n\tif (!source?.playbackId) return void 0;\n\tconst { playbackId, customDomain = MUX_VIDEO_DOMAIN, drm } = source;\n\tconst { token } = drm ?? {};\n\tif (!token || parseJwt(token)?.aud !== \"d\") return void 0;\n\tconst query = createMuxQuery({ token });\n\tconst url = (path) => `https://license.${customDomain}/${path}/${playbackId}${query}`;\n\treturn {\n\t\t\"com.apple.fps\": {\n\t\t\tlicenseUrl: url(\"license/fairplay\"),\n\t\t\tserverCertificateUrl: url(\"appcert/fairplay\")\n\t\t},\n\t\t\"com.widevine.alpha\": { licenseUrl: url(\"license/widevine\") },\n\t\t\"com.microsoft.playready\": { licenseUrl: url(\"license/playready\") }\n\t};\n}\n//#endregion\nexport { createMuxDrmSystems };\n\n//# sourceMappingURL=drm.js.map","import { HlsJsMedia } from \"../hls-js/media.js\";\nimport { createMuxPosterURL, createMuxStoryboardURL, createMuxVideoURL, parseMuxVideoURL } from \"./source/source.js\";\nimport { createMuxDrmSystems } from \"./drm.js\";\n//#region src/dom/mux/media.ts\nconst muxMediaDefaultProps = {\n\tsrc: \"\",\n\tsource: null\n};\n/**\n* @fires sourcechange - Fired when `source` changes, either directly or by parsing a new `src`. Read `source` for the new value.\n*/\nvar MuxMedia = class extends HlsJsMedia {\n\t#source = muxMediaDefaultProps.source;\n\t/**\n\t* Media source URL. Setting a Mux stream URL\n\t* (`https://stream.mux.com/<playback-id>.m3u8?...`) extracts the playback ID\n\t* and query params into `source`; other URLs are kept as a plain `source.src`.\n\t*\n\t* Only playback options carry over. Mux identity comes from the URL, and the\n\t* signed `poster`, `storyboard`, and `drm` tokens are scoped to a playback ID,\n\t* so carrying them onto a different source would build rejected URLs.\n\t*/\n\tget src() {\n\t\treturn super.src;\n\t}\n\tset src(value) {\n\t\tif (super.src === value) return;\n\t\tconst { type, preferPlayback, engine, maxAutoResolution, capRenditionToPlayerSize, minAutoResolution } = this.#source ?? {};\n\t\tconst source = {\n\t\t\t...type && { type },\n\t\t\t...preferPlayback && { preferPlayback },\n\t\t\t...engine && { engine },\n\t\t\t...maxAutoResolution && { maxAutoResolution },\n\t\t\t...capRenditionToPlayerSize !== void 0 && { capRenditionToPlayerSize },\n\t\t\t...minAutoResolution && { minAutoResolution },\n\t\t\t...parseMuxVideoURL(value) ?? (value ? { src: value } : null)\n\t\t};\n\t\tthis.source = Object.keys(source).length > 0 ? source : null;\n\t}\n\t/**\n\t* Structured Mux source. Setting it derives `src` from the playback ID,\n\t* custom domain, and `playback` params (appended as `snake_case` query\n\t* params). A `playback.token` replaces all other params — signed URLs bake\n\t* them into the token. Engine options live under `engine`.\n\t*\n\t* A `drm.token` fills in `drm` itself: Mux's FairPlay, Widevine, and\n\t* PlayReady license servers for this playback ID, so protected media plays\n\t* whichever path the browser takes. License servers named alongside the token\n\t* win, key by key, for content Mux does not license.\n\t*\n\t* `playback.maxResolution` and `playback.minResolution` are server-side: they\n\t* decide which renditions Mux puts in the manifest at all. The inherited\n\t* `maxAutoResolution` and `minAutoResolution` only look like their pair —\n\t* those are client-side and bound which of the renditions that *do* arrive\n\t* adaptive selection reaches for. The two halves are independent.\n\t*/\n\tget source() {\n\t\treturn this.#source;\n\t}\n\tset source(value) {\n\t\tconst source = value ?? null;\n\t\tif (source === this.#source) return;\n\t\tthis.#source = source;\n\t\tsuper.source = source && {\n\t\t\t...source,\n\t\t\tsrc: createMuxVideoURL(source) ?? source.src ?? \"\",\n\t\t\t...withMuxDrm(source)\n\t\t};\n\t}\n\t/**\n\t* Image URLs `source` describes rather than plays: `poster` from its `poster`\n\t* params, `storyboard` from its `storyboard` params. A key is absent when the\n\t* URL can't be built — no playback ID, or signed playback without a matching\n\t* image token.\n\t*\n\t* Read-only and re-derived on read, so read it again after `sourcechange`.\n\t* Nothing here is applied for you, apart from the thumbnail track\n\t* `<mux-video>` adds from `storyboard` (and drops for live streams).\n\t*/\n\tget contentData() {\n\t\tconst poster = createMuxPosterURL(this.source);\n\t\tconst storyboard = createMuxStoryboardURL(this.source);\n\t\treturn {\n\t\t\t...poster && { poster },\n\t\t\t...storyboard && { storyboard }\n\t\t};\n\t}\n};\n/**\n* Resolve Mux's DRM authoring input into the license servers the HLS layer\n* licenses from. Which engine ends up playing is decided later, and both read\n* `drm`, so a signed Mux source plays either way.\n*\n* `token` is Mux's own input and stops here — it names no license server, and a\n* key system is what everything downstream expects to find. Servers the caller\n* named win, key by key, so their own licensing replaces the derived URLs.\n*/\nfunction withMuxDrm(source) {\n\tconst { token: _token, ...systems } = source.drm ?? {};\n\tconst drm = {\n\t\t...createMuxDrmSystems(source),\n\t\t...systems\n\t};\n\treturn { drm: Object.keys(drm).length > 0 ? drm : void 0 };\n}\n//#endregion\nexport { MuxMedia, muxMediaDefaultProps };\n\n//# sourceMappingURL=media.js.map"],"mappings":"2HAmBA,SAAS,EAAoB,EAAQ,CACpC,GAAI,CAAC,GAAQ,WAAY,OACzB,GAAM,CAAE,aAAY,eAAe,EAAkB,OAAQ,EACvD,CAAE,SAAU,GAAO,CAAC,EAC1B,GAAI,CAAC,GAAS,EAAS,CAAK,CAAC,EAAE,MAAQ,IAAK,OAC5C,IAAM,EAAQ,EAAe,CAAE,OAAM,CAAC,EAChC,EAAO,GAAS,mBAAmB,EAAa,GAAG,EAAK,GAAG,IAAa,IAC9E,MAAO,CACN,gBAAiB,CAChB,WAAY,EAAI,kBAAkB,EAClC,qBAAsB,EAAI,kBAAkB,CAC7C,EACA,qBAAsB,CAAE,WAAY,EAAI,kBAAkB,CAAE,EAC5D,0BAA2B,CAAE,WAAY,EAAI,mBAAmB,CAAE,CACnE,CACD,CC9BA,MAAM,EAAuB,CAC5B,IAAK,GACL,OAAQ,IACT,EAIA,IAAI,EAAW,cAAc,CAAW,CACvC,GAAU,EAAqB,OAU/B,IAAI,KAAM,CACT,OAAO,MAAM,GACd,CACA,IAAI,IAAI,EAAO,CACd,GAAI,MAAM,MAAQ,EAAO,OACzB,GAAM,CAAE,OAAM,iBAAgB,SAAQ,oBAAmB,2BAA0B,qBAAsB,KAAKA,IAAW,CAAC,EACpH,EAAS,CACd,GAAG,GAAQ,CAAE,MAAK,EAClB,GAAG,GAAkB,CAAE,gBAAe,EACtC,GAAG,GAAU,CAAE,QAAO,EACtB,GAAG,GAAqB,CAAE,mBAAkB,EAC5C,GAAG,IAA6B,IAAK,IAAK,CAAE,0BAAyB,EACrE,GAAG,GAAqB,CAAE,mBAAkB,EAC5C,GAAG,EAAiB,CAAK,IAAM,EAAQ,CAAE,IAAK,CAAM,EAAI,KACzD,EACA,KAAK,OAAS,OAAO,KAAK,CAAM,CAAC,CAAC,OAAS,EAAI,EAAS,IACzD,CAkBA,IAAI,QAAS,CACZ,OAAO,KAAKA,EACb,CACA,IAAI,OAAO,EAAO,CACjB,IAAM,EAAS,GAAS,KACpB,IAAW,KAAKA,KACpB,KAAKA,GAAU,EACf,MAAM,OAAS,GAAU,CACxB,GAAG,EACH,IAAK,EAAkB,CAAM,GAAK,EAAO,KAAO,GAChD,GAAG,EAAW,CAAM,CACrB,EACD,CAWA,IAAI,aAAc,CACjB,IAAM,EAAS,EAAmB,KAAK,MAAM,EACvC,EAAa,EAAuB,KAAK,MAAM,EACrD,MAAO,CACN,GAAG,GAAU,CAAE,QAAO,EACtB,GAAG,GAAc,CAAE,YAAW,CAC/B,CACD,CACD,EAUA,SAAS,EAAW,EAAQ,CAC3B,GAAM,CAAE,MAAO,EAAQ,GAAG,GAAY,EAAO,KAAO,CAAC,EAC/C,EAAM,CACX,GAAG,EAAoB,CAAM,EAC7B,GAAG,CACJ,EACA,MAAO,CAAE,IAAK,OAAO,KAAK,CAAG,CAAC,CAAC,OAAS,EAAI,EAAM,IAAK,EAAE,CAC1D"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"media-COIe3uI5.js","names":["#source"],"sources":["../../media/dist/dev/dom/mux/drm.js","../../media/dist/dev/dom/mux/media.js"],"sourcesContent":["import { MUX_VIDEO_DOMAIN, createMuxQuery } from \"./source/source.js\";\nimport { parseJwt } from \"@videojs/utils/jwt\";\n//#region src/dom/mux/drm.ts\n/**\n* Build the license servers a source describes, keyed by EME key system id —\n* `source.drm` as any other source would name it. Mux signs one license token\n* per playback ID and serves every system from a URL derived from it, so\n* `drm.token` is all a caller provides.\n*\n* Returns `undefined` when no license token is present, or when the token is\n* not scoped to DRM — an unsigned license request is always rejected, so there\n* is nothing useful to configure.\n*\n* Separate from `./source` because it is the one part of the Mux source an\n* engine that licenses differently — or, like SPF today, doesn't license at\n* all — has nothing to do with.\n*\n* @internal\n*/\nfunction createMuxDrmSystems(source) {\n\tif (!source?.playbackId) return void 0;\n\tconst { playbackId, customDomain = MUX_VIDEO_DOMAIN, drm } = source;\n\tconst { token } = drm ?? {};\n\tif (!token || parseJwt(token)?.aud !== \"d\") return void 0;\n\tconst query = createMuxQuery({ token });\n\tconst url = (path) => `https://license.${customDomain}/${path}/${playbackId}${query}`;\n\treturn {\n\t\t\"com.apple.fps\": {\n\t\t\tlicenseUrl: url(\"license/fairplay\"),\n\t\t\tserverCertificateUrl: url(\"appcert/fairplay\")\n\t\t},\n\t\t\"com.widevine.alpha\": { licenseUrl: url(\"license/widevine\") },\n\t\t\"com.microsoft.playready\": { licenseUrl: url(\"license/playready\") }\n\t};\n}\n//#endregion\nexport { createMuxDrmSystems };\n\n//# sourceMappingURL=drm.js.map","import { HlsJsMedia } from \"../hls-js/media.js\";\nimport { createMuxPosterURL, createMuxStoryboardURL, createMuxVideoURL, parseMuxVideoURL } from \"./source/source.js\";\nimport { createMuxDrmSystems } from \"./drm.js\";\n//#region src/dom/mux/media.ts\nconst muxMediaDefaultProps = {\n\tsrc: \"\",\n\tsource: null\n};\n/**\n* @fires sourcechange - Fired when `source` changes, either directly or by parsing a new `src`. Read `source` for the new value.\n*/\nvar MuxMedia = class extends HlsJsMedia {\n\t#source = muxMediaDefaultProps.source;\n\t/**\n\t* Media source URL. Setting a Mux stream URL\n\t* (`https://stream.mux.com/<playback-id>.m3u8?...`) extracts the playback ID\n\t* and query params into `source`; other URLs are kept as a plain `source.src`.\n\t*\n\t* Only playback options carry over. Mux identity comes from the URL, and the\n\t* signed `poster`, `storyboard`, and `drm` tokens are scoped to a playback ID,\n\t* so carrying them onto a different source would build rejected URLs.\n\t*/\n\tget src() {\n\t\treturn super.src;\n\t}\n\tset src(value) {\n\t\tif (super.src === value) return;\n\t\tconst { type, preferPlayback, engine, maxAutoResolution, capRenditionToPlayerSize, minAutoResolution } = this.#source ?? {};\n\t\tconst source = {\n\t\t\t...type && { type },\n\t\t\t...preferPlayback && { preferPlayback },\n\t\t\t...engine && { engine },\n\t\t\t...maxAutoResolution && { maxAutoResolution },\n\t\t\t...capRenditionToPlayerSize !== void 0 && { capRenditionToPlayerSize },\n\t\t\t...minAutoResolution && { minAutoResolution },\n\t\t\t...parseMuxVideoURL(value) ?? (value ? { src: value } : null)\n\t\t};\n\t\tthis.source = Object.keys(source).length > 0 ? source : null;\n\t}\n\t/**\n\t* Structured Mux source. Setting it derives `src` from the playback ID,\n\t* custom domain, and `playback` params (appended as `snake_case` query\n\t* params). A `playback.token` replaces all other params — signed URLs bake\n\t* them into the token. Engine options live under `engine`.\n\t*\n\t* A `drm.token` fills in `drm` itself: Mux's FairPlay, Widevine, and\n\t* PlayReady license servers for this playback ID, so protected media plays\n\t* whichever path the browser takes. License servers named alongside the token\n\t* win, key by key, for content Mux does not license.\n\t*\n\t* `playback.maxResolution` and `playback.minResolution` are server-side: they\n\t* decide which renditions Mux puts in the manifest at all. The inherited\n\t* `maxAutoResolution` and `minAutoResolution` only look like their pair —\n\t* those are client-side and bound which of the renditions that *do* arrive\n\t* adaptive selection reaches for. The two halves are independent.\n\t*/\n\tget source() {\n\t\treturn this.#source;\n\t}\n\tset source(value) {\n\t\tconst source = value ?? null;\n\t\tif (source === this.#source) return;\n\t\tthis.#source = source;\n\t\tsuper.source = source && {\n\t\t\t...source,\n\t\t\tsrc: createMuxVideoURL(source) ?? source.src ?? \"\",\n\t\t\t...withMuxDrm(source)\n\t\t};\n\t}\n\t/**\n\t* Image URLs `source` describes rather than plays: `poster` from its `poster`\n\t* params, `storyboard` from its `storyboard` params. A key is absent when the\n\t* URL can't be built — no playback ID, or signed playback without a matching\n\t* image token.\n\t*\n\t* Read-only and re-derived on read, so read it again after `sourcechange`.\n\t* Nothing here is applied for you, apart from the thumbnail track\n\t* `<mux-video>` adds from `storyboard` (and drops for live streams).\n\t*/\n\tget contentData() {\n\t\tconst poster = createMuxPosterURL(this.source);\n\t\tconst storyboard = createMuxStoryboardURL(this.source);\n\t\treturn {\n\t\t\t...poster && { poster },\n\t\t\t...storyboard && { storyboard }\n\t\t};\n\t}\n};\n/**\n* Resolve Mux's DRM authoring input into the license servers the HLS layer\n* licenses from. Which engine ends up playing is decided later, and both read\n* `drm`, so a signed Mux source plays either way.\n*\n* `token` is Mux's own input and stops here — it names no license server, and a\n* key system is what everything downstream expects to find. Servers the caller\n* named win, key by key, so their own licensing replaces the derived URLs.\n*/\nfunction withMuxDrm(source) {\n\tconst { token: _token, ...systems } = source.drm ?? {};\n\tconst drm = {\n\t\t...createMuxDrmSystems(source),\n\t\t...systems\n\t};\n\treturn { drm: Object.keys(drm).length > 0 ? drm : void 0 };\n}\n//#endregion\nexport { MuxMedia, muxMediaDefaultProps };\n\n//# sourceMappingURL=media.js.map"],"mappings":";;;;;;;;;;;;;;;;;;;;AAmBA,SAAS,oBAAoB,QAAQ;CACpC,IAAI,CAAC,QAAQ,YAAY,OAAO,KAAK;CACrC,MAAM,EAAE,YAAY,eAAe,kBAAkB,QAAQ;CAC7D,MAAM,EAAE,UAAU,OAAO,CAAC;CAC1B,IAAI,CAAC,SAAS,SAAS,KAAK,CAAC,EAAE,QAAQ,KAAK,OAAO,KAAK;CACxD,MAAM,QAAQ,eAAe,EAAE,MAAM,CAAC;CACtC,MAAM,OAAO,SAAS,mBAAmB,aAAa,GAAG,KAAK,GAAG,aAAa;CAC9E,OAAO;EACN,iBAAiB;GAChB,YAAY,IAAI,kBAAkB;GAClC,sBAAsB,IAAI,kBAAkB;EAC7C;EACA,sBAAsB,EAAE,YAAY,IAAI,kBAAkB,EAAE;EAC5D,2BAA2B,EA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EAAE,OAAO,QAAQ,GAAG,YAAY,OAAO,OAAO,CAAC;CACrD,MAAM,MAAM;EACX,GAAG,oBAAoB,MAAM;EAC7B,GAAG;CACJ;CACA,OAAO,EAAE,KAAK,OAAO,KAAK,GAAG,CAAC,CAAC,SAAS,IAAI,MAAM,KAAK,EAAE;AAC1D"}
|
package/cdn/media-CPVSKLdk.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./listen-4VrUltMW.js";import{n as t}from"./text-track-CG8USvNG.js";import{$ as n,A as r,C as i,D as a,G as o,H as s,I as c,J as l,K as u,L as d,N as f,Q as p,R as ee,U as m,W as te,X as h,Y as g,Z as ne,at as _,b as re,c as ie,et as ae,f as oe,h as se,it as ce,j as le,k as ue,l as de,m as fe,nt as v,p as pe,q as y,rt as b,s as me,tt as x,u as he,v as ge,y as _e,z as ve}from"./select-tracks-xV1s28xD.js";import{t as S}from"./types-CtRpsVFF.js";import{t as ye}from"./mixin-BqN0V06a.js";import{t as be}from"./video-host-DIjP224l.js";import{C as xe,D as Se,E as Ce,S as we,T as C,_ as w,a as T,b as E,c as D,d as O,f as k,g as Te,h as Ee,i as De,l as A,m as Oe,n as ke,o as Ae,p as je,r as Me,s as Ne,t as Pe,u as Fe,v as Ie,w as Le,x as Re,y as ze}from"./error-surface-DCT1m2p1.js";function Be(e,t){return new Promise((n,r)=>{if(t?.aborted){r(t.reason);return}let i=()=>{clearTimeout(a),r(t?.reason)},a=setTimeout(()=>{t?.removeEventListener(`abort`,i),n()},e);t?.addEventListener(`abort`,i,{once:!0})})}function j(e){return`${y(e)?.mediaSequence??0}:${e.segments.length}`}function M(e){return y(e)?.targetDuration||6}function Ve(e,t){if(Number.isFinite(e.duration))return null;let n=M(e);return(!t||j(e)!==j(t)?n:n/2)*1e3}function He(e){return y(e)?.holdBack??3*M(e)}function N(e,t){if(!l(e)||!t)return 0;let n=s(e,t);return n&&g(n)?He(n):0}function P(e,t){if(!l(e)||!t)return null;let n=s(e,t);if(!n||!g(n)||n.segments.length===0||Number.isFinite(n.duration))return null;let{segments:r}=n,i=r[r.length-1];return{start:r[0].startTime,end:i.startTime+i.duration}}function F(e){return e.selectedVideoTrackId?.get()??e.selectedAudioTrackId?.get()}function I(e,t,n){if(!e||t===void 0)return null;let r=P(e,t);if(r)return r;for(let t of m(e,n)){let n=P(e,t.id);if(n)return n}return null}function L(e){let t=e.presentation.get(),n=I(t,e.selectedVideoTrackId?.get(),`video`),r=I(t,e.selectedAudioTrackId?.get(),`audio`);if(n&&r){let e=Math.max(n.start,r.start),t=Math.min(n.end,r.end);return e<t?{start:e,end:t}:null}return n??r}function R({state:e,config:t}){let n=L(e);if(!n)return null;let r=t?.resolveLiveLatency?.(e.presentation.get(),F(e))??0;return{...n,liveEdgeStart:Math.max(n.start,n.end-r)}}let z=null;function Ue(){return z||(z=document.createElement(`video`),z.muted=!0,z.preload=`none`,z.style.display=`none`,z.crossOrigin=`anonymous`),z}function We(e){let t=Ue(),n=document.createElement(`track`);return n.kind=`subtitles`,new Promise((r,i)=>{let a=()=>{let e=[],t=n.track;if(t.cues)for(let n=0;n<t.cues.length;n++){let r=t.cues[n];r&&e.push(r)}s(),r(e)},o=()=>{s(),i(Error(`Failed to load VTT segment: ${e}`))},s=()=>{n.removeEventListener(`load`,a),n.removeEventListener(`error`,o),t.removeChild(n)};n.addEventListener(`load`,a),n.addEventListener(`error`,o),t.appendChild(n),n.track.mode=`hidden`,n.src=e})}function Ge(e,t){let{snapshotSignal:n,getState:r,transition:i}=ne({value:`active`,context:e}),a=()=>b(()=>n.get().context),o=e=>ce(n,{context:e});return{get snapshot(){return n},send(e){if(r()===`destroyed`)return;let n=a(),i=t(n,e);i!==n&&o(i)},destroy(){r()!==`destroyed`&&i(`destroyed`)}}}function B(e,t){return t.some(t=>t.startTime===e.startTime&&t.endTime===e.endTime&&t.text===e.text)}function Ke(e){return Ge({loaded:{},segments:{}},(t,n)=>{if(n.type===`clear`)return{loaded:{},segments:{}};let{meta:r,cues:i}=n,{trackId:a,id:o,startTime:s,duration:c}=r,l=Array.from(e.textTracks).find(e=>e.id===a);if(!l)return t;let u=t.loaded[a]??[],d=t.segments[a]??[],f=i.filter(e=>!B(e,u)),p=d.some(e=>e.id===o);if(f.length===0&&p)return t;for(let e of f)l.addCue(e);return{...t,loaded:{...t.loaded,[a]:[...u,...f]},segments:p?t.segments:{...t.segments,[a]:[...d,{id:o,startTime:s,duration:c}]}}})}function qe(e,t,n={},r={state:{},context:{},config:{}}){let i={...te,...n.forwardBuffer},a={state:r.state,context:r.context,config:{...r.config,textTracksActor:e,resolveSegment:t}},s=(n.messagePipelines??Fe)(),c=t=>{let{track:n,range:r}=t;if(!r)return[];let a=n.id,s=v(e.snapshot).context.segments[a]??[];return o(n.segments,s,r.start,i).map(e=>({segment:e,trackId:a}))},l=(e,{getContext:t,setContext:n})=>new re(async r=>{if(r.aborted)return;let i={op:e};n({...t(),inFlightTrackId:e.trackId,inFlightSegmentId:e.segment.id});try{for(let e of s){if(r.aborted)return;await e(i,r,a)}}catch(e){console.error(`Failed to load text-track segment:`,e)}finally{n({...t(),inFlightTrackId:null,inFlightSegmentId:null})}}),u=(e,t)=>{for(let n of e)t.runner.schedule(l(n,t)).then(void 0,e=>{e instanceof Error&&e.name===`AbortError`||(console.error(`Unexpected error in text-track segment loader:`,e),t.runner.abortPending())})};return ge({runner:()=>new _e,initial:`idle`,context:{inFlightTrackId:null,inFlightSegmentId:null},states:{idle:{on:{load:(e,t)=>{let n=c(e);n.length!==0&&(t.transition(`loading`),u(n,t))}}},loading:{onSettled:`idle`,on:{load:(e,t)=>{let{context:n,runner:r}=t,i=c(e);n.inFlightTrackId!==null&&n.inFlightSegmentId!==null&&i.some(e=>e.trackId===n.inFlightTrackId&&e.segment.id===n.inFlightSegmentId)?(r.abortPending(),u(i.filter(e=>e.trackId!==n.inFlightTrackId||e.segment.id!==n.inFlightSegmentId),t)):(r.abortAll(),u(i,t))}}}}})}function Je({state:e,context:t,config:n}){return _(()=>{let r=t.mediaElement.get();if(!r)return;let i=Ke(r),a=qe(i,n.resolveTextTrackSegment,{forwardBuffer:n.forwardBuffer,messagePipelines:n.textMessagePipelines},{state:e,context:t,config:n});return t.textTracksActor.set(i),t.textTrackSegmentLoaderActor.set(a),()=>{i.destroy(),a.destroy(),t.textTracksActor.set(void 0),t.textTrackSegmentLoaderActor.set(void 0)}})}const Ye={stateKeys:[],contextKeys:[`mediaElement`,`textTracksActor`,`textTrackSegmentLoaderActor`],setup:Je};function Xe(e){return async t=>{let n=Date.now(),r=e(await t.run(),t.previous);return r===null?!1:(await Be(Math.max(0,r-(Date.now()-n)),t.signal),!0)}}const V=`track[data-src-track]`;function Ze(e,t){for(let n of t){let t=document.createElement(`track`);t.id=n.id,t.kind=n.kind,t.label=n.label,t.toggleAttribute(`data-src-track`,!0),n.language&&(t.srclang=n.language),e.appendChild(t)}}function Qe(e){let n=e.querySelectorAll(V);for(let e of n){let n=e.track;if(n.mode===`showing`&&t(n))return n}}function $e(e){let t=e.querySelectorAll(V);for(let e of t)e.remove()}function H(e,n){for(let r=0;r<e.length;r++){let i=e[r];t(i)&&(i.mode=i.id===n?`showing`:`disabled`)}}function et(e,t){return e&&t?`live`:`inactive`}function tt({state:t,context:n,config:r}){let i=x(()=>et(n.mediaElement.get(),R({state:t,config:r})));return h({initial:`inactive`,monitor:()=>i.get(),states:{inactive:{},live:{entry:()=>{let e=n.mediaElement.get(),{liveEdgeStart:i}=R({state:t,config:r});e.currentTime>=i||t.startPosition.set(i)},effects:()=>{let{start:i,liveEdgeStart:a}=R({state:t,config:r}),o=v(n.mediaElement),s=()=>{o.paused||o.currentTime<i-.1&&(o.currentTime=a)};return s(),e(o,`play`,s)}}}})}const nt={stateKeys:[`presentation`,`startPosition`],contextKeys:[`mediaElement`],setup:tt};function rt({state:e,context:t}){return _(()=>{let n=t.mediaSource.get(),r=L(e);!n||!r||n.setLiveSeekableRange(r.start,r.end)})}const it={stateKeys:[`presentation`],contextKeys:[`mediaSource`],setup:rt};function at(e,t){return!t||!e?`preconditions-unmet`:m(e,`text`).length>0?`sync-active`:`preconditions-unmet`}function ot(e,t){if(!e)return`off`;let n=t.find(t=>t.id===e)?.language;return n?{language:n}:{id:e}}function st({state:t,context:n,config:r}){let{addSubtitlesTracksToMedia:i,getShowingSubtitlesTrackFromMedia:a,removeAllSubtitlesTracksFromMedia:o}=r,s=x(()=>at(t.presentation.get(),n.mediaElement.get()));return h({initial:`preconditions-unmet`,monitor:()=>s.get(),states:{"preconditions-unmet":{},"sync-active":{entry:()=>{let r=n.mediaElement.get(),s=m(t.presentation.get(),`text`);i(r,s),H(r.textTracks,t.selectedTextTrackId.get());let c=!0,l=setTimeout(()=>{c=!1},0),u=e(r.textTracks,`change`,()=>{if(c){H(r.textTracks,t.selectedTextTrackId.get());return}let e=a(r)?.id||void 0;e!==t.selectedTextTrackId.get()&&t.userTextTrackSelection.set(ot(e,s))});return()=>{u(),clearTimeout(l),o(r),v(n.textTracksActor)?.send({type:`clear`})}},effects:()=>{H(v(n.mediaElement).textTracks,t.selectedTextTrackId.get())}}}})}const ct=ae({stateKeys:[`presentation`,`selectedTextTrackId`,`userTextTrackSelection`],contextKeys:[`mediaElement`,`textTracksActor`],setup:st}),lt=p([`userVideoTrackSelection`,`userAudioTrackSelection`,`userTextTrackSelection`,`disableRemotePlayback`]);function ut(e={}){let t=e.deriveStartMediaTime??Re,o={...e,deriveStartMediaTime:t,attachMediaSource:f,canPlayTrack:e.canPlayTrack??E,reportUnsupportedTrackConditions:e.reportUnsupportedTrackConditions??Ne,resolveTextTrackSegment:e.resolveTextTrackSegment??We,textMessagePipelines:D,resolveDuration:e.resolveDuration??r,parsePresentation:e.parsePresentation??le,addSubtitlesTracksToMedia:e.addSubtitlesTracksToMedia??Ze,getShowingSubtitlesTrackFromMedia:e.getShowingSubtitlesTrackFromMedia??Qe,removeAllSubtitlesTracksFromMedia:e.removeAllSubtitlesTracksFromMedia??$e,videoMessagePipelines:A(`video`,t),audioMessagePipelines:A(`audio`,t),gateFirstParse:xe,resolveLiveLatency:N,reschedule:e.reschedule??Xe(Ve)};return n([Oe,Le,he,ze,Ee,a,de,me,ie,ue,pe,oe,we,se,fe,Ie,c,w,je,O,k,ve,d,it,nt,i,Te,ct,Ye,ee,lt],{config:o,initialState:{bandwidthState:{fastEstimate:0,fastTotalWeight:0,slowEstimate:0,slowTotalWeight:0,bytesSampled:0}}})}const U={src:``,preload:``,disableRemotePlayback:!1,streamType:S.UNKNOWN};function dt(e,t){if(!l(e)||!t)return NaN;let n=s(e,t);if(!n||!g(n))return NaN;let r=y(n);return r?r.playlistType===`EVENT`?1/0:u(r)===`live`?0:NaN:NaN}const ft=new Set([Ce,C]);function pt(e){class t extends e{static get alternativeMediaSuggestion(){}#e;#t;#n;#r=U.preload;#i=U.disableRemotePlayback;#a=U.streamType;#o=!1;#s=NaN;#c=null;#l=null;#u=new Set;#d;#f;#p=null;constructor(...e){super(...e);let{config:t}=e?.[0]??{};this.#t=t,this.#e=this.#b(),this.#d=_(()=>{let e=this.#n.state.presentation.get();this.#m(e?.streamType??S.UNKNOWN),this.#g(dt(e,F(this.#n.state))),this.#y(e)}),this.#f=_(()=>{let e=this.#n.state.errors.get();this.#_(Pe(e,ft),e)})}get engine(){return this.#e}get error(){return this.#c}get streamType(){return this.#a}set streamType(e){if(e===S.UNKNOWN){this.#o=!1,this.#h(this.#n.state.presentation.get()?.streamType??S.UNKNOWN);return}this.#o=!0,this.#h(e)}get liveEdgeStart(){return R({state:this.#n.state,config:{resolveLiveLatency:N}})?.liveEdgeStart??NaN}get targetLiveWindow(){return this.#s}#m(e){this.#o||this.#h(e)}#h(e){this.#a!==e&&(this.#a=e,this.dispatchEvent?.(new Event(`streamtypechange`)))}#g(e){Object.is(this.#s,e)||(this.#s=e,this.dispatchEvent?.(new Event(`targetlivewindowchange`)))}#_(e,t){if(!e){this.#c=null,this.#l=null;return}if(this.#l===e.code)return;this.#l=e.code;let n=ke(t);n&&console.error(this.#v(Ae),{conditions:t}),this.#c={code:n?Se:e.code,message:e.message??``,...e.data===void 0?{}:{data:e.data}},this.dispatchEvent?.(new Event(`error`))}attach(e){super.attach?.(e),this.#n.context.mediaElement.set(e)}detach(){this.#x(),this.#n.context.mediaElement.set(void 0),super.detach?.()}destroy(){this.#x(),this.#d(),this.#f(),this.#e.destroy()}get preload(){return this.#r}set preload(e){this.#r=e,e&&this.#n.state.preload.set(e)}get disableRemotePlayback(){return this.#i}set disableRemotePlayback(e){this.#i=e,this.#n.state.disableRemotePlayback.set(e)}get src(){return this.#n.state.presentation.get()?.url??``}set src(e){e!==this.src&&(this.#x(),this.#n.state.presentation.set(e?{url:e}:void 0))}play(){let e=this.#n.context.mediaElement.get();return e?(this.#n.state.loadActivated.set(!0),e.play().catch(t=>{if(this.src)return new Promise((t,n)=>{let r=()=>{this.#p=null,e.play().then(t,n)};this.#p=r,e.addEventListener(`loadstart`,r,{once:!0})});throw t})):Promise.reject(Error(`HlsVideoMediaElement: no media element attached`))}#v(e){return Me(e,this)}#y(e){if(!l(e)){this.#u.clear();return}let t=F(this.#n.state),n=t?s(e,t):void 0;if(!n||!g(n))return;let r=y(n);r&&(r.lowLatency&&!this.#u.has(`lowLatency`)&&(this.#u.add(`lowLatency`),console.warn(this.#v(T))),r.playlistType===`EVENT`&&!this.#u.has(`dvr`)&&(this.#u.add(`dvr`),console.warn(this.#v(De))))}#b(){return ut({...this.#t,onSignalsReady:e=>{this.#n=e}})}#x(){this.#p&&=(this.#n.context.mediaElement.get()?.removeEventListener(`loadstart`,this.#p),null)}}return t}function mt(e){return e?K({tracks:m(e,`video`),keyFn:q}):[]}function ht(e){return e?K({tracks:m(e,`audio`),keyFn:J}):[]}function W(e,t){if(!e||!t)return;let n=s(e,t);return n?.type===`video`?n:void 0}function G(e,t){if(!e||!t)return;let n=s(e,t);return n?.type===`audio`?n:void 0}function gt(e,t){for(let n in e)if(e[n]!==t[n])return!1;return!0}function K({tracks:e,keyFn:t}){let n=[],r=[];for(let i of e){let e=t(i);!e||n.some(t=>gt(t,e))||(n.push(e),r.push(i))}return r}function q(e){return e?{width:e.width,height:e.height,bandwidth:e.bandwidth}:void 0}function J(e){return e?{language:e.language,name:e.name}:void 0}function Y(e,t){return!!t&&e.width===t.width&&e.height===t.height&&e.bandwidth===t.bandwidth}function X(e,t){return!!t&&(e.language??``)===(t.language??``)&&e.name===t.name}const _t=e=>e.frameRateNumerator/(e.frameRateDenominator??1),Z=e=>({width:e.width,height:e.height,bandwidth:e.bitrate}),Q=e=>({language:e.language,name:e.label}),$=(e,t)=>e.length===t.length&&e.every((e,n)=>e.id===t[n].id);function vt(e){class t extends e{#e=new AbortController;#t=!1;#n=[];#r=[];constructor(...e){super(...e);let{state:t}=this.engine,{signal:n}=this.#e,r=x(()=>mt(t.presentation.get()),{equals:$}),i=x(()=>ht(t.presentation.get()),{equals:$}),a=()=>{let e=r.get();if(this.#n=e,this.#o(),!e.length)return;let n=this.addVideoTrack(`main`);n.selected=!0;let i=b(()=>W(t.presentation.get(),t.selectedVideoTrackId.get()));for(let t of e){let e=n.addRendition(``,t.width,t.height,t.codecs.join(`,`),t.bandwidth,t.frameRate?_t(t.frameRate):void 0);e.id=t.id,e.active=Y(Z(e),i)}},o=()=>{let e=W(t.presentation.get(),t.selectedVideoTrackId.get());for(let t of this.videoRenditions)t.active=Y(Z(t),e)},s=()=>{let e=i.get();if(this.#r=e,this.#s(),!e.length)return;let n=b(()=>G(t.presentation.get(),t.selectedAudioTrackId.get()));for(let t of e){let e=this.addAudioTrack(t.default?`main`:`alternative`,t.name,t.language??``);e.id=t.id,e.enabled=X(Q(e),n)}},c=()=>{let e=G(t.presentation.get(),t.selectedAudioTrackId.get());for(let t of this.audioTracks)t.enabled=X(Q(t),e)},l=x(()=>t.presentation.get()?.url),u=[_(a),_(o),_(s),_(c),_(()=>{l.get(),t.userVideoTrackSelection.set(void 0),t.userAudioTrackSelection.set(void 0)})];this.videoRenditions.addEventListener(`change`,this.#i,{signal:n}),this.audioTracks.addEventListener(`change`,this.#a,{signal:n}),n.addEventListener(`abort`,()=>u.forEach(e=>e()),{once:!0})}destroy(){this.#t||(this.#t=!0,this.#e.abort(),this.#o(),this.#s(),super.destroy?.())}#i=()=>{let{userVideoTrackSelection:e}=this.engine.state,t=this.videoRenditions.selectedIndex,n=t<0?void 0:this.videoRenditions[t],r=this.#n.find(e=>e.id===n?.id);e.set(q(r))};#a=()=>{let{presentation:e,selectedAudioTrackId:t,userAudioTrackSelection:n}=this.engine.state,r=G(e.get(),t.get()),i=[...this.audioTracks].find(e=>X(Q(e),r)),a=[...this.audioTracks].filter(e=>e.enabled),o=a.find(e=>e!==i)??a[0];if(!o)return;for(let e of a)e!==o&&(e.enabled=!1);if(o===i)return;let s=this.#r.find(e=>e.id===o.id);n.set(J(s))};#o(){for(let e of[...this.videoTracks])this.removeVideoTrack(e)}#s(){for(let e of[...this.audioTracks])this.removeAudioTrack(e)}}return t}const yt=vt(ye(pt(be)));var bt=class extends yt{};export{bt as t};
|
|
2
|
-
//# sourceMappingURL=media-CPVSKLdk.js.map
|
package/cdn/media-Dq4zmIJa.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./attributes-CwICYz98.js";import{$ as t,A as n,B as r,C as i,I as a,J as o,Q as s,V as c,X as l,et as u,f as d,h as f,i as p,j as m,k as h,l as g,n as _,o as v,p as y,r as b,tt as x,u as S,z as C}from"./select-tracks-xV1s28xD.js";import{t as w}from"./media-attach-mixin-Igi3-1UG.js";import{t as T}from"./template-BEfj3Apn.js";function E({state:e,config:{selectedKey:t,picker:n,pickerConfig:r}}){let i=x(()=>o(e.presentation.get())?`presentation-resolved`:`presentation-unresolved`);return l({initial:`presentation-unresolved`,monitor:()=>i.get(),states:{"presentation-unresolved":{},"presentation-resolved":{entry:()=>{if(!e[t].get()){let i=n(e.presentation.get(),r);i&&e[t].set(i)}return()=>e[t].set(void 0)}}}})}const D=e=>b(e,`video`),O=u({stateKeys:[`presentation`,`selectedVideoTrackId`],contextKeys:[],setup:({state:e,config:t})=>E({state:e,config:{selectedKey:c.selectedKey,picker:t?.picker??D,pickerConfig:t}})});u({stateKeys:[`presentation`,`selectedAudioTrackId`],contextKeys:[],setup:({state:e,config:t})=>E({state:e,config:{selectedKey:r.selectedKey,picker:t?.picker??_,pickerConfig:t}})});const k=s();function A(e={}){let r={...e,picker:e.picker??p,parsePresentation:e.parsePresentation??m,resolveDuration:n};return t([S,h,O,g,C,y,d,f,a,i,k],{config:r,initialState:{loadActivated:!0}})}function j(e){class t extends e{#e;#t;#n;#r=null;constructor(...e){super(...e);let{config:t}=e?.[0]??{};this.#t=t,this.#e=this.#i()}get engine(){return this.#e}attach(e){super.attach?.(e),e.loop=!0,e.muted=!0,e.autoplay=!0,e.preload=`auto`,this.#n.context.mediaElement.set(e)}detach(){this.#a(),this.#n.context.mediaElement.set(void 0),super.detach?.()}destroy(){this.#a(),this.#e.destroy()}get src(){return this.#n.state.presentation.get()?.url??``}set src(e){e!==this.src&&(this.#a(),this.#n.state.presentation.set(e?{url:e}:void 0))}async play(){let e=this.#n.context.mediaElement.get();if(!e)return Promise.reject(Error(`HlsBackgroundVideoMediaElement: no media element attached`));try{return await e.play()}catch(t){if(this.src)return new Promise((t,n)=>{let r=()=>{this.#r=null,e.play().then(t,n)};this.#r=r,e.addEventListener(`loadstart`,r,{once:!0})});throw t}}#i(){return A({picker:e=>v((e.selectionSets?.find(e=>e.type===`video`))?.switchingSets[0]?.tracks??[])?.id,...this.#t,onSignalsReady:e=>{this.#n=e}})}#a(){this.#r&&=(this.#n.context.mediaElement.get()?.removeEventListener(`loadstart`,this.#r),null)}}return t}const M=j(class extends EventTarget{#e=null;attach(e){!e||this.#e===e||(this.#e=e)}detach(){this.#e=null}get loop(){return this.#e?.loop??!1}set loop(e){this.#e&&(this.#e.loop=e)}get muted(){return this.#e?.muted??!1}set muted(e){this.#e&&(this.#e.muted=e)}get autoplay(){return this.#e?.autoplay??!1}set autoplay(e){this.#e&&(this.#e.autoplay=e)}get preload(){return this.#e?.preload??`metadata`}set preload(e){this.#e&&(this.#e.preload=e)}});var N=class extends M{};const P=w(HTMLElement);var F=class extends P{static{this.shadowRootOptions={mode:`open`}}static{this.getTemplateHTML=T}static get observedAttributes(){return[`src`]}#e=new N;constructor(){if(super(),!this.shadowRoot){this.attachShadow(this.constructor.shadowRootOptions);let t={...e(this.attributes),muted:``,loop:``,autoplay:``,playsinline:``,disableremoteplayback:``,disablepictureinpicture:``};this.shadowRoot.innerHTML=T(t)}let t=this.video;t&&this.#e.attach(t)}getMediaTarget(){return this.#e}disconnectedCallback(){super.disconnectedCallback?.(),!this.hasAttribute(`keep-alive`)&&queueMicrotask(()=>{this.isConnected||this.#e.destroy()})}attributeChangedCallback(e,t,n){t!==n&&e===`src`&&(this.src=n??``)}get video(){let e=this.shadowRoot?.querySelector(`video`);return e instanceof HTMLVideoElement?e:null}get src(){return this.#e.src}set src(e){this.#e.src=e}};export{F as t};
|
|
2
|
-
//# sourceMappingURL=media-Dq4zmIJa.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"media-Dq4zmIJa.js","names":["#config","#engine","#createEngine","#signals","#cancelPendingPlay","#loadstartListener","#target","#media"],"sources":["../../spf/dist/default/playback/behaviors/select-tracks.js","../../spf/dist/default/playback/engines/hls/engine-background-video.js","../../spf/dist/default/playback/adapters/hls-background-video/adapter.js","../../spf/dist/default/playback/adapters/hls-background-video/host.js","../../spf/dist/default/playback/adapters/hls-background-video/media.js","../src/media/hls-background-video/media.ts"],"sourcesContent":["import { computed } from \"../../core/signals/primitives.js\";\nimport { defineBehavior } from \"../../core/composition/create-composition.js\";\nimport { createMachineReactor } from \"../../core/reactors/create-machine-reactor.js\";\nimport { isResolvedPresentation } from \"../../media/types/index.js\";\nimport { AUDIO_TYPE_CONFIG, VIDEO_TYPE_CONFIG } from \"../primitives/track-types.js\";\nimport { pickAudioTrack, pickFirstTrackId } from \"../../media/primitives/select-tracks.js\";\n//#region src/playback/behaviors/select-tracks.ts\n/**\n* **Default audio/video track selection on src load / unselect on src unload.**\n* When a presentation is resolved, sets `selectedVideoTrackId` /\n* `selectedAudioTrackId` to a per-type-picker default if no selection already\n* exists. When the presentation is unset/reset (transitions back to unresolved),\n* clears the selection so a stale id from the previous source doesn't persist.\n*\n* Lifecycle-driven: each transition fires its work once. Does not police the\n* selection between transitions; external writes (user picks, ABR, programmatic\n* filter-driven re-picks) are left alone.\n*\n* Picker is config-driven: each per-type export wires a sensible default\n* (`pickAudioTrack` for audio — three-tier language-aware; `pickFirstTrackId`\n* for video) and the caller can supply their own via `config.picker` for custom\n* selection logic. The behavior's `config` is forwarded to the picker as its\n* second argument, so options like `preferredAudioLanguage` reach the picker\n* without an intermediate wrapping layer.\n*\n* Compose `selectVideoTrack` for the simple \"pick a default video track\"\n* behavior, or `switchVideoTrack` (`./track-switching.ts`) for the\n* ABR-driven variant. Compose `selectAudioTrack` for the simple default\n* pick, or `switchAudioTrack` (`./track-switching.ts`) for the\n* filter-reactive + mid-stream-flush slot-owner variant — when audio-abr\n* lands, `switchAudioTrack` extends into `switchAudioQuality`. Compose\n* only one per type — they're alternatives, not stackable (each writes\n* the same `selected*TrackId` slot). The simple variants tree-shake out\n* the heavier machinery (bandwidth estimator, quality selection, flush\n* orchestration).\n*\n* Text selection has no simple variant here — it's owned by `switchTextTrack`\n* (`./track-switching.ts`), which resolves standing `userTextTrackSelection`\n* intent against the constrained, CDN-scoped renditions.\n*/\nfunction setupTrackSelection({ state, config: { selectedKey, picker, pickerConfig } }) {\n\tconst derivedStateSignal = computed(() => isResolvedPresentation(state.presentation.get()) ? \"presentation-resolved\" : \"presentation-unresolved\");\n\treturn createMachineReactor({\n\t\tinitial: \"presentation-unresolved\",\n\t\tmonitor: () => derivedStateSignal.get(),\n\t\tstates: {\n\t\t\t\"presentation-unresolved\": {},\n\t\t\t\"presentation-resolved\": { entry: () => {\n\t\t\t\tif (!state[selectedKey].get()) {\n\t\t\t\t\tconst id = picker(state.presentation.get(), pickerConfig);\n\t\t\t\t\tif (id) state[selectedKey].set(id);\n\t\t\t\t}\n\t\t\t\treturn () => state[selectedKey].set(void 0);\n\t\t\t} }\n\t\t}\n\t});\n}\n/** Default video picker: first track in the video selection set. */\nconst defaultVideoPicker = (presentation) => pickFirstTrackId(presentation, \"video\");\n/**\n* Select a video track when a presentation loads. Clears the selection on\n* src unload.\n*\n* This is the simple, non-ABR counterpart to `switchVideoTrack` — compose\n* one or the other, not both (both write `selectedVideoTrackId`). Composing\n* `selectVideoTrack` alone tree-shakes out the ABR code path\n* (bandwidth-estimator, quality-selection); use it for sources without\n* meaningful quality variants, test setups, or players that intentionally\n* pin a quality.\n*\n* @example\n* const reactor = selectVideoTrack.setup({ state });\n*/\nconst selectVideoTrack = defineBehavior({\n\tstateKeys: [\"presentation\", \"selectedVideoTrackId\"],\n\tcontextKeys: [],\n\tsetup: ({ state, config }) => setupTrackSelection({\n\t\tstate,\n\t\tconfig: {\n\t\t\tselectedKey: VIDEO_TYPE_CONFIG.selectedKey,\n\t\t\tpicker: config?.picker ?? defaultVideoPicker,\n\t\t\tpickerConfig: config\n\t\t}\n\t})\n});\ndefineBehavior({\n\tstateKeys: [\"presentation\", \"selectedAudioTrackId\"],\n\tcontextKeys: [],\n\tsetup: ({ state, config }) => setupTrackSelection({\n\t\tstate,\n\t\tconfig: {\n\t\t\tselectedKey: AUDIO_TYPE_CONFIG.selectedKey,\n\t\t\tpicker: config?.picker ?? pickAudioTrack,\n\t\t\tpickerConfig: config\n\t\t}\n\t})\n});\n//#endregion\nexport { selectVideoTrack };\n\n//# sourceMappingURL=select-tracks.js.map","import { createComposition } from \"../../../core/composition/create-composition.js\";\nimport { makeShareSignals } from \"../../../core/composition/share-signals.js\";\nimport { loadVideoSegments } from \"../../behaviors/dom/load-segments.js\";\nimport { trackCurrentTime } from \"../../behaviors/dom/track-current-time.js\";\nimport { parseMultivariantPlaylist } from \"../../../media/hls/parse-multivariant.js\";\nimport { getResolvedSelectedTrackDuration } from \"../../../media/utils/track-selection.js\";\nimport { calculatePresentationDuration } from \"../../behaviors/calculate-presentation-duration.js\";\nimport { endOfStream } from \"../../behaviors/dom/end-of-stream.js\";\nimport { setupVideoBufferActors } from \"../../behaviors/dom/setup-buffer-actors.js\";\nimport { setupMediaSource } from \"../../behaviors/dom/setup-mediasource.js\";\nimport { updateMediaSourceDuration } from \"../../behaviors/dom/update-mediasource-duration.js\";\nimport { resolvePresentation } from \"../../behaviors/resolve-presentation.js\";\nimport { resolveVideoTrack } from \"../../behaviors/resolve-track.js\";\nimport { pickHighestResolutionVideoTrack } from \"../../../media/primitives/select-tracks.js\";\nimport { selectVideoTrack } from \"../../behaviors/select-tracks.js\";\n//#region src/playback/engines/hls/engine-background-video.ts\nconst shareSignals = makeShareSignals();\n/**\n* Create a background-video playback engine.\n*\n* Subtractive composition over the HLS engine baseline:\n* audio-side, text-side, ABR-driven, preload-monitoring, and play/seek\n* load-trigger behaviors are removed. `selectVideoTrack` (with a\n* max-resolution picker by default) replaces `switchVideoQuality`, pinning\n* a single rendition for the session. The initial state seeds\n* `loadActivated: true` so the composition behaves as if preload has\n* already been activated — appropriate for ambient / hero / GIF-replacement\n* surfaces that should start loading the moment a src is set.\n*\n* Native `loop` / `muted` / `autoplay` are adapter concerns and live on\n* `HlsBackgroundVideoMediaElement` rather than the engine.\n*\n* @example\n* ```ts\n* let signals: BackgroundVideoEngineSignals;\n* const engine = createBackgroundVideoEngine({\n* onSignalsReady: (refs) => {\n* signals = refs;\n* },\n* });\n*\n* signals.context.mediaElement.set(videoEl);\n* signals.state.presentation.set({ url: 'https://example.com/stream.m3u8' });\n*\n* await engine.destroy();\n* ```\n*/\nfunction createBackgroundVideoEngine(config = {}) {\n\tconst finalConfig = {\n\t\t...config,\n\t\tpicker: config.picker ?? pickHighestResolutionVideoTrack,\n\t\tparsePresentation: config.parsePresentation ?? parseMultivariantPlaylist,\n\t\tresolveDuration: getResolvedSelectedTrackDuration\n\t};\n\treturn createComposition([\n\t\tresolvePresentation,\n\t\tcalculatePresentationDuration,\n\t\tselectVideoTrack,\n\t\tresolveVideoTrack,\n\t\tloadVideoSegments,\n\t\tsetupMediaSource,\n\t\tupdateMediaSourceDuration,\n\t\tsetupVideoBufferActors,\n\t\ttrackCurrentTime,\n\t\tendOfStream,\n\t\tshareSignals\n\t], {\n\t\tconfig: finalConfig,\n\t\tinitialState: { loadActivated: true }\n\t});\n}\n//#endregion\nexport { createBackgroundVideoEngine };\n\n//# sourceMappingURL=engine-background-video.js.map","import { pickTrackUnderPixelArea } from \"../../../media/primitives/select-tracks.js\";\nimport { createBackgroundVideoEngine } from \"../../engines/hls/engine-background-video.js\";\n//#region src/playback/adapters/hls-background-video/adapter.ts\nconst hlsBackgroundVideoMediaDefaultProps = { src: \"\" };\n/**\n* Mixin that adds the background-video SPF playback engine to any base class,\n* for an HLS URL.\n*\n* `src` is the whole surface, and the picker always pins the top rendition on\n* offer. There is no cap of its own because the manifest is the better place to\n* narrow one: a delivery param — `?max_resolution=720p` on a Mux stream URL, for\n* one — keeps the renditions it excludes out of the manifest entirely, rather\n* than fetched-then-unpicked. Deriving a cap from the screen instead is on the\n* roadmap, and lands here when it does.\n*\n* `@videojs/spf/mux-background-video` is this same Media under a Mux-flavored\n* name — an alias, not a variant. Nothing about the surface changes with the\n* import path.\n*\n* Everything else the use case fixes rather than exposes: video-only, looping,\n* muted, autoplaying, loading as soon as there is a source. `attach` writes that\n* onto the element and nothing here declares `loop` / `muted` / `autoplay` /\n* `preload` of its own — a host-bound Media inherits all four from the host\n* already, and shadowing them with fixed values would only make reads describe\n* an intention rather than what the element is doing.\n*\n* A new src re-resolves the presentation, tearing down the state, SourceBuffers,\n* and in-flight requests the previous one built before the next begins. The\n* engine instance and the attached media element are both kept, so neither has to\n* be rewired.\n*\n* @example\n* class HlsBackgroundVideoMedia extends HlsBackgroundVideoMediaMixin(BackgroundVideoHost) {}\n*\n* const media = new HlsBackgroundVideoMedia();\n* media.attach(document.querySelector('video'));\n* media.src = 'https://stream.mux.com/PLAYBACK_ID.m3u8?max_resolution=720p';\n* media.play();\n*/\nfunction HlsBackgroundVideoMediaMixin(BaseClass) {\n\tclass HlsBackgroundVideoMediaImpl extends BaseClass {\n\t\t#engine;\n\t\t#config;\n\t\t#signals;\n\t\t/** Pending loadstart listener from a deferred play() retry, if any. */\n\t\t#loadstartListener = null;\n\t\tconstructor(...args) {\n\t\t\tsuper(...args);\n\t\t\tconst { config } = args?.[0] ?? {};\n\t\t\tthis.#config = config;\n\t\t\tthis.#engine = this.#createEngine();\n\t\t}\n\t\tget engine() {\n\t\t\treturn this.#engine;\n\t\t}\n\t\tattach(mediaElement) {\n\t\t\tsuper.attach?.(mediaElement);\n\t\t\tmediaElement.loop = true;\n\t\t\tmediaElement.muted = true;\n\t\t\tmediaElement.autoplay = true;\n\t\t\tmediaElement.preload = \"auto\";\n\t\t\tthis.#signals.context.mediaElement.set(mediaElement);\n\t\t}\n\t\tdetach() {\n\t\t\tthis.#cancelPendingPlay();\n\t\t\tthis.#signals.context.mediaElement.set(void 0);\n\t\t\tsuper.detach?.();\n\t\t}\n\t\tdestroy() {\n\t\t\tthis.#cancelPendingPlay();\n\t\t\tthis.#engine.destroy();\n\t\t}\n\t\tget src() {\n\t\t\treturn this.#signals.state.presentation.get()?.url ?? \"\";\n\t\t}\n\t\tset src(value) {\n\t\t\tif (value === this.src) return;\n\t\t\tthis.#cancelPendingPlay();\n\t\t\tthis.#signals.state.presentation.set(value ? { url: value } : void 0);\n\t\t}\n\t\tasync play() {\n\t\t\tconst mediaElement = this.#signals.context.mediaElement.get();\n\t\t\tif (!mediaElement) return Promise.reject(/* @__PURE__ */ new Error(\"HlsBackgroundVideoMediaElement: no media element attached\"));\n\t\t\ttry {\n\t\t\t\treturn await mediaElement.play();\n\t\t\t} catch (err) {\n\t\t\t\tif (this.src) return new Promise((resolve, reject) => {\n\t\t\t\t\tconst listener = () => {\n\t\t\t\t\t\tthis.#loadstartListener = null;\n\t\t\t\t\t\tmediaElement.play().then(resolve, reject);\n\t\t\t\t\t};\n\t\t\t\t\tthis.#loadstartListener = listener;\n\t\t\t\t\tmediaElement.addEventListener(\"loadstart\", listener, { once: true });\n\t\t\t\t});\n\t\t\t\tthrow err;\n\t\t\t}\n\t\t}\n\t\t#createEngine() {\n\t\t\tconst adapterPicker = (presentation) => {\n\t\t\t\treturn pickTrackUnderPixelArea((presentation.selectionSets?.find((s) => s.type === \"video\"))?.switchingSets[0]?.tracks ?? [])?.id;\n\t\t\t};\n\t\t\treturn createBackgroundVideoEngine({\n\t\t\t\tpicker: adapterPicker,\n\t\t\t\t...this.#config,\n\t\t\t\tonSignalsReady: (signals) => {\n\t\t\t\t\tthis.#signals = signals;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\t#cancelPendingPlay() {\n\t\t\tif (!this.#loadstartListener) return;\n\t\t\tthis.#signals.context.mediaElement.get()?.removeEventListener(\"loadstart\", this.#loadstartListener);\n\t\t\tthis.#loadstartListener = null;\n\t\t}\n\t}\n\treturn HlsBackgroundVideoMediaImpl;\n}\n/** Standalone SPF background-video adapter with no base class. */\nvar HlsBackgroundVideoMediaElement = class extends HlsBackgroundVideoMediaMixin(class {}) {};\n//#endregion\nexport { HlsBackgroundVideoMediaElement, HlsBackgroundVideoMediaMixin, hlsBackgroundVideoMediaDefaultProps };\n\n//# sourceMappingURL=adapter.js.map","//#region src/playback/adapters/hls-background-video/host.ts\n/**\n* The `<video>` binding a background video uses: somewhere to keep the attached\n* element, and the four properties the Media fixes on it.\n*\n* That is the whole surface anything here reaches. The engine drives playback,\n* the element exposes `src` and nothing else, and the background player\n* subscribes to no store features, so nothing asks a background video for\n* `currentTime`, `play()`, picture-in-picture, fullscreen, forwarded events, or\n* media components. Holding the host to what is reachable is what keeps this\n* entry free of `@videojs/media`, and small enough to suit a component whose\n* whole pitch is its size.\n*\n* An `EventTarget`, because a Media is one: the store and the element layers\n* take anything they attach as an event source, and inheriting the three methods\n* satisfies that for free rather than by stubbing them.\n*\n* ⚠️ It still implements too little to carry the rest of the media surface, which\n* bounds what may consume it: a store feature reading a property outside this set\n* gets `undefined` rather than an error. A Media needing more of that surface\n* belongs on a host that provides it.\n*/\nvar BackgroundVideoHost = class extends EventTarget {\n\t#target = null;\n\tattach(target) {\n\t\tif (!target || this.#target === target) return;\n\t\tthis.#target = target;\n\t}\n\tdetach() {\n\t\tthis.#target = null;\n\t}\n\tget loop() {\n\t\treturn this.#target?.loop ?? false;\n\t}\n\tset loop(value) {\n\t\tif (this.#target) this.#target.loop = value;\n\t}\n\tget muted() {\n\t\treturn this.#target?.muted ?? false;\n\t}\n\tset muted(value) {\n\t\tif (this.#target) this.#target.muted = value;\n\t}\n\tget autoplay() {\n\t\treturn this.#target?.autoplay ?? false;\n\t}\n\tset autoplay(value) {\n\t\tif (this.#target) this.#target.autoplay = value;\n\t}\n\tget preload() {\n\t\treturn this.#target?.preload ?? \"metadata\";\n\t}\n\tset preload(value) {\n\t\tif (this.#target) this.#target.preload = value;\n\t}\n};\n//#endregion\nexport { BackgroundVideoHost };\n\n//# sourceMappingURL=host.js.map","import { HlsBackgroundVideoMediaMixin } from \"./adapter.js\";\nimport { BackgroundVideoHost } from \"./host.js\";\n//#region src/playback/adapters/hls-background-video/media.ts\nconst HlsBackgroundVideoMediaBase = HlsBackgroundVideoMediaMixin(BackgroundVideoHost);\n/**\n* The background-video Media, bound to a `<video>` through\n* {@link BackgroundVideoHost}.\n*\n* That host carries the attached element and the four properties `attach` fixes,\n* which is all this Media's surface needs, and it is local — so this entry has\n* no `@videojs/media` dependency.\n*\n* No `MediaTracksMixin`, unlike `HlsVideoMedia`: the engine subtracts audio and\n* text entirely and pins one video rendition for the session, so there are no\n* track lists for a consumer to project or switch between.\n*/\nvar HlsBackgroundVideoMedia = class extends HlsBackgroundVideoMediaBase {};\n//#endregion\nexport { HlsBackgroundVideoMedia };\n\n//# sourceMappingURL=media.js.map","import type { Media } from '@videojs/media/dom';\nimport { HlsBackgroundVideoMedia } from '@videojs/spf/hls-background-video';\nimport { type CustomElement, namedNodeMapToObject } from '@videojs/utils/dom';\nimport type { Constructor } from '@videojs/utils/types';\nimport { MediaAttachMixin } from '../../store/media-attach-mixin';\nimport { getTemplateHTML } from '../background-video/template';\n\n// `MediaAttachMixin` is typed as returning its base, so its `disconnectedCallback`\n// isn't visible for `super` to reach. `CustomElement` declares the lifecycle\n// callbacks this element overrides.\nconst HlsBackgroundVideoBase = MediaAttachMixin(HTMLElement) as unknown as Constructor<CustomElement>;\n\n/**\n * A muted, looping, chrome-less video over the SPF background-video engine.\n *\n * The SPF-backed counterpart to `<background-video>`, which plays its source\n * natively. This one streams HLS through the engine, which pins a single\n * rendition for the session rather than adapting, and drops audio and text\n * handling entirely — the shape an ambient hero video actually wants.\n *\n * Nearer an image than a player, and `src` is the whole surface. Replaces the\n * standalone `mux-background-video` package, whose `audio`, `debug`, `preload`,\n * and `max-resolution` attributes are all deliberately absent. Capping which\n * rendition is fetched is a delivery param on the URL — `?max_resolution=720p`\n * on a Mux stream, for one — which keeps the renditions it excludes out of the\n * manifest rather than merely unpicked; `preload` would have nothing to say,\n * since the engine loads from the moment it has a source. And unlike\n * `<background-video>` there are no `nomuted` / `noloop` / `noautoplay` opt-outs:\n * those three are what this element is for, so the adapter fixes them on at\n * attach.\n *\n * Takes no structured `source` — `src` is an HLS URL, as the package it replaces\n * required. Mux playback-ID identity, poster, and storyboard belong to\n * `<mux-video>`; none of them mean anything without controls to hang them on.\n *\n * `<mux-background-video>` is this element under the name the package it replaces\n * used. Same class, so the tag is a naming choice and nothing more.\n *\n * @example\n * ```html\n * <hls-background-video src=\"https://stream.mux.com/PLAYBACK_ID.m3u8?max_resolution=720p\">\n * <img src=\"https://image.mux.com/PLAYBACK_ID/thumbnail.webp?time=0\" alt=\"\" />\n * </hls-background-video>\n * ```\n */\n// Deliberately not `CustomMediaElement`, matching `<background-video>`: a\n// background video needs one property, not the full WHATWG media API.\nexport class HlsBackgroundVideo extends HlsBackgroundVideoBase {\n static shadowRootOptions = { mode: 'open' as ShadowRootMode };\n static getTemplateHTML = getTemplateHTML;\n\n static get observedAttributes(): string[] {\n return ['src'];\n }\n\n #media = new HlsBackgroundVideoMedia();\n\n constructor() {\n super();\n\n if (!this.shadowRoot) {\n this.attachShadow((this.constructor as typeof HlsBackgroundVideo).shadowRootOptions);\n\n const attrs = {\n ...namedNodeMapToObject(this.attributes),\n muted: '',\n loop: '',\n autoplay: '',\n playsinline: '',\n disableremoteplayback: '',\n disablepictureinpicture: '',\n };\n\n this.shadowRoot!.innerHTML = getTemplateHTML(attrs);\n }\n\n // Neither Chrome nor Firefox honor a `muted` attribute set after\n // `document.createElement`, and autoplay is refused without it. Attaching is\n // what sets the property — along with the rest of the fixed behavior — so\n // nothing here needs to repeat it.\n const video = this.video;\n if (video) this.#media.attach(video);\n }\n\n /** Register the Media (not the inner `<video>`) with the provider. */\n getMediaTarget(): Media | null {\n return this.#media as unknown as Media;\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback?.();\n if (this.hasAttribute('keep-alive')) return;\n // Deferred so a synchronous reparent (remove then insert) doesn't tear down\n // the engine, matching `CustomMediaElement`.\n queueMicrotask(() => {\n if (!this.isConnected) this.#media.destroy();\n });\n }\n\n attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void {\n if (oldValue === newValue) return;\n\n if (name === 'src') this.src = newValue ?? '';\n }\n\n /** The inner `<video>` the engine renders into. */\n get video(): HTMLVideoElement | null {\n const video = this.shadowRoot?.querySelector('video');\n return video instanceof HTMLVideoElement ? video : null;\n }\n\n /** HLS manifest URL. Assigning a new one restarts playback from scratch. */\n get src(): string {\n return this.#media.src;\n }\n\n set src(value: string) {\n this.#media.src = value;\n }\n}\n"],"mappings":"yVAwCA,SAAS,EAAoB,CAAE,QAAO,OAAQ,CAAE,cAAa,SAAQ,iBAAkB,CACtF,IAAM,EAAqB,MAAe,EAAuB,EAAM,aAAa,IAAI,CAAC,EAAI,wBAA0B,yBAAyB,EAChJ,O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