@hanifhan1f/vidstack 1.12.13 → 1.12.18
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/chunks/vidstack-2f5gzOW6.js +1 -0
- package/cdn/chunks/vidstack-BYgY9wmd.js +1 -0
- package/cdn/chunks/vidstack-BfBBPhXV.js +1 -0
- package/cdn/chunks/vidstack-Bjo5esRp.js +1 -0
- package/cdn/chunks/vidstack-BuL67v3q.js +1 -0
- package/cdn/chunks/vidstack-C0msPRTd.js +3 -0
- package/cdn/chunks/vidstack-CIjxJCz3.js +1 -0
- package/cdn/chunks/vidstack-C_AxqLKV.js +1 -0
- package/cdn/chunks/vidstack-CioT3Yw2.js +1 -0
- package/cdn/chunks/vidstack-CmpbA3Yd.js +16 -0
- package/cdn/chunks/vidstack-CrqkytHl.js +1 -0
- package/cdn/chunks/vidstack-D0M8R0ZU.js +1 -0
- package/cdn/chunks/vidstack-D40FSa5B.js +3 -0
- package/cdn/chunks/vidstack-DD2JwFVU.js +1 -0
- package/cdn/chunks/vidstack-DRH_1tFW.js +1 -0
- package/cdn/chunks/vidstack-DfDZuHNP.js +1 -0
- package/cdn/chunks/vidstack-DiNS2Vx5.js +1 -0
- package/cdn/chunks/vidstack-xjJ-ui_l.js +1 -0
- package/cdn/providers/vidstack-audio-2Dt_Ivbp.js +1 -0
- package/cdn/providers/vidstack-dash-CUtD4e6q.js +1 -0
- package/cdn/providers/vidstack-google-cast-BdORATUX.js +1 -0
- package/cdn/providers/vidstack-hls-R25Kb6DP.js +1 -0
- package/cdn/providers/vidstack-html-DaAUJYsD.js +1 -0
- package/cdn/providers/vidstack-video-Csvox7SO.js +1 -0
- package/cdn/providers/vidstack-vimeo-D4Z96kg2.js +1 -0
- package/cdn/providers/vidstack-youtube-DiND6h3s.js +1 -0
- package/cdn/vidstack.js +1 -0
- package/cdn/with-layouts/chunks/vidstack-2f5gzOW6.js +1 -0
- package/cdn/with-layouts/chunks/vidstack-BGhRKayG.js +914 -0
- package/cdn/with-layouts/chunks/vidstack-BL_lNyW_.js +1 -0
- package/cdn/with-layouts/chunks/vidstack-BMhNagfl.js +1 -0
- package/cdn/with-layouts/chunks/vidstack-BfBBPhXV.js +1 -0
- package/cdn/with-layouts/chunks/vidstack-BjOOdDcQ.js +1 -0
- package/cdn/with-layouts/chunks/vidstack-Bxv1Qnxe.js +1 -0
- package/cdn/with-layouts/chunks/vidstack-C5AP9wid.js +1 -0
- package/cdn/with-layouts/chunks/vidstack-CS2aNc61.js +1 -0
- package/cdn/with-layouts/chunks/vidstack-C_AxqLKV.js +1 -0
- package/cdn/with-layouts/chunks/vidstack-D-3_fAsK.js +1 -0
- package/cdn/with-layouts/chunks/vidstack-DKqYI_HJ.js +1 -0
- package/cdn/with-layouts/chunks/vidstack-DLVdcWrK.js +3 -0
- package/cdn/with-layouts/chunks/vidstack-DPO7J4-v.js +3 -0
- package/cdn/with-layouts/chunks/vidstack-DRH_1tFW.js +1 -0
- package/cdn/with-layouts/chunks/vidstack-DWjB11vV.js +1 -0
- package/cdn/with-layouts/chunks/vidstack-Dge3KT8k.js +1 -0
- package/cdn/with-layouts/chunks/vidstack-Dh2GOjra.js +1 -0
- package/cdn/with-layouts/chunks/vidstack-DiNS2Vx5.js +1 -0
- package/cdn/with-layouts/chunks/vidstack-QW5tTAS4.js +897 -0
- package/cdn/with-layouts/chunks/vidstack-Xe_d7ovA.js +1 -0
- package/cdn/with-layouts/chunks/vidstack-wt2OT4N7.js +1 -0
- package/cdn/with-layouts/providers/vidstack-audio-Bw1csc6N.js +1 -0
- package/cdn/with-layouts/providers/vidstack-dash-DHRMFG4Y.js +1 -0
- package/cdn/with-layouts/providers/vidstack-google-cast-BSYJYn-o.js +1 -0
- package/cdn/with-layouts/providers/vidstack-hls-DG1rTEqu.js +1 -0
- package/cdn/with-layouts/providers/vidstack-html-CoKFAYW5.js +1 -0
- package/cdn/with-layouts/providers/vidstack-video-CIxFJ9Z1.js +1 -0
- package/cdn/with-layouts/providers/vidstack-vimeo-CNLKOGMa.js +1 -0
- package/cdn/with-layouts/providers/vidstack-youtube-D1e-LE-8.js +1 -0
- package/cdn/with-layouts/vidstack.js +1 -0
- package/dev/chunks/vidstack-03oQOdB7.js +58 -0
- package/dev/chunks/vidstack-0Of4tJ8D.js +224 -0
- package/dev/chunks/vidstack-BJsZjPkB.js +204 -0
- package/dev/chunks/vidstack-BQSA-Rux.js +56 -0
- package/{src/core/quality/utils.ts → dev/chunks/vidstack-BTM4ERc7.js} +5 -7
- package/dev/chunks/vidstack-BXSB7eI9.js +58 -0
- package/dev/chunks/vidstack-BaGbgcvz.js +107 -0
- package/{src/core/time-ranges.ts → dev/chunks/vidstack-Becy7l6h.js} +22 -61
- package/dev/chunks/vidstack-Bf6x4gWe.js +29 -0
- package/dev/chunks/vidstack-BjxlZzGu.js +11 -0
- package/dev/chunks/vidstack-Blfm1k-4.js +1520 -0
- package/dev/chunks/vidstack-Bpr4fI4n.js +7 -0
- package/dev/chunks/vidstack-Bs54kFSz.js +66 -0
- package/dev/chunks/vidstack-Bur7I7Vy.js +57 -0
- package/dev/chunks/vidstack-C0SWkbs7.js +254 -0
- package/dev/chunks/vidstack-C1PwJD_4.js +1635 -0
- package/dev/chunks/vidstack-C4aPQ7hZ.js +1482 -0
- package/dev/chunks/vidstack-C6OqdJO7.js +114 -0
- package/dev/chunks/vidstack-C_rvOKWp.js +33 -0
- package/dev/chunks/vidstack-CaudO1jl.js +109 -0
- package/dev/chunks/vidstack-Cax7aAP-.js +66 -0
- package/dev/chunks/vidstack-CcQdBWil.js +58 -0
- package/dev/chunks/vidstack-CwTj4H1w.js +18 -0
- package/dev/chunks/vidstack-DAOcbKGP.js +254 -0
- package/dev/chunks/vidstack-DKaohJzR.js +5181 -0
- package/dev/chunks/vidstack-DXxIKXmd.js +50 -0
- package/dev/chunks/vidstack-DXzRuMtJ.js +107 -0
- package/dev/chunks/vidstack-Db1-Hg_U.js +297 -0
- package/dev/chunks/vidstack-DbBJlz7I.js +10 -0
- package/dev/chunks/vidstack-Dihypf8P.js +11 -0
- package/dev/chunks/vidstack-Dm1xEU9Q.js +34 -0
- package/dev/chunks/vidstack-Dv_LIPFu.js +14 -0
- package/{src/foundation/observers/raf-loop.ts → dev/chunks/vidstack-DwyWIZjv.js} +8 -11
- package/dev/chunks/vidstack-EoLRQZbs.js +2986 -0
- package/dev/chunks/vidstack-FKkY62Dr.js +104 -0
- package/dev/chunks/vidstack-krOAtKMi.js +32 -0
- package/dev/define/plyr-layout.js +52 -0
- package/dev/define/templates/plyr-layout.js +571 -0
- package/dev/define/templates/vidstack-audio-layout.js +168 -0
- package/dev/define/templates/vidstack-video-layout.js +486 -0
- package/dev/define/vidstack-icons.js +1 -0
- package/dev/define/vidstack-player-default-layout.js +22 -0
- package/dev/define/vidstack-player-layouts.js +26 -0
- package/dev/define/vidstack-player-ui.js +71 -0
- package/dev/define/vidstack-player.js +19 -0
- package/dev/global/plyr.js +502 -0
- package/dev/global/vidstack-player.js +129 -0
- package/dev/providers/vidstack-audio.js +35 -0
- package/dev/providers/vidstack-dash.js +516 -0
- package/dev/providers/vidstack-google-cast.js +474 -0
- package/dev/providers/vidstack-hls.js +408 -0
- package/dev/providers/vidstack-html.js +567 -0
- package/dev/providers/vidstack-video.js +207 -0
- package/dev/providers/vidstack-vimeo.js +554 -0
- package/dev/providers/vidstack-youtube.js +286 -0
- package/dev/vidstack-elements.js +37 -0
- package/dev/vidstack.js +92 -0
- package/elements.d.ts +1433 -0
- package/global/player.d.ts +52 -0
- package/{types/global → global}/plyr.d.ts +32 -33
- package/icons.d.ts +1 -0
- package/index.d.ts +402 -0
- package/package.json +3 -87
- package/{styles/player → player/styles}/default/layouts/video.css +69 -0
- package/plugins.d.ts +19 -0
- package/plugins.js +13 -0
- package/prod/chunks/vidstack-9_r3lWNO.js +45 -0
- package/prod/chunks/vidstack-B01xzxC4.js +7 -0
- package/prod/chunks/vidstack-BDIzK77F.js +107 -0
- package/prod/chunks/vidstack-BHqGlnGz.js +1482 -0
- package/prod/chunks/vidstack-BNpgCJJ1.js +1588 -0
- package/prod/chunks/vidstack-BP49Gz0m.js +58 -0
- package/prod/chunks/vidstack-BRZe2BNi.js +107 -0
- package/prod/chunks/vidstack-BTM4ERc7.js +11 -0
- package/prod/chunks/vidstack-BaaRY-9x.js +201 -0
- package/prod/chunks/vidstack-BdFYWy6h.js +26 -0
- package/prod/chunks/vidstack-BpLd9ASW.js +246 -0
- package/prod/chunks/vidstack-C05ipjAK.js +1520 -0
- package/prod/chunks/vidstack-C9vIqaYT.js +10 -0
- package/prod/chunks/vidstack-CA4tDJdF.js +33 -0
- package/prod/chunks/vidstack-COLU-zPZ.js +57 -0
- package/prod/chunks/vidstack-CwTj4H1w.js +18 -0
- package/prod/chunks/vidstack-D5EzK014.js +14 -0
- package/prod/chunks/vidstack-D7hJcnN-.js +297 -0
- package/prod/chunks/vidstack-DB9WDRL5.js +248 -0
- package/prod/chunks/vidstack-DESBVLFp.js +104 -0
- package/prod/chunks/vidstack-DXxIKXmd.js +50 -0
- package/prod/chunks/vidstack-DcMkaIHJ.js +2976 -0
- package/prod/chunks/vidstack-Dihypf8P.js +11 -0
- package/prod/chunks/vidstack-Dm1xEU9Q.js +34 -0
- package/prod/chunks/vidstack-DwenML7x.js +4771 -0
- package/prod/chunks/vidstack-Fem0yF3c.js +77 -0
- package/prod/chunks/vidstack-IDWYvfna.js +58 -0
- package/prod/chunks/vidstack-MbEMbVfP.js +109 -0
- package/prod/chunks/vidstack-Oq65llxr.js +29 -0
- package/prod/chunks/vidstack-SnIdjCkV.js +58 -0
- package/prod/chunks/vidstack-V1jwkH0s.js +66 -0
- package/prod/chunks/vidstack-bdt7uOlN.js +114 -0
- package/prod/chunks/vidstack-krOAtKMi.js +32 -0
- package/prod/chunks/vidstack-mxJIo4Sg.js +56 -0
- package/prod/chunks/vidstack-tt3O1zL6.js +11 -0
- package/prod/chunks/vidstack-zfCm-GM5.js +205 -0
- package/prod/define/plyr-layout.js +52 -0
- package/prod/define/templates/plyr-layout.js +571 -0
- package/prod/define/templates/vidstack-audio-layout.js +168 -0
- package/prod/define/templates/vidstack-video-layout.js +486 -0
- package/prod/define/vidstack-icons.js +1 -0
- package/prod/define/vidstack-player-default-layout.js +22 -0
- package/prod/define/vidstack-player-layouts.js +26 -0
- package/prod/define/vidstack-player-ui.js +71 -0
- package/prod/define/vidstack-player.js +19 -0
- package/prod/global/plyr.js +494 -0
- package/prod/global/vidstack-player.js +129 -0
- package/prod/providers/vidstack-audio.js +35 -0
- package/prod/providers/vidstack-dash.js +501 -0
- package/prod/providers/vidstack-google-cast.js +468 -0
- package/prod/providers/vidstack-hls.js +393 -0
- package/prod/providers/vidstack-html.js +555 -0
- package/prod/providers/vidstack-video.js +204 -0
- package/prod/providers/vidstack-vimeo.js +548 -0
- package/prod/providers/vidstack-youtube.js +286 -0
- package/prod/vidstack-elements.js +37 -0
- package/prod/vidstack.js +159 -0
- package/server/chunks/vidstack-B4CWj0Hp.js +381 -0
- package/server/chunks/vidstack-B8LynzY5.js +1564 -0
- package/server/chunks/vidstack-BGgfNYAH.js +141 -0
- package/server/chunks/vidstack-BGmwlunt.js +3035 -0
- package/server/chunks/vidstack-BOTZD4tC.js +18 -0
- package/server/chunks/vidstack-C19bj3Wq.js +307 -0
- package/server/chunks/vidstack-CFTkUXGK.js +295 -0
- package/server/chunks/vidstack-CQMB7Msg.js +1502 -0
- package/server/chunks/vidstack-CdBfecZT.js +205 -0
- package/server/chunks/vidstack-Cv_Art04.js +4635 -0
- package/server/chunks/vidstack-CwTj4H1w.js +18 -0
- package/server/chunks/vidstack-DE4b5Bgx.js +2002 -0
- package/server/chunks/vidstack-DXxIKXmd.js +50 -0
- package/server/chunks/vidstack-DbvCOsqU.js +107 -0
- package/server/chunks/vidstack-DgHfFDiw.js +1962 -0
- package/server/chunks/vidstack-Dm1xEU9Q.js +34 -0
- package/server/chunks/vidstack-DnkB7eGO.js +207 -0
- package/server/chunks/vidstack-DsnTqzpL.js +29 -0
- package/{src/elements/define/layouts/plyr/ui.ts → server/chunks/vidstack-FHGkN5xj.js} +144 -235
- package/server/chunks/vidstack-P_QDjYIl.js +56 -0
- package/server/chunks/vidstack-f5-aflD2.js +104 -0
- package/server/chunks/vidstack-krOAtKMi.js +32 -0
- package/server/define/plyr-layout.js +16 -0
- package/server/define/vidstack-icons.js +1 -0
- package/server/define/vidstack-player-default-layout.js +13 -0
- package/server/define/vidstack-player-layouts.js +16 -0
- package/server/define/vidstack-player-ui.js +11 -0
- package/server/define/vidstack-player.js +6 -0
- package/server/global/plyr.js +322 -0
- package/server/global/vidstack-player.js +58 -0
- package/server/vidstack-elements.js +46 -0
- package/server/vidstack.js +148 -0
- package/types/vidstack-BOvzfZjK.d.ts +1269 -0
- package/types/vidstack-DYLKXUvI.d.ts +7479 -0
- package/.templates/sandbox/favicon-32x32.png +0 -0
- package/.templates/sandbox/index.html +0 -42
- package/.templates/sandbox/main.ts +0 -137
- package/.templates/sandbox/styles.css +0 -68
- package/analyze.config.ts +0 -133
- package/build/build-styles.js +0 -33
- package/build/rollup-decorators.ts +0 -102
- package/build/rollup-minify.js +0 -20
- package/build/rollup-ts.js +0 -57
- package/rollup.config.ts +0 -442
- package/src/components/aria/announcer.ts +0 -181
- package/src/components/layouts/default/audio-layout.ts +0 -20
- package/src/components/layouts/default/context.ts +0 -15
- package/src/components/layouts/default/default-layout.ts +0 -67
- package/src/components/layouts/default/props.ts +0 -143
- package/src/components/layouts/default/translations.ts +0 -70
- package/src/components/layouts/default/video-layout.ts +0 -20
- package/src/components/layouts/plyr/context.ts +0 -13
- package/src/components/layouts/plyr/plyr-layout.ts +0 -90
- package/src/components/layouts/plyr/props.ts +0 -114
- package/src/components/layouts/plyr/translations.ts +0 -53
- package/src/components/player.ts +0 -758
- package/src/components/provider/provider.ts +0 -184
- package/src/components/provider/source-select.ts +0 -378
- package/src/components/provider/tracks.ts +0 -37
- package/src/components/ui/buttons/airplay-button.ts +0 -74
- package/src/components/ui/buttons/caption-button.ts +0 -68
- package/src/components/ui/buttons/fullscreen-button.ts +0 -90
- package/src/components/ui/buttons/google-cast-button.ts +0 -75
- package/src/components/ui/buttons/live-button.ts +0 -76
- package/src/components/ui/buttons/mute-button.ts +0 -69
- package/src/components/ui/buttons/pip-button.ts +0 -71
- package/src/components/ui/buttons/play-button.ts +0 -62
- package/src/components/ui/buttons/seek-button.ts +0 -92
- package/src/components/ui/buttons/toggle-button-controller.ts +0 -92
- package/src/components/ui/buttons/toggle-button.ts +0 -49
- package/src/components/ui/captions/captions-renderer.ts +0 -63
- package/src/components/ui/captions/captions.ts +0 -227
- package/src/components/ui/controls-group.ts +0 -13
- package/src/components/ui/controls.ts +0 -101
- package/src/components/ui/gesture.ts +0 -252
- package/src/components/ui/menu/menu-button.ts +0 -95
- package/src/components/ui/menu/menu-context.ts +0 -27
- package/src/components/ui/menu/menu-focus-controller.ts +0 -205
- package/src/components/ui/menu/menu-item.ts +0 -9
- package/src/components/ui/menu/menu-items.ts +0 -129
- package/src/components/ui/menu/menu-portal.ts +0 -105
- package/src/components/ui/menu/menu.ts +0 -612
- package/src/components/ui/menu/radio/radio-controller.ts +0 -18
- package/src/components/ui/menu/radio/radio-group-controller.ts +0 -81
- package/src/components/ui/menu/radio/radio-group.ts +0 -78
- package/src/components/ui/menu/radio/radio.ts +0 -151
- package/src/components/ui/menu/radio-groups/audio-gain-radio-group.ts +0 -116
- package/src/components/ui/menu/radio-groups/audio-radio-group.ts +0 -121
- package/src/components/ui/menu/radio-groups/captions-radio-group.ts +0 -153
- package/src/components/ui/menu/radio-groups/chapters-radio-group.ts +0 -211
- package/src/components/ui/menu/radio-groups/quality-radio-group.ts +0 -181
- package/src/components/ui/menu/radio-groups/speed-radio-group.ts +0 -112
- package/src/components/ui/popper/popper.ts +0 -103
- package/src/components/ui/poster.ts +0 -187
- package/src/components/ui/sliders/audio-gain-slider.ts +0 -150
- package/src/components/ui/sliders/quality-slider.ts +0 -148
- package/src/components/ui/sliders/slider/api/cssvars.ts +0 -10
- package/src/components/ui/sliders/slider/api/events.ts +0 -65
- package/src/components/ui/sliders/slider/api/state.ts +0 -101
- package/src/components/ui/sliders/slider/events-controller.ts +0 -383
- package/src/components/ui/sliders/slider/format.ts +0 -12
- package/src/components/ui/sliders/slider/slider-context.ts +0 -18
- package/src/components/ui/sliders/slider/slider-controller.ts +0 -211
- package/src/components/ui/sliders/slider/slider.ts +0 -94
- package/src/components/ui/sliders/slider/types.ts +0 -1
- package/src/components/ui/sliders/slider/utils.ts +0 -14
- package/src/components/ui/sliders/slider-preview.ts +0 -131
- package/src/components/ui/sliders/slider-thumbnail.ts +0 -28
- package/src/components/ui/sliders/slider-value.ts +0 -122
- package/src/components/ui/sliders/slider-video.ts +0 -198
- package/src/components/ui/sliders/speed-slider.ts +0 -147
- package/src/components/ui/sliders/time-slider/slider-chapters.ts +0 -444
- package/src/components/ui/sliders/time-slider/time-slider.ts +0 -319
- package/src/components/ui/sliders/volume-slider.ts +0 -145
- package/src/components/ui/thumbnails/thumbnail-loader.ts +0 -324
- package/src/components/ui/thumbnails/thumbnail.ts +0 -244
- package/src/components/ui/time.ts +0 -191
- package/src/components/ui/tooltip/tooltip-content.ts +0 -105
- package/src/components/ui/tooltip/tooltip-context.ts +0 -13
- package/src/components/ui/tooltip/tooltip-trigger.ts +0 -49
- package/src/components/ui/tooltip/tooltip.ts +0 -127
- package/src/core/api/media-attrs.ts +0 -35
- package/src/core/api/media-context.ts +0 -52
- package/src/core/api/media-events.ts +0 -601
- package/src/core/api/media-request-events.ts +0 -323
- package/src/core/api/player-controller.ts +0 -10
- package/src/core/api/player-events.ts +0 -49
- package/src/core/api/player-props.ts +0 -233
- package/src/core/api/player-state.ts +0 -940
- package/src/core/api/src-types.ts +0 -97
- package/src/core/api/types.ts +0 -69
- package/src/core/controls.ts +0 -251
- package/src/core/font/font-options.ts +0 -106
- package/src/core/font/font-vars.ts +0 -107
- package/src/core/keyboard/aria-shortcuts.ts +0 -42
- package/src/core/keyboard/controller.ts +0 -302
- package/src/core/keyboard/types.ts +0 -40
- package/src/core/quality/events.ts +0 -48
- package/src/core/quality/symbols.ts +0 -8
- package/src/core/quality/video-quality.ts +0 -86
- package/src/core/state/media-events-logger.ts +0 -67
- package/src/core/state/media-load-controller.ts +0 -40
- package/src/core/state/media-player-delegate.ts +0 -170
- package/src/core/state/media-request-manager.ts +0 -952
- package/src/core/state/media-state-manager.ts +0 -1077
- package/src/core/state/media-state-sync.ts +0 -162
- package/src/core/state/media-storage.ts +0 -196
- package/src/core/state/navigator-media-session.ts +0 -62
- package/src/core/state/remote-control.ts +0 -584
- package/src/core/state/tracked-media-events.ts +0 -22
- package/src/core/tracks/audio/audio-tracks.ts +0 -33
- package/src/core/tracks/audio/events.ts +0 -41
- package/src/core/tracks/text/events.ts +0 -52
- package/src/core/tracks/text/render/libass-text-renderer.ts +0 -246
- package/src/core/tracks/text/render/native-text-renderer.ts +0 -106
- package/src/core/tracks/text/render/text-renderer.ts +0 -134
- package/src/core/tracks/text/symbols.ts +0 -17
- package/src/core/tracks/text/text-track.test.ts +0 -407
- package/src/core/tracks/text/text-track.ts +0 -413
- package/src/core/tracks/text/text-tracks.ts +0 -210
- package/src/core/tracks/text/utils.ts +0 -85
- package/src/elements/bundles/cdn/player.core.ts +0 -6
- package/src/elements/bundles/cdn/player.ts +0 -8
- package/src/elements/bundles/cdn/plyr.ts +0 -6
- package/src/elements/bundles/cdn-legacy/player-with-default.ts +0 -4
- package/src/elements/bundles/cdn-legacy/player-with-layouts.ts +0 -4
- package/src/elements/bundles/cdn-legacy/player-with-plyr.ts +0 -3
- package/src/elements/bundles/cdn-legacy/player.ts +0 -3
- package/src/elements/bundles/icons.ts +0 -3
- package/src/elements/bundles/player-layouts/default.ts +0 -7
- package/src/elements/bundles/player-layouts/index.ts +0 -9
- package/src/elements/bundles/player-layouts/plyr.ts +0 -65
- package/src/elements/bundles/player-ui.ts +0 -108
- package/src/elements/bundles/player.ts +0 -7
- package/src/elements/define/announcer-element.ts +0 -20
- package/src/elements/define/buttons/airplay-button-element.ts +0 -21
- package/src/elements/define/buttons/caption-button-element.ts +0 -22
- package/src/elements/define/buttons/fullscreen-button-element.ts +0 -22
- package/src/elements/define/buttons/google-cast-button-element.ts +0 -21
- package/src/elements/define/buttons/live-button-element.ts +0 -22
- package/src/elements/define/buttons/mute-button-element.ts +0 -23
- package/src/elements/define/buttons/pip-button-element.ts +0 -22
- package/src/elements/define/buttons/play-button-element.ts +0 -23
- package/src/elements/define/buttons/seek-button-element.ts +0 -26
- package/src/elements/define/buttons/toggle-button-element.ts +0 -21
- package/src/elements/define/captions-element.ts +0 -20
- package/src/elements/define/chapter-title-element.ts +0 -54
- package/src/elements/define/controls-element.ts +0 -26
- package/src/elements/define/controls-group-element.ts +0 -26
- package/src/elements/define/gesture-element.ts +0 -24
- package/src/elements/define/layouts/default/audio-layout-element.ts +0 -137
- package/src/elements/define/layouts/default/audio-layout.ts +0 -113
- package/src/elements/define/layouts/default/icons-loader.ts +0 -17
- package/src/elements/define/layouts/default/icons.ts +0 -86
- package/src/elements/define/layouts/default/slots.ts +0 -12
- package/src/elements/define/layouts/default/ui/announcer.ts +0 -14
- package/src/elements/define/layouts/default/ui/buttons.ts +0 -291
- package/src/elements/define/layouts/default/ui/captions.ts +0 -14
- package/src/elements/define/layouts/default/ui/controls.ts +0 -5
- package/src/elements/define/layouts/default/ui/keyboard-display.ts +0 -114
- package/src/elements/define/layouts/default/ui/menu/accessibility-menu.ts +0 -79
- package/src/elements/define/layouts/default/ui/menu/audio-menu.ts +0 -135
- package/src/elements/define/layouts/default/ui/menu/captions-menu.ts +0 -114
- package/src/elements/define/layouts/default/ui/menu/chapters-menu.ts +0 -117
- package/src/elements/define/layouts/default/ui/menu/episodes-menu.ts +0 -133
- package/src/elements/define/layouts/default/ui/menu/font-menu.ts +0 -253
- package/src/elements/define/layouts/default/ui/menu/items/menu-checkbox.ts +0 -67
- package/src/elements/define/layouts/default/ui/menu/items/menu-items.ts +0 -108
- package/src/elements/define/layouts/default/ui/menu/items/menu-slider.ts +0 -59
- package/src/elements/define/layouts/default/ui/menu/menu-portal.ts +0 -56
- package/src/elements/define/layouts/default/ui/menu/playback-menu.ts +0 -183
- package/src/elements/define/layouts/default/ui/menu/settings-menu.ts +0 -98
- package/src/elements/define/layouts/default/ui/slider.ts +0 -112
- package/src/elements/define/layouts/default/ui/time.ts +0 -41
- package/src/elements/define/layouts/default/ui/title.ts +0 -25
- package/src/elements/define/layouts/default/ui/utils.ts +0 -10
- package/src/elements/define/layouts/default/video-layout-element.ts +0 -125
- package/src/elements/define/layouts/default/video-layout.ts +0 -353
- package/src/elements/define/layouts/icons/icons-loader.ts +0 -47
- package/src/elements/define/layouts/icons/layout-icons-loader.ts +0 -24
- package/src/elements/define/layouts/layout-element.ts +0 -78
- package/src/elements/define/layouts/layout-name.ts +0 -15
- package/src/elements/define/layouts/plyr/icons/plyr-airplay.js +0 -1
- package/src/elements/define/layouts/plyr/icons/plyr-captions-off.js +0 -1
- package/src/elements/define/layouts/plyr/icons/plyr-captions-on.js +0 -1
- package/src/elements/define/layouts/plyr/icons/plyr-download.js +0 -1
- package/src/elements/define/layouts/plyr/icons/plyr-enter-fullscreen.js +0 -1
- package/src/elements/define/layouts/plyr/icons/plyr-exit-fullscreen.js +0 -1
- package/src/elements/define/layouts/plyr/icons/plyr-fast-forward.js +0 -1
- package/src/elements/define/layouts/plyr/icons/plyr-muted.js +0 -1
- package/src/elements/define/layouts/plyr/icons/plyr-pause.js +0 -1
- package/src/elements/define/layouts/plyr/icons/plyr-pip.js +0 -1
- package/src/elements/define/layouts/plyr/icons/plyr-play.js +0 -1
- package/src/elements/define/layouts/plyr/icons/plyr-restart.js +0 -1
- package/src/elements/define/layouts/plyr/icons/plyr-rewind.js +0 -1
- package/src/elements/define/layouts/plyr/icons/plyr-settings.js +0 -1
- package/src/elements/define/layouts/plyr/icons/plyr-volume.js +0 -1
- package/src/elements/define/layouts/plyr/icons-loader.ts +0 -21
- package/src/elements/define/layouts/plyr/icons.ts +0 -34
- package/src/elements/define/layouts/plyr/plyr-layout-element.ts +0 -67
- package/src/elements/define/layouts/slot-manager.ts +0 -61
- package/src/elements/define/layouts/slot-observer.ts +0 -70
- package/src/elements/define/menus/_template.ts +0 -47
- package/src/elements/define/menus/audio-gain-group-element.ts +0 -37
- package/src/elements/define/menus/audio-radio-group-element.ts +0 -37
- package/src/elements/define/menus/captions-radio-group-element.ts +0 -37
- package/src/elements/define/menus/chapters-radio-group-element.ts +0 -68
- package/src/elements/define/menus/menu-button-element.ts +0 -27
- package/src/elements/define/menus/menu-element.ts +0 -28
- package/src/elements/define/menus/menu-item-element.ts +0 -24
- package/src/elements/define/menus/menu-items-element.ts +0 -27
- package/src/elements/define/menus/menu-portal-element.ts +0 -35
- package/src/elements/define/menus/quality-radio-group-element.ts +0 -51
- package/src/elements/define/menus/radio-element.ts +0 -24
- package/src/elements/define/menus/radio-group-element.ts +0 -24
- package/src/elements/define/menus/speed-radio-group-element.ts +0 -37
- package/src/elements/define/player-element.ts +0 -33
- package/src/elements/define/poster-element.ts +0 -53
- package/src/elements/define/provider-cast-display.ts +0 -36
- package/src/elements/define/provider-element.ts +0 -158
- package/src/elements/define/sliders/audio-gain-slider-element.ts +0 -34
- package/src/elements/define/sliders/quality-slider-element.ts +0 -34
- package/src/elements/define/sliders/slider-chapters-element.ts +0 -53
- package/src/elements/define/sliders/slider-element.ts +0 -25
- package/src/elements/define/sliders/slider-preview-element.ts +0 -16
- package/src/elements/define/sliders/slider-steps-element.ts +0 -50
- package/src/elements/define/sliders/slider-thumbnail-element.ts +0 -48
- package/src/elements/define/sliders/slider-value-element.ts +0 -49
- package/src/elements/define/sliders/slider-video-element.ts +0 -59
- package/src/elements/define/sliders/speed-slider-element.ts +0 -34
- package/src/elements/define/sliders/time-slider-element.ts +0 -34
- package/src/elements/define/sliders/volume-slider-element.ts +0 -34
- package/src/elements/define/spinner-element.ts +0 -96
- package/src/elements/define/thumbnail-element.ts +0 -63
- package/src/elements/define/time-element.ts +0 -32
- package/src/elements/define/title-element.ts +0 -38
- package/src/elements/define/tooltips/tooltip-content-element.ts +0 -28
- package/src/elements/define/tooltips/tooltip-element.ts +0 -28
- package/src/elements/define/tooltips/tooltip-trigger-element.ts +0 -32
- package/src/elements/icon.ts +0 -30
- package/src/elements/index.ts +0 -71
- package/src/elements/lit/directives/signal.ts +0 -80
- package/src/elements/lit/html.ts +0 -11
- package/src/elements/lit/lit-element.ts +0 -23
- package/src/elements/state-controller.ts +0 -48
- package/src/exports/components.ts +0 -79
- package/src/exports/core.ts +0 -41
- package/src/exports/events.ts +0 -46
- package/src/exports/font.ts +0 -3
- package/src/exports/foundation.ts +0 -8
- package/src/exports/maverick.ts +0 -9
- package/src/exports/providers.ts +0 -42
- package/src/exports/utils.ts +0 -18
- package/src/foundation/fullscreen/controller.ts +0 -128
- package/src/foundation/fullscreen/events.ts +0 -26
- package/src/foundation/list/list.ts +0 -127
- package/src/foundation/list/select-list.ts +0 -86
- package/src/foundation/list/symbols.ts +0 -22
- package/src/foundation/logger/colors.ts +0 -33
- package/src/foundation/logger/controller.ts +0 -71
- package/src/foundation/logger/events.ts +0 -29
- package/src/foundation/logger/grouped-log.ts +0 -44
- package/src/foundation/logger/log-level.ts +0 -17
- package/src/foundation/logger/log-printer.ts +0 -119
- package/src/foundation/logger/ms.ts +0 -31
- package/src/foundation/observers/focus-visible.ts +0 -74
- package/src/foundation/observers/intersection-observer.ts +0 -60
- package/src/foundation/observers/page-visibility.ts +0 -105
- package/src/foundation/orientation/controller.ts +0 -139
- package/src/foundation/orientation/events.ts +0 -20
- package/src/foundation/orientation/types.ts +0 -96
- package/src/foundation/queue/queue.ts +0 -41
- package/src/foundation/queue/request-queue.test.ts +0 -139
- package/src/foundation/queue/request-queue.ts +0 -94
- package/src/global/layouts/default.ts +0 -28
- package/src/global/layouts/loader.ts +0 -5
- package/src/global/layouts/plyr.ts +0 -24
- package/src/global/player.ts +0 -144
- package/src/global/plyr.ts +0 -917
- package/src/globals.d.ts +0 -11
- package/src/index.ts +0 -10
- package/src/plugins.ts +0 -369
- package/src/providers/audio/loader.ts +0 -45
- package/src/providers/audio/provider.ts +0 -50
- package/src/providers/dash/dash.ts +0 -417
- package/src/providers/dash/events.ts +0 -585
- package/src/providers/dash/lib-loader.ts +0 -202
- package/src/providers/dash/loader.ts +0 -33
- package/src/providers/dash/provider.ts +0 -135
- package/src/providers/dash/types.ts +0 -21
- package/src/providers/embed/EmbedProvider.ts +0 -84
- package/src/providers/google-cast/events.ts +0 -53
- package/src/providers/google-cast/loader.ts +0 -174
- package/src/providers/google-cast/media-info.ts +0 -49
- package/src/providers/google-cast/provider.ts +0 -483
- package/src/providers/google-cast/tracks.ts +0 -170
- package/src/providers/google-cast/types.ts +0 -3
- package/src/providers/google-cast/utils.ts +0 -112
- package/src/providers/hls/events.ts +0 -472
- package/src/providers/hls/hls.ts +0 -290
- package/src/providers/hls/lib-loader.ts +0 -178
- package/src/providers/hls/loader.ts +0 -33
- package/src/providers/hls/provider.ts +0 -137
- package/src/providers/hls/types.ts +0 -10
- package/src/providers/html/audio/audio-context.ts +0 -60
- package/src/providers/html/audio/audio-gain.ts +0 -100
- package/src/providers/html/html/342/200/223media-events.ts +0 -338
- package/src/providers/html/native-audio-tracks.ts +0 -91
- package/src/providers/html/provider.ts +0 -141
- package/src/providers/html/remote-playback.ts +0 -94
- package/src/providers/type-check.ts +0 -61
- package/src/providers/types.ts +0 -95
- package/src/providers/video/loader.ts +0 -45
- package/src/providers/video/native-hls-text-tracks.ts +0 -69
- package/src/providers/video/picture-in-picture.ts +0 -54
- package/src/providers/video/presentation/events.ts +0 -12
- package/src/providers/video/presentation/video-presentation.ts +0 -110
- package/src/providers/video/provider.ts +0 -91
- package/src/providers/vimeo/embed/command.ts +0 -118
- package/src/providers/vimeo/embed/event.ts +0 -124
- package/src/providers/vimeo/embed/message.ts +0 -9
- package/src/providers/vimeo/embed/misc.ts +0 -57
- package/src/providers/vimeo/embed/params.ts +0 -168
- package/src/providers/vimeo/loader.ts +0 -61
- package/src/providers/vimeo/provider.ts +0 -730
- package/src/providers/vimeo/utils.ts +0 -53
- package/src/providers/youtube/embed/command.ts +0 -21
- package/src/providers/youtube/embed/event.ts +0 -1
- package/src/providers/youtube/embed/message.ts +0 -54
- package/src/providers/youtube/embed/params.ts +0 -238
- package/src/providers/youtube/embed/quality.ts +0 -35
- package/src/providers/youtube/embed/state.ts +0 -13
- package/src/providers/youtube/loader.ts +0 -61
- package/src/providers/youtube/provider.ts +0 -403
- package/src/providers/youtube/utils.ts +0 -45
- package/src/tailwind.test.ts +0 -413
- package/src/test-utils/index.ts +0 -22
- package/src/test-utils/setup.ts +0 -3
- package/src/utils/aria.ts +0 -14
- package/src/utils/array.ts +0 -3
- package/src/utils/color.ts +0 -5
- package/src/utils/dom.ts +0 -458
- package/src/utils/error.ts +0 -11
- package/src/utils/language.ts +0 -16
- package/src/utils/manifest.ts +0 -61
- package/src/utils/mime.ts +0 -101
- package/src/utils/network.ts +0 -118
- package/src/utils/number.ts +0 -25
- package/src/utils/promise.ts +0 -12
- package/src/utils/scroll.ts +0 -19
- package/src/utils/support.ts +0 -163
- package/src/utils/time.test.ts +0 -111
- package/src/utils/time.ts +0 -123
- package/tsconfig.build.json +0 -9
- package/tsconfig.json +0 -11
- package/types/components/aria/announcer.d.ts +0 -27
- package/types/components/layouts/default/audio-layout.d.ts +0 -15
- package/types/components/layouts/default/context.d.ts +0 -9
- package/types/components/layouts/default/default-layout.d.ts +0 -10
- package/types/components/layouts/default/props.d.ts +0 -125
- package/types/components/layouts/default/translations.d.ts +0 -6
- package/types/components/layouts/default/video-layout.d.ts +0 -15
- package/types/components/layouts/plyr/context.d.ts +0 -7
- package/types/components/layouts/plyr/plyr-layout.d.ts +0 -9
- package/types/components/layouts/plyr/props.d.ts +0 -68
- package/types/components/layouts/plyr/translations.d.ts +0 -6
- package/types/components/player.d.ts +0 -214
- package/types/components/provider/provider.d.ts +0 -24
- package/types/components/provider/source-select.d.ts +0 -10
- package/types/components/provider/tracks.d.ts +0 -7
- package/types/components/ui/buttons/airplay-button.d.ts +0 -23
- package/types/components/ui/buttons/caption-button.d.ts +0 -21
- package/types/components/ui/buttons/fullscreen-button.d.ts +0 -28
- package/types/components/ui/buttons/google-cast-button.d.ts +0 -23
- package/types/components/ui/buttons/live-button.d.ts +0 -30
- package/types/components/ui/buttons/mute-button.d.ts +0 -21
- package/types/components/ui/buttons/pip-button.d.ts +0 -22
- package/types/components/ui/buttons/play-button.d.ts +0 -21
- package/types/components/ui/buttons/seek-button.d.ts +0 -32
- package/types/components/ui/buttons/toggle-button-controller.d.ts +0 -20
- package/types/components/ui/buttons/toggle-button.d.ts +0 -29
- package/types/components/ui/captions/captions-renderer.d.ts +0 -12
- package/types/components/ui/captions/captions.d.ts +0 -22
- package/types/components/ui/controls-group.d.ts +0 -9
- package/types/components/ui/controls.d.ts +0 -38
- package/types/components/ui/gesture.d.ts +0 -64
- package/types/components/ui/menu/menu-button.d.ts +0 -37
- package/types/components/ui/menu/menu-context.d.ts +0 -23
- package/types/components/ui/menu/menu-focus-controller.d.ts +0 -14
- package/types/components/ui/menu/menu-item.d.ts +0 -9
- package/types/components/ui/menu/menu-items.d.ts +0 -44
- package/types/components/ui/menu/menu-portal.d.ts +0 -31
- package/types/components/ui/menu/menu.d.ts +0 -66
- package/types/components/ui/menu/radio/radio-controller.d.ts +0 -14
- package/types/components/ui/menu/radio/radio-group-controller.d.ts +0 -11
- package/types/components/ui/menu/radio/radio-group.d.ts +0 -40
- package/types/components/ui/menu/radio/radio.d.ts +0 -50
- package/types/components/ui/menu/radio-groups/audio-gain-radio-group.d.ts +0 -36
- package/types/components/ui/menu/radio-groups/audio-radio-group.d.ts +0 -37
- package/types/components/ui/menu/radio-groups/captions-radio-group.d.ts +0 -38
- package/types/components/ui/menu/radio-groups/chapters-radio-group.d.ts +0 -46
- package/types/components/ui/menu/radio-groups/quality-radio-group.d.ts +0 -48
- package/types/components/ui/menu/radio-groups/speed-radio-group.d.ts +0 -36
- package/types/components/ui/popper/popper.d.ts +0 -15
- package/types/components/ui/poster.d.ts +0 -47
- package/types/components/ui/sliders/audio-gain-slider.d.ts +0 -43
- package/types/components/ui/sliders/quality-slider.d.ts +0 -34
- package/types/components/ui/sliders/slider/api/cssvars.d.ts +0 -10
- package/types/components/ui/sliders/slider/api/events.d.ts +0 -57
- package/types/components/ui/sliders/slider/api/state.d.ts +0 -68
- package/types/components/ui/sliders/slider/events-controller.d.ts +0 -23
- package/types/components/ui/sliders/slider/format.d.ts +0 -8
- package/types/components/ui/sliders/slider/slider-context.d.ts +0 -13
- package/types/components/ui/sliders/slider/slider-controller.d.ts +0 -59
- package/types/components/ui/sliders/slider/slider.d.ts +0 -39
- package/types/components/ui/sliders/slider/types.d.ts +0 -1
- package/types/components/ui/sliders/slider/utils.d.ts +0 -2
- package/types/components/ui/sliders/slider-preview.d.ts +0 -34
- package/types/components/ui/sliders/slider-thumbnail.d.ts +0 -16
- package/types/components/ui/sliders/slider-value.d.ts +0 -59
- package/types/components/ui/sliders/slider-video.d.ts +0 -73
- package/types/components/ui/sliders/speed-slider.d.ts +0 -42
- package/types/components/ui/sliders/time-slider/slider-chapters.d.ts +0 -36
- package/types/components/ui/sliders/time-slider/time-slider.d.ts +0 -56
- package/types/components/ui/sliders/volume-slider.d.ts +0 -35
- package/types/components/ui/thumbnails/thumbnail-loader.d.ts +0 -47
- package/types/components/ui/thumbnails/thumbnail.d.ts +0 -50
- package/types/components/ui/time.d.ts +0 -62
- package/types/components/ui/tooltip/tooltip-content.d.ts +0 -39
- package/types/components/ui/tooltip/tooltip-context.d.ts +0 -11
- package/types/components/ui/tooltip/tooltip-trigger.d.ts +0 -14
- package/types/components/ui/tooltip/tooltip.d.ts +0 -23
- package/types/core/api/media-attrs.d.ts +0 -3
- package/types/core/api/media-context.d.ts +0 -37
- package/types/core/api/media-events.d.ts +0 -581
- package/types/core/api/media-request-events.d.ts +0 -319
- package/types/core/api/player-controller.d.ts +0 -6
- package/types/core/api/player-events.d.ts +0 -38
- package/types/core/api/player-props.d.ts +0 -163
- package/types/core/api/player-state.d.ts +0 -656
- package/types/core/api/src-types.d.ts +0 -50
- package/types/core/api/types.d.ts +0 -54
- package/types/core/controls.d.ts +0 -43
- package/types/core/font/font-options.d.ts +0 -42
- package/types/core/font/font-vars.d.ts +0 -1
- package/types/core/keyboard/aria-shortcuts.d.ts +0 -6
- package/types/core/keyboard/controller.d.ts +0 -9
- package/types/core/keyboard/types.d.ts +0 -33
- package/types/core/quality/events.d.ts +0 -43
- package/types/core/quality/symbols.d.ts +0 -6
- package/types/core/quality/utils.d.ts +0 -2
- package/types/core/quality/video-quality.d.ts +0 -52
- package/types/core/state/media-events-logger.d.ts +0 -7
- package/types/core/state/media-load-controller.d.ts +0 -6
- package/types/core/state/media-player-delegate.d.ts +0 -13
- package/types/core/state/media-request-manager.d.ts +0 -71
- package/types/core/state/media-state-manager.d.ts +0 -59
- package/types/core/state/media-state-sync.d.ts +0 -8
- package/types/core/state/media-storage.d.ts +0 -74
- package/types/core/state/navigator-media-session.d.ts +0 -5
- package/types/core/state/remote-control.d.ts +0 -288
- package/types/core/state/tracked-media-events.d.ts +0 -2
- package/types/core/time-ranges.d.ts +0 -12
- package/types/core/tracks/audio/audio-tracks.d.ts +0 -32
- package/types/core/tracks/audio/events.d.ts +0 -37
- package/types/core/tracks/text/events.d.ts +0 -49
- package/types/core/tracks/text/render/libass-text-renderer.d.ts +0 -181
- package/types/core/tracks/text/render/native-text-renderer.d.ts +0 -13
- package/types/core/tracks/text/render/text-renderer.d.ts +0 -17
- package/types/core/tracks/text/symbols.d.ts +0 -11
- package/types/core/tracks/text/text-track.d.ts +0 -137
- package/types/core/tracks/text/text-tracks.d.ts +0 -55
- package/types/core/tracks/text/utils.d.ts +0 -8
- package/types/elements/bundles/cdn/player.core.d.ts +0 -5
- package/types/elements/bundles/cdn/player.d.ts +0 -7
- package/types/elements/bundles/cdn/plyr.d.ts +0 -5
- package/types/elements/bundles/cdn-legacy/player-with-default.d.ts +0 -4
- package/types/elements/bundles/cdn-legacy/player-with-layouts.d.ts +0 -4
- package/types/elements/bundles/cdn-legacy/player-with-plyr.d.ts +0 -3
- package/types/elements/bundles/cdn-legacy/player.d.ts +0 -3
- package/types/elements/bundles/icons.d.ts +0 -2
- package/types/elements/bundles/player-layouts/default.d.ts +0 -1
- package/types/elements/bundles/player-layouts/index.d.ts +0 -1
- package/types/elements/bundles/player-layouts/plyr.d.ts +0 -1
- package/types/elements/bundles/player-ui.d.ts +0 -1
- package/types/elements/bundles/player.d.ts +0 -1
- package/types/elements/define/announcer-element.d.ts +0 -18
- package/types/elements/define/buttons/airplay-button-element.d.ts +0 -19
- package/types/elements/define/buttons/caption-button-element.d.ts +0 -20
- package/types/elements/define/buttons/fullscreen-button-element.d.ts +0 -20
- package/types/elements/define/buttons/google-cast-button-element.d.ts +0 -19
- package/types/elements/define/buttons/live-button-element.d.ts +0 -20
- package/types/elements/define/buttons/mute-button-element.d.ts +0 -21
- package/types/elements/define/buttons/pip-button-element.d.ts +0 -20
- package/types/elements/define/buttons/play-button-element.d.ts +0 -21
- package/types/elements/define/buttons/seek-button-element.d.ts +0 -24
- package/types/elements/define/buttons/toggle-button-element.d.ts +0 -19
- package/types/elements/define/captions-element.d.ts +0 -18
- package/types/elements/define/chapter-title-element.d.ts +0 -30
- package/types/elements/define/controls-element.d.ts +0 -24
- package/types/elements/define/controls-group-element.d.ts +0 -24
- package/types/elements/define/gesture-element.d.ts +0 -22
- package/types/elements/define/layouts/default/audio-layout-element.d.ts +0 -29
- package/types/elements/define/layouts/default/audio-layout.d.ts +0 -1
- package/types/elements/define/layouts/default/icons-loader.d.ts +0 -5
- package/types/elements/define/layouts/default/icons.d.ts +0 -52
- package/types/elements/define/layouts/default/slots.d.ts +0 -2
- package/types/elements/define/layouts/default/ui/announcer.d.ts +0 -1
- package/types/elements/define/layouts/default/ui/buttons.d.ts +0 -31
- package/types/elements/define/layouts/default/ui/captions.d.ts +0 -1
- package/types/elements/define/layouts/default/ui/controls.d.ts +0 -1
- package/types/elements/define/layouts/default/ui/keyboard-display.d.ts +0 -1
- package/types/elements/define/layouts/default/ui/menu/accessibility-menu.d.ts +0 -1
- package/types/elements/define/layouts/default/ui/menu/audio-menu.d.ts +0 -1
- package/types/elements/define/layouts/default/ui/menu/captions-menu.d.ts +0 -1
- package/types/elements/define/layouts/default/ui/menu/chapters-menu.d.ts +0 -8
- package/types/elements/define/layouts/default/ui/menu/episodes-menu.d.ts +0 -8
- package/types/elements/define/layouts/default/ui/menu/font-menu.d.ts +0 -1
- package/types/elements/define/layouts/default/ui/menu/items/menu-checkbox.d.ts +0 -8
- package/types/elements/define/layouts/default/ui/menu/items/menu-items.d.ts +0 -26
- package/types/elements/define/layouts/default/ui/menu/items/menu-slider.d.ts +0 -3
- package/types/elements/define/layouts/default/ui/menu/menu-portal.d.ts +0 -4
- package/types/elements/define/layouts/default/ui/menu/playback-menu.d.ts +0 -1
- package/types/elements/define/layouts/default/ui/menu/settings-menu.d.ts +0 -8
- package/types/elements/define/layouts/default/ui/slider.d.ts +0 -10
- package/types/elements/define/layouts/default/ui/time.d.ts +0 -3
- package/types/elements/define/layouts/default/ui/title.d.ts +0 -2
- package/types/elements/define/layouts/default/ui/utils.d.ts +0 -3
- package/types/elements/define/layouts/default/video-layout-element.d.ts +0 -29
- package/types/elements/define/layouts/default/video-layout.d.ts +0 -5
- package/types/elements/define/layouts/icons/icons-loader.d.ts +0 -11
- package/types/elements/define/layouts/icons/layout-icons-loader.d.ts +0 -4
- package/types/elements/define/layouts/layout-element.d.ts +0 -38
- package/types/elements/define/layouts/layout-name.d.ts +0 -2
- package/types/elements/define/layouts/plyr/icons/plyr-airplay.d.ts +0 -2
- package/types/elements/define/layouts/plyr/icons/plyr-captions-off.d.ts +0 -2
- package/types/elements/define/layouts/plyr/icons/plyr-captions-on.d.ts +0 -2
- package/types/elements/define/layouts/plyr/icons/plyr-download.d.ts +0 -2
- package/types/elements/define/layouts/plyr/icons/plyr-enter-fullscreen.d.ts +0 -2
- package/types/elements/define/layouts/plyr/icons/plyr-exit-fullscreen.d.ts +0 -2
- package/types/elements/define/layouts/plyr/icons/plyr-fast-forward.d.ts +0 -2
- package/types/elements/define/layouts/plyr/icons/plyr-muted.d.ts +0 -2
- package/types/elements/define/layouts/plyr/icons/plyr-pause.d.ts +0 -2
- package/types/elements/define/layouts/plyr/icons/plyr-pip.d.ts +0 -2
- package/types/elements/define/layouts/plyr/icons/plyr-play.d.ts +0 -2
- package/types/elements/define/layouts/plyr/icons/plyr-restart.d.ts +0 -2
- package/types/elements/define/layouts/plyr/icons/plyr-rewind.d.ts +0 -2
- package/types/elements/define/layouts/plyr/icons/plyr-settings.d.ts +0 -2
- package/types/elements/define/layouts/plyr/icons/plyr-volume.d.ts +0 -2
- package/types/elements/define/layouts/plyr/icons-loader.d.ts +0 -5
- package/types/elements/define/layouts/plyr/icons.d.ts +0 -18
- package/types/elements/define/layouts/plyr/plyr-layout-element.d.ts +0 -26
- package/types/elements/define/layouts/plyr/ui.d.ts +0 -3
- package/types/elements/define/layouts/slot-manager.d.ts +0 -7
- package/types/elements/define/layouts/slot-observer.d.ts +0 -12
- package/types/elements/define/menus/_template.d.ts +0 -7
- package/types/elements/define/menus/audio-gain-group-element.d.ts +0 -31
- package/types/elements/define/menus/audio-radio-group-element.d.ts +0 -31
- package/types/elements/define/menus/captions-radio-group-element.d.ts +0 -31
- package/types/elements/define/menus/chapters-radio-group-element.d.ts +0 -36
- package/types/elements/define/menus/menu-button-element.d.ts +0 -25
- package/types/elements/define/menus/menu-element.d.ts +0 -26
- package/types/elements/define/menus/menu-item-element.d.ts +0 -22
- package/types/elements/define/menus/menu-items-element.d.ts +0 -25
- package/types/elements/define/menus/menu-portal-element.d.ts +0 -25
- package/types/elements/define/menus/quality-radio-group-element.d.ts +0 -33
- package/types/elements/define/menus/radio-element.d.ts +0 -22
- package/types/elements/define/menus/radio-group-element.d.ts +0 -22
- package/types/elements/define/menus/speed-radio-group-element.d.ts +0 -31
- package/types/elements/define/player-element.d.ts +0 -24
- package/types/elements/define/poster-element.d.ts +0 -25
- package/types/elements/define/provider-cast-display.d.ts +0 -2
- package/types/elements/define/provider-element.d.ts +0 -25
- package/types/elements/define/sliders/audio-gain-slider-element.d.ts +0 -32
- package/types/elements/define/sliders/quality-slider-element.d.ts +0 -32
- package/types/elements/define/sliders/slider-chapters-element.d.ts +0 -31
- package/types/elements/define/sliders/slider-element.d.ts +0 -23
- package/types/elements/define/sliders/slider-preview-element.d.ts +0 -14
- package/types/elements/define/sliders/slider-steps-element.d.ts +0 -28
- package/types/elements/define/sliders/slider-thumbnail-element.d.ts +0 -26
- package/types/elements/define/sliders/slider-value-element.d.ts +0 -37
- package/types/elements/define/sliders/slider-video-element.d.ts +0 -25
- package/types/elements/define/sliders/speed-slider-element.d.ts +0 -32
- package/types/elements/define/sliders/time-slider-element.d.ts +0 -32
- package/types/elements/define/sliders/volume-slider-element.d.ts +0 -32
- package/types/elements/define/spinner-element.d.ts +0 -50
- package/types/elements/define/thumbnail-element.d.ts +0 -29
- package/types/elements/define/time-element.d.ts +0 -24
- package/types/elements/define/title-element.d.ts +0 -23
- package/types/elements/define/tooltips/tooltip-content-element.d.ts +0 -26
- package/types/elements/define/tooltips/tooltip-element.d.ts +0 -26
- package/types/elements/define/tooltips/tooltip-trigger-element.d.ts +0 -27
- package/types/elements/icon.d.ts +0 -10
- package/types/elements/index.d.ts +0 -56
- package/types/elements/lit/directives/signal.d.ts +0 -1
- package/types/elements/lit/html.d.ts +0 -4
- package/types/elements/lit/lit-element.d.ts +0 -8
- package/types/elements/state-controller.d.ts +0 -5
- package/types/exports/components.d.ts +0 -59
- package/types/exports/core.d.ts +0 -26
- package/types/exports/events.d.ts +0 -32
- package/types/exports/font.d.ts +0 -2
- package/types/exports/foundation.d.ts +0 -8
- package/types/exports/maverick.d.ts +0 -1
- package/types/exports/providers.d.ts +0 -22
- package/types/exports/utils.d.ts +0 -4
- package/types/foundation/fullscreen/controller.d.ts +0 -39
- package/types/foundation/fullscreen/events.d.ts +0 -25
- package/types/foundation/list/list.d.ts +0 -64
- package/types/foundation/list/select-list.d.ts +0 -30
- package/types/foundation/list/symbols.d.ts +0 -14
- package/types/foundation/logger/colors.d.ts +0 -5
- package/types/foundation/logger/controller.d.ts +0 -20
- package/types/foundation/logger/events.d.ts +0 -26
- package/types/foundation/logger/grouped-log.d.ts +0 -22
- package/types/foundation/logger/log-level.d.ts +0 -15
- package/types/foundation/logger/log-printer.d.ts +0 -11
- package/types/foundation/logger/ms.d.ts +0 -4
- package/types/foundation/observers/focus-visible.d.ts +0 -7
- package/types/foundation/observers/intersection-observer.d.ts +0 -36
- package/types/foundation/observers/page-visibility.d.ts +0 -37
- package/types/foundation/observers/raf-loop.d.ts +0 -6
- package/types/foundation/orientation/controller.d.ts +0 -62
- package/types/foundation/orientation/events.d.ts +0 -16
- package/types/foundation/orientation/types.d.ts +0 -85
- package/types/foundation/queue/queue.d.ts +0 -24
- package/types/foundation/queue/request-queue.d.ts +0 -42
- package/types/global/layouts/default.d.ts +0 -9
- package/types/global/layouts/loader.d.ts +0 -5
- package/types/global/layouts/plyr.d.ts +0 -9
- package/types/global/player.d.ts +0 -26
- package/types/index.d.ts +0 -6
- package/types/plugins.d.ts +0 -11
- package/types/providers/audio/loader.d.ts +0 -12
- package/types/providers/audio/provider.d.ts +0 -29
- package/types/providers/dash/dash.d.ts +0 -15
- package/types/providers/dash/events.d.ts +0 -570
- package/types/providers/dash/lib-loader.d.ts +0 -6
- package/types/providers/dash/loader.d.ts +0 -10
- package/types/providers/dash/provider.d.ts +0 -62
- package/types/providers/dash/types.d.ts +0 -13
- package/types/providers/embed/EmbedProvider.d.ts +0 -18
- package/types/providers/google-cast/events.d.ts +0 -36
- package/types/providers/google-cast/loader.d.ts +0 -18
- package/types/providers/google-cast/media-info.d.ts +0 -11
- package/types/providers/google-cast/provider.d.ts +0 -48
- package/types/providers/google-cast/tracks.d.ts +0 -10
- package/types/providers/google-cast/types.d.ts +0 -3
- package/types/providers/google-cast/utils.d.ts +0 -34
- package/types/providers/hls/events.d.ts +0 -463
- package/types/providers/hls/hls.d.ts +0 -14
- package/types/providers/hls/lib-loader.d.ts +0 -6
- package/types/providers/hls/loader.d.ts +0 -10
- package/types/providers/hls/provider.d.ts +0 -64
- package/types/providers/hls/types.d.ts +0 -9
- package/types/providers/html/audio/audio-context.d.ts +0 -6
- package/types/providers/html/audio/audio-gain.d.ts +0 -10
- package/types/providers/html/html/342/200/223media-events.d.ts +0 -6
- package/types/providers/html/native-audio-tracks.d.ts +0 -6
- package/types/providers/html/provider.d.ts +0 -34
- package/types/providers/html/remote-playback.d.ts +0 -18
- package/types/providers/type-check.d.ts +0 -28
- package/types/providers/types.d.ts +0 -95
- package/types/providers/video/loader.d.ts +0 -12
- package/types/providers/video/native-hls-text-tracks.d.ts +0 -9
- package/types/providers/video/picture-in-picture.d.ts +0 -16
- package/types/providers/video/presentation/events.d.ts +0 -11
- package/types/providers/video/presentation/video-presentation.d.ts +0 -30
- package/types/providers/video/provider.d.ts +0 -34
- package/types/providers/vimeo/embed/command.d.ts +0 -81
- package/types/providers/vimeo/embed/event.d.ts +0 -58
- package/types/providers/vimeo/embed/message.d.ts +0 -8
- package/types/providers/vimeo/embed/misc.d.ts +0 -52
- package/types/providers/vimeo/embed/params.d.ts +0 -148
- package/types/providers/vimeo/loader.d.ts +0 -14
- package/types/providers/vimeo/provider.d.ts +0 -61
- package/types/providers/vimeo/utils.d.ts +0 -6
- package/types/providers/youtube/embed/command.d.ts +0 -13
- package/types/providers/youtube/embed/event.d.ts +0 -1
- package/types/providers/youtube/embed/message.d.ts +0 -50
- package/types/providers/youtube/embed/params.d.ts +0 -218
- package/types/providers/youtube/embed/quality.d.ts +0 -2
- package/types/providers/youtube/embed/state.d.ts +0 -12
- package/types/providers/youtube/loader.d.ts +0 -14
- package/types/providers/youtube/provider.d.ts +0 -61
- package/types/providers/youtube/utils.d.ts +0 -2
- package/types/utils/aria.d.ts +0 -4
- package/types/utils/array.d.ts +0 -1
- package/types/utils/color.d.ts +0 -1
- package/types/utils/dom.d.ts +0 -41
- package/types/utils/error.d.ts +0 -2
- package/types/utils/language.d.ts +0 -8
- package/types/utils/manifest.d.ts +0 -3
- package/types/utils/mime.d.ts +0 -15
- package/types/utils/network.d.ts +0 -17
- package/types/utils/number.d.ts +0 -17
- package/types/utils/promise.d.ts +0 -1
- package/types/utils/scroll.d.ts +0 -5
- package/types/utils/support.d.ts +0 -72
- package/types/utils/time.d.ts +0 -57
- package/vite.config.ts +0 -61
- /package/{npm/analyze.json.d.ts → analyze.json.d.ts} +0 -0
- /package/{npm/bundle.d.ts → bundle.d.ts} +0 -0
- /package/{npm/dom.d.ts → dom.d.ts} +0 -0
- /package/{npm/empty.vtt → empty.vtt} +0 -0
- /package/{npm/google-cast.d.ts → google-cast.d.ts} +0 -0
- /package/{npm/player → player}/index.d.ts +0 -0
- /package/{npm/player → player}/layouts/default.d.ts +0 -0
- /package/{npm/player → player}/layouts/index.d.ts +0 -0
- /package/{npm/player → player}/layouts/plyr.d.ts +0 -0
- /package/{styles/player → player/styles}/base.css +0 -0
- /package/{styles/player → player/styles}/default/buffering.css +0 -0
- /package/{styles/player → player/styles}/default/buttons.css +0 -0
- /package/{styles/player → player/styles}/default/captions.css +0 -0
- /package/{styles/player → player/styles}/default/chapter-title.css +0 -0
- /package/{styles/player → player/styles}/default/controls.css +0 -0
- /package/{styles/player → player/styles}/default/gestures.css +0 -0
- /package/{styles/player → player/styles}/default/icons.css +0 -0
- /package/{styles/player → player/styles}/default/keyboard.css +0 -0
- /package/{styles/player → player/styles}/default/layouts/audio.css +0 -0
- /package/{styles/player → player/styles}/default/menus.css +0 -0
- /package/{styles/player → player/styles}/default/poster.css +0 -0
- /package/{styles/player → player/styles}/default/sliders.css +0 -0
- /package/{styles/player → player/styles}/default/theme.css +0 -0
- /package/{styles/player → player/styles}/default/thumbnail.css +0 -0
- /package/{styles/player → player/styles}/default/time.css +0 -0
- /package/{styles/player → player/styles}/default/tooltips.css +0 -0
- /package/{styles/player → player/styles}/plyr/theme.css +0 -0
- /package/{npm/player → player}/ui.d.ts +0 -0
- /package/{npm/tailwind.cjs → tailwind.cjs} +0 -0
- /package/{npm/tailwind.d.cts → tailwind.d.cts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as n,b as l,d as c}from"./vidstack-DWjB11vV.js";import{l as p}from"./vidstack-DKqYI_HJ.js";import{a as g,b as d,i,d as h,e as m,f as y,c as C,j as f}from"./vidstack-C5AP9wid.js";import{p as w}from"./vidstack-DLVdcWrK.js";class E{name="google-cast";target;#e;get cast(){return g()}mediaType(){return"video"}canPlay(e){return n&&!l&&c(e)}async prompt(e){let t,a,r;try{t=await this.#r(e),this.#e||(this.#e=new cast.framework.RemotePlayer,new cast.framework.RemotePlayerController(this.#e)),a=e.player.createEvent("google-cast-prompt-open",{trigger:t}),e.player.dispatchEvent(a),this.#t(e,"connecting",a),await this.#o(w(e.$props.googleCast)),e.$state.remotePlaybackInfo.set({deviceName:d()?.getCastDevice().friendlyName}),i()&&this.#t(e,"connected",a)}catch(o){const s=o instanceof Error?o:this.#a((o+"").toUpperCase(),"Prompt failed.");throw r=e.player.createEvent("google-cast-prompt-error",{detail:s,trigger:a??t,cancelable:!0}),e.player.dispatch(r),this.#t(e,i()?"connected":"disconnected",r),s}finally{e.player.dispatch("google-cast-prompt-close",{trigger:r??a??t})}}async load(e){if(!this.#e)throw Error("[vidstack] google cast player was not initialized");return new(await import("../providers/vidstack-google-cast-BSYJYn-o.js")).GoogleCastProvider(this.#e,e)}async#r(e){if(h())return;const t=e.player.createEvent("google-cast-load-start");e.player.dispatch(t),await p(m()),await customElements.whenDefined("google-cast-launcher");const a=e.player.createEvent("google-cast-loaded",{trigger:t});if(e.player.dispatch(a),!y())throw this.#a("CAST_NOT_AVAILABLE","Google Cast not available on this platform.");return a}async#o(e){this.#s(e);const t=await this.cast.requestSession();if(t)throw this.#a(t.toUpperCase(),C(t))}#s(e){this.cast?.setOptions({...f(),...e})}#t(e,t,a){const r={type:"google-cast",state:t};e.notify("remote-playback-change",r,a)}#a(e,t){const a=Error(t);return a.code=e,a}}export{E as GoogleCastLoader};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{s as a,e as o,l as n,E as h}from"./vidstack-DLVdcWrK.js";import"./vidstack-DWjB11vV.js";class c{#t;#s;#i;#e=a(!1);get supported(){return this.#e()}constructor(e,t){this.#t=e,this.#s=t,this.#r()}#r(){!this.#t?.remote||!this.canPrompt||(this.#t.remote.watchAvailability(e=>{this.#e.set(e)}).catch(()=>{this.#e.set(!1)}),o(this.#a.bind(this)))}#a(){if(!this.#e())return;const e=["connecting","connect","disconnect"],t=this.#o.bind(this);t(),n(this.#t,"playing",t);const s=new h(this.#t.remote);for(const r of e)s.add(r,t)}async prompt(){if(!this.supported)throw Error("Not supported on this platform.");return this.type==="airplay"&&this.#t.webkitShowPlaybackTargetPicker?this.#t.webkitShowPlaybackTargetPicker():this.#t.remote.prompt()}#o(e){const t=this.#t.remote.state;if(t===this.#i)return;const s={type:this.type,state:t};this.#s.notify("remote-playback-change",s,e),this.#i=t}}class p extends c{type="airplay";get canPrompt(){return"WebKitPlaybackTargetAvailabilityEvent"in window}}export{p as H};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as t}from"../chunks/vidstack-DLVdcWrK.js";import{HTMLMediaProvider as e}from"./vidstack-html-CoKFAYW5.js";import{H as o}from"../chunks/vidstack-wt2OT4N7.js";import"../chunks/vidstack-DWjB11vV.js";import"../chunks/vidstack-Dh2GOjra.js";import"../chunks/vidstack-Bxv1Qnxe.js";import"../chunks/vidstack-C_AxqLKV.js";class s extends e{$$PROVIDER_TYPE="AUDIO";get type(){return"audio"}airPlay;constructor(r,i){super(r,i),t(()=>{this.airPlay=new o(this.media,i)},this.scope)}setup(){super.setup(),this.type==="audio"&&this.ctx.notify("provider-setup",this)}get audio(){return this.media}}export{s as AudioProvider};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{l as x,p as k}from"../chunks/vidstack-DKqYI_HJ.js";import{h as M,f as C,a as N,j as R}from"../chunks/vidstack-DWjB11vV.js";import{VideoProvider as F}from"./vidstack-video-CIxFJ9Z1.js";import{l as S,e as I,D as l,I as P,i as u,Q as _,H as v,j as $,p as q}from"../chunks/vidstack-DLVdcWrK.js";import{Q as b}from"../chunks/vidstack-DRH_1tFW.js";import{T as m,a as H}from"../chunks/vidstack-DPO7J4-v.js";import{L as p}from"../chunks/vidstack-C_AxqLKV.js";import{R as j}from"../chunks/vidstack-Dh2GOjra.js";import{c as Q}from"../chunks/vidstack-BfBBPhXV.js";import"./vidstack-html-CoKFAYW5.js";import"../chunks/vidstack-Bxv1Qnxe.js";import"../chunks/vidstack-wt2OT4N7.js";function w(n){try{return new Intl.DisplayNames(navigator.languages,{type:"language"}).of(n)??null}catch{return null}}const O=n=>`dash-${_(n)}`;class G{#e;#i;#t=null;#a=new Set;#r=null;config={};get instance(){return this.#t}constructor(t,i){this.#e=t,this.#i=i}setup(t){this.#t=t().create();const i=this.#m.bind(this);for(const s of Object.values(t.events))this.#t.on(s,i);this.#t.on(t.events.ERROR,this.#b.bind(this));for(const s of this.#a)s(this.#t);this.#i.player.dispatch("dash-instance",{detail:this.#t}),this.#t.initialize(this.#e,void 0,!1),this.#t.updateSettings({streaming:{text:{defaultEnabled:!1,dispatchForManualRendering:!0},buffer:{fastSwitchEnabled:!0}},...this.config}),this.#t.on(t.events.FRAGMENT_LOADING_STARTED,this.#w.bind(this)),this.#t.on(t.events.FRAGMENT_LOADING_COMPLETED,this.#E.bind(this)),this.#t.on(t.events.MANIFEST_LOADED,this.#v.bind(this)),this.#t.on(t.events.QUALITY_CHANGE_RENDERED,this.#S.bind(this)),this.#t.on(t.events.TEXT_TRACKS_ADDED,this.#y.bind(this)),this.#t.on(t.events.TRACK_CHANGE_RENDERED,this.#T.bind(this)),this.#i.qualities[b.enableAuto]=this.#A.bind(this),S(this.#i.qualities,"change",this.#D.bind(this)),S(this.#i.audioTracks,"change",this.#x.bind(this)),this.#r=I(this.#d.bind(this))}#s(t){return new l(O(t.type),{detail:t})}#d(){if(!this.#i.$state.live())return;const t=new j(this.#f.bind(this));return t.start(),t.stop.bind(t)}#f(){if(!this.#t)return;const t=this.#t.duration()-this.#t.time();this.#i.$state.liveSyncPosition.set(isNaN(t)?1/0:t)}#m(t){this.#i.player?.dispatch(this.#s(t))}#n=null;#h={};#g(t){const i=this.#n?.[m.native],s=(i?.track).cues;if(!i||!s)return;const r=this.#n.id,a=this.#h[r]??0,o=this.#s(t);for(let c=a;c<s.length;c++){const h=s[c];h.positionAlign||(h.positionAlign="auto"),this.#n.addCue(h,o)}this.#h[r]=s.length}#y(t){if(!this.#t)return;const i=t.tracks,s=[...this.#e.textTracks].filter(a=>"manualMode"in a),r=this.#s(t);for(let a=0;a<s.length;a++){const o=i[a],c=s[a],h=`dash-${o.kind}-${a}`,d=new H({id:h,label:o?.label??o.labels.find(g=>g.text)?.text??(o?.lang&&w(o.lang))??o?.lang??void 0,language:o.lang??void 0,kind:o.kind,default:o.defaultTrack});d[m.native]={managed:!0,track:c},d[m.readyState]=2,d[m.onModeChange]=()=>{this.#t&&(d.mode==="showing"?(this.#t.setTextTrack(a),this.#n=d):(this.#t.setTextTrack(-1),this.#n=null))},this.#i.textTracks.add(d,r)}}#T(t){const{mediaType:i,newMediaInfo:s}=t;if(i==="audio"){const r=this.#i.audioTracks.getById(`dash-audio-${s.index}`);if(r){const a=this.#s(t);this.#i.audioTracks[p.select](r,!0,a)}}}#S(t){if(t.mediaType!=="video")return;const i=this.#i.qualities[t.newQuality];if(i){const s=this.#s(t);this.#i.qualities[p.select](i,!0,s)}}#v(t){if(this.#i.$state.canPlay()||!this.#t)return;const{type:i,mediaPresentationDuration:s}=t.data,r=this.#s(t);this.#i.notify("stream-type-change",i!=="static"?"live":"on-demand",r),this.#i.notify("duration-change",s,r),this.#i.qualities[b.setAuto](!0,r);const a=this.#t.getVideoElement(),o=this.#t.getTracksForTypeFromManifest("video",t.data),c=[...new Set(o.map(e=>e.mimeType))].find(e=>e&&M(a,e)),h=o.filter(e=>c===e.mimeType)[0];let d=this.#t.getTracksForTypeFromManifest("audio",t.data);const g=[...new Set(d.map(e=>e.mimeType))].find(e=>e&&C(a,e));if(d=d.filter(e=>g===e.mimeType),h.bitrateList.forEach((e,f)=>{const y={id:e.id?.toString()??`dash-bitrate-${f}`,width:e.width??0,height:e.height??0,bitrate:e.bandwidth??0,codec:h.codec,index:f};this.#i.qualities[p.add](y,r)}),P(h.index)){const e=this.#i.qualities[h.index];e&&this.#i.qualities[p.select](e,!0,r)}d.forEach((e,f)=>{const L=e.labels.find(T=>navigator.languages.some(D=>T.lang&&D.toLowerCase().startsWith(T.lang.toLowerCase())))||e.labels[0],A={id:`dash-audio-${e?.index}`,label:L?.text??(e.lang&&w(e.lang))??e.lang??"",language:e.lang??"",kind:"main",mimeType:e.mimeType,codec:e.codec,index:f};this.#i.audioTracks[p.add](A,r)}),a.dispatchEvent(new l("canplay",{trigger:r}))}#b(t){const{type:i,error:s}=t;switch(s.code){case 27:this.#L(s);break;default:this.#l(s);break}}#w(){this.#o>=0&&this.#c()}#E(t){t.mediaType==="text"&&requestAnimationFrame(this.#g.bind(this,t))}#o=-1;#L(t){this.#c(),this.#t?.play(),this.#o=window.setTimeout(()=>{this.#o=-1,this.#l(t)},5e3)}#c(){clearTimeout(this.#o),this.#o=-1}#l(t){this.#i.notify("error",{message:t.message??"",code:1,error:t})}#A(){this.#u("video",!0);const{qualities:t}=this.#i;this.#t?.setQualityFor("video",t.selectedIndex,!0)}#u(t,i){this.#t?.updateSettings({streaming:{abr:{autoSwitchBitrate:{[t]:i}}}})}#D(){const{qualities:t}=this.#i;!this.#t||t.auto||!t.selected||(this.#u("video",!1),this.#t.setQualityFor("video",t.selectedIndex,t.switch==="current"),N&&(this.#e.currentTime=this.#e.currentTime))}#x(){if(!this.#t)return;const{audioTracks:t}=this.#i,i=this.#t.getTracksFor("audio").find(s=>t.selected&&t.selected.id===`dash-audio-${s.index}`);i&&this.#t.setCurrentTrack(i)}#p(){this.#c(),this.#n=null,this.#h={}}onInstance(t){return this.#a.add(t),()=>this.#a.delete(t)}loadSource(t){this.#p(),u(t.src)&&this.#t?.attachSource(t.src)}destroy(){this.#p(),this.#t?.destroy(),this.#t=null,this.#r?.(),this.#r=null}}class V{#e;#i;#t;constructor(t,i,s){this.#e=t,this.#i=i,this.#t=s,this.#a()}async#a(){const t={onLoadStart:this.#r.bind(this),onLoaded:this.#s.bind(this),onLoadError:this.#d.bind(this)};let i=await B(this.#e,t);if(v(i)&&!u(this.#e)&&(i=await U(this.#e,t)),!i)return null;if(!window.dashjs.supportsMediaSource()){const s="[vidstack] `dash.js` is not supported in this environment";return this.#i.player.dispatch(new l("dash-unsupported")),this.#i.notify("error",{message:s,code:4}),null}return i}#r(){this.#i.player.dispatch(new l("dash-lib-load-start"))}#s(t){this.#i.player.dispatch(new l("dash-lib-loaded",{detail:t})),this.#t(t)}#d(t){const i=Q(t);this.#i.player.dispatch(new l("dash-lib-load-error",{detail:i})),this.#i.notify("error",{message:i.message,code:4,error:i})}}async function U(n,t={}){if(!v(n)){if(t.onLoadStart?.(),K(n))return t.onLoaded?.(n),n;if(E(n)){const i=n.MediaPlayer;return t.onLoaded?.(i),i}try{const i=(await n())?.default;if(E(i))return t.onLoaded?.(i.MediaPlayer),i.MediaPlayer;if(i)t.onLoaded?.(i);else throw Error("");return i}catch(i){t.onLoadError?.(i)}}}async function B(n,t={}){if(u(n)){t.onLoadStart?.();try{if(await x(n),!$(window.dashjs.MediaPlayer))throw Error("");const i=window.dashjs.MediaPlayer;return t.onLoaded?.(i),i}catch(i){t.onLoadError?.(i)}}}function K(n){return n&&n.prototype&&n.prototype!==Function}function E(n){return n&&"MediaPlayer"in n}const Y="https://cdn.jsdelivr.net";class z extends F{$$PROVIDER_TYPE="DASH";#e=null;#i=new G(this.video,this.ctx);get ctor(){return this.#e}get instance(){return this.#i.instance}static supported=R();get type(){return"dash"}get canLiveSync(){return!0}#t=`${Y}/npm/dashjs@4.7.4/dist/dash.all.min.js`;get config(){return this.#i.config}set config(t){this.#i.config=t}get library(){return this.#t}set library(t){this.#t=t}preconnect(){u(this.#t)&&k(this.#t)}setup(){super.setup(),new V(this.#t,this.ctx,t=>{this.#e=t,this.#i.setup(t),this.ctx.notify("provider-setup",this);const i=q(this.ctx.$state.source);i&&this.loadSource(i)})}async loadSource(t,i){if(!u(t.src)){this.removeSource();return}this.media.preload=i||"",this.appendSource(t,"application/x-mpegurl"),this.#i.loadSource(t),this.currentSrc=t}onInstance(t){const i=this.#i.instance;return i&&t(i),this.#i.onInstance(t)}destroy(){this.#i.destroy()}}export{z as DASHProvider};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{l,e as g,g as k,ak as y,a5 as u,o as p,D as m,p as h}from"../chunks/vidstack-DLVdcWrK.js";import{T as o}from"../chunks/vidstack-CS2aNc61.js";import{R as C}from"../chunks/vidstack-Dh2GOjra.js";import{L as E}from"../chunks/vidstack-C_AxqLKV.js";import{g as T,a as v,b as L,h as f,l as S,c as A}from"../chunks/vidstack-C5AP9wid.js";class I{#t;constructor(t){this.#t=new chrome.cast.media.MediaInfo(t.src,t.type)}build(){return this.#t}setStreamType(t){return t.includes("live")?this.#t.streamType=chrome.cast.media.StreamType.LIVE:this.#t.streamType=chrome.cast.media.StreamType.BUFFERED,this}setTracks(t){return this.#t.tracks=t.map(this.#e),this}setMetadata(t,e){return this.#t.metadata=new chrome.cast.media.GenericMediaMetadata,this.#t.metadata.title=t,this.#t.metadata.images=[{url:e}],this}#e(t,e){const s=new chrome.cast.media.Track(e,chrome.cast.media.TrackType.TEXT);return s.name=t.label,s.trackContentId=t.src,s.trackContentType="text/vtt",s.language=t.language,s.subtype=t.kind.toUpperCase(),s}}class b{#t;#e;#i;constructor(t,e,s){this.#t=t,this.#e=e,this.#i=s}setup(){const t=this.syncRemoteActiveIds.bind(this);l(this.#e.audioTracks,"change",t),l(this.#e.textTracks,"mode-change",t),g(this.#n.bind(this))}getLocalTextTracks(){return this.#e.$state.textTracks().filter(t=>t.src&&t.type==="vtt")}#a(){return this.#e.$state.audioTracks()}#r(t){const e=this.#t.mediaInfo?.tracks??[];return t?e.filter(s=>s.type===t):e}#l(){const t=[],e=this.#a().find(i=>i.selected),s=this.getLocalTextTracks().filter(i=>i.mode==="showing");if(e){const i=this.#r(chrome.cast.media.TrackType.AUDIO),r=this.#d(i,e);r&&t.push(r.trackId)}if(s?.length){const i=this.#r(chrome.cast.media.TrackType.TEXT);if(i.length)for(const r of s){const a=this.#d(i,r);a&&t.push(a.trackId)}}return t}#n(){const t=this.getLocalTextTracks();if(!this.#t.isMediaLoaded)return;const e=this.#r(chrome.cast.media.TrackType.TEXT);for(const s of t)if(!this.#d(e,s)){k(()=>this.#i?.());break}}syncRemoteTracks(t){if(!this.#t.isMediaLoaded)return;const e=this.#a(),s=this.getLocalTextTracks(),i=this.#r(chrome.cast.media.TrackType.AUDIO),r=this.#r(chrome.cast.media.TrackType.TEXT);for(const a of i){if(this.#h(e,a))continue;const n={id:a.trackId.toString(),label:a.name,language:a.language,kind:a.subtype??"main",selected:!1};this.#e.audioTracks[E.add](n,t)}for(const a of r){if(this.#h(s,a))continue;const n={id:a.trackId.toString(),src:a.trackContentId,label:a.name,language:a.language,kind:a.subtype.toLowerCase()};this.#e.textTracks.add(n,t)}}syncRemoteActiveIds(t){if(!this.#t.isMediaLoaded)return;const e=this.#l(),s=new chrome.cast.media.EditTracksInfoRequest(e);this.#c(s).catch(i=>{})}#c(t){const e=T();return new Promise((s,i)=>e?.editTracksInfo(t,s,i))}#h(t,e){return t.find(s=>this.#s(s,e))}#d(t,e){return t.find(s=>this.#s(e,s))}#s(t,e){return e.name===t.label&&e.language===t.language&&e.subtype.toLowerCase()===t.kind.toLowerCase()}}class R{$$PROVIDER_TYPE="GOOGLE_CAST";scope=y();#t;#e;#i;#a=null;#r="disconnected";#l=0;#n=0;#c=new o(0,0);#h=new C(this.#b.bind(this));#d;#s=null;#u=!1;constructor(t,e){this.#t=t,this.#e=e,this.#i=new b(t,e,this.#G.bind(this))}get type(){return"google-cast"}get currentSrc(){return this.#a}get player(){return this.#t}get cast(){return v()}get session(){return L()}get media(){return T()}get hasActiveSession(){return f(this.#a)}setup(){this.#L(),this.#S(),this.#i.setup(),this.#e.notify("provider-setup",this)}#L(){S(cast.framework.CastContextEventType.CAST_STATE_CHANGED,this.#f.bind(this))}#S(){const t=cast.framework.RemotePlayerEventType,e={[t.IS_CONNECTED_CHANGED]:this.#f,[t.IS_MEDIA_LOADED_CHANGED]:this.#g,[t.CAN_CONTROL_VOLUME_CHANGED]:this.#k,[t.CAN_SEEK_CHANGED]:this.#y,[t.DURATION_CHANGED]:this.#D,[t.IS_MUTED_CHANGED]:this.#p,[t.VOLUME_LEVEL_CHANGED]:this.#p,[t.IS_PAUSED_CHANGED]:this.#N,[t.LIVE_SEEKABLE_RANGE_CHANGED]:this.#C,[t.PLAYER_STATE_CHANGED]:this.#P};this.#d=e;const s=this.#R.bind(this);for(const i of u(e))this.#t.controller.addEventListener(i,s);p(()=>{for(const i of u(e))this.#t.controller.removeEventListener(i,s)})}async play(){if(!(!this.#t.isPaused&&!this.#u)){if(this.#u){await this.#v(!1,0);return}this.#t.controller?.playOrPause()}}async pause(){this.#t.isPaused||this.#t.controller?.playOrPause()}getMediaStatus(t){return new Promise((e,s)=>{this.media?.getStatus(t,e,s)})}setMuted(t){(t&&!this.#t.isMuted||!t&&this.#t.isMuted)&&this.#t.controller?.muteOrUnmute()}setCurrentTime(t){this.#t.currentTime=t,this.#e.notify("seeking",t),this.#t.controller?.seek()}setVolume(t){this.#t.volumeLevel=t,this.#t.controller?.setVolumeLevel()}async loadSource(t){if(this.#s?.src!==t&&(this.#s=null),f(t)){this.#A(),this.#a=t;return}this.#e.notify("load-start");const e=this.#x(t),s=await this.session.loadMedia(e);if(s){this.#a=null,this.#e.notify("error",Error(A(s)));return}this.#a=t}destroy(){this.#m(),this.#T()}#m(){this.#s||(this.#n=0,this.#c=new o(0,0)),this.#h.stop(),this.#l=0,this.#s=null}#A(){const t=new m("resume-session",{detail:this.session});this.#g(t);const{muted:e,volume:s,savedState:i}=this.#e.$state,r=i();this.setCurrentTime(Math.max(this.#t.currentTime,r?.currentTime??0)),this.setMuted(e()),this.setVolume(s()),r?.paused===!1&&this.play()}#T(){this.cast.endCurrentSession(!0);const{remotePlaybackLoader:t}=this.#e.$state;t.set(null)}#I(){const{savedState:t}=this.#e.$state;t.set({paused:this.#t.isPaused,currentTime:this.#t.currentTime}),this.#T()}#b(){this.#M()}#R(t){this.#d[t.type].call(this,t)}#f(t){const e=this.cast.getCastState(),s=e===cast.framework.CastState.CONNECTED?"connected":e===cast.framework.CastState.CONNECTING?"connecting":"disconnected";if(this.#r===s)return;const i={type:"google-cast",state:s},r=this.#o(t);this.#r=s,this.#e.notify("remote-playback-change",i,r),s==="disconnected"&&this.#I()}#g(t){if(!!!this.#t.isMediaLoaded)return;const s=h(this.#e.$state.source);Promise.resolve().then(()=>{if(s!==h(this.#e.$state.source)||!this.#t.isMediaLoaded)return;this.#m();const i=this.#t.duration;this.#c=new o(0,i);const r={provider:this,duration:i,buffered:new o(0,0),seekable:this.#E()},a=this.#o(t);this.#e.notify("loaded-metadata",void 0,a),this.#e.notify("loaded-data",void 0,a),this.#e.notify("can-play",r,a),this.#k(),this.#y(t);const{volume:c,muted:n}=this.#e.$state;this.setVolume(c()),this.setMuted(n()),this.#h.start(),this.#i.syncRemoteTracks(a),this.#i.syncRemoteActiveIds(a)})}#k(){this.#e.$state.canSetVolume.set(this.#t.canControlVolume)}#y(t){const e=this.#o(t);this.#e.notify("stream-type-change",this.#w(),e)}#w(){return this.#t.mediaInfo?.streamType===chrome.cast.media.StreamType.LIVE?this.#t.canSeek?"live:dvr":"live":"on-demand"}#M(){if(this.#s)return;const t=this.#t.currentTime;t!==this.#l&&(this.#e.notify("time-change",t),t>this.#n&&(this.#n=t,this.#C()),this.#e.$state.seeking()&&this.#e.notify("seeked",t),this.#l=t)}#D(t){if(!this.#t.isMediaLoaded||this.#s)return;const e=this.#t.duration,s=this.#o(t);this.#c=new o(0,e),this.#e.notify("duration-change",e,s)}#p(t){if(!this.#t.isMediaLoaded)return;const e={muted:this.#t.isMuted,volume:this.#t.volumeLevel},s=this.#o(t);this.#e.notify("volume-change",e,s)}#N(t){const e=this.#o(t);this.#t.isPaused?this.#e.notify("pause",void 0,e):this.#e.notify("play",void 0,e)}#C(t){const e={seekable:this.#E(),buffered:new o(0,this.#n)},s=t?this.#o(t):void 0;this.#e.notify("progress",e,s)}#P(t){const e=this.#t.playerState,s=chrome.cast.media.PlayerState;if(this.#u=e===s.IDLE,e===s.PAUSED)return;const i=this.#o(t);switch(e){case s.PLAYING:this.#e.notify("playing",void 0,i);break;case s.BUFFERING:this.#e.notify("waiting",void 0,i);break;case s.IDLE:this.#h.stop(),this.#e.notify("pause"),this.#e.notify("end");break}}#E(){return this.#t.liveSeekableRange?new o(this.#t.liveSeekableRange.start,this.#t.liveSeekableRange.end):this.#c}#o(t){return t instanceof Event?t:new m(t.type,{detail:t})}#_(t){const{streamType:e,title:s,poster:i}=this.#e.$state;return new I(t).setMetadata(s(),i()).setStreamType(e()).setTracks(this.#i.getLocalTextTracks()).build()}#x(t){const e=this.#_(t),s=new chrome.cast.media.LoadRequest(e),i=this.#e.$state.savedState();return s.autoplay=(this.#s?.paused??i?.paused)===!1,s.currentTime=this.#s?.time??i?.currentTime??0,s}async#v(t,e){const s=h(this.#e.$state.source);this.#s={src:s,paused:t,time:e},await this.loadSource(s)}#G(){this.#v(this.#t.isPaused,this.#t.currentTime).catch(t=>{})}}export{R as GoogleCastProvider};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{l as L,p as S}from"../chunks/vidstack-DKqYI_HJ.js";import{a as E,l as T}from"../chunks/vidstack-DWjB11vV.js";import{VideoProvider as b}from"./vidstack-video-CIxFJ9Z1.js";import{p as f,l as v,e as k,D as d,i as l,Q as w,H as y,j as x}from"../chunks/vidstack-DLVdcWrK.js";import{Q as g}from"../chunks/vidstack-DRH_1tFW.js";import{a as D,T as m}from"../chunks/vidstack-DPO7J4-v.js";import{L as u}from"../chunks/vidstack-C_AxqLKV.js";import{R as C}from"../chunks/vidstack-Dh2GOjra.js";import{c as H}from"../chunks/vidstack-BfBBPhXV.js";import"./vidstack-html-CoKFAYW5.js";import"../chunks/vidstack-Bxv1Qnxe.js";import"../chunks/vidstack-wt2OT4N7.js";const I=r=>w(r);class A{#e;#t;#i=null;#n=null;config={};#r=new Set;get instance(){return this.#i}constructor(t,i){this.#e=t,this.#t=i}setup(t){const{streamType:i}=this.#t.$state,e=f(i).includes("live"),s=f(i).includes("ll-");this.#i=new t({lowLatencyMode:s,backBufferLength:s?4:e?8:void 0,renderTextTracksNatively:!1,...this.config});const o=this.#h.bind(this);for(const n of Object.values(t.Events))this.#i.on(n,o);this.#i.on(t.Events.ERROR,this.#v.bind(this));for(const n of this.#r)n(this.#i);this.#t.player.dispatch("hls-instance",{detail:this.#i}),this.#i.attachMedia(this.#e),this.#i.on(t.Events.AUDIO_TRACK_SWITCHED,this.#l.bind(this)),this.#i.on(t.Events.LEVEL_SWITCHED,this.#u.bind(this)),this.#i.on(t.Events.LEVEL_LOADED,this.#f.bind(this)),this.#i.on(t.Events.LEVEL_UPDATED,this.#p.bind(this)),this.#i.on(t.Events.NON_NATIVE_TEXT_TRACKS_FOUND,this.#c.bind(this)),this.#i.on(t.Events.CUES_PARSED,this.#d.bind(this)),this.#t.qualities[g.enableAuto]=this.#g.bind(this),v(this.#t.qualities,"change",this.#m.bind(this)),v(this.#t.audioTracks,"change",this.#L.bind(this)),this.#n=k(this.#o.bind(this))}#s(t,i){return new d(I(t),{detail:i})}#o(){if(!this.#t.$state.live())return;const t=new C(this.#a.bind(this));return t.start(),t.stop.bind(t)}#a(){this.#t.$state.liveSyncPosition.set(this.#i?.liveSyncPosition??1/0)}#h(t,i){this.#t.player?.dispatch(this.#s(t,i))}#c(t,i){const e=this.#s(t,i);let s=-1;for(let o=0;o<i.tracks.length;o++){const n=i.tracks[o],h=n.subtitleTrack??n.closedCaptions,c=new D({id:`hls-${n.kind}-${o}`,src:h?.url,label:n.label,language:h?.lang,kind:n.kind,default:n.default});c[m.readyState]=2,c[m.onModeChange]=()=>{c.mode==="showing"?(this.#i.subtitleTrack=o,s=o):s===o&&(this.#i.subtitleTrack=-1,s=-1)},this.#t.textTracks.add(c,e)}}#d(t,i){const e=this.#i?.subtitleTrack,s=this.#t.textTracks.getById(`hls-${i.type}-${e}`);if(!s)return;const o=this.#s(t,i);for(const n of i.cues)n.positionAlign="auto",s.addCue(n,o)}#l(t,i){const e=this.#t.audioTracks[i.id];if(e){const s=this.#s(t,i);this.#t.audioTracks[u.select](e,!0,s)}}#u(t,i){const e=this.#t.qualities[i.level];if(e){const s=this.#s(t,i);this.#t.qualities[u.select](e,!0,s)}}#p(t,i){i.details.totalduration>0&&this.#t.$state.inferredLiveDVRWindow.set(i.details.totalduration)}#f(t,i){if(this.#t.$state.canPlay())return;const{type:e,live:s,totalduration:o,targetduration:n}=i.details,h=this.#s(t,i);this.#t.notify("stream-type-change",s?e==="EVENT"&&Number.isFinite(o)&&n>=10?"live:dvr":"live":"on-demand",h),this.#t.notify("duration-change",o,h);const c=this.#i.media;this.#i.currentLevel===-1&&this.#t.qualities[g.setAuto](!0,h);for(const a of this.#i.audioTracks){const p={id:a.id.toString(),label:a.name,language:a.lang||"",kind:"main"};this.#t.audioTracks[u.add](p,h)}for(const a of this.#i.levels){const p={id:a.id?.toString()??a.height+"p",width:a.width,height:a.height,codec:a.codecSet,bitrate:a.bitrate};this.#t.qualities[u.add](p,h)}c.dispatchEvent(new d("canplay",{trigger:h}))}#v(t,i){if(i.fatal)switch(i.type){case"mediaError":this.#i?.recoverMediaError();break;default:this.#y(i.error);break}}#y(t){this.#t.notify("error",{message:t.message,code:1,error:t})}#g(){this.#i&&(this.#i.currentLevel=-1)}#m(){const{qualities:t}=this.#t;!this.#i||t.auto||(this.#i[t.switch+"Level"]=t.selectedIndex,E&&(this.#e.currentTime=this.#e.currentTime))}#L(){const{audioTracks:t}=this.#t;this.#i&&this.#i.audioTrack!==t.selectedIndex&&(this.#i.audioTrack=t.selectedIndex)}onInstance(t){return this.#r.add(t),()=>this.#r.delete(t)}loadSource(t){l(t.src)&&this.#i?.loadSource(t.src)}destroy(){this.#i?.destroy(),this.#i=null,this.#n?.(),this.#n=null}}class _{#e;#t;#i;constructor(t,i,e){this.#e=t,this.#t=i,this.#i=e,this.#n()}async#n(){const t={onLoadStart:this.#r.bind(this),onLoaded:this.#s.bind(this),onLoadError:this.#o.bind(this)};let i=await R(this.#e,t);if(y(i)&&!l(this.#e)&&(i=await $(this.#e,t)),!i)return null;if(!i.isSupported()){const e="[vidstack] `hls.js` is not supported in this environment";return this.#t.player.dispatch(new d("hls-unsupported")),this.#t.notify("error",{message:e,code:4}),null}return i}#r(){this.#t.player.dispatch(new d("hls-lib-load-start"))}#s(t){this.#t.player.dispatch(new d("hls-lib-loaded",{detail:t})),this.#i(t)}#o(t){const i=H(t);this.#t.player.dispatch(new d("hls-lib-load-error",{detail:i})),this.#t.notify("error",{message:i.message,code:4,error:i})}}async function $(r,t={}){if(!y(r)){if(t.onLoadStart?.(),r.prototype&&r.prototype!==Function)return t.onLoaded?.(r),r;try{const i=(await r())?.default;if(i&&i.isSupported)t.onLoaded?.(i);else throw Error("");return i}catch(i){t.onLoadError?.(i)}}}async function R(r,t={}){if(l(r)){t.onLoadStart?.();try{if(await L(r),!x(window.Hls))throw Error("");const i=window.Hls;return t.onLoaded?.(i),i}catch(i){t.onLoadError?.(i)}}}const O="https://cdn.jsdelivr.net";class P extends b{$$PROVIDER_TYPE="HLS";#e=null;#t=new A(this.video,this.ctx);get ctor(){return this.#e}get instance(){return this.#t.instance}static supported=T();get type(){return"hls"}get canLiveSync(){return!0}#i=`${O}/npm/hls.js@^1.5.0/dist/hls.min.js`;get config(){return this.#t.config}set config(t){this.#t.config=t}get library(){return this.#i}set library(t){this.#i=t}preconnect(){l(this.#i)&&S(this.#i)}setup(){super.setup(),new _(this.#i,this.ctx,t=>{this.#e=t,this.#t.setup(t),this.ctx.notify("provider-setup",this);const i=f(this.ctx.$state.source);i&&this.loadSource(i)})}async loadSource(t,i){if(!l(t.src)){this.removeSource();return}this.media.preload=i||"",this.appendSource(t,"application/x-mpegurl"),this.#t.loadSource(t),this.currentSrc=t}onInstance(t){const i=this.#t.instance;return i&&t(i),this.#t.onInstance(t)}destroy(){this.#t.destroy()}}export{P as HLSProvider};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{q as r,b as T,m as S,r as k}from"../chunks/vidstack-DWjB11vV.js";import{s as f,E as m,e as C,o as y,p as E,a2 as w,l as p,D as P,ak as A,k as h,i as L}from"../chunks/vidstack-DLVdcWrK.js";import{R as x}from"../chunks/vidstack-Dh2GOjra.js";import{g}from"../chunks/vidstack-Bxv1Qnxe.js";import{L as c}from"../chunks/vidstack-C_AxqLKV.js";let o=null,d=[],u=[];function l(){return o??=new AudioContext}function $(){const s=l(),t=s.createGain();return t.connect(s.destination),d.push(t),t}function G(s,t){const i=l(),e=i.createMediaElementSource(s);return t&&e.connect(t),u.push(e),e}function N(s){const t=d.indexOf(s);t!==-1&&(d.splice(t,1),s.disconnect(),v())}function M(s){const t=u.indexOf(s);t!==-1&&(u.splice(t,1),s.disconnect(),v())}function v(){o&&d.length===0&&u.length===0&&o.close().then(()=>{o=null})}class R{#n;#t;#e=null;#a=null;get currentGain(){return this.#e?.gain?.value??null}get supported(){return!0}constructor(t,i){this.#n=t,this.#t=i}setGain(t){const i=this.currentGain;if(t!==this.currentGain){if(t===1&&i!==1){this.removeGain();return}this.#e||(this.#e=$(),this.#a&&this.#a.connect(this.#e)),this.#a||(this.#a=G(this.#n,this.#e)),this.#e.gain.value=t,this.#t(t)}}removeGain(){this.#e&&(this.#a&&this.#a.connect(l().destination),this.#r(),this.#t(null))}destroy(){this.#h(),this.#r()}#h(){if(this.#a)try{M(this.#a)}catch{}finally{this.#a=null}}#r(){if(this.#e)try{N(this.#e)}catch{}finally{this.#e=null}}}const D=["focus","blur","visibilitychange","pageshow","pagehide"];class O{#n=f(b());#t=f(document.visibilityState);#e;connect(){const t=new m(window),i=this.#a.bind(this);for(const e of D)t.add(e,i);r&&t.add("beforeunload",e=>{this.#e=setTimeout(()=>{e.defaultPrevented||e.returnValue.length>0||(this.#n.set("hidden"),this.#t.set("hidden"))},0)})}get pageState(){return this.#n()}get visibility(){return this.#t()}#a(t){r&&window.clearTimeout(this.#e),(t.type!=="blur"||this.#n()==="active")&&(this.#n.set(b(t)),this.#t.set(document.visibilityState=="hidden"?"hidden":"visible"))}}function b(s){return s?.type==="blur"||document.visibilityState==="hidden"?"hidden":document.hasFocus()?"active":"passive"}class I{#n;#t;#e=!1;#a=!1;#h=!1;#r=new x(this.#p.bind(this));#d=new O;#u;get#i(){return this.#n.media}constructor(t,i){this.#n=t,this.#t=i,this.#u=new m(t.media),this.#g(),this.#d.connect(),C(this.#M.bind(this)),y(this.#y.bind(this))}#y(){this.#a=!1,this.#h=!1,this.#r.stop(),this.#u.abort(),this.#T?.clear()}#c=0;#l=-1;#p(){const t=this.#i.currentTime;!(r&&t-this.#l<.35)&&this.#c!==t&&(this.#o(t),this.#c=t)}#g(){this.#s("loadstart",this.#S),this.#s("abort",this.#m),this.#s("emptied",this.#k),this.#s("error",this.#H),this.#s("volumechange",this.#O)}#v(){this.#a||(this.#s("loadeddata",this.#C),this.#s("loadedmetadata",this.#E),this.#s("canplay",this.#A),this.#s("canplaythrough",this.#L),this.#s("durationchange",this.#D),this.#s("play",this.#w),this.#s("progress",this.#U),this.#s("stalled",this.#$),this.#s("suspend",this.#V),this.#s("ratechange",this.#q),this.#a=!0)}#b(){this.#h||(this.#s("pause",this.#P),this.#s("playing",this.#x),this.#s("seeked",this.#I),this.#s("seeking",this.#F),this.#s("ended",this.#N),this.#s("waiting",this.#G),this.#h=!0)}#T=void 0;#j=void 0;#s(t,i){this.#u.add(t,i.bind(this))}#B(t){}#o(t,i){const e=Math.min(t,this.#t.$state.seekableEnd());this.#t.notify("time-change",e,i)}#S(t){if(this.#i.networkState===3){this.#m(t);return}this.#v(),this.#t.notify("load-start",void 0,t)}#m(t){this.#t.notify("abort",void 0,t)}#k(){this.#t.notify("emptied",void 0,event)}#C(t){this.#t.notify("loaded-data",void 0,t)}#E(t){this.#c=0,this.#l=-1,this.#b(),this.#t.notify("loaded-metadata",void 0,t),(T||r&&S(this.#t.$state.source()))&&this.#t.delegate.ready(this.#f(),t)}#f(){return{provider:E(this.#t.$provider),duration:this.#i.duration,buffered:this.#i.buffered,seekable:this.#i.seekable}}#w(t){this.#t.$state.canPlay&&this.#t.notify("play",void 0,t)}#P(t){this.#i.readyState===1&&!this.#e||(this.#e=!1,this.#r.stop(),this.#t.notify("pause",void 0,t))}#A(t){this.#t.delegate.ready(this.#f(),t)}#L(t){this.#t.$state.started()||this.#t.notify("can-play-through",this.#f(),t)}#x(t){this.#i.paused||(this.#e=!1,this.#t.notify("playing",void 0,t),this.#r.start())}#$(t){this.#t.notify("stalled",void 0,t),this.#i.readyState<3&&(this.#e=!0,this.#t.notify("waiting",void 0,t))}#G(t){this.#i.readyState<3&&(this.#e=!0,this.#t.notify("waiting",void 0,t))}#N(t){this.#r.stop(),this.#o(this.#i.duration,t),this.#t.notify("end",void 0,t),this.#t.$state.loop()&&w(this.#i.controls)&&(this.#i.controls=!1)}#M(){const t=this.#t.$state.paused(),i=this.#d.visibility==="hidden";(t||i)&&p(this.#i,"timeupdate",this.#R.bind(this))}#R(t){this.#o(this.#i.currentTime,t)}#D(t){this.#t.$state.ended()&&this.#o(this.#i.duration,t),this.#t.notify("duration-change",this.#i.duration,t)}#O(t){const i={volume:this.#i.volume,muted:this.#i.muted};this.#t.notify("volume-change",i,t)}#I(t){this.#l=this.#i.currentTime,this.#o(this.#i.currentTime,t),this.#t.notify("seeked",this.#i.currentTime,t),Math.trunc(this.#i.currentTime)===Math.trunc(this.#i.duration)&&g(this.#i.duration)>g(this.#i.currentTime)&&(this.#o(this.#i.duration,t),this.#i.ended||this.#t.player.dispatch(new P("media-play-request",{trigger:t})))}#F(t){this.#t.notify("seeking",this.#i.currentTime,t)}#U(t){const i={buffered:this.#i.buffered,seekable:this.#i.seekable};this.#t.notify("progress",i,t)}#V(t){this.#t.notify("suspend",void 0,t)}#q(t){this.#t.notify("rate-change",this.#i.playbackRate,t)}#H(t){const i=this.#i.error;if(!i)return;const e={message:i.message,code:i.code,mediaError:i};this.#t.notify("error",e,t)}}class F{#n;#t;get#e(){return this.#n.media.audioTracks}constructor(t,i){this.#n=t,this.#t=i,this.#e.onaddtrack=this.#a.bind(this),this.#e.onremovetrack=this.#h.bind(this),this.#e.onchange=this.#r.bind(this),p(this.#t.audioTracks,"change",this.#u.bind(this))}#a(t){const i=t.track;if(i.label==="")return;const e=i.id.toString()||`native-audio-${this.#t.audioTracks.length}`,a={id:e,label:i.label,language:i.language,kind:i.kind,selected:!1};this.#t.audioTracks[c.add](a,t),i.enabled&&(a.selected=!0)}#h(t){const i=this.#t.audioTracks.getById(t.track.id);i&&this.#t.audioTracks[c.remove](i,t)}#r(t){let i=this.#d();if(!i)return;const e=this.#t.audioTracks.getById(i.id);e&&this.#t.audioTracks[c.select](e,!0,t)}#d(){return Array.from(this.#e).find(t=>t.enabled)}#u(t){const{current:i}=t.detail;if(!i)return;const e=this.#e.getTrackById(i.id);if(e){const a=this.#d();a&&(a.enabled=!1),e.enabled=!0}}}class U{constructor(t,i){this.media=t,this.ctx=i,this.audioGain=new R(t,e=>{this.ctx.notify("audio-gain-change",e)})}scope=A();currentSrc=null;audioGain;setup(){new I(this,this.ctx),"audioTracks"in this.media&&new F(this,this.ctx),y(()=>{this.audioGain.destroy(),this.media.srcObject=null,this.media.removeAttribute("src");for(const t of this.media.querySelectorAll("source"))t.remove();this.media.load()})}get type(){return""}setPlaybackRate(t){this.media.playbackRate=t}async play(){return this.media.play()}async pause(){return this.media.pause()}setMuted(t){this.media.muted=t}setVolume(t){this.media.volume=t}setCurrentTime(t){this.media.currentTime=t}setPlaysInline(t){h(this.media,"playsinline",t)}async loadSource({src:t,type:i},e){this.media.preload=e||"",k(t)?(this.removeSource(),this.media.srcObject=t):(this.media.srcObject=null,L(t)?i!=="?"?this.appendSource({src:t,type:i}):(this.removeSource(),this.media.src=this.#n(t)):(this.removeSource(),this.media.src=window.URL.createObjectURL(t))),this.media.load(),this.currentSrc={src:t,type:i}}appendSource(t,i){const e=this.media.querySelector("source[data-vds]"),a=e??document.createElement("source");h(a,"src",this.#n(t.src)),h(a,"type",t.type!=="?"?t.type:i),h(a,"data-vds",""),e||this.media.append(a)}removeSource(){this.media.querySelector("source[data-vds]")?.remove()}#n(t){const{clipStartTime:i,clipEndTime:e}=this.ctx.$state,a=i(),n=e();return a>0&&n>0?`${t}#t=${a},${n}`:a>0?`${t}#t=${a}`:n>0?`${t}#t=0,${n}`:t}}export{U as HTMLMediaProvider};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o,E as p,l,D as P,n as f}from"../chunks/vidstack-DLVdcWrK.js";import{n as u,o as h,p as m}from"../chunks/vidstack-DWjB11vV.js";import{HTMLMediaProvider as g}from"./vidstack-html-CoKFAYW5.js";import{H as k}from"../chunks/vidstack-wt2OT4N7.js";import{a as x,T as n}from"../chunks/vidstack-DPO7J4-v.js";import"../chunks/vidstack-Dh2GOjra.js";import"../chunks/vidstack-Bxv1Qnxe.js";import"../chunks/vidstack-C_AxqLKV.js";import"../chunks/vidstack-DKqYI_HJ.js";class T{#t;#i;constructor(t,e){this.#t=t,this.#i=e,t.textTracks.onaddtrack=this.#e.bind(this),o(this.#r.bind(this))}#e(t){const e=t.track;if(!e||y(this.#t,e))return;const i=new x({id:e.id,kind:e.kind,label:e.label??"",language:e.language,type:"vtt"});i[n.native]={track:e},i[n.readyState]=2,i[n.nativeHLS]=!0;let a=0;const c=d=>{if(e.cues)for(let s=a;s<e.cues.length;s++)i.addCue(e.cues[s],d),a++};c(t),e.oncuechange=c,this.#i.textTracks.add(i,t),i.setMode(e.mode,t)}#r(){this.#t.textTracks.onaddtrack=null;for(const t of this.#i.textTracks){const e=t[n.native]?.track;e?.oncuechange&&(e.oncuechange=null)}}}function y(r,t){return Array.from(r.children).find(e=>e.track===t)}class v{#t;#i;constructor(t,e){this.#t=t,this.#i=e,new p(t).add("enterpictureinpicture",this.#e.bind(this)).add("leavepictureinpicture",this.#r.bind(this))}get active(){return document.pictureInPictureElement===this.#t}get supported(){return u(this.#t)}async enter(){return this.#t.requestPictureInPicture()}exit(){return document.exitPictureInPicture()}#e(t){this.#n(!0,t)}#r(t){this.#n(!1,t)}#n=(t,e)=>{this.#i.notify("picture-in-picture-change",t,e)}}class M{#t;#i;#e="inline";get mode(){return this.#e}constructor(t,e){this.#t=t,this.#i=e,l(t,"webkitpresentationmodechanged",this.#r.bind(this))}get supported(){return h(this.#t)}async setPresentationMode(t){this.#e!==t&&this.#t.webkitSetPresentationMode(t)}#r(t){const e=this.#e;this.#e=this.#t.webkitPresentationMode,this.#i.player?.dispatch(new P("video-presentation-change",{detail:this.#e,trigger:t})),["fullscreen","picture-in-picture"].forEach(i=>{(this.#e===i||e===i)&&this.#i.notify(`${i}-change`,this.#e===i,t)})}}class w{#t;get active(){return this.#t.mode==="fullscreen"}get supported(){return this.#t.supported}constructor(t){this.#t=t}async enter(){this.#t.setPresentationMode("fullscreen")}async exit(){this.#t.setPresentationMode("inline")}}class E{#t;get active(){return this.#t.mode==="picture-in-picture"}get supported(){return this.#t.supported}constructor(t){this.#t=t}async enter(){this.#t.setPresentationMode("picture-in-picture")}async exit(){this.#t.setPresentationMode("inline")}}class I extends g{$$PROVIDER_TYPE="VIDEO";get type(){return"video"}airPlay;fullscreen;pictureInPicture;constructor(t,e){super(t,e),f(()=>{if(this.airPlay=new k(t,e),h(t)){const i=new M(t,e);this.fullscreen=new w(i),this.pictureInPicture=new E(i)}else u(t)&&(this.pictureInPicture=new v(t,e))},this.scope)}setup(){super.setup(),m(this.video)&&new T(this.video,this.ctx),this.ctx.textRenderers.attachVideo(this.video),o(()=>{this.ctx.textRenderers.attachVideo(null)}),this.type==="video"&&this.ctx.notify("provider-setup",this)}get video(){return this.media}}export{I as VideoProvider};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ak as y,s as l,e as c,p as u,i as b,h as d,l as k,a as m}from"../chunks/vidstack-DLVdcWrK.js";import{Q as f}from"../chunks/vidstack-DRH_1tFW.js";import{T as o}from"../chunks/vidstack-CS2aNc61.js";import{a as v}from"../chunks/vidstack-DPO7J4-v.js";import{L as r}from"../chunks/vidstack-C_AxqLKV.js";import{R as w}from"../chunks/vidstack-Dh2GOjra.js";import{p as P}from"../chunks/vidstack-DKqYI_HJ.js";import{E as T}from"../chunks/vidstack-BL_lNyW_.js";import{resolveVimeoVideoId as g,getVimeoVideoInfo as C}from"../chunks/vidstack-2f5gzOW6.js";import"../chunks/vidstack-DWjB11vV.js";const $=["bufferend","bufferstart","durationchange","ended","enterpictureinpicture","error","fullscreenchange","leavepictureinpicture","loaded","playProgress","loadProgress","pause","play","playbackratechange","qualitychange","seeked","seeking","timeupdate","volumechange","waiting"];class E extends T{$$PROVIDER_TYPE="VIMEO";scope=y();fullscreen;#e;#s=l("");#i=l(!1);#o=null;#c=null;#d=!1;#n=new o(0,0);#u=new w(this.#C.bind(this));#w=null;#r=null;#a=new Map;#l=null;constructor(e,t){super(e),this.#e=t;const s=this;this.fullscreen={get active(){return s.#d},supported:!0,enter:()=>this.#t("requestFullscreen"),exit:()=>this.#t("exitFullscreen")}}cookies=!1;title=!0;byline=!0;portrait=!0;color="00ADEF";get type(){return"vimeo"}get currentSrc(){return this.#c}get videoId(){return this.#s()}get hash(){return this.#o}get isPro(){return this.#i()}preconnect(){P(this.getOrigin())}setup(){super.setup(),c(this.#P.bind(this)),c(this.#T.bind(this)),c(this.#g.bind(this)),this.#e.notify("provider-setup",this)}destroy(){this.#m(),this.fullscreen=void 0;const e="provider destroyed";for(const t of this.#a.values())for(const{reject:s}of t)s(e);this.#a.clear(),this.#t("destroy")}async play(){return this.#t("play")}async pause(){return this.#t("pause")}setMuted(e){this.#t("setMuted",e)}setCurrentTime(e){this.#t("seekTo",e),this.#e.notify("seeking",e)}setVolume(e){this.#t("setVolume",e),this.#t("setMuted",u(this.#e.$state.muted))}setPlaybackRate(e){this.#t("setPlaybackRate",e)}async loadSource(e){if(!b(e.src)){this.#c=null,this.#o=null,this.#s.set("");return}const{videoId:t,hash:s}=g(e.src);this.#s.set(t??""),this.#o=s??null,this.#c=e}#P(){this.#m();const e=this.#s();if(!e){this.src.set("");return}this.src.set(`${this.getOrigin()}/video/${e}`),this.#e.notify("load-start")}#T(){const e=this.#s();if(!e)return;const t=d(),s=new AbortController;return this.#l=t,C(e,s,this.#o).then(i=>{t.resolve(i)}).catch(i=>{t.reject()}),()=>{t.reject(),s.abort()}}#g(){const e=this.#i(),{$state:t,qualities:s}=this.#e;if(t.canSetPlaybackRate.set(e),s[r.setReadonly](!e),e)return k(s,"change",()=>{if(s.auto)return;const i=s.selected?.id;i&&this.#t("setQuality",i)})}getOrigin(){return"https://player.vimeo.com"}buildParams(){const{keyDisabled:e}=this.#e.$props,{playsInline:t,nativeControls:s}=this.#e.$state,i=s();return{title:this.title,byline:this.byline,color:this.color,portrait:this.portrait,controls:i,h:this.hash,keyboard:i&&!e(),transparent:!0,playsinline:t(),dnt:!this.cookies}}#C(){this.#t("getCurrentTime")}#h=!1;#$(e,t){if(this.#h&&e===0)return;const{realCurrentTime:s,paused:i,bufferedEnd:n,seekableEnd:a,live:h}=this.#e.$state;if(s()===e)return;const p=s();this.#e.notify("time-change",e,t),Math.abs(p-e)>1.5&&(this.#e.notify("seeking",e,t),!i()&&n()<e&&this.#e.notify("waiting",void 0,t)),!h()&&a()-e<.01&&(this.#e.notify("end",void 0,t),this.#h=!0,setTimeout(()=>{this.#h=!1},500))}#E(e,t){this.#e.notify("seeked",e,t)}#V(e){const t=this.#s();this.#l?.promise.then(s=>{if(!s)return;const{title:i,poster:n,duration:a,pro:h}=s;this.#i.set(h),this.#e.notify("title-change",i,e),this.#e.notify("poster-change",n,e),this.#e.notify("duration-change",a,e),this.#f(a,e)}).catch(()=>{t===this.#s()&&(this.#t("getVideoTitle"),this.#t("getDuration"))})}#f(e,t){const{nativeControls:s}=this.#e.$state,i=s();this.#n=new o(0,e);const n={buffered:new o(0,0),seekable:this.#n,duration:e};this.#e.delegate.ready(n,t),i||this.#t("_hideOverlay"),this.#t("getQualities"),this.#t("getChapters")}#I(e,t,s){switch(e){case"getVideoTitle":const i=t;this.#e.notify("title-change",i,s);break;case"getDuration":const n=t;this.#e.$state.canPlay()?this.#e.notify("duration-change",n,s):this.#f(n,s);break;case"getCurrentTime":this.#$(t,s);break;case"getBuffered":m(t)&&t.length&&this.#p(t[t.length-1][1],s);break;case"setMuted":case"getMuted":this.#y(u(this.#e.$state.volume),t,s);break;case"getChapters":this.#L(t);break;case"getQualities":this.#F(t,s);break}this.#v(e)?.resolve()}#R(){for(const e of $)this.#t("addEventListener",e)}#M(e){this.#u.stop(),this.#e.notify("pause",void 0,e)}async#A(e){this.#u.start(),await this.#t("getMuted"),this.#e.notify("play",void 0,e)}#S(e){const{paused:t}=this.#e.$state;!t()&&!this.#h&&this.#e.notify("playing",void 0,e)}#p(e,t){const s={buffered:new o(0,e),seekable:this.#n};this.#e.notify("progress",s,t)}#q(e){this.#e.notify("waiting",void 0,e)}#x(e){const{paused:t}=this.#e.$state;t()||this.#e.notify("playing",void 0,e)}async#Q(e){const{paused:t}=this.#e.$state;t()&&(await this.#t("getMuted"),this.#e.notify("play",void 0,e)),this.#e.notify("waiting",void 0,e)}#y(e,t,s){const i={volume:e,muted:t};this.#e.notify("volume-change",i,s)}#L(e){if(this.#b(),!e.length)return;const t=new v({kind:"chapters",default:!0}),{seekableEnd:s}=this.#e.$state;for(let i=0;i<e.length;i++){const n=e[i],a=e[i+1];t.addCue(new window.VTTCue(n.startTime,a?.startTime??s(),n.title))}this.#r=t,this.#e.textTracks.add(t)}#b(){this.#r&&(this.#e.textTracks.remove(this.#r),this.#r=null)}#F(e,t){this.#e.qualities[f.enableAuto]=e.some(s=>s.id==="auto")?()=>this.#t("setQuality","auto"):void 0;for(const s of e){if(s.id==="auto")continue;const i=+s.id.slice(0,-1);isNaN(i)||this.#e.qualities[r.add]({id:s.id,width:i*(16/9),height:i,codec:"avc1,h.264",bitrate:-1},t)}this.#k(e.find(s=>s.active),t)}#k({id:e}={},t){if(!e)return;const s=e==="auto",i=this.#e.qualities.getById(e);s?(this.#e.qualities[f.setAuto](s,t),this.#e.qualities[r.select](void 0,!0,t)):this.#e.qualities[r.select](i??void 0,!0,t)}#O(e,t,s){switch(e){case"ready":this.#R();break;case"loaded":this.#V(s);break;case"play":this.#A(s);break;case"playProgress":this.#S(s);break;case"pause":this.#M(s);break;case"loadProgress":this.#p(t.seconds,s);break;case"waiting":this.#Q(s);break;case"bufferstart":this.#q(s);break;case"bufferend":this.#x(s);break;case"volumechange":this.#y(t.volume,u(this.#e.$state.muted),s);break;case"durationchange":this.#n=new o(0,t.duration),this.#e.notify("duration-change",t.duration,s);break;case"playbackratechange":this.#e.notify("rate-change",t.playbackRate,s);break;case"qualitychange":this.#k(t,s);break;case"fullscreenchange":this.#d=t.fullscreen,this.#e.notify("fullscreen-change",t.fullscreen,s);break;case"enterpictureinpicture":this.#e.notify("picture-in-picture-change",!0,s);break;case"leavepictureinpicture":this.#e.notify("picture-in-picture-change",!1,s);break;case"ended":this.#e.notify("end",void 0,s);break;case"error":this.#D(t,s);break;case"seek":case"seeked":this.#E(t.seconds,s);break}}#D(e,t){const{message:s,method:i}=e;i==="setPlaybackRate"&&this.#i.set(!1),i&&this.#v(i)?.reject(s)}onMessage(e,t){e.event?this.#O(e.event,e.data,t):e.method&&this.#I(e.method,e.value,t)}onLoad(){}async#t(e,t){let s=d(),i=this.#a.get(e);return i||this.#a.set(e,i=[]),i.push(s),this.postMessage({method:e,value:t}),s.promise}#m(){this.#u.stop(),this.#n=new o(0,0),this.#l=null,this.#w=null,this.#i.set(!1),this.#b()}#v(e){return this.#a.get(e)?.shift()}}export{E as VimeoProvider};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ak as p,s as y,e as m,i as f,h as g,al as b,I as d,W as k}from"../chunks/vidstack-DLVdcWrK.js";import{T as u}from"../chunks/vidstack-CS2aNc61.js";import{p as v}from"../chunks/vidstack-DKqYI_HJ.js";import{E as P}from"../chunks/vidstack-BL_lNyW_.js";import{resolveYouTubeVideoId as w}from"../chunks/vidstack-DiNS2Vx5.js";import"../chunks/vidstack-DWjB11vV.js";const r={Ended:0,Playing:1,Paused:2,Buffering:3,Cued:5};class T extends P{$$PROVIDER_TYPE="YOUTUBE";scope=p();#e;#a=y("");#o=-1;#d=null;#r=-1;#i=!1;#s=new Map;constructor(e,t){super(e),this.#e=t}language="en";color="red";cookies=!1;get currentSrc(){return this.#d}get type(){return"youtube"}get videoId(){return this.#a()}preconnect(){v(this.getOrigin())}setup(){super.setup(),m(this.#c.bind(this)),this.#e.notify("provider-setup",this)}destroy(){this.#l();const e="provider destroyed";for(const t of this.#s.values())for(const{reject:s}of t)s(e);this.#s.clear()}async play(){return this.#t("playVideo")}#k(e){this.#n("playVideo")?.reject(e)}async pause(){return this.#t("pauseVideo")}#v(e){this.#n("pauseVideo")?.reject(e)}setMuted(e){e?this.#t("mute"):this.#t("unMute")}setCurrentTime(e){this.#t("seekTo",[e,!0]),this.#e.notify("seeking",e)}setVolume(e){this.#t("setVolume",e*100)}setPlaybackRate(e){this.#t("setPlaybackRate",e)}async loadSource(e){if(!f(e.src)){this.#d=null,this.#a.set("");return}const t=w(e.src);this.#a.set(t??""),this.#d=e}getOrigin(){return this.cookies?"https://www.youtube.com":"https://www.youtube-nocookie.com"}#c(){this.#l();const e=this.#a();if(!e){this.src.set("");return}this.src.set(`${this.getOrigin()}/embed/${e}`),this.#e.notify("load-start")}buildParams(){const{keyDisabled:e}=this.#e.$props,{muted:t,playsInline:s,nativeControls:a}=this.#e.$state,i=a();return{rel:0,autoplay:0,cc_lang_pref:this.language,cc_load_policy:i?1:void 0,color:this.color,controls:i?1:0,disablekb:!i||e()?1:0,enablejsapi:1,fs:1,hl:this.language,iv_load_policy:i?1:3,mute:t()?1:0,playsinline:s()?1:0}}#t(e,t){let s=g(),a=this.#s.get(e);a||this.#s.set(e,a=[]),a.push(s);const i=Array.isArray(t)?t:t?[t]:void 0;return this.postMessage({event:"command",func:e,args:i}),s.promise}onLoad(){window.setTimeout(()=>this.postMessage({event:"listening"}),100)}#p(e){this.#e.notify("loaded-metadata"),this.#e.notify("loaded-data"),this.#e.delegate.ready(void 0,e)}#y(e){this.#n("pauseVideo")?.resolve(),this.#e.notify("pause",void 0,e)}#m(e,t){const{duration:s,realCurrentTime:a}=this.#e.$state,i=this.#o===r.Ended,o=i?s():e;this.#e.notify("time-change",o,t),!i&&Math.abs(o-a())>1&&this.#e.notify("seeking",o,t)}#u(e,t,s){const a={buffered:new u(0,e),seekable:t};this.#e.notify("progress",a,s);const{seeking:i,realCurrentTime:o}=this.#e.$state;i()&&e>o()&&this.#h(s)}#h(e){const{paused:t,realCurrentTime:s}=this.#e.$state;window.clearTimeout(this.#r),this.#r=window.setTimeout(()=>{this.#e.notify("seeked",s(),e),this.#r=-1},t()?100:0)}#f(e){const{seeking:t}=this.#e.$state;t()&&this.#h(e),this.#e.notify("pause",void 0,e),this.#e.notify("end",void 0,e)}#g(e,t){const{paused:s,seeking:a}=this.#e.$state,i=e===r.Playing,o=e===r.Buffering,n=this.#b("playVideo"),h=s()&&(o||i);if(o&&this.#e.notify("waiting",void 0,t),a()&&i&&this.#h(t),this.#i&&i){this.pause(),this.#i=!1,this.setMuted(this.#e.$state.muted());return}if(!n&&h){this.#i=!0,this.setMuted(!0);return}switch(h&&(this.#n("playVideo")?.resolve(),this.#e.notify("play",void 0,t)),e){case r.Cued:this.#p(t);break;case r.Playing:this.#e.notify("playing",void 0,t);break;case r.Paused:this.#y(t);break;case r.Ended:this.#f(t);break}this.#o=e}onMessage({info:e},t){if(!e)return;const{title:s,intrinsicDuration:a,playbackRate:i}=this.#e.$state;if(b(e.videoData)&&e.videoData.title!==s()&&this.#e.notify("title-change",e.videoData.title,t),d(e.duration)&&e.duration!==a()){if(d(e.videoLoadedFraction)){const o=e.progressState?.loaded??e.videoLoadedFraction*e.duration,n=new u(0,e.duration);this.#u(o,n,t)}this.#e.notify("duration-change",e.duration,t)}if(d(e.playbackRate)&&e.playbackRate!==i()&&this.#e.notify("rate-change",e.playbackRate,t),e.progressState){const{current:o,seekableStart:n,seekableEnd:h,loaded:c,duration:l}=e.progressState;this.#m(o,t),this.#u(c,new u(n,h),t),l!==a()&&this.#e.notify("duration-change",l,t)}if(d(e.volume)&&k(e.muted)&&!this.#i){const o={muted:e.muted,volume:e.volume/100};this.#e.notify("volume-change",o,t)}d(e.playerState)&&e.playerState!==this.#o&&this.#g(e.playerState,t)}#l(){this.#o=-1,this.#r=-1,this.#i=!1}#n(e){return this.#s.get(e)?.shift()}#b(e){return!!this.#s.get(e)?.length}}export{T as YouTubeProvider};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunks/vidstack-BGhRKayG.js";import"https://cdn.vidstack.io/icons";import"./chunks/vidstack-DLVdcWrK.js";import"./chunks/vidstack-DWjB11vV.js";import"./chunks/vidstack-CS2aNc61.js";import"./chunks/vidstack-DPO7J4-v.js";import"./chunks/vidstack-DKqYI_HJ.js";import"./chunks/vidstack-C_AxqLKV.js";import"./chunks/vidstack-DRH_1tFW.js";import"./chunks/vidstack-BfBBPhXV.js";import"./chunks/vidstack-Bxv1Qnxe.js";
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { signal, listenEvent, effect, peek, isString } from './vidstack-C1PwJD_4.js';
|
|
2
|
+
import { appendParamsToURL } from './vidstack-Bs54kFSz.js';
|
|
3
|
+
|
|
4
|
+
class EmbedProvider {
|
|
5
|
+
#iframe;
|
|
6
|
+
src = signal("");
|
|
7
|
+
/**
|
|
8
|
+
* Defines which referrer is sent when fetching the resource.
|
|
9
|
+
*
|
|
10
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/referrerPolicy}
|
|
11
|
+
*/
|
|
12
|
+
referrerPolicy = null;
|
|
13
|
+
get iframe() {
|
|
14
|
+
return this.#iframe;
|
|
15
|
+
}
|
|
16
|
+
constructor(iframe) {
|
|
17
|
+
this.#iframe = iframe;
|
|
18
|
+
iframe.setAttribute("frameBorder", "0");
|
|
19
|
+
iframe.setAttribute("aria-hidden", "true");
|
|
20
|
+
iframe.setAttribute(
|
|
21
|
+
"allow",
|
|
22
|
+
"autoplay; fullscreen; encrypted-media; picture-in-picture; accelerometer; gyroscope"
|
|
23
|
+
);
|
|
24
|
+
if (this.referrerPolicy !== null) {
|
|
25
|
+
iframe.setAttribute("referrerpolicy", this.referrerPolicy);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
setup() {
|
|
29
|
+
listenEvent(window, "message", this.#onWindowMessage.bind(this));
|
|
30
|
+
listenEvent(this.#iframe, "load", this.onLoad.bind(this));
|
|
31
|
+
effect(this.#watchSrc.bind(this));
|
|
32
|
+
}
|
|
33
|
+
#watchSrc() {
|
|
34
|
+
const src = this.src();
|
|
35
|
+
if (!src.length) {
|
|
36
|
+
this.#iframe.setAttribute("src", "");
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
const params = peek(() => this.buildParams());
|
|
40
|
+
this.#iframe.setAttribute("src", appendParamsToURL(src, params));
|
|
41
|
+
}
|
|
42
|
+
postMessage(message, target) {
|
|
43
|
+
this.#iframe.contentWindow?.postMessage(JSON.stringify(message), target ?? "*");
|
|
44
|
+
}
|
|
45
|
+
#onWindowMessage(event) {
|
|
46
|
+
const origin = this.getOrigin(), isOriginMatch = (event.source === null || event.source === this.#iframe?.contentWindow) && (!isString(origin) || origin === event.origin);
|
|
47
|
+
if (!isOriginMatch) return;
|
|
48
|
+
try {
|
|
49
|
+
const message = JSON.parse(event.data);
|
|
50
|
+
if (message) this.onMessage(message, event);
|
|
51
|
+
return;
|
|
52
|
+
} catch (e) {
|
|
53
|
+
}
|
|
54
|
+
if (event.data) this.onMessage(event.data, event);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export { EmbedProvider };
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
import { computed, peek, effect, onDispose, isDOMNode, animationFrameThrottle, isString } from './vidstack-C1PwJD_4.js';
|
|
2
|
+
import { nothing, render, html } from 'lit-html';
|
|
3
|
+
import { ifDefined } from 'lit-html/directives/if-defined.js';
|
|
4
|
+
import { unsafeSVG } from 'lit-html/directives/unsafe-svg.js';
|
|
5
|
+
import { directive, AsyncDirective, PartType } from 'lit-html/async-directive.js';
|
|
6
|
+
import { useMediaContext } from './vidstack-BjxlZzGu.js';
|
|
7
|
+
|
|
8
|
+
class SignalDirective extends AsyncDirective {
|
|
9
|
+
#signal = null;
|
|
10
|
+
#isAttr = false;
|
|
11
|
+
#stop = null;
|
|
12
|
+
constructor(part) {
|
|
13
|
+
super(part);
|
|
14
|
+
this.#isAttr = part.type === PartType.ATTRIBUTE || part.type === PartType.BOOLEAN_ATTRIBUTE;
|
|
15
|
+
}
|
|
16
|
+
render(signal) {
|
|
17
|
+
if (signal !== this.#signal) {
|
|
18
|
+
this.disconnected();
|
|
19
|
+
this.#signal = signal;
|
|
20
|
+
if (this.isConnected) this.#watch();
|
|
21
|
+
}
|
|
22
|
+
return this.#signal ? this.#resolveValue(peek(this.#signal)) : nothing;
|
|
23
|
+
}
|
|
24
|
+
reconnected() {
|
|
25
|
+
this.#watch();
|
|
26
|
+
}
|
|
27
|
+
disconnected() {
|
|
28
|
+
this.#stop?.();
|
|
29
|
+
this.#stop = null;
|
|
30
|
+
}
|
|
31
|
+
#watch() {
|
|
32
|
+
if (!this.#signal) return;
|
|
33
|
+
this.#stop = effect(this.#onValueChange.bind(this));
|
|
34
|
+
}
|
|
35
|
+
#resolveValue(value) {
|
|
36
|
+
return this.#isAttr ? ifDefined(value) : value;
|
|
37
|
+
}
|
|
38
|
+
#setValue(value) {
|
|
39
|
+
this.setValue(this.#resolveValue(value));
|
|
40
|
+
}
|
|
41
|
+
#onValueChange() {
|
|
42
|
+
{
|
|
43
|
+
try {
|
|
44
|
+
this.#setValue(this.#signal?.());
|
|
45
|
+
} catch (error) {
|
|
46
|
+
if (error instanceof Error && error.message.includes("This `ChildPart` has no `parentNode`")) {
|
|
47
|
+
const svelteDynamicImportExample = [
|
|
48
|
+
"{#await import('./Player.svelte') then {default: Player}}",
|
|
49
|
+
" <svelte:component this={Player} />",
|
|
50
|
+
"{/await}"
|
|
51
|
+
].join("\n");
|
|
52
|
+
console.warn(
|
|
53
|
+
`[vidstack] Failed to render most likely due to a hydration issue with your framework. Dynamically importing the player should resolve the issue.
|
|
54
|
+
|
|
55
|
+
Svelte Example:
|
|
56
|
+
|
|
57
|
+
${svelteDynamicImportExample}`
|
|
58
|
+
);
|
|
59
|
+
} else {
|
|
60
|
+
console.error(error);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
function $signal(compute) {
|
|
67
|
+
return directive(SignalDirective)(computed(compute));
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
class SlotObserver {
|
|
71
|
+
#roots;
|
|
72
|
+
#callback;
|
|
73
|
+
elements = /* @__PURE__ */ new Set();
|
|
74
|
+
constructor(roots, callback) {
|
|
75
|
+
this.#roots = roots;
|
|
76
|
+
this.#callback = callback;
|
|
77
|
+
}
|
|
78
|
+
connect() {
|
|
79
|
+
this.#update();
|
|
80
|
+
const observer = new MutationObserver(this.#onMutation);
|
|
81
|
+
for (const root of this.#roots) observer.observe(root, { childList: true, subtree: true });
|
|
82
|
+
onDispose(() => observer.disconnect());
|
|
83
|
+
onDispose(this.disconnect.bind(this));
|
|
84
|
+
}
|
|
85
|
+
disconnect() {
|
|
86
|
+
this.elements.clear();
|
|
87
|
+
}
|
|
88
|
+
assign(template, slot) {
|
|
89
|
+
if (isDOMNode(template)) {
|
|
90
|
+
slot.textContent = "";
|
|
91
|
+
slot.append(template);
|
|
92
|
+
} else {
|
|
93
|
+
render(null, slot);
|
|
94
|
+
render(template, slot);
|
|
95
|
+
}
|
|
96
|
+
if (!slot.style.display) {
|
|
97
|
+
slot.style.display = "contents";
|
|
98
|
+
}
|
|
99
|
+
const el = slot.firstElementChild;
|
|
100
|
+
if (!el) return;
|
|
101
|
+
const classList = slot.getAttribute("data-class");
|
|
102
|
+
if (classList) el.classList.add(...classList.split(" "));
|
|
103
|
+
}
|
|
104
|
+
#onMutation = animationFrameThrottle(this.#update.bind(this));
|
|
105
|
+
#update(entries) {
|
|
106
|
+
if (entries && !entries.some((e) => e.addedNodes.length)) return;
|
|
107
|
+
let changed = false, slots = this.#roots.flatMap((root) => [...root.querySelectorAll("slot")]);
|
|
108
|
+
for (const slot of slots) {
|
|
109
|
+
if (!slot.hasAttribute("name") || this.elements.has(slot)) continue;
|
|
110
|
+
this.elements.add(slot);
|
|
111
|
+
changed = true;
|
|
112
|
+
}
|
|
113
|
+
if (changed) this.#callback(this.elements);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
let id = 0, slotIdAttr = "data-slot-id";
|
|
118
|
+
class SlotManager {
|
|
119
|
+
#roots;
|
|
120
|
+
slots;
|
|
121
|
+
constructor(roots) {
|
|
122
|
+
this.#roots = roots;
|
|
123
|
+
this.slots = new SlotObserver(roots, this.#update.bind(this));
|
|
124
|
+
}
|
|
125
|
+
connect() {
|
|
126
|
+
this.slots.connect();
|
|
127
|
+
this.#update();
|
|
128
|
+
const mutations = new MutationObserver(this.#onMutation);
|
|
129
|
+
for (const root of this.#roots) mutations.observe(root, { childList: true });
|
|
130
|
+
onDispose(() => mutations.disconnect());
|
|
131
|
+
}
|
|
132
|
+
#onMutation = animationFrameThrottle(this.#update.bind(this));
|
|
133
|
+
#update() {
|
|
134
|
+
for (const root of this.#roots) {
|
|
135
|
+
for (const node of root.children) {
|
|
136
|
+
if (node.nodeType !== 1) continue;
|
|
137
|
+
const name = node.getAttribute("slot");
|
|
138
|
+
if (!name) continue;
|
|
139
|
+
node.style.display = "none";
|
|
140
|
+
let slotId = node.getAttribute(slotIdAttr);
|
|
141
|
+
if (!slotId) {
|
|
142
|
+
node.setAttribute(slotIdAttr, slotId = ++id + "");
|
|
143
|
+
}
|
|
144
|
+
for (const slot of this.slots.elements) {
|
|
145
|
+
if (slot.getAttribute("name") !== name || slot.getAttribute(slotIdAttr) === slotId) {
|
|
146
|
+
continue;
|
|
147
|
+
}
|
|
148
|
+
const clone = document.importNode(node, true);
|
|
149
|
+
if (name.includes("-icon")) clone.classList.add("vds-icon");
|
|
150
|
+
clone.style.display = "";
|
|
151
|
+
clone.removeAttribute("slot");
|
|
152
|
+
this.slots.assign(clone, slot);
|
|
153
|
+
slot.setAttribute(slotIdAttr, slotId);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
function Icon({ name, class: _class, state, paths, viewBox = "0 0 32 32" }) {
|
|
161
|
+
return html`<svg
|
|
162
|
+
class="${"vds-icon" + (_class ? ` ${_class}` : "")}"
|
|
163
|
+
viewBox="${viewBox}"
|
|
164
|
+
fill="none"
|
|
165
|
+
aria-hidden="true"
|
|
166
|
+
focusable="false"
|
|
167
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
168
|
+
data-icon=${ifDefined(name ?? state)}
|
|
169
|
+
>
|
|
170
|
+
${!isString(paths) ? $signal(paths) : unsafeSVG(paths)}
|
|
171
|
+
</svg>`;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
class IconsLoader {
|
|
175
|
+
#icons = {};
|
|
176
|
+
#loaded = false;
|
|
177
|
+
slots;
|
|
178
|
+
constructor(roots) {
|
|
179
|
+
this.slots = new SlotObserver(roots, this.#insertIcons.bind(this));
|
|
180
|
+
}
|
|
181
|
+
connect() {
|
|
182
|
+
this.slots.connect();
|
|
183
|
+
}
|
|
184
|
+
load() {
|
|
185
|
+
this.loadIcons().then((icons) => {
|
|
186
|
+
this.#icons = icons;
|
|
187
|
+
this.#loaded = true;
|
|
188
|
+
this.#insertIcons();
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
*#iterate() {
|
|
192
|
+
for (const iconName of Object.keys(this.#icons)) {
|
|
193
|
+
const slotName = `${iconName}-icon`;
|
|
194
|
+
for (const slot of this.slots.elements) {
|
|
195
|
+
if (slot.name !== slotName) continue;
|
|
196
|
+
yield { icon: this.#icons[iconName], slot };
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
#insertIcons() {
|
|
201
|
+
if (!this.#loaded) return;
|
|
202
|
+
for (const { icon, slot } of this.#iterate()) {
|
|
203
|
+
this.slots.assign(icon, slot);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
class LayoutIconsLoader extends IconsLoader {
|
|
209
|
+
connect() {
|
|
210
|
+
super.connect();
|
|
211
|
+
const { player } = useMediaContext();
|
|
212
|
+
if (!player.el) return;
|
|
213
|
+
let dispose, observer = new IntersectionObserver((entries) => {
|
|
214
|
+
if (!entries[0]?.isIntersecting) return;
|
|
215
|
+
dispose?.();
|
|
216
|
+
dispose = void 0;
|
|
217
|
+
this.load();
|
|
218
|
+
});
|
|
219
|
+
observer.observe(player.el);
|
|
220
|
+
dispose = onDispose(() => observer.disconnect());
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
export { $signal, Icon, LayoutIconsLoader, SlotManager };
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import { Host, effect, setAttribute, isString, useState, BOOLEAN } from './vidstack-C1PwJD_4.js';
|
|
2
|
+
import { Thumbnail, Time, AirPlayButton, CaptionButton, FullscreenButton, LiveButton, MuteButton, PIPButton, PlayButton, SeekButton, AudioRadioGroup, CaptionsRadioGroup, Menu, MenuButton, MenuItem, MenuItems, SpeedRadioGroup, QualityRadioGroup, Radio, Slider, SliderValue, TimeSlider, SliderPreview, VolumeSlider } from './vidstack-EoLRQZbs.js';
|
|
3
|
+
import { cloneTemplateContent, createTemplate, requestScopedAnimationFrame, cloneTemplate } from './vidstack-C0SWkbs7.js';
|
|
4
|
+
import { useMediaContext } from './vidstack-BjxlZzGu.js';
|
|
5
|
+
|
|
6
|
+
const imgTemplate = /* @__PURE__ */ createTemplate(
|
|
7
|
+
'<img loading="eager" decoding="async" aria-hidden="true">'
|
|
8
|
+
);
|
|
9
|
+
class MediaThumbnailElement extends Host(HTMLElement, Thumbnail) {
|
|
10
|
+
static tagName = "media-thumbnail";
|
|
11
|
+
static attrs = {
|
|
12
|
+
crossOrigin: "crossorigin"
|
|
13
|
+
};
|
|
14
|
+
#media;
|
|
15
|
+
#img = this.#createImg();
|
|
16
|
+
onSetup() {
|
|
17
|
+
this.#media = useMediaContext();
|
|
18
|
+
this.$state.img.set(this.#img);
|
|
19
|
+
}
|
|
20
|
+
onConnect() {
|
|
21
|
+
const { src, crossOrigin } = this.$state;
|
|
22
|
+
if (this.#img.parentNode !== this) {
|
|
23
|
+
this.prepend(this.#img);
|
|
24
|
+
}
|
|
25
|
+
effect(() => {
|
|
26
|
+
setAttribute(this.#img, "src", src());
|
|
27
|
+
setAttribute(this.#img, "crossorigin", crossOrigin());
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
#createImg() {
|
|
31
|
+
return cloneTemplateContent(imgTemplate);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
class MediaTimeElement extends Host(HTMLElement, Time) {
|
|
36
|
+
static tagName = "media-time";
|
|
37
|
+
onConnect() {
|
|
38
|
+
effect(() => {
|
|
39
|
+
this.textContent = this.$state.timeText();
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
class MediaAirPlayButtonElement extends Host(HTMLElement, AirPlayButton) {
|
|
45
|
+
static tagName = "media-airplay-button";
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
class MediaCaptionButtonElement extends Host(HTMLElement, CaptionButton) {
|
|
49
|
+
static tagName = "media-caption-button";
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
class MediaFullscreenButtonElement extends Host(HTMLElement, FullscreenButton) {
|
|
53
|
+
static tagName = "media-fullscreen-button";
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
class MediaLiveButtonElement extends Host(HTMLElement, LiveButton) {
|
|
57
|
+
static tagName = "media-live-button";
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
class MediaMuteButtonElement extends Host(HTMLElement, MuteButton) {
|
|
61
|
+
static tagName = "media-mute-button";
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
class MediaPIPButtonElement extends Host(HTMLElement, PIPButton) {
|
|
65
|
+
static tagName = "media-pip-button";
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
class MediaPlayButtonElement extends Host(HTMLElement, PlayButton) {
|
|
69
|
+
static tagName = "media-play-button";
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
class MediaSeekButtonElement extends Host(HTMLElement, SeekButton) {
|
|
73
|
+
static tagName = "media-seek-button";
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function renderMenuItemsTemplate(el, onCreate) {
|
|
77
|
+
requestScopedAnimationFrame(() => {
|
|
78
|
+
if (!el.connectScope) return;
|
|
79
|
+
const template = el.querySelector("template");
|
|
80
|
+
if (!template) return;
|
|
81
|
+
effect(() => {
|
|
82
|
+
if (!template.content.firstElementChild?.localName && !template.firstElementChild) {
|
|
83
|
+
throw Error("[vidstack] menu items template requires root element");
|
|
84
|
+
}
|
|
85
|
+
const options = el.getOptions();
|
|
86
|
+
cloneTemplate(template, options.length, (radio, i) => {
|
|
87
|
+
const { label, value } = options[i], labelEl = radio.querySelector(`[data-part="label"]`);
|
|
88
|
+
radio.setAttribute("value", value);
|
|
89
|
+
if (labelEl) {
|
|
90
|
+
if (isString(label)) {
|
|
91
|
+
labelEl.textContent = label;
|
|
92
|
+
} else {
|
|
93
|
+
effect(() => {
|
|
94
|
+
labelEl.textContent = label();
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
onCreate?.(radio, options[i], i);
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
class MediaAudioRadioGroupElement extends Host(HTMLElement, AudioRadioGroup) {
|
|
105
|
+
static tagName = "media-audio-radio-group";
|
|
106
|
+
onConnect() {
|
|
107
|
+
renderMenuItemsTemplate(this);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
class MediaCaptionsRadioGroupElement extends Host(HTMLElement, CaptionsRadioGroup) {
|
|
112
|
+
static tagName = "media-captions-radio-group";
|
|
113
|
+
onConnect() {
|
|
114
|
+
renderMenuItemsTemplate(this);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
class MediaMenuElement extends Host(HTMLElement, Menu) {
|
|
119
|
+
static tagName = "media-menu";
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
class MediaMenuButtonElement extends Host(HTMLElement, MenuButton) {
|
|
123
|
+
static tagName = "media-menu-button";
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
class MediaMenuItemElement extends Host(HTMLElement, MenuItem) {
|
|
127
|
+
static tagName = "media-menu-item";
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
class MediaMenuItemsElement extends Host(HTMLElement, MenuItems) {
|
|
131
|
+
static tagName = "media-menu-items";
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
class MediaSpeedRadioGroupElement extends Host(HTMLElement, SpeedRadioGroup) {
|
|
135
|
+
static tagName = "media-speed-radio-group";
|
|
136
|
+
onConnect() {
|
|
137
|
+
renderMenuItemsTemplate(this);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
class MediaQualityRadioGroupElement extends Host(HTMLElement, QualityRadioGroup) {
|
|
142
|
+
static tagName = "media-quality-radio-group";
|
|
143
|
+
onConnect() {
|
|
144
|
+
renderMenuItemsTemplate(this, (el, option) => {
|
|
145
|
+
const bitrate = option.bitrate, bitrateEl = el.querySelector('[data-part="bitrate"]');
|
|
146
|
+
if (bitrate && bitrateEl) {
|
|
147
|
+
effect(() => {
|
|
148
|
+
bitrateEl.textContent = bitrate() || "";
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
class MediaRadioElement extends Host(HTMLElement, Radio) {
|
|
156
|
+
static tagName = "media-radio";
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
class MediaSliderThumbnailElement extends MediaThumbnailElement {
|
|
160
|
+
static tagName = "media-slider-thumbnail";
|
|
161
|
+
#media;
|
|
162
|
+
#slider;
|
|
163
|
+
onSetup() {
|
|
164
|
+
super.onSetup();
|
|
165
|
+
this.#media = useMediaContext();
|
|
166
|
+
this.#slider = useState(Slider.state);
|
|
167
|
+
}
|
|
168
|
+
onConnect() {
|
|
169
|
+
super.onConnect();
|
|
170
|
+
effect(this.#watchTime.bind(this));
|
|
171
|
+
}
|
|
172
|
+
#watchTime() {
|
|
173
|
+
const { duration, clipStartTime } = this.#media.$state;
|
|
174
|
+
this.time = clipStartTime() + this.#slider.pointerRate() * duration();
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
class MediaSliderValueElement extends Host(HTMLElement, SliderValue) {
|
|
179
|
+
static tagName = "media-slider-value";
|
|
180
|
+
static attrs = {
|
|
181
|
+
padMinutes: {
|
|
182
|
+
converter: BOOLEAN
|
|
183
|
+
}
|
|
184
|
+
};
|
|
185
|
+
onConnect() {
|
|
186
|
+
effect(() => {
|
|
187
|
+
this.textContent = this.getValueText();
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
class MediaTimeSliderElement extends Host(HTMLElement, TimeSlider) {
|
|
193
|
+
static tagName = "media-time-slider";
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
class MediaSliderPreviewElement extends Host(HTMLElement, SliderPreview) {
|
|
197
|
+
static tagName = "media-slider-preview";
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
class MediaVolumeSliderElement extends Host(HTMLElement, VolumeSlider) {
|
|
201
|
+
static tagName = "media-volume-slider";
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
export { MediaAirPlayButtonElement, MediaAudioRadioGroupElement, MediaCaptionButtonElement, MediaCaptionsRadioGroupElement, MediaFullscreenButtonElement, MediaLiveButtonElement, MediaMenuButtonElement, MediaMenuElement, MediaMenuItemElement, MediaMenuItemsElement, MediaMuteButtonElement, MediaPIPButtonElement, MediaPlayButtonElement, MediaQualityRadioGroupElement, MediaRadioElement, MediaSeekButtonElement, MediaSliderPreviewElement, MediaSliderThumbnailElement, MediaSliderValueElement, MediaSpeedRadioGroupElement, MediaThumbnailElement, MediaTimeElement, MediaTimeSliderElement, MediaVolumeSliderElement, renderMenuItemsTemplate };
|