@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
|
@@ -0,0 +1,825 @@
|
|
|
1
|
+
import { r as isFunction } from "./predicate-faYxAB6Z.js";
|
|
2
|
+
import { t as namedNodeMapToObject } from "./attributes-c6az3W3y.js";
|
|
3
|
+
import { t as shallowEqual } from "./shallow-equal-C7S8rj2f.js";
|
|
4
|
+
import { t as listen } from "./listen-CdeggIF8.js";
|
|
5
|
+
import { $ as getTracksByType, B as reportAbsentTrackType, C as updateMediaSourceDuration, E as setupVideoBufferActors, H as getResolvedSelectedTrackDuration, K as trackCurrentTime, P as endOfStream, R as collectErrors, U as parseMultivariantPlaylist, V as calculatePresentationDuration, W as canPlayTrack, X as AUDIO_TYPE_CONFIG, Y as loadVideoSegments, Z as VIDEO_TYPE_CONFIG, _ as tracksUnderPixelArea, _t as SVTA_UNSUPPORTED_DRM_SYSTEM, b as resolveVideoTrack, bt as effect, c as reportUnsupportedTrackConditions, ct as makeShareSignals, d as excludeUnplayableTracks, dt as computed, f as sameCandidateSet, ft as peek, gt as SVTA_NO_SUPPORTED_VIDEO_TRACK, h as pickAudioTrackFromTracks, it as isResolvedPresentation, l as applyConstraints, lt as createComposition, n as hasUnsupportedFeatureCause, o as UNPLAYABLE_SOURCE_MESSAGE, ot as createMachineReactor, p as byDescendingResolution, t as firstFatal, u as applyRules, ut as defineBehavior, vt as SVTA_UNSUPPORTED_PLAYBACK_FEATURE, w as setupMediaSource, x as resolvePresentation, yt as SVTA_UNSUPPORTED_VIDEO_FORMAT } from "./error-surface-D0bo71gD.js";
|
|
6
|
+
import { t as MediaAttachMixin } from "./media-attach-mixin-uThv5NL_.js";
|
|
7
|
+
import { t as getTemplateHTML } from "./template-CBmklOD-.js";
|
|
8
|
+
|
|
9
|
+
//#region ../spf/dist/dev/playback/behaviors/select-tracks.js
|
|
10
|
+
/**
|
|
11
|
+
* **Default audio/video track selection on src load / unselect on src unload.**
|
|
12
|
+
* When a presentation is resolved, sets `selectedVideoTrackId` /
|
|
13
|
+
* `selectedAudioTrackId` from a per-type default rule chain if no selection
|
|
14
|
+
* already exists. When the presentation is unset/reset (transitions back to unresolved),
|
|
15
|
+
* clears the selection so a stale id from the previous source doesn't persist.
|
|
16
|
+
*
|
|
17
|
+
* Lifecycle-driven: the pick fires once per transition, and nothing re-picks —
|
|
18
|
+
* that is what separates these from the `switch*` variants. External writes (user
|
|
19
|
+
* picks, ABR, programmatic filter-driven re-picks) are left alone, including a
|
|
20
|
+
* write naming a track the manifest never offered.
|
|
21
|
+
*
|
|
22
|
+
* The one thing policed between transitions is a pick the *constraints* turn
|
|
23
|
+
* against: a rendition's container and encryption are only known once its media
|
|
24
|
+
* playlist resolves, which is after the pick was made, so a selection that becomes
|
|
25
|
+
* unplayable is dropped. Dropped, never moved — re-picking is exactly the behavior
|
|
26
|
+
* `switchVideoTrack` exists to provide. Dropping reports nothing on its own, since
|
|
27
|
+
* whatever made the pick unplayable already reported its own, more specific cause.
|
|
28
|
+
*
|
|
29
|
+
* Selection runs the same rule model `switchVideoTrack` does — a hard
|
|
30
|
+
* `constraints` pre-pass, then an ordered `rules` chain, with the pick as the
|
|
31
|
+
* head (see `internal/design/spf/track-switching-model.md`). What differs is
|
|
32
|
+
* reactivity, not the rules: this evaluates the chain once on resolve and pins
|
|
33
|
+
* the result, where `switchVideoTrack` re-evaluates inside an effect so its rules
|
|
34
|
+
* subscribe to bandwidth and user selection. A rule written for one therefore
|
|
35
|
+
* composes into the other unchanged.
|
|
36
|
+
*
|
|
37
|
+
* Both are config-driven, each per-type export wiring a sensible default: audio's
|
|
38
|
+
* three-tier language policy, and for video the *empty* chain — with nothing
|
|
39
|
+
* narrowing or reordering, the head is the first candidate. The behavior's
|
|
40
|
+
* `config` is forwarded to the rules, so options like `preferredAudioLanguage`
|
|
41
|
+
* reach them without an intermediate layer.
|
|
42
|
+
*
|
|
43
|
+
* Note a rule can only pick among real candidates, where the picker it replaced
|
|
44
|
+
* could return any id at all. An id absent from the manifest was never
|
|
45
|
+
* selectable, so that narrowing is the point rather than a limitation.
|
|
46
|
+
*
|
|
47
|
+
* Compose `selectVideoTrack` for the simple "pick a default video track"
|
|
48
|
+
* behavior, or `switchVideoTrack` (`./track-switching.ts`) for the
|
|
49
|
+
* ABR-driven variant. Compose `selectAudioTrack` for the simple default
|
|
50
|
+
* pick, or `switchAudioTrack` (`./track-switching.ts`) for the
|
|
51
|
+
* filter-reactive + mid-stream-flush slot-owner variant — when audio-abr
|
|
52
|
+
* lands, `switchAudioTrack` extends into `switchAudioQuality`. Compose
|
|
53
|
+
* only one per type — they're alternatives, not stackable (each writes
|
|
54
|
+
* the same `selected*TrackId` slot). The simple variants tree-shake out
|
|
55
|
+
* the heavier machinery (bandwidth estimator, quality selection, flush
|
|
56
|
+
* orchestration).
|
|
57
|
+
*
|
|
58
|
+
* Text selection has no simple variant here — it's owned by `switchTextTrack`
|
|
59
|
+
* (`./track-switching.ts`), which resolves standing `userTextTrackSelection`
|
|
60
|
+
* intent against the constrained, CDN-scoped renditions.
|
|
61
|
+
*/
|
|
62
|
+
function setupTrackSelection({ state, config: { selectedKey, trackType, constraints, rules, ruleConfig } }) {
|
|
63
|
+
const derivedStateSignal = computed(() => isResolvedPresentation(state.presentation.get()) ? "presentation-resolved" : "presentation-unresolved");
|
|
64
|
+
const deps = {
|
|
65
|
+
state,
|
|
66
|
+
config: ruleConfig
|
|
67
|
+
};
|
|
68
|
+
const candidateSet = computed(() => {
|
|
69
|
+
const presentation = state.presentation.get();
|
|
70
|
+
if (!isResolvedPresentation(presentation)) return [];
|
|
71
|
+
return applyConstraints(constraints, getTracksByType(presentation, trackType), deps);
|
|
72
|
+
}, { equals: sameCandidateSet });
|
|
73
|
+
return createMachineReactor({
|
|
74
|
+
initial: "presentation-unresolved",
|
|
75
|
+
monitor: () => derivedStateSignal.get(),
|
|
76
|
+
states: {
|
|
77
|
+
"presentation-unresolved": {},
|
|
78
|
+
"presentation-resolved": {
|
|
79
|
+
entry: () => {
|
|
80
|
+
if (!state[selectedKey].get()) {
|
|
81
|
+
const id = applyRules(rules, peek(candidateSet), deps)[0]?.id;
|
|
82
|
+
if (id) state[selectedKey].set(id);
|
|
83
|
+
}
|
|
84
|
+
return () => state[selectedKey].set(void 0);
|
|
85
|
+
},
|
|
86
|
+
effects: [() => {
|
|
87
|
+
const selectedId = peek(state[selectedKey]);
|
|
88
|
+
if (!selectedId) return;
|
|
89
|
+
if (candidateSet.get().some((track) => track.id === selectedId)) return;
|
|
90
|
+
const presentation = peek(state.presentation);
|
|
91
|
+
if (isResolvedPresentation(presentation) && getTracksByType(presentation, trackType).some((track) => track.id === selectedId)) state[selectedKey].set(void 0);
|
|
92
|
+
}]
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
/** Default video chain: none. The first candidate is the pick. */
|
|
98
|
+
const DEFAULT_VIDEO_RULES = [];
|
|
99
|
+
/**
|
|
100
|
+
* Default audio chain: the three-tier policy (`preferredAudioLanguage` →
|
|
101
|
+
* `DEFAULT=YES` → first) as a single narrowing rule. Returning `[]` when nothing
|
|
102
|
+
* is picked lets `applyRules` fall through to the unnarrowed candidates, so the
|
|
103
|
+
* head stays the first track — the same last tier the policy itself ends on.
|
|
104
|
+
*/
|
|
105
|
+
const preferAudioPolicy = (tracks, { config }) => {
|
|
106
|
+
const id = pickAudioTrackFromTracks(tracks, config);
|
|
107
|
+
const pick = tracks.find((track) => track.id === id);
|
|
108
|
+
return pick ? [pick] : [];
|
|
109
|
+
};
|
|
110
|
+
const DEFAULT_AUDIO_RULES = [preferAudioPolicy];
|
|
111
|
+
/**
|
|
112
|
+
* Order the candidates by resolution, largest first, with bandwidth breaking ties
|
|
113
|
+
* between renditions of identical dimensions. The background-video default — that
|
|
114
|
+
* variant pins one rendition for the session, and absent a cap the largest is the
|
|
115
|
+
* head.
|
|
116
|
+
*
|
|
117
|
+
* A ranker, so it reorders rather than narrowing: the chain's pick is the head of
|
|
118
|
+
* what it returns, which means ranking never has to collapse to one track. Belongs
|
|
119
|
+
* last in a chain — a sort only reorders what survived the filters ahead of it, and
|
|
120
|
+
* leaving it last is what lets `applyRules` early-bail before it runs.
|
|
121
|
+
*
|
|
122
|
+
* Exported because it is a *rule*, not a variant's private policy: the same one
|
|
123
|
+
* composes into `switchVideoTrack`'s chain when a ranker is wanted there.
|
|
124
|
+
*/
|
|
125
|
+
const preferHighestResolution = (tracks) => [...tracks].sort(byDescendingResolution);
|
|
126
|
+
/**
|
|
127
|
+
* Narrow to the renditions that fit the screen, by pixel area — the screen-size
|
|
128
|
+
* cap from `internal/design/spf/features/rendition-selection-caps.md`, as a scope
|
|
129
|
+
* (soft filter) rather than a constraint: an over-cap rendition is wasteful, not
|
|
130
|
+
* unplayable, so nothing here may make a source unplayable.
|
|
131
|
+
*
|
|
132
|
+
* Narrows only — it neither orders the survivors nor resolves the case where none
|
|
133
|
+
* survive, because `applyRules` owns both. So it needs a ranker behind it to pick
|
|
134
|
+
* within the cap: `[screenResolutionCap, preferHighestResolution]` yields the
|
|
135
|
+
* largest rendition that fits. Composed *last*, the pick would instead be whichever
|
|
136
|
+
* fitting rendition the manifest happened to list first.
|
|
137
|
+
*
|
|
138
|
+
* Reading `state.screenResolution` through its signal is what subscribes a
|
|
139
|
+
* re-evaluating chain (`switchVideoTrack`) to screen changes; `selectVideoTrack`
|
|
140
|
+
* pins the first answer instead, by design.
|
|
141
|
+
*
|
|
142
|
+
* Compares areas rather than matching a `"1080p"`-style tier because a tier only
|
|
143
|
+
* describes a rendition once you assume its aspect ratio — the assumption that
|
|
144
|
+
* mis-measures an anamorphic ladder. See `media/dom/screen.ts`.
|
|
145
|
+
*
|
|
146
|
+
* Three ways the cap ends up not applying, all of them fall-through:
|
|
147
|
+
*
|
|
148
|
+
* - **No `screenResolution` signal at all**, because the composition omits
|
|
149
|
+
* `trackScreenResolution`. So composing the cap without its signal source is
|
|
150
|
+
* inert rather than broken.
|
|
151
|
+
* - **A `screenResolution` of `undefined`**, meaning no screen to read. "Unknown"
|
|
152
|
+
* has to mean "don't cap": treating it as an area of zero would pin every source
|
|
153
|
+
* to its smallest rendition on exactly the environments we know least about.
|
|
154
|
+
* - **No rendition fits**, on a screen smaller than the whole ladder. `applyRules`
|
|
155
|
+
* skips the empty result and the chain proceeds unnarrowed, so the ranker behind
|
|
156
|
+
* the cap decides — for `preferHighestResolution`, the largest rendition. A floor
|
|
157
|
+
* is the fix if that ever matters (`rendition-selection-caps.md` carries one), not
|
|
158
|
+
* a special case here.
|
|
159
|
+
*/
|
|
160
|
+
const screenResolutionCap = (tracks, { state }) => {
|
|
161
|
+
const screenResolution = state?.screenResolution?.get();
|
|
162
|
+
if (!screenResolution) return [];
|
|
163
|
+
return tracksUnderPixelArea(tracks, screenResolution.width * screenResolution.height);
|
|
164
|
+
};
|
|
165
|
+
/**
|
|
166
|
+
* Default video constraints: the capability pre-pass alone. No
|
|
167
|
+
* `excludeFailedCdns` — this variant's compositions run no failover monitor, so
|
|
168
|
+
* `failedCdns` has no writer and the constraint would always pass through.
|
|
169
|
+
*/
|
|
170
|
+
const DEFAULT_VIDEO_CONSTRAINTS = [excludeUnplayableTracks];
|
|
171
|
+
/**
|
|
172
|
+
* Select a video track when a presentation loads. Clears the selection on
|
|
173
|
+
* src unload.
|
|
174
|
+
*
|
|
175
|
+
* This is the simple, non-ABR counterpart to `switchVideoTrack` — compose
|
|
176
|
+
* one or the other, not both (both write `selectedVideoTrackId`). Composing
|
|
177
|
+
* `selectVideoTrack` alone tree-shakes out the ABR code path
|
|
178
|
+
* (bandwidth-estimator, quality-selection); use it for sources without
|
|
179
|
+
* meaningful quality variants, test setups, or players that intentionally
|
|
180
|
+
* pin a quality.
|
|
181
|
+
*
|
|
182
|
+
* @example
|
|
183
|
+
* const reactor = selectVideoTrack.setup({ state });
|
|
184
|
+
*/
|
|
185
|
+
const selectVideoTrack = defineBehavior({
|
|
186
|
+
stateKeys: ["presentation", "selectedVideoTrackId"],
|
|
187
|
+
contextKeys: [],
|
|
188
|
+
setup: ({ state, config }) => setupTrackSelection({
|
|
189
|
+
state,
|
|
190
|
+
config: {
|
|
191
|
+
selectedKey: VIDEO_TYPE_CONFIG.selectedKey,
|
|
192
|
+
trackType: "video",
|
|
193
|
+
constraints: config?.constraints ?? DEFAULT_VIDEO_CONSTRAINTS,
|
|
194
|
+
rules: config?.rules ?? DEFAULT_VIDEO_RULES,
|
|
195
|
+
ruleConfig: config
|
|
196
|
+
}
|
|
197
|
+
})
|
|
198
|
+
});
|
|
199
|
+
defineBehavior({
|
|
200
|
+
stateKeys: ["presentation", "selectedAudioTrackId"],
|
|
201
|
+
contextKeys: [],
|
|
202
|
+
setup: ({ state, config }) => setupTrackSelection({
|
|
203
|
+
state,
|
|
204
|
+
config: {
|
|
205
|
+
selectedKey: AUDIO_TYPE_CONFIG.selectedKey,
|
|
206
|
+
trackType: "audio",
|
|
207
|
+
constraints: config?.constraints ?? [],
|
|
208
|
+
rules: config?.rules ?? DEFAULT_AUDIO_RULES,
|
|
209
|
+
ruleConfig: config
|
|
210
|
+
}
|
|
211
|
+
})
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
//#endregion
|
|
215
|
+
//#region ../spf/dist/dev/media/dom/screen.js
|
|
216
|
+
/**
|
|
217
|
+
* Screen resolution, as the signal source for a screen-size rendition cap.
|
|
218
|
+
*
|
|
219
|
+
* Reported as a width and a height rather than a `"720p"`-style tier, because
|
|
220
|
+
* the cap that consumes it compares against real track dimensions. A tier only
|
|
221
|
+
* describes a track once you assume its aspect ratio, and that assumption
|
|
222
|
+
* mis-measures an anamorphic or otherwise non-16:9 rendition.
|
|
223
|
+
*
|
|
224
|
+
* The signal source for the screen-size cap in
|
|
225
|
+
* `internal/design/spf/features/rendition-selection-caps.md`.
|
|
226
|
+
*
|
|
227
|
+
* The screen underneath a window is not stable: rotating a device swaps the axes,
|
|
228
|
+
* and unplugging a monitor or dragging the window to another display changes the
|
|
229
|
+
* numbers *and* which physical screen they describe. So `getScreenResolution`
|
|
230
|
+
* reads at call time and caches nothing, and `watchScreenResolution` layers the
|
|
231
|
+
* reacting on top rather than the reader holding state of its own.
|
|
232
|
+
*/
|
|
233
|
+
/**
|
|
234
|
+
* Read the screen's resolution, or `undefined` where there isn't one to read.
|
|
235
|
+
*
|
|
236
|
+
* `undefined` means "unknown", which is the answer a cap needs in order to not
|
|
237
|
+
* cap. `screenResolutionCap` reads it that way and declines to narrow, so an
|
|
238
|
+
* unknown screen is "no cap" rather than a cap of zero — the reading a naive
|
|
239
|
+
* `?? 0` would produce, which would pin every source to its smallest rendition on
|
|
240
|
+
* exactly the environments we know least about.
|
|
241
|
+
*
|
|
242
|
+
* Dimensions are reported as-is, including the axis swap a rotated device
|
|
243
|
+
* applies to them. Normalizing orientation away is a policy question — whether a
|
|
244
|
+
* cap should flap on rotation, or hold the larger budget across both — and
|
|
245
|
+
* belongs to the cap rather than to the reading.
|
|
246
|
+
*/
|
|
247
|
+
function getScreenResolution({ useDevicePixelRatio } = { useDevicePixelRatio: true }) {
|
|
248
|
+
const screen = globalThis.screen;
|
|
249
|
+
if (!screen) return void 0;
|
|
250
|
+
const ratio = useDevicePixelRatio ? globalThis.devicePixelRatio || 1 : 1;
|
|
251
|
+
const width = Math.round(screen.width * ratio);
|
|
252
|
+
const height = Math.round(screen.height * ratio);
|
|
253
|
+
return width > 0 && height > 0 ? {
|
|
254
|
+
width,
|
|
255
|
+
height
|
|
256
|
+
} : void 0;
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Call `onChange` whenever {@link getScreenResolution} would start answering
|
|
260
|
+
* differently. Returns a function that stops watching.
|
|
261
|
+
*
|
|
262
|
+
* There is no single event for "the screen changed", so this subscribes to every
|
|
263
|
+
* signal that implies one and compares readings to decide whether anything
|
|
264
|
+
* actually moved. Comparing is what makes that safe: the signals overlap and
|
|
265
|
+
* `resize` in particular is noisy, so over-subscribing costs a discarded read
|
|
266
|
+
* rather than a spurious call.
|
|
267
|
+
*
|
|
268
|
+
* `onChange` is called once on subscribe with the starting value — including
|
|
269
|
+
* `undefined` where there is no screen — and after that only on a genuine change.
|
|
270
|
+
* So a consumer gets its initial state from the watcher and never has to pair it
|
|
271
|
+
* with a separate {@link getScreenResolution} call.
|
|
272
|
+
*
|
|
273
|
+
* The signals, and what each one is here for:
|
|
274
|
+
*
|
|
275
|
+
* - **`screen`'s own `change`** — the screen itself being reconfigured, or the
|
|
276
|
+
* window landing on a different one. The direct signal, and the only one that
|
|
277
|
+
* catches a window moving between two same-size, same-ratio displays. From the
|
|
278
|
+
* Window Management API, but on the base `Screen` rather than behind
|
|
279
|
+
* `getScreenDetails()`, so it needs no permission — only a secure context.
|
|
280
|
+
* Measured present in Chromium and absent in WebKit and Firefox, hence the
|
|
281
|
+
* three below rather than this alone.
|
|
282
|
+
* - **`resize`** — the window changing size, which is also what the OS does to it
|
|
283
|
+
* when the display it was on goes away.
|
|
284
|
+
* - **`screen.orientation` change** — rotation, which swaps the axes without
|
|
285
|
+
* necessarily resizing the window.
|
|
286
|
+
* - **a `(resolution: <ratio>dppx)` media query** — the device pixel ratio
|
|
287
|
+
* changing under a window that kept its size, which is the cross-display drag
|
|
288
|
+
* between displays of different density. Each query only answers about the ratio
|
|
289
|
+
* it was built for, so it reports one change and its handler arms the next.
|
|
290
|
+
*
|
|
291
|
+
* Worth keeping despite looking redundant, because it is the only coverage that
|
|
292
|
+
* case has in WebKit and Firefox: neither implements `screen`'s change event,
|
|
293
|
+
* and the drag doesn't resize the window. It is also a cleaner signal in Safari
|
|
294
|
+
* than elsewhere — WebKit holds `devicePixelRatio` independent of page zoom, so
|
|
295
|
+
* there it moves only on a real density change, where Chromium and Gecko fold
|
|
296
|
+
* zoom into it as well.
|
|
297
|
+
*
|
|
298
|
+
* ⚠️ Known gap, on engines without `screen`'s change event: dragging a window
|
|
299
|
+
* between two different-size displays that share a ratio, without the window
|
|
300
|
+
* resizing, changes the reading with nothing firing. Closing it there would mean
|
|
301
|
+
* polling, whose interval and battery cost are a policy decision this function
|
|
302
|
+
* shouldn't be making.
|
|
303
|
+
*/
|
|
304
|
+
function watchScreenResolution(onChange, options = { useDevicePixelRatio: true }) {
|
|
305
|
+
const disconnect = new AbortController();
|
|
306
|
+
const { signal } = disconnect;
|
|
307
|
+
let current = getScreenResolution(options);
|
|
308
|
+
const check = () => {
|
|
309
|
+
const next = getScreenResolution(options);
|
|
310
|
+
if (shallowEqual(current, next)) return;
|
|
311
|
+
current = next;
|
|
312
|
+
onChange(next);
|
|
313
|
+
};
|
|
314
|
+
onChange(current);
|
|
315
|
+
const watchRatio = () => {
|
|
316
|
+
const query = globalThis.matchMedia?.(`(resolution: ${globalThis.devicePixelRatio}dppx)`);
|
|
317
|
+
if (!query) return;
|
|
318
|
+
listen(query, "change", () => {
|
|
319
|
+
watchRatio();
|
|
320
|
+
check();
|
|
321
|
+
}, {
|
|
322
|
+
once: true,
|
|
323
|
+
signal
|
|
324
|
+
});
|
|
325
|
+
};
|
|
326
|
+
watchRatio();
|
|
327
|
+
const screen = globalThis.screen;
|
|
328
|
+
const orientation = screen?.orientation;
|
|
329
|
+
if (globalThis.window) listen(globalThis.window, "resize", check, { signal });
|
|
330
|
+
if (isEventTarget(screen)) listen(screen, "change", check, { signal });
|
|
331
|
+
if (orientation) listen(orientation, "change", check, { signal });
|
|
332
|
+
return () => disconnect.abort();
|
|
333
|
+
}
|
|
334
|
+
function isEventTarget(value) {
|
|
335
|
+
return isFunction(value?.addEventListener);
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
//#endregion
|
|
339
|
+
//#region ../spf/dist/dev/playback/behaviors/dom/track-screen-resolution.js
|
|
340
|
+
/**
|
|
341
|
+
* Mirror the screen's pixel dimensions into reactive state, so a rendition cap
|
|
342
|
+
* can narrow candidates to what the screen can actually show without reading the
|
|
343
|
+
* environment at pick time — which would make the picker impure, and would never
|
|
344
|
+
* re-pick when the screen changed.
|
|
345
|
+
*
|
|
346
|
+
* Populated at setup rather than on the first change: `watchScreenResolution`
|
|
347
|
+
* reports its starting value, so nothing downstream waits on a screen that may
|
|
348
|
+
* never move. `undefined` where there is no screen to read, which is the value a
|
|
349
|
+
* cap reads as "no cap" — see `getScreenResolution` on why that beats a zero.
|
|
350
|
+
*
|
|
351
|
+
* Reads no other slot, and has no source-identity reset: the screen is
|
|
352
|
+
* independent of the presentation, so a new `src` doesn't invalidate the reading.
|
|
353
|
+
*/
|
|
354
|
+
function trackScreenResolutionSetup({ state, config }) {
|
|
355
|
+
return watchScreenResolution((resolution) => state.screenResolution.set(resolution), { useDevicePixelRatio: config?.useDevicePixelRatio ?? true });
|
|
356
|
+
}
|
|
357
|
+
const trackScreenResolution = defineBehavior({
|
|
358
|
+
stateKeys: ["screenResolution"],
|
|
359
|
+
contextKeys: [],
|
|
360
|
+
setup: trackScreenResolutionSetup
|
|
361
|
+
});
|
|
362
|
+
|
|
363
|
+
//#endregion
|
|
364
|
+
//#region ../spf/dist/dev/playback/engines/hls/engine-background-video.js
|
|
365
|
+
const shareSignals = makeShareSignals();
|
|
366
|
+
/**
|
|
367
|
+
* Create a background-video playback engine.
|
|
368
|
+
*
|
|
369
|
+
* Subtractive composition over the HLS engine baseline:
|
|
370
|
+
* audio-side, text-side, ABR-driven, preload-monitoring, and play/seek
|
|
371
|
+
* load-trigger behaviors are removed. `selectVideoTrack` (with a
|
|
372
|
+
* highest-resolution rule by default) replaces `switchVideoQuality`, pinning
|
|
373
|
+
* a single rendition for the session. The initial state seeds
|
|
374
|
+
* `loadActivated: true` so the composition behaves as if preload has
|
|
375
|
+
* already been activated — appropriate for ambient / hero / GIF-replacement
|
|
376
|
+
* surfaces that should start loading the moment a src is set.
|
|
377
|
+
*
|
|
378
|
+
* Error reporting is *not* subtracted: `collectErrors` owns the sequence,
|
|
379
|
+
* `resolveVideoTrack` reports per-rendition causes, and `selectVideoTrack`
|
|
380
|
+
* reports the video verdict when nothing survives its constraints. Without them
|
|
381
|
+
* every unplayable source here is a silent stall — an unsupported container,
|
|
382
|
+
* encryption this engine can't decrypt, and an undecodable codec all leave
|
|
383
|
+
* `HTMLMediaElement.error` null on both Chromium and WebKit.
|
|
384
|
+
*
|
|
385
|
+
* Native `loop` / `muted` / `autoplay` are adapter concerns and live on
|
|
386
|
+
* `HlsBackgroundVideoMediaElement` rather than the engine.
|
|
387
|
+
*
|
|
388
|
+
* @example
|
|
389
|
+
* ```ts
|
|
390
|
+
* let signals: BackgroundVideoEngineSignals;
|
|
391
|
+
* const engine = createBackgroundVideoEngine({
|
|
392
|
+
* onSignalsReady: (refs) => {
|
|
393
|
+
* signals = refs;
|
|
394
|
+
* },
|
|
395
|
+
* });
|
|
396
|
+
*
|
|
397
|
+
* signals.context.mediaElement.set(videoEl);
|
|
398
|
+
* signals.state.presentation.set({ url: 'https://example.com/stream.m3u8' });
|
|
399
|
+
*
|
|
400
|
+
* await engine.destroy();
|
|
401
|
+
* ```
|
|
402
|
+
*/
|
|
403
|
+
function createBackgroundVideoEngine(config = {}) {
|
|
404
|
+
const finalConfig = {
|
|
405
|
+
...config,
|
|
406
|
+
constraints: config.constraints ?? [reportAbsentTrackType(2011), excludeUnplayableTracks],
|
|
407
|
+
rules: config.rules ?? [screenResolutionCap, preferHighestResolution],
|
|
408
|
+
parsePresentation: config.parsePresentation ?? parseMultivariantPlaylist,
|
|
409
|
+
resolveDuration: getResolvedSelectedTrackDuration,
|
|
410
|
+
canPlayTrack: config.canPlayTrack ?? canPlayTrack,
|
|
411
|
+
reportUnsupportedTrackConditions: config.reportUnsupportedTrackConditions ?? reportUnsupportedTrackConditions
|
|
412
|
+
};
|
|
413
|
+
return createComposition([
|
|
414
|
+
resolvePresentation,
|
|
415
|
+
calculatePresentationDuration,
|
|
416
|
+
collectErrors,
|
|
417
|
+
selectVideoTrack,
|
|
418
|
+
resolveVideoTrack,
|
|
419
|
+
loadVideoSegments,
|
|
420
|
+
setupMediaSource,
|
|
421
|
+
updateMediaSourceDuration,
|
|
422
|
+
setupVideoBufferActors,
|
|
423
|
+
trackCurrentTime,
|
|
424
|
+
trackScreenResolution,
|
|
425
|
+
endOfStream,
|
|
426
|
+
shareSignals
|
|
427
|
+
], {
|
|
428
|
+
config: finalConfig,
|
|
429
|
+
initialState: { loadActivated: true }
|
|
430
|
+
});
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
//#endregion
|
|
434
|
+
//#region ../spf/dist/dev/playback/adapters/hls-background-video/adapter.js
|
|
435
|
+
/**
|
|
436
|
+
* Which reported conditions this composition treats as **fatal** — the ones that
|
|
437
|
+
* reach `error` and fire `'error'`. Severity isn't part of an SVTA code
|
|
438
|
+
* (§Approach: "impact varies with player implementation"), so it's decided at
|
|
439
|
+
* this boundary rather than by the reporter.
|
|
440
|
+
*
|
|
441
|
+
* **Causes are fatal here, unlike on the other two adapters.** There, a cause is
|
|
442
|
+
* context — one unplayable rendition doesn't fail a source whose others still
|
|
443
|
+
* play, and a verdict follows if the type empties. In the pinned variant a cause
|
|
444
|
+
* *is* the verdict: only the pinned rendition's playlist is ever resolved, so a
|
|
445
|
+
* cause can only be about the pick itself, and dropping that pick is final —
|
|
446
|
+
* nothing here re-picks (that is what `switchVideoTrack` exists for, and this
|
|
447
|
+
* engine doesn't compose it). Measured on Chromium: an MPEG-TS source reports
|
|
448
|
+
* 1004 and an encrypted one 4008, each with no verdict behind it, and the element
|
|
449
|
+
* then sits at `readyState 0` with `error` null forever.
|
|
450
|
+
*
|
|
451
|
+
* The verdict is still listed, for the one shape that reports nothing else: a
|
|
452
|
+
* source offering no video renditions at all, which `reportAbsentTrackType`
|
|
453
|
+
* reports from the head of the constraint chain.
|
|
454
|
+
*
|
|
455
|
+
* First-fatal-wins then surfaces the cause rather than the verdict when both are
|
|
456
|
+
* present, which is the more specific of the two.
|
|
457
|
+
*/
|
|
458
|
+
const FATAL_SVTA_CODES = /* @__PURE__ */ new Set([
|
|
459
|
+
SVTA_NO_SUPPORTED_VIDEO_TRACK,
|
|
460
|
+
SVTA_UNSUPPORTED_VIDEO_FORMAT,
|
|
461
|
+
SVTA_UNSUPPORTED_DRM_SYSTEM
|
|
462
|
+
]);
|
|
463
|
+
/**
|
|
464
|
+
* Mixin that adds the background-video SPF playback engine to any base class,
|
|
465
|
+
* for an HLS URL.
|
|
466
|
+
*
|
|
467
|
+
* `src` is the whole input surface, and `error` is the one output: nothing about
|
|
468
|
+
* an unplayable source reaches the media element on its own here — an unsupported
|
|
469
|
+
* container, encryption with no EME, and an undecodable codec all leave
|
|
470
|
+
* `HTMLMediaElement.error` null with the element stalled at `readyState 0`
|
|
471
|
+
* (measured on Chromium and WebKit) — so a consumer that watched only the
|
|
472
|
+
* `<video>` would see a source that never appears and never says why. The engine
|
|
473
|
+
* reports each condition onto `engine.state.errors` and logs it; this adapter
|
|
474
|
+
* promotes the first fatal one, mapping it the same way the video and audio Medias
|
|
475
|
+
* map theirs. See `internal/design/spf/features/errors.md`.
|
|
476
|
+
*
|
|
477
|
+
* Selection pins the largest rendition that *fits the screen*, and holds it for
|
|
478
|
+
* the session. The manifest is still the better place to narrow further: a
|
|
479
|
+
* delivery param — `?max_resolution=720p` on a Mux stream URL, for one — keeps
|
|
480
|
+
* the renditions it excludes out of the manifest entirely, rather than
|
|
481
|
+
* fetched-then-unpicked.
|
|
482
|
+
*
|
|
483
|
+
* The pin is given up, never moved, if the pick turns out to be unplayable: the
|
|
484
|
+
* container is only known once a media playlist resolves, which is after the pick
|
|
485
|
+
* is made, so the selection clears rather than quietly appending bytes nothing can
|
|
486
|
+
* decode.
|
|
487
|
+
*
|
|
488
|
+
* `@videojs/spf/mux-background-video` is this same Media under a Mux-flavored
|
|
489
|
+
* name — an alias, not a variant. Nothing about the surface changes with the
|
|
490
|
+
* import path.
|
|
491
|
+
*
|
|
492
|
+
* Everything else the use case fixes rather than exposes: video-only, looping,
|
|
493
|
+
* muted, autoplaying, loading as soon as there is a source. `attach` writes that
|
|
494
|
+
* onto the element and nothing here declares `loop` / `muted` / `autoplay` /
|
|
495
|
+
* `preload` of its own — a host-bound Media inherits all four from the host
|
|
496
|
+
* already, and shadowing them with fixed values would only make reads describe
|
|
497
|
+
* an intention rather than what the element is doing.
|
|
498
|
+
*
|
|
499
|
+
* A new src re-resolves the presentation, tearing down the state, SourceBuffers,
|
|
500
|
+
* and in-flight requests the previous one built before the next begins. The
|
|
501
|
+
* engine instance and the attached media element are both kept, so neither has to
|
|
502
|
+
* be rewired.
|
|
503
|
+
*
|
|
504
|
+
* @fires error - Fired when a fatal condition is reported. Read `error` for it.
|
|
505
|
+
*
|
|
506
|
+
* @example
|
|
507
|
+
* class HlsBackgroundVideoMedia extends HlsBackgroundVideoMediaMixin(BackgroundVideoHost) {}
|
|
508
|
+
*
|
|
509
|
+
* const media = new HlsBackgroundVideoMedia();
|
|
510
|
+
* media.attach(document.querySelector('video'));
|
|
511
|
+
* media.src = 'https://stream.mux.com/PLAYBACK_ID.m3u8?max_resolution=720p';
|
|
512
|
+
* media.play();
|
|
513
|
+
*/
|
|
514
|
+
function HlsBackgroundVideoMediaMixin(BaseClass) {
|
|
515
|
+
class HlsBackgroundVideoMediaImpl extends BaseClass {
|
|
516
|
+
#engine;
|
|
517
|
+
#config;
|
|
518
|
+
#signals;
|
|
519
|
+
#error = null;
|
|
520
|
+
/**
|
|
521
|
+
* The *reported* condition currently surfaced, which is what the re-fire latch
|
|
522
|
+
* keys on. Not `#error.code`: that's the code this adapter chose to surface,
|
|
523
|
+
* and the substitution below can make the two differ.
|
|
524
|
+
*/
|
|
525
|
+
#reportedCode = null;
|
|
526
|
+
#stopErrorSync;
|
|
527
|
+
/** Pending loadstart listener from a deferred play() retry, if any. */
|
|
528
|
+
#loadstartListener = null;
|
|
529
|
+
constructor(...args) {
|
|
530
|
+
super(...args);
|
|
531
|
+
const { config } = args?.[0] ?? {};
|
|
532
|
+
this.#config = config;
|
|
533
|
+
this.#engine = this.#createEngine();
|
|
534
|
+
this.#stopErrorSync = effect(() => {
|
|
535
|
+
const errors = this.#signals.state.errors.get();
|
|
536
|
+
this.#setError(firstFatal(errors, FATAL_SVTA_CODES), errors);
|
|
537
|
+
});
|
|
538
|
+
}
|
|
539
|
+
get engine() {
|
|
540
|
+
return this.#engine;
|
|
541
|
+
}
|
|
542
|
+
/**
|
|
543
|
+
* The current fatal condition, or `null`. Only *fatal* ones appear here — the
|
|
544
|
+
* engine reports non-fatal ones too (they stay in `engine.state.errors`), and
|
|
545
|
+
* promoting them would say playback had failed when it hadn't. Which ones are
|
|
546
|
+
* fatal is wider here than on the video and audio Medias; see
|
|
547
|
+
* {@link FATAL_SVTA_CODES}. Resets per source. Fires `'error'` when set.
|
|
548
|
+
*
|
|
549
|
+
* Mapped the same way theirs are: a sequence holding an
|
|
550
|
+
* unimplemented-capability cause surfaces as
|
|
551
|
+
* {@link SVTA_UNSUPPORTED_PLAYBACK_FEATURE} (99001) with the specifics logged,
|
|
552
|
+
* because "this player can't play this source" is what a consumer can act on,
|
|
553
|
+
* where a raw container or DRM code only says what to go and look up.
|
|
554
|
+
*/
|
|
555
|
+
get error() {
|
|
556
|
+
return this.#error;
|
|
557
|
+
}
|
|
558
|
+
#setError(reported, errors) {
|
|
559
|
+
if (!reported) {
|
|
560
|
+
this.#error = null;
|
|
561
|
+
this.#reportedCode = null;
|
|
562
|
+
return;
|
|
563
|
+
}
|
|
564
|
+
if (this.#reportedCode === reported.code) return;
|
|
565
|
+
this.#reportedCode = reported.code;
|
|
566
|
+
console.error(UNPLAYABLE_SOURCE_MESSAGE, { conditions: errors });
|
|
567
|
+
this.#error = {
|
|
568
|
+
code: hasUnsupportedFeatureCause(errors) ? SVTA_UNSUPPORTED_PLAYBACK_FEATURE : reported.code,
|
|
569
|
+
message: reported.message ?? "",
|
|
570
|
+
...reported.data === void 0 ? {} : { data: reported.data }
|
|
571
|
+
};
|
|
572
|
+
this.dispatchEvent?.(new Event("error"));
|
|
573
|
+
}
|
|
574
|
+
attach(mediaElement) {
|
|
575
|
+
super.attach?.(mediaElement);
|
|
576
|
+
mediaElement.loop = true;
|
|
577
|
+
mediaElement.muted = true;
|
|
578
|
+
mediaElement.autoplay = true;
|
|
579
|
+
mediaElement.preload = "auto";
|
|
580
|
+
this.#signals.context.mediaElement.set(mediaElement);
|
|
581
|
+
}
|
|
582
|
+
detach() {
|
|
583
|
+
this.#cancelPendingPlay();
|
|
584
|
+
this.#signals.context.mediaElement.set(void 0);
|
|
585
|
+
super.detach?.();
|
|
586
|
+
}
|
|
587
|
+
destroy() {
|
|
588
|
+
this.#cancelPendingPlay();
|
|
589
|
+
this.#stopErrorSync();
|
|
590
|
+
this.#engine.destroy();
|
|
591
|
+
}
|
|
592
|
+
get src() {
|
|
593
|
+
return this.#signals.state.presentation.get()?.url ?? "";
|
|
594
|
+
}
|
|
595
|
+
set src(value) {
|
|
596
|
+
if (value === this.src) return;
|
|
597
|
+
this.#cancelPendingPlay();
|
|
598
|
+
this.#signals.state.presentation.set(value ? { url: value } : void 0);
|
|
599
|
+
}
|
|
600
|
+
async play() {
|
|
601
|
+
const mediaElement = this.#signals.context.mediaElement.get();
|
|
602
|
+
if (!mediaElement) return Promise.reject(/* @__PURE__ */ new Error("HlsBackgroundVideoMediaElement: no media element attached"));
|
|
603
|
+
try {
|
|
604
|
+
return await mediaElement.play();
|
|
605
|
+
} catch (err) {
|
|
606
|
+
if (this.src) return new Promise((resolve, reject) => {
|
|
607
|
+
const listener = () => {
|
|
608
|
+
this.#loadstartListener = null;
|
|
609
|
+
mediaElement.play().then(resolve, reject);
|
|
610
|
+
};
|
|
611
|
+
this.#loadstartListener = listener;
|
|
612
|
+
mediaElement.addEventListener("loadstart", listener, { once: true });
|
|
613
|
+
});
|
|
614
|
+
throw err;
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
#createEngine() {
|
|
618
|
+
return createBackgroundVideoEngine({
|
|
619
|
+
...this.#config,
|
|
620
|
+
onSignalsReady: (signals) => {
|
|
621
|
+
this.#signals = signals;
|
|
622
|
+
}
|
|
623
|
+
});
|
|
624
|
+
}
|
|
625
|
+
#cancelPendingPlay() {
|
|
626
|
+
if (!this.#loadstartListener) return;
|
|
627
|
+
this.#signals.context.mediaElement.get()?.removeEventListener("loadstart", this.#loadstartListener);
|
|
628
|
+
this.#loadstartListener = null;
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
return HlsBackgroundVideoMediaImpl;
|
|
632
|
+
}
|
|
633
|
+
/** Standalone SPF background-video adapter with no base class. */
|
|
634
|
+
var HlsBackgroundVideoMediaElement = class extends HlsBackgroundVideoMediaMixin(class {}) {};
|
|
635
|
+
|
|
636
|
+
//#endregion
|
|
637
|
+
//#region ../spf/dist/dev/playback/adapters/hls-background-video/host.js
|
|
638
|
+
/**
|
|
639
|
+
* The `<video>` binding a background video uses: somewhere to keep the attached
|
|
640
|
+
* element, and the four properties the Media fixes on it.
|
|
641
|
+
*
|
|
642
|
+
* That is the whole surface anything here reaches. The engine drives playback,
|
|
643
|
+
* the element exposes `src` and nothing else, and the background player
|
|
644
|
+
* subscribes to no store features, so nothing asks a background video for
|
|
645
|
+
* `currentTime`, `play()`, picture-in-picture, fullscreen, forwarded events, or
|
|
646
|
+
* media components. Holding the host to what is reachable is what keeps this
|
|
647
|
+
* entry free of `@videojs/media`, and small enough to suit a component whose
|
|
648
|
+
* whole pitch is its size.
|
|
649
|
+
*
|
|
650
|
+
* An `EventTarget`, because a Media is one: the store and the element layers
|
|
651
|
+
* take anything they attach as an event source, and inheriting the three methods
|
|
652
|
+
* satisfies that for free rather than by stubbing them.
|
|
653
|
+
*
|
|
654
|
+
* ⚠️ It still implements too little to carry the rest of the media surface, which
|
|
655
|
+
* bounds what may consume it: a store feature reading a property outside this set
|
|
656
|
+
* gets `undefined` rather than an error. A Media needing more of that surface
|
|
657
|
+
* belongs on a host that provides it.
|
|
658
|
+
*/
|
|
659
|
+
var BackgroundVideoHost = class extends EventTarget {
|
|
660
|
+
#target = null;
|
|
661
|
+
attach(target) {
|
|
662
|
+
if (!target || this.#target === target) return;
|
|
663
|
+
this.#target = target;
|
|
664
|
+
}
|
|
665
|
+
detach() {
|
|
666
|
+
this.#target = null;
|
|
667
|
+
}
|
|
668
|
+
get loop() {
|
|
669
|
+
return this.#target?.loop ?? false;
|
|
670
|
+
}
|
|
671
|
+
set loop(value) {
|
|
672
|
+
if (this.#target) this.#target.loop = value;
|
|
673
|
+
}
|
|
674
|
+
get muted() {
|
|
675
|
+
return this.#target?.muted ?? false;
|
|
676
|
+
}
|
|
677
|
+
set muted(value) {
|
|
678
|
+
if (this.#target) this.#target.muted = value;
|
|
679
|
+
}
|
|
680
|
+
get autoplay() {
|
|
681
|
+
return this.#target?.autoplay ?? false;
|
|
682
|
+
}
|
|
683
|
+
set autoplay(value) {
|
|
684
|
+
if (this.#target) this.#target.autoplay = value;
|
|
685
|
+
}
|
|
686
|
+
get preload() {
|
|
687
|
+
return this.#target?.preload ?? "metadata";
|
|
688
|
+
}
|
|
689
|
+
set preload(value) {
|
|
690
|
+
if (this.#target) this.#target.preload = value;
|
|
691
|
+
}
|
|
692
|
+
};
|
|
693
|
+
|
|
694
|
+
//#endregion
|
|
695
|
+
//#region ../spf/dist/dev/playback/adapters/hls-background-video/media.js
|
|
696
|
+
const HlsBackgroundVideoMediaBase = HlsBackgroundVideoMediaMixin(BackgroundVideoHost);
|
|
697
|
+
/**
|
|
698
|
+
* The background-video Media, bound to a `<video>` through
|
|
699
|
+
* {@link BackgroundVideoHost}.
|
|
700
|
+
*
|
|
701
|
+
* That host carries the attached element and the four properties `attach` fixes,
|
|
702
|
+
* which is all this Media's surface needs, and it is local — so this entry has
|
|
703
|
+
* no `@videojs/media` dependency.
|
|
704
|
+
*
|
|
705
|
+
* No `MediaTracksMixin`, unlike `HlsVideoMedia`: the engine subtracts audio and
|
|
706
|
+
* text entirely and pins one video rendition for the session, so there are no
|
|
707
|
+
* track lists for a consumer to project or switch between.
|
|
708
|
+
*/
|
|
709
|
+
var HlsBackgroundVideoMedia = class extends HlsBackgroundVideoMediaBase {};
|
|
710
|
+
|
|
711
|
+
//#endregion
|
|
712
|
+
//#region src/media/hls-background-video/media.ts
|
|
713
|
+
const HlsBackgroundVideoBase = MediaAttachMixin(HTMLElement);
|
|
714
|
+
/**
|
|
715
|
+
* A muted, looping, chrome-less video over the SPF background-video engine.
|
|
716
|
+
*
|
|
717
|
+
* The SPF-backed counterpart to `<background-video>`, which plays its source
|
|
718
|
+
* natively. This one streams HLS through the engine, which pins a single
|
|
719
|
+
* rendition for the session rather than adapting, and drops audio and text
|
|
720
|
+
* handling entirely — the shape an ambient hero video actually wants.
|
|
721
|
+
*
|
|
722
|
+
* Nearer an image than a player, and `src` is the whole surface. Replaces the
|
|
723
|
+
* standalone `mux-background-video` package, whose `audio`, `debug`, `preload`,
|
|
724
|
+
* and `max-resolution` attributes are all deliberately absent. Capping which
|
|
725
|
+
* rendition is fetched is a delivery param on the URL — `?max_resolution=720p`
|
|
726
|
+
* on a Mux stream, for one — which keeps the renditions it excludes out of the
|
|
727
|
+
* manifest rather than merely unpicked; `preload` would have nothing to say,
|
|
728
|
+
* since the engine loads from the moment it has a source. And unlike
|
|
729
|
+
* `<background-video>` there are no `nomuted` / `noloop` / `noautoplay` opt-outs:
|
|
730
|
+
* those three are what this element is for, so the adapter fixes them on at
|
|
731
|
+
* attach.
|
|
732
|
+
*
|
|
733
|
+
* Takes no structured `source` — `src` is an HLS URL, as the package it replaces
|
|
734
|
+
* required. Mux playback-ID identity, poster, and storyboard belong to
|
|
735
|
+
* `<mux-video>`; none of them mean anything without controls to hang them on.
|
|
736
|
+
*
|
|
737
|
+
* Nothing about an unplayable source reaches the inner `<video>` on its own, so
|
|
738
|
+
* `error` on it stays null and the element sits at `readyState 0`. The engine
|
|
739
|
+
* reports each condition and logs it, the Media promotes the fatal one, and this
|
|
740
|
+
* element re-fires it as its own `error` / `'error'` — the one place a consumer
|
|
741
|
+
* holding the element can see a source that never appears.
|
|
742
|
+
*
|
|
743
|
+
* @fires error - Fired when a fatal condition is reported. Read `error` for it.
|
|
744
|
+
*
|
|
745
|
+
* `<mux-background-video>` is this element under the name the package it replaces
|
|
746
|
+
* used. Same class, so the tag is a naming choice and nothing more.
|
|
747
|
+
*
|
|
748
|
+
* @example
|
|
749
|
+
* ```html
|
|
750
|
+
* <hls-background-video src="https://stream.mux.com/PLAYBACK_ID.m3u8?max_resolution=720p">
|
|
751
|
+
* <img src="https://image.mux.com/PLAYBACK_ID/thumbnail.webp?time=0" alt="" />
|
|
752
|
+
* </hls-background-video>
|
|
753
|
+
* ```
|
|
754
|
+
*/
|
|
755
|
+
var HlsBackgroundVideo = class extends HlsBackgroundVideoBase {
|
|
756
|
+
static {
|
|
757
|
+
this.shadowRootOptions = { mode: "open" };
|
|
758
|
+
}
|
|
759
|
+
static {
|
|
760
|
+
this.getTemplateHTML = getTemplateHTML;
|
|
761
|
+
}
|
|
762
|
+
static get observedAttributes() {
|
|
763
|
+
return ["src"];
|
|
764
|
+
}
|
|
765
|
+
#media = new HlsBackgroundVideoMedia();
|
|
766
|
+
constructor() {
|
|
767
|
+
super();
|
|
768
|
+
if (!this.shadowRoot) {
|
|
769
|
+
this.attachShadow(this.constructor.shadowRootOptions);
|
|
770
|
+
const attrs = {
|
|
771
|
+
...namedNodeMapToObject(this.attributes),
|
|
772
|
+
muted: "",
|
|
773
|
+
loop: "",
|
|
774
|
+
autoplay: "",
|
|
775
|
+
playsinline: "",
|
|
776
|
+
disableremoteplayback: "",
|
|
777
|
+
disablepictureinpicture: ""
|
|
778
|
+
};
|
|
779
|
+
this.shadowRoot.innerHTML = getTemplateHTML(attrs);
|
|
780
|
+
}
|
|
781
|
+
const video = this.video;
|
|
782
|
+
if (video) this.#media.attach(video);
|
|
783
|
+
this.#media.addEventListener("error", () => this.dispatchEvent(new Event("error")));
|
|
784
|
+
}
|
|
785
|
+
/** Register the Media (not the inner `<video>`) with the provider. */
|
|
786
|
+
getMediaTarget() {
|
|
787
|
+
return this.#media;
|
|
788
|
+
}
|
|
789
|
+
disconnectedCallback() {
|
|
790
|
+
super.disconnectedCallback?.();
|
|
791
|
+
if (this.hasAttribute("keep-alive")) return;
|
|
792
|
+
queueMicrotask(() => {
|
|
793
|
+
if (!this.isConnected) this.#media.destroy();
|
|
794
|
+
});
|
|
795
|
+
}
|
|
796
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
797
|
+
if (oldValue === newValue) return;
|
|
798
|
+
if (name === "src") this.src = newValue ?? "";
|
|
799
|
+
}
|
|
800
|
+
/** The inner `<video>` the engine renders into. */
|
|
801
|
+
get video() {
|
|
802
|
+
const video = this.shadowRoot?.querySelector("video");
|
|
803
|
+
return video instanceof HTMLVideoElement ? video : null;
|
|
804
|
+
}
|
|
805
|
+
/**
|
|
806
|
+
* What made the current source unplayable, or `null`. An SVTA code rather than
|
|
807
|
+
* a `MediaError` one — 99001 where this player has no pipeline for what the
|
|
808
|
+
* source needs, with the specifics logged. Reset by a new source, and not on
|
|
809
|
+
* the inner `<video>`, which never learns of it.
|
|
810
|
+
*/
|
|
811
|
+
get error() {
|
|
812
|
+
return this.#media.error;
|
|
813
|
+
}
|
|
814
|
+
/** HLS manifest URL. Assigning a new one restarts playback from scratch. */
|
|
815
|
+
get src() {
|
|
816
|
+
return this.#media.src;
|
|
817
|
+
}
|
|
818
|
+
set src(value) {
|
|
819
|
+
this.#media.src = value;
|
|
820
|
+
}
|
|
821
|
+
};
|
|
822
|
+
|
|
823
|
+
//#endregion
|
|
824
|
+
export { HlsBackgroundVideo as t };
|
|
825
|
+
//# sourceMappingURL=media-mYKOAsk3.js.map
|