@hanifhan1f/vidstack-react 1.12.13 → 1.12.15
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/dev/chunks/vidstack-B-FM4-oZ.js +668 -0
- package/dev/chunks/vidstack-B92UncBI.js +61 -0
- package/dev/chunks/vidstack-BDiAEW1N.js +11691 -0
- package/dev/chunks/vidstack-BZIhWvGa.js +1371 -0
- package/dev/chunks/vidstack-Bfi_jCvb.js +476 -0
- package/dev/chunks/vidstack-CBF7iUqu.js +22 -0
- package/dev/chunks/vidstack-CFZ0rYJz.js +34 -0
- package/dev/chunks/vidstack-CM82l-7o.js +551 -0
- package/dev/chunks/vidstack-CvWDiSTs.js +84 -0
- package/dev/chunks/vidstack-CzU-uC5f.js +189 -0
- package/dev/chunks/vidstack-D-hQD1eE.js +9 -0
- package/dev/chunks/vidstack-D6_9yy0x.js +643 -0
- package/dev/chunks/vidstack-DJQOTrl6.js +180 -0
- package/dev/chunks/vidstack-DNbKNc4R.js +288 -0
- package/dev/chunks/vidstack-D_bWd66h.js +2023 -0
- package/dev/chunks/vidstack-Dm1xEU9Q.js +36 -0
- package/dev/chunks/vidstack-f6WXkmfP.js +375 -0
- package/dev/chunks/vidstack-krOAtKMi.js +34 -0
- package/dev/chunks/vidstack-lYFZKRUc.js +401 -0
- package/dev/chunks/vidstack-vz-aZSfo.js +1497 -0
- package/dev/player/vidstack-default-components.js +14 -0
- package/dev/player/vidstack-default-icons.js +88 -0
- package/dev/player/vidstack-default-layout.js +14 -0
- package/dev/player/vidstack-plyr-icons.js +62 -0
- package/dev/player/vidstack-plyr-layout.js +636 -0
- package/dev/player/vidstack-remotion.js +345 -0
- package/dev/vidstack.js +587 -0
- package/dom.d.ts +91 -0
- package/google-cast.d.ts +1422 -0
- package/icons.d.ts +5 -0
- package/index.d.ts +8 -0
- package/package.json +9 -60
- package/player/layouts/default.d.ts +11392 -0
- package/player/layouts/plyr.d.ts +5 -0
- package/player/remotion.d.ts +5 -0
- package/player/styles/base.css +153 -0
- package/player/styles/default/buffering.css +55 -0
- package/player/styles/default/buttons.css +175 -0
- package/player/styles/default/captions.css +181 -0
- package/player/styles/default/chapter-title.css +26 -0
- package/player/styles/default/controls.css +56 -0
- package/player/styles/default/gestures.css +19 -0
- package/player/styles/default/icons.css +6 -0
- package/player/styles/default/keyboard.css +148 -0
- package/player/styles/default/layouts/audio.css +417 -0
- package/player/styles/default/layouts/video.css +1082 -0
- package/player/styles/default/menus.css +959 -0
- package/player/styles/default/poster.css +52 -0
- package/player/styles/default/sliders.css +391 -0
- package/player/styles/default/theme.css +2461 -0
- package/player/styles/default/thumbnail.css +40 -0
- package/player/styles/default/time.css +45 -0
- package/player/styles/default/tooltips.css +141 -0
- package/player/styles/plyr/theme.css +1237 -0
- package/prod/chunks/vidstack-0Foyib2F.js +34 -0
- package/prod/chunks/vidstack-BbPEqH3g.js +11196 -0
- package/prod/chunks/vidstack-Bh7M8kL6.js +663 -0
- package/prod/chunks/vidstack-BlPINAXN.js +189 -0
- package/prod/chunks/vidstack-C5Rzkyfp.js +375 -0
- package/prod/chunks/vidstack-CBF7iUqu.js +22 -0
- package/prod/chunks/vidstack-CZNlvfmV.js +288 -0
- package/prod/chunks/vidstack-CZgUA94N.js +1979 -0
- package/prod/chunks/vidstack-Ce0Qn3e1.js +1497 -0
- package/prod/chunks/vidstack-D0XCUWbp.js +159 -0
- package/prod/chunks/vidstack-DTyDOhwS.js +504 -0
- package/prod/chunks/vidstack-DhC5F6c8.js +470 -0
- package/prod/chunks/vidstack-Dm1xEU9Q.js +36 -0
- package/prod/chunks/vidstack-Ma9rwtR0.js +386 -0
- package/prod/chunks/vidstack-WsodkLQg.js +1371 -0
- package/prod/chunks/vidstack-jIPoNqhj.js +545 -0
- package/prod/chunks/vidstack-krOAtKMi.js +34 -0
- package/prod/chunks/vidstack-vqp2QaHR.js +9 -0
- package/prod/chunks/vidstack-xo_SmgiV.js +84 -0
- package/prod/chunks/vidstack-xvxeRtaN.js +61 -0
- package/prod/player/vidstack-default-components.js +14 -0
- package/prod/player/vidstack-default-icons.js +88 -0
- package/prod/player/vidstack-default-layout.js +14 -0
- package/prod/player/vidstack-plyr-icons.js +62 -0
- package/prod/player/vidstack-plyr-layout.js +636 -0
- package/prod/player/vidstack-remotion.js +335 -0
- package/prod/vidstack-icons.js +435 -0
- package/prod/vidstack.js +648 -0
- package/server/chunks/vidstack-2zMSe4ym.js +1371 -0
- package/server/chunks/vidstack-BtqWstSj.js +375 -0
- package/server/chunks/vidstack-C-HdFsZi.js +84 -0
- package/server/chunks/vidstack-C4iWXMC-.js +545 -0
- package/server/chunks/vidstack-C5zFBMwg.js +386 -0
- package/server/chunks/vidstack-CBF7iUqu.js +22 -0
- package/server/chunks/vidstack-CEh38XpD.js +288 -0
- package/server/chunks/vidstack-CWR0J8Qz.js +1497 -0
- package/server/chunks/vidstack-CkMAeO-e.js +34 -0
- package/server/chunks/vidstack-Cm0qnRvu.js +11196 -0
- package/server/chunks/vidstack-CoGzBr_V.js +663 -0
- package/server/chunks/vidstack-CyFwkPiu.js +470 -0
- package/server/chunks/vidstack-D-hQD1eE.js +9 -0
- package/server/chunks/vidstack-D_bWd66h.js +2023 -0
- package/server/chunks/vidstack-Dm1xEU9Q.js +36 -0
- package/server/chunks/vidstack-DtQSvsQr.js +189 -0
- package/server/chunks/vidstack-jlaBqZq5.js +61 -0
- package/server/chunks/vidstack-krOAtKMi.js +34 -0
- package/server/chunks/vidstack-rWs25cS9.js +159 -0
- package/server/chunks/vidstack-uyCXITen.js +504 -0
- package/server/player/vidstack-default-components.js +14 -0
- package/server/player/vidstack-default-icons.js +88 -0
- package/server/player/vidstack-default-layout.js +14 -0
- package/server/player/vidstack-plyr-icons.js +62 -0
- package/server/player/vidstack-plyr-layout.js +636 -0
- package/server/player/vidstack-remotion.js +335 -0
- package/server/vidstack.js +648 -0
- package/tailwind.cjs +101 -0
- package/tailwind.d.cts +15 -0
- package/.templates/sandbox/document.css +0 -27
- package/.templates/sandbox/favicon-32x32.png +0 -0
- package/.templates/sandbox/index.html +0 -21
- package/.templates/sandbox/main.tsx +0 -12
- package/.templates/sandbox/player.css +0 -39
- package/.templates/sandbox/player.tsx +0 -121
- package/.templates/sandbox/tracks.ts +0 -23
- package/analyze.config.ts +0 -7
- package/build/build-icons.js +0 -62
- package/rollup.config.ts +0 -256
- package/src/components/announcer.tsx +0 -47
- package/src/components/layouts/default/audio-layout.tsx +0 -231
- package/src/components/layouts/default/context.ts +0 -28
- package/src/components/layouts/default/hooks.ts +0 -13
- package/src/components/layouts/default/icons.tsx +0 -225
- package/src/components/layouts/default/index.ts +0 -11
- package/src/components/layouts/default/media-layout.tsx +0 -259
- package/src/components/layouts/default/slots.tsx +0 -98
- package/src/components/layouts/default/ui/announcer.tsx +0 -22
- package/src/components/layouts/default/ui/buttons.tsx +0 -301
- package/src/components/layouts/default/ui/captions.tsx +0 -16
- package/src/components/layouts/default/ui/controls.tsx +0 -12
- package/src/components/layouts/default/ui/keyboard-display.tsx +0 -132
- package/src/components/layouts/default/ui/menus/accessibility-menu.tsx +0 -100
- package/src/components/layouts/default/ui/menus/audio-menu.tsx +0 -167
- package/src/components/layouts/default/ui/menus/captions-menu.tsx +0 -61
- package/src/components/layouts/default/ui/menus/chapters-menu.tsx +0 -132
- package/src/components/layouts/default/ui/menus/font-menu.tsx +0 -331
- package/src/components/layouts/default/ui/menus/items/menu-checkbox.tsx +0 -72
- package/src/components/layouts/default/ui/menus/items/menu-items.tsx +0 -135
- package/src/components/layouts/default/ui/menus/items/menu-slider.tsx +0 -92
- package/src/components/layouts/default/ui/menus/playback-menu.tsx +0 -232
- package/src/components/layouts/default/ui/menus/settings-menu.tsx +0 -114
- package/src/components/layouts/default/ui/menus/utils.ts +0 -12
- package/src/components/layouts/default/ui/sliders.tsx +0 -136
- package/src/components/layouts/default/ui/time.tsx +0 -73
- package/src/components/layouts/default/ui/title.tsx +0 -24
- package/src/components/layouts/default/ui/tooltip.tsx +0 -27
- package/src/components/layouts/default/ui.ts +0 -8
- package/src/components/layouts/default/video-layout.tsx +0 -344
- package/src/components/layouts/plyr/context.ts +0 -26
- package/src/components/layouts/plyr/icons/plyr-airplay.js +0 -1
- package/src/components/layouts/plyr/icons/plyr-captions-off.js +0 -1
- package/src/components/layouts/plyr/icons/plyr-captions-on.js +0 -1
- package/src/components/layouts/plyr/icons/plyr-download.js +0 -1
- package/src/components/layouts/plyr/icons/plyr-enter-fullscreen.js +0 -1
- package/src/components/layouts/plyr/icons/plyr-exit-fullscreen.js +0 -1
- package/src/components/layouts/plyr/icons/plyr-fast-forward.js +0 -1
- package/src/components/layouts/plyr/icons/plyr-muted.js +0 -1
- package/src/components/layouts/plyr/icons/plyr-pause.js +0 -1
- package/src/components/layouts/plyr/icons/plyr-pip.js +0 -1
- package/src/components/layouts/plyr/icons/plyr-play.js +0 -1
- package/src/components/layouts/plyr/icons/plyr-restart.js +0 -1
- package/src/components/layouts/plyr/icons/plyr-rewind.js +0 -1
- package/src/components/layouts/plyr/icons/plyr-settings.js +0 -1
- package/src/components/layouts/plyr/icons/plyr-volume.js +0 -1
- package/src/components/layouts/plyr/icons.tsx +0 -71
- package/src/components/layouts/plyr/index.ts +0 -11
- package/src/components/layouts/plyr/layout.tsx +0 -1024
- package/src/components/layouts/plyr/props.ts +0 -104
- package/src/components/layouts/plyr/slots.tsx +0 -52
- package/src/components/layouts/remotion-ui.ts +0 -13
- package/src/components/layouts/utils.ts +0 -17
- package/src/components/player-callbacks.ts +0 -67
- package/src/components/player.tsx +0 -67
- package/src/components/primitives/instances.ts +0 -92
- package/src/components/primitives/nodes.tsx +0 -58
- package/src/components/primitives/slot.tsx +0 -132
- package/src/components/provider.tsx +0 -187
- package/src/components/text-track.tsx +0 -106
- package/src/components/ui/buttons/airplay-button.tsx +0 -53
- package/src/components/ui/buttons/caption-button.tsx +0 -55
- package/src/components/ui/buttons/fullscreen-button.tsx +0 -55
- package/src/components/ui/buttons/google-cast-button.tsx +0 -53
- package/src/components/ui/buttons/live-button.tsx +0 -56
- package/src/components/ui/buttons/mute-button.tsx +0 -60
- package/src/components/ui/buttons/pip-button.tsx +0 -54
- package/src/components/ui/buttons/play-button.tsx +0 -53
- package/src/components/ui/buttons/seek-button.tsx +0 -55
- package/src/components/ui/buttons/toggle-button.tsx +0 -51
- package/src/components/ui/caption.tsx +0 -70
- package/src/components/ui/captions.tsx +0 -41
- package/src/components/ui/chapter-title.tsx +0 -40
- package/src/components/ui/controls.tsx +0 -90
- package/src/components/ui/gesture.tsx +0 -43
- package/src/components/ui/menu.tsx +0 -251
- package/src/components/ui/poster.tsx +0 -101
- package/src/components/ui/radio-group.tsx +0 -88
- package/src/components/ui/sliders/audio-gain-slider.tsx +0 -55
- package/src/components/ui/sliders/quality-slider.tsx +0 -54
- package/src/components/ui/sliders/slider-callbacks.ts +0 -14
- package/src/components/ui/sliders/slider-value.tsx +0 -13
- package/src/components/ui/sliders/slider.tsx +0 -254
- package/src/components/ui/sliders/speed-slider.tsx +0 -54
- package/src/components/ui/sliders/time-slider.tsx +0 -379
- package/src/components/ui/sliders/volume-slider.tsx +0 -55
- package/src/components/ui/spinner.tsx +0 -105
- package/src/components/ui/thumbnail.tsx +0 -82
- package/src/components/ui/time.tsx +0 -77
- package/src/components/ui/title.tsx +0 -32
- package/src/components/ui/tooltip.tsx +0 -135
- package/src/globals.d.ts +0 -3
- package/src/hooks/create-text-track.ts +0 -22
- package/src/hooks/options/use-audio-gain-options.ts +0 -75
- package/src/hooks/options/use-audio-options.ts +0 -71
- package/src/hooks/options/use-caption-options.ts +0 -95
- package/src/hooks/options/use-chapter-options.ts +0 -97
- package/src/hooks/options/use-playback-rate-options.ts +0 -75
- package/src/hooks/options/use-video-quality-options.ts +0 -123
- package/src/hooks/use-active-text-cues.ts +0 -28
- package/src/hooks/use-active-text-track.ts +0 -19
- package/src/hooks/use-chapter-title.ts +0 -12
- package/src/hooks/use-dom.ts +0 -121
- package/src/hooks/use-media-context.ts +0 -6
- package/src/hooks/use-media-player.ts +0 -19
- package/src/hooks/use-media-provider.ts +0 -31
- package/src/hooks/use-media-remote.ts +0 -37
- package/src/hooks/use-media-state.ts +0 -58
- package/src/hooks/use-signals.ts +0 -24
- package/src/hooks/use-slider-preview.ts +0 -126
- package/src/hooks/use-slider-state.ts +0 -63
- package/src/hooks/use-state.ts +0 -47
- package/src/hooks/use-text-cues.ts +0 -33
- package/src/hooks/use-thumbnails.ts +0 -69
- package/src/icon.ts +0 -37
- package/src/icons.ts +0 -754
- package/src/index.ts +0 -181
- package/src/providers/remotion/index.ts +0 -10
- package/src/providers/remotion/layout-engine.ts +0 -123
- package/src/providers/remotion/loader.ts +0 -35
- package/src/providers/remotion/playback-engine.ts +0 -142
- package/src/providers/remotion/provider.tsx +0 -514
- package/src/providers/remotion/type-check.ts +0 -13
- package/src/providers/remotion/types.ts +0 -94
- package/src/providers/remotion/ui/context.tsx +0 -120
- package/src/providers/remotion/ui/error-boundary.tsx +0 -57
- package/src/providers/remotion/ui/poster.tsx +0 -33
- package/src/providers/remotion/ui/slider-thumbnail.tsx +0 -41
- package/src/providers/remotion/ui/thumbnail.tsx +0 -166
- package/src/providers/remotion/validate.ts +0 -220
- package/src/source.ts +0 -5
- package/src/utils.ts +0 -27
- package/tsconfig.build.json +0 -10
- package/tsconfig.json +0 -11
- package/types/react/src/components/announcer.d.ts +0 -16
- package/types/react/src/components/layouts/default/audio-layout.d.ts +0 -27
- package/types/react/src/components/layouts/default/context.d.ts +0 -14
- package/types/react/src/components/layouts/default/hooks.d.ts +0 -2
- package/types/react/src/components/layouts/default/icons.d.ts +0 -95
- package/types/react/src/components/layouts/default/index.d.ts +0 -5
- package/types/react/src/components/layouts/default/media-layout.d.ts +0 -133
- package/types/react/src/components/layouts/default/slots.d.ts +0 -22
- package/types/react/src/components/layouts/default/ui/announcer.d.ts +0 -6
- package/types/react/src/components/layouts/default/ui/buttons.d.ts +0 -54
- package/types/react/src/components/layouts/default/ui/captions.d.ts +0 -6
- package/types/react/src/components/layouts/default/ui/controls.d.ts +0 -6
- package/types/react/src/components/layouts/default/ui/keyboard-display.d.ts +0 -8
- package/types/react/src/components/layouts/default/ui/menus/accessibility-menu.d.ts +0 -10
- package/types/react/src/components/layouts/default/ui/menus/audio-menu.d.ts +0 -10
- package/types/react/src/components/layouts/default/ui/menus/captions-menu.d.ts +0 -10
- package/types/react/src/components/layouts/default/ui/menus/chapters-menu.d.ts +0 -7
- package/types/react/src/components/layouts/default/ui/menus/font-menu.d.ts +0 -6
- package/types/react/src/components/layouts/default/ui/menus/items/menu-checkbox.d.ts +0 -13
- package/types/react/src/components/layouts/default/ui/menus/items/menu-items.d.ts +0 -49
- package/types/react/src/components/layouts/default/ui/menus/items/menu-slider.d.ts +0 -26
- package/types/react/src/components/layouts/default/ui/menus/playback-menu.d.ts +0 -10
- package/types/react/src/components/layouts/default/ui/menus/settings-menu.d.ts +0 -15
- package/types/react/src/components/layouts/default/ui/menus/utils.d.ts +0 -1
- package/types/react/src/components/layouts/default/ui/sliders.d.ts +0 -24
- package/types/react/src/components/layouts/default/ui/time.d.ts +0 -30
- package/types/react/src/components/layouts/default/ui/title.d.ts +0 -6
- package/types/react/src/components/layouts/default/ui/tooltip.d.ts +0 -12
- package/types/react/src/components/layouts/default/ui.d.ts +0 -8
- package/types/react/src/components/layouts/default/video-layout.d.ts +0 -47
- package/types/react/src/components/layouts/plyr/context.d.ts +0 -12
- package/types/react/src/components/layouts/plyr/icons/plyr-airplay.d.ts +0 -2
- package/types/react/src/components/layouts/plyr/icons/plyr-captions-off.d.ts +0 -2
- package/types/react/src/components/layouts/plyr/icons/plyr-captions-on.d.ts +0 -2
- package/types/react/src/components/layouts/plyr/icons/plyr-download.d.ts +0 -2
- package/types/react/src/components/layouts/plyr/icons/plyr-enter-fullscreen.d.ts +0 -2
- package/types/react/src/components/layouts/plyr/icons/plyr-exit-fullscreen.d.ts +0 -2
- package/types/react/src/components/layouts/plyr/icons/plyr-fast-forward.d.ts +0 -2
- package/types/react/src/components/layouts/plyr/icons/plyr-muted.d.ts +0 -2
- package/types/react/src/components/layouts/plyr/icons/plyr-pause.d.ts +0 -2
- package/types/react/src/components/layouts/plyr/icons/plyr-pip.d.ts +0 -2
- package/types/react/src/components/layouts/plyr/icons/plyr-play.d.ts +0 -2
- package/types/react/src/components/layouts/plyr/icons/plyr-restart.d.ts +0 -2
- package/types/react/src/components/layouts/plyr/icons/plyr-rewind.d.ts +0 -2
- package/types/react/src/components/layouts/plyr/icons/plyr-settings.d.ts +0 -2
- package/types/react/src/components/layouts/plyr/icons/plyr-volume.d.ts +0 -2
- package/types/react/src/components/layouts/plyr/icons.d.ts +0 -25
- package/types/react/src/components/layouts/plyr/index.d.ts +0 -6
- package/types/react/src/components/layouts/plyr/layout.d.ts +0 -17
- package/types/react/src/components/layouts/plyr/props.d.ts +0 -71
- package/types/react/src/components/layouts/plyr/slots.d.ts +0 -9
- package/types/react/src/components/layouts/remotion-ui.d.ts +0 -3
- package/types/react/src/components/layouts/utils.d.ts +0 -1
- package/types/react/src/components/player-callbacks.d.ts +0 -6
- package/types/react/src/components/player.d.ts +0 -32
- package/types/react/src/components/primitives/instances.d.ts +0 -83
- package/types/react/src/components/primitives/nodes.d.ts +0 -15
- package/types/react/src/components/primitives/slot.d.ts +0 -11
- package/types/react/src/components/provider.d.ts +0 -26
- package/types/react/src/components/text-track.d.ts +0 -100
- package/types/react/src/components/ui/buttons/airplay-button.d.ts +0 -22
- package/types/react/src/components/ui/buttons/caption-button.d.ts +0 -24
- package/types/react/src/components/ui/buttons/fullscreen-button.d.ts +0 -24
- package/types/react/src/components/ui/buttons/google-cast-button.d.ts +0 -22
- package/types/react/src/components/ui/buttons/live-button.d.ts +0 -26
- package/types/react/src/components/ui/buttons/mute-button.d.ts +0 -30
- package/types/react/src/components/ui/buttons/pip-button.d.ts +0 -24
- package/types/react/src/components/ui/buttons/play-button.d.ts +0 -23
- package/types/react/src/components/ui/buttons/seek-button.d.ts +0 -25
- package/types/react/src/components/ui/buttons/toggle-button.d.ts +0 -22
- package/types/react/src/components/ui/caption.d.ts +0 -11
- package/types/react/src/components/ui/captions.d.ts +0 -20
- package/types/react/src/components/ui/chapter-title.d.ts +0 -20
- package/types/react/src/components/ui/controls.d.ts +0 -40
- package/types/react/src/components/ui/gesture.d.ts +0 -20
- package/types/react/src/components/ui/menu.d.ts +0 -102
- package/types/react/src/components/ui/poster.d.ts +0 -25
- package/types/react/src/components/ui/radio-group.d.ts +0 -39
- package/types/react/src/components/ui/sliders/audio-gain-slider.d.ts +0 -29
- package/types/react/src/components/ui/sliders/quality-slider.d.ts +0 -28
- package/types/react/src/components/ui/sliders/slider-callbacks.d.ts +0 -6
- package/types/react/src/components/ui/sliders/slider-value.d.ts +0 -9
- package/types/react/src/components/ui/sliders/slider.d.ts +0 -134
- package/types/react/src/components/ui/sliders/speed-slider.d.ts +0 -28
- package/types/react/src/components/ui/sliders/time-slider.d.ts +0 -124
- package/types/react/src/components/ui/sliders/volume-slider.d.ts +0 -29
- package/types/react/src/components/ui/spinner.d.ts +0 -31
- package/types/react/src/components/ui/thumbnail.d.ts +0 -26
- package/types/react/src/components/ui/time.d.ts +0 -20
- package/types/react/src/components/ui/title.d.ts +0 -15
- package/types/react/src/components/ui/tooltip.d.ts +0 -63
- package/types/react/src/hooks/create-text-track.d.ts +0 -7
- package/types/react/src/hooks/options/use-audio-gain-options.d.ts +0 -22
- package/types/react/src/hooks/options/use-audio-options.d.ts +0 -17
- package/types/react/src/hooks/options/use-caption-options.d.ts +0 -24
- package/types/react/src/hooks/options/use-chapter-options.d.ts +0 -18
- package/types/react/src/hooks/options/use-playback-rate-options.d.ts +0 -22
- package/types/react/src/hooks/options/use-video-quality-options.d.ts +0 -35
- package/types/react/src/hooks/use-active-text-cues.d.ts +0 -6
- package/types/react/src/hooks/use-active-text-track.d.ts +0 -5
- package/types/react/src/hooks/use-chapter-title.d.ts +0 -4
- package/types/react/src/hooks/use-dom.d.ts +0 -9
- package/types/react/src/hooks/use-media-context.d.ts +0 -1
- package/types/react/src/hooks/use-media-player.d.ts +0 -7
- package/types/react/src/hooks/use-media-provider.d.ts +0 -7
- package/types/react/src/hooks/use-media-remote.d.ts +0 -12
- package/types/react/src/hooks/use-media-state.d.ts +0 -15
- package/types/react/src/hooks/use-signals.d.ts +0 -5
- package/types/react/src/hooks/use-slider-preview.d.ts +0 -27
- package/types/react/src/hooks/use-slider-state.d.ts +0 -16
- package/types/react/src/hooks/use-state.d.ts +0 -18
- package/types/react/src/hooks/use-text-cues.d.ts +0 -6
- package/types/react/src/hooks/use-thumbnails.d.ts +0 -16
- package/types/react/src/icon.d.ts +0 -17
- package/types/react/src/icons.d.ts +0 -215
- package/types/react/src/index.d.ts +0 -78
- package/types/react/src/providers/remotion/index.d.ts +0 -7
- package/types/react/src/providers/remotion/layout-engine.d.ts +0 -8
- package/types/react/src/providers/remotion/loader.d.ts +0 -9
- package/types/react/src/providers/remotion/playback-engine.d.ts +0 -11
- package/types/react/src/providers/remotion/provider.d.ts +0 -26
- package/types/react/src/providers/remotion/type-check.d.ts +0 -6
- package/types/react/src/providers/remotion/types.d.ts +0 -91
- package/types/react/src/providers/remotion/ui/context.d.ts +0 -17
- package/types/react/src/providers/remotion/ui/error-boundary.d.ts +0 -21
- package/types/react/src/providers/remotion/ui/poster.d.ts +0 -18
- package/types/react/src/providers/remotion/ui/slider-thumbnail.d.ts +0 -17
- package/types/react/src/providers/remotion/ui/thumbnail.d.ts +0 -32
- package/types/react/src/providers/remotion/validate.d.ts +0 -12
- package/types/react/src/source.d.ts +0 -3
- package/types/react/src/utils.d.ts +0 -3
- package/types/vidstack/src/core/api/src-types.d.ts +0 -50
- package/types/vidstack/src/utils/mime.d.ts +0 -15
- package/types/vidstack/src/utils/network.d.ts +0 -17
- package/types/vidstack/src/utils/support.d.ts +0 -72
- package/vite.config.ts +0 -23
- /package/{npm/analyze.json.d.ts → analyze.json.d.ts} +0 -0
|
@@ -0,0 +1,648 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import { TextTrackSymbol, RadioGroupController, useMediaContext, menuContext, Primitive, MediaPlayerInstance, MediaProviderInstance, isRemotionProvider, mediaState, TextTrack, ToggleButtonInstance, PosterInstance, useMediaState, ThumbnailsLoader, updateSliderPreviewPlacement } from './chunks/vidstack-Cm0qnRvu.js';
|
|
4
|
+
export { ARIAKeyShortcuts, AUDIO_EXTENSIONS, AUDIO_TYPES, AirPlayButtonInstance, AudioGainSliderInstance, AudioProviderLoader, AudioTrackList, CaptionButtonInstance, CaptionsInstance, ControlsGroupInstance, ControlsInstance, DASHProviderLoader, DASH_VIDEO_EXTENSIONS, DASH_VIDEO_TYPES, FullscreenButtonInstance, FullscreenController, GestureInstance, GoogleCastButtonInstance, HLSProviderLoader, HLS_VIDEO_EXTENSIONS, HLS_VIDEO_TYPES, List, LiveButtonInstance, LocalMediaStorage, MEDIA_KEY_SHORTCUTS, MediaAnnouncerInstance, MediaControls, MediaRemoteControl, MenuButtonInstance, MenuInstance, MenuItemInstance, MenuItemsInstance, MenuPortalInstance, MuteButtonInstance, PIPButtonInstance, PlayButtonInstance, QualitySliderInstance, RadioGroupInstance, RadioInstance, ScreenOrientationController, SeekButtonInstance, SliderChaptersInstance, SliderInstance, SliderPreviewInstance, SliderThumbnailInstance, SliderValueInstance, SliderVideoInstance, SpeedSliderInstance, TextRenderers, TextTrackList, ThumbnailInstance, TimeInstance, TimeRange, TimeSliderInstance, TooltipContentInstance, TooltipInstance, TooltipTriggerInstance, VIDEO_EXTENSIONS, VIDEO_TYPES, VideoProviderLoader, VideoQualityList, VimeoProviderLoader, VolumeSliderInstance, YouTubeProviderLoader, boundTime, canChangeVolume, canFullscreen, canGoogleCastSrc, canOrientScreen, canPlayHLSNatively, canRotateScreen, canUsePictureInPicture, canUseVideoPresentation, findActiveCue, formatSpokenTime, formatTime, getDownloadFile, getTimeRangesEnd, getTimeRangesStart, isAudioProvider, isAudioSrc, isCueActive, isDASHProvider, isDASHSrc, isGoogleCastProvider, isHLSProvider, isHLSSrc, isHTMLAudioElement, isHTMLIFrameElement, isHTMLMediaElement, isHTMLVideoElement, isMediaStream, isTrackCaptionKind, isVideoProvider, isVideoQualitySrc, isVideoSrc, isVimeoProvider, isYouTubeProvider, mediaContext, normalizeTimeIntervals, parseJSONCaptionsFile, sliderState, softResetMediaState, sortVideoQualities, updateTimeIntervals, useMediaStore, useSliderState, useSliderStore, watchActiveTextTrack, watchCueTextChange } from './chunks/vidstack-Cm0qnRvu.js';
|
|
5
|
+
import * as React from 'react';
|
|
6
|
+
import { DOMEvent, isString, EventsController, prop, method, Component, hasProvidedContext, useContext, effect, createReactComponent, useStateContext, useSignal, composeRefs, useSignalRecord, useReactScope, signal } from './chunks/vidstack-D_bWd66h.js';
|
|
7
|
+
export { appendTriggerEvent, findTriggerEvent, hasTriggerEvent, isKeyboardClick, isKeyboardEvent, isPointerEvent, walkTriggerEventChain } from './chunks/vidstack-D_bWd66h.js';
|
|
8
|
+
import { createSignal, useScoped } from './chunks/vidstack-BtqWstSj.js';
|
|
9
|
+
export { audioGainSlider as AudioGainSlider, Captions, ChapterTitle, controls as Controls, GoogleCastButton, MediaAnnouncer, qualitySlider as QualitySlider, speedSlider as SpeedSlider, spinner as Spinner, Title, tooltip as Tooltip, useActiveTextCues, useActiveTextTrack, useChapterOptions, useChapterTitle, useTextCues } from './chunks/vidstack-BtqWstSj.js';
|
|
10
|
+
import { useMediaContext as useMediaContext$1 } from './chunks/vidstack-CoGzBr_V.js';
|
|
11
|
+
export { AirPlayButton, CaptionButton, FullscreenButton, Gesture, LiveButton, menu as Menu, MuteButton, PIPButton, PlayButton, radioGroup as RadioGroup, SeekButton, slider as Slider, thumbnail as Thumbnail, Time, timeSlider as TimeSlider, volumeSlider as VolumeSlider, useAudioOptions, useCaptionOptions, useMediaPlayer } from './chunks/vidstack-CoGzBr_V.js';
|
|
12
|
+
import { Icon } from './chunks/vidstack-CBF7iUqu.js';
|
|
13
|
+
export { DEFAULT_PLAYBACK_RATES, useMediaRemote, usePlaybackRateOptions, useVideoQualityOptions } from './chunks/vidstack-DtQSvsQr.js';
|
|
14
|
+
import '@floating-ui/dom';
|
|
15
|
+
import 'react-dom';
|
|
16
|
+
|
|
17
|
+
const GROUPED_LOG = Symbol(0);
|
|
18
|
+
class GroupedLog {
|
|
19
|
+
constructor(logger, level, title, root, parent) {
|
|
20
|
+
this.logger = logger;
|
|
21
|
+
this.level = level;
|
|
22
|
+
this.title = title;
|
|
23
|
+
this.root = root;
|
|
24
|
+
this.parent = parent;
|
|
25
|
+
}
|
|
26
|
+
[GROUPED_LOG] = true;
|
|
27
|
+
logs = [];
|
|
28
|
+
log(...data) {
|
|
29
|
+
this.logs.push({ data });
|
|
30
|
+
return this;
|
|
31
|
+
}
|
|
32
|
+
labelledLog(label, ...data) {
|
|
33
|
+
this.logs.push({ label, data });
|
|
34
|
+
return this;
|
|
35
|
+
}
|
|
36
|
+
groupStart(title) {
|
|
37
|
+
return new GroupedLog(this.logger, this.level, title, this.root ?? this, this);
|
|
38
|
+
}
|
|
39
|
+
groupEnd() {
|
|
40
|
+
this.parent?.logs.push(this);
|
|
41
|
+
return this.parent ?? this;
|
|
42
|
+
}
|
|
43
|
+
dispatch() {
|
|
44
|
+
return this.logger.dispatch(this.level, this.root ?? this);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
class Logger {
|
|
49
|
+
#target = null;
|
|
50
|
+
error(...data) {
|
|
51
|
+
return this.dispatch("error", ...data);
|
|
52
|
+
}
|
|
53
|
+
warn(...data) {
|
|
54
|
+
return this.dispatch("warn", ...data);
|
|
55
|
+
}
|
|
56
|
+
info(...data) {
|
|
57
|
+
return this.dispatch("info", ...data);
|
|
58
|
+
}
|
|
59
|
+
debug(...data) {
|
|
60
|
+
return this.dispatch("debug", ...data);
|
|
61
|
+
}
|
|
62
|
+
errorGroup(title) {
|
|
63
|
+
return new GroupedLog(this, "error", title);
|
|
64
|
+
}
|
|
65
|
+
warnGroup(title) {
|
|
66
|
+
return new GroupedLog(this, "warn", title);
|
|
67
|
+
}
|
|
68
|
+
infoGroup(title) {
|
|
69
|
+
return new GroupedLog(this, "info", title);
|
|
70
|
+
}
|
|
71
|
+
debugGroup(title) {
|
|
72
|
+
return new GroupedLog(this, "debug", title);
|
|
73
|
+
}
|
|
74
|
+
setTarget(newTarget) {
|
|
75
|
+
this.#target = newTarget;
|
|
76
|
+
}
|
|
77
|
+
dispatch(level, ...data) {
|
|
78
|
+
return this.#target?.dispatchEvent(
|
|
79
|
+
new DOMEvent("vds-log", {
|
|
80
|
+
bubbles: true,
|
|
81
|
+
composed: true,
|
|
82
|
+
detail: { level, data }
|
|
83
|
+
})
|
|
84
|
+
) || false;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
class LibASSTextRenderer {
|
|
89
|
+
constructor(loader, config) {
|
|
90
|
+
this.loader = loader;
|
|
91
|
+
this.config = config;
|
|
92
|
+
}
|
|
93
|
+
priority = 1;
|
|
94
|
+
#instance = null;
|
|
95
|
+
#track = null;
|
|
96
|
+
#typeRE = /(ssa|ass)$/;
|
|
97
|
+
canRender(track, video) {
|
|
98
|
+
return !!video && !!track.src && (isString(track.type) && this.#typeRE.test(track.type) || this.#typeRE.test(track.src));
|
|
99
|
+
}
|
|
100
|
+
attach(video) {
|
|
101
|
+
if (!video) return;
|
|
102
|
+
this.loader().then(async (mod) => {
|
|
103
|
+
this.#instance = new mod.default({
|
|
104
|
+
...this.config,
|
|
105
|
+
video,
|
|
106
|
+
subUrl: this.#track?.src || ""
|
|
107
|
+
});
|
|
108
|
+
new EventsController(this.#instance).add("ready", () => {
|
|
109
|
+
const canvas = this.#instance?._canvas;
|
|
110
|
+
if (canvas) canvas.style.pointerEvents = "none";
|
|
111
|
+
}).add("error", (event) => {
|
|
112
|
+
if (!this.#track) return;
|
|
113
|
+
this.#track[TextTrackSymbol.readyState] = 3;
|
|
114
|
+
this.#track.dispatchEvent(
|
|
115
|
+
new DOMEvent("error", {
|
|
116
|
+
trigger: event,
|
|
117
|
+
detail: event.error
|
|
118
|
+
})
|
|
119
|
+
);
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
changeTrack(track) {
|
|
124
|
+
if (!track || track.readyState === 3) {
|
|
125
|
+
this.#freeTrack();
|
|
126
|
+
} else if (this.#track !== track) {
|
|
127
|
+
this.#instance?.setTrackByUrl(track.src);
|
|
128
|
+
this.#track = track;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
detach() {
|
|
132
|
+
this.#freeTrack();
|
|
133
|
+
}
|
|
134
|
+
#freeTrack() {
|
|
135
|
+
this.#instance?.freeTrack();
|
|
136
|
+
this.#track = null;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
const DEFAULT_AUDIO_GAINS = [1, 1.25, 1.5, 1.75, 2, 2.5, 3, 4];
|
|
141
|
+
class AudioGainRadioGroup extends Component {
|
|
142
|
+
static props = {
|
|
143
|
+
normalLabel: "Disabled",
|
|
144
|
+
gains: DEFAULT_AUDIO_GAINS
|
|
145
|
+
};
|
|
146
|
+
#media;
|
|
147
|
+
#menu;
|
|
148
|
+
#controller;
|
|
149
|
+
get value() {
|
|
150
|
+
return this.#controller.value;
|
|
151
|
+
}
|
|
152
|
+
get disabled() {
|
|
153
|
+
const { gains } = this.$props, { canSetAudioGain } = this.#media.$state;
|
|
154
|
+
return !canSetAudioGain() || gains().length === 0;
|
|
155
|
+
}
|
|
156
|
+
constructor() {
|
|
157
|
+
super();
|
|
158
|
+
this.#controller = new RadioGroupController();
|
|
159
|
+
this.#controller.onValueChange = this.#onValueChange.bind(this);
|
|
160
|
+
}
|
|
161
|
+
onSetup() {
|
|
162
|
+
this.#media = useMediaContext();
|
|
163
|
+
if (hasProvidedContext(menuContext)) {
|
|
164
|
+
this.#menu = useContext(menuContext);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
onConnect(el) {
|
|
168
|
+
effect(this.#watchValue.bind(this));
|
|
169
|
+
effect(this.#watchHintText.bind(this));
|
|
170
|
+
effect(this.#watchControllerDisabled.bind(this));
|
|
171
|
+
}
|
|
172
|
+
getOptions() {
|
|
173
|
+
const { gains, normalLabel } = this.$props;
|
|
174
|
+
return gains().map((gain) => ({
|
|
175
|
+
label: gain === 1 || gain === null ? normalLabel : String(gain * 100) + "%",
|
|
176
|
+
value: gain.toString()
|
|
177
|
+
}));
|
|
178
|
+
}
|
|
179
|
+
#watchValue() {
|
|
180
|
+
this.#controller.value = this.#getValue();
|
|
181
|
+
}
|
|
182
|
+
#watchHintText() {
|
|
183
|
+
const { normalLabel } = this.$props, { audioGain } = this.#media.$state, gain = audioGain();
|
|
184
|
+
this.#menu?.hint.set(gain === 1 || gain == null ? normalLabel() : String(gain * 100) + "%");
|
|
185
|
+
}
|
|
186
|
+
#watchControllerDisabled() {
|
|
187
|
+
this.#menu?.disable(this.disabled);
|
|
188
|
+
}
|
|
189
|
+
#getValue() {
|
|
190
|
+
const { audioGain } = this.#media.$state;
|
|
191
|
+
return audioGain()?.toString() ?? "1";
|
|
192
|
+
}
|
|
193
|
+
#onValueChange(value, trigger) {
|
|
194
|
+
if (this.disabled) return;
|
|
195
|
+
const gain = +value;
|
|
196
|
+
this.#media.remote.changeAudioGain(gain, trigger);
|
|
197
|
+
this.dispatch("change", { detail: gain, trigger });
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
const audiogainradiogroup__proto = AudioGainRadioGroup.prototype;
|
|
201
|
+
prop(audiogainradiogroup__proto, "value");
|
|
202
|
+
prop(audiogainradiogroup__proto, "disabled");
|
|
203
|
+
method(audiogainradiogroup__proto, "getOptions");
|
|
204
|
+
|
|
205
|
+
const playerCallbacks = [
|
|
206
|
+
"onAbort",
|
|
207
|
+
"onAudioTrackChange",
|
|
208
|
+
"onAudioTracksChange",
|
|
209
|
+
"onAutoPlay",
|
|
210
|
+
"onAutoPlayChange",
|
|
211
|
+
"onAutoPlayFail",
|
|
212
|
+
"onCanLoad",
|
|
213
|
+
"onCanPlay",
|
|
214
|
+
"onCanPlayThrough",
|
|
215
|
+
"onControlsChange",
|
|
216
|
+
"onDestroy",
|
|
217
|
+
"onDurationChange",
|
|
218
|
+
"onEmptied",
|
|
219
|
+
"onEnd",
|
|
220
|
+
"onEnded",
|
|
221
|
+
"onError",
|
|
222
|
+
"onFindMediaPlayer",
|
|
223
|
+
"onFullscreenChange",
|
|
224
|
+
"onFullscreenError",
|
|
225
|
+
"onLiveChange",
|
|
226
|
+
"onLiveEdgeChange",
|
|
227
|
+
"onLoadedData",
|
|
228
|
+
"onLoadedMetadata",
|
|
229
|
+
"onLoadStart",
|
|
230
|
+
"onLoopChange",
|
|
231
|
+
"onOrientationChange",
|
|
232
|
+
"onPause",
|
|
233
|
+
"onPictureInPictureChange",
|
|
234
|
+
"onPictureInPictureError",
|
|
235
|
+
"onPlay",
|
|
236
|
+
"onPlayFail",
|
|
237
|
+
"onPlaying",
|
|
238
|
+
"onPlaysInlineChange",
|
|
239
|
+
"onPosterChange",
|
|
240
|
+
"onProgress",
|
|
241
|
+
"onProviderChange",
|
|
242
|
+
"onProviderLoaderChange",
|
|
243
|
+
"onProviderSetup",
|
|
244
|
+
"onQualitiesChange",
|
|
245
|
+
"onQualityChange",
|
|
246
|
+
"onRateChange",
|
|
247
|
+
"onReplay",
|
|
248
|
+
"onSeeked",
|
|
249
|
+
"onSeeking",
|
|
250
|
+
"onSourceChange",
|
|
251
|
+
"onSourceChange",
|
|
252
|
+
"onStalled",
|
|
253
|
+
"onStarted",
|
|
254
|
+
"onStreamTypeChange",
|
|
255
|
+
"onSuspend",
|
|
256
|
+
"onTextTrackChange",
|
|
257
|
+
"onTextTracksChange",
|
|
258
|
+
"onTimeUpdate",
|
|
259
|
+
"onTitleChange",
|
|
260
|
+
"onVdsLog",
|
|
261
|
+
"onVideoPresentationChange",
|
|
262
|
+
"onVolumeChange",
|
|
263
|
+
"onWaiting"
|
|
264
|
+
];
|
|
265
|
+
|
|
266
|
+
const MediaPlayerBridge = createReactComponent(MediaPlayerInstance, {
|
|
267
|
+
events: playerCallbacks,
|
|
268
|
+
eventsRegex: /^onHls/,
|
|
269
|
+
domEventsRegex: /^onMedia/
|
|
270
|
+
});
|
|
271
|
+
const MediaPlayer = React.forwardRef(
|
|
272
|
+
({ aspectRatio, children, ...props }, forwardRef) => {
|
|
273
|
+
return /* @__PURE__ */ React.createElement(
|
|
274
|
+
MediaPlayerBridge,
|
|
275
|
+
{
|
|
276
|
+
...props,
|
|
277
|
+
src: props.src,
|
|
278
|
+
ref: forwardRef,
|
|
279
|
+
style: {
|
|
280
|
+
aspectRatio,
|
|
281
|
+
...props.style
|
|
282
|
+
}
|
|
283
|
+
},
|
|
284
|
+
(props2) => /* @__PURE__ */ React.createElement(Primitive.div, { ...props2 }, children)
|
|
285
|
+
);
|
|
286
|
+
}
|
|
287
|
+
);
|
|
288
|
+
MediaPlayer.displayName = "MediaPlayer";
|
|
289
|
+
|
|
290
|
+
const MediaProviderBridge = createReactComponent(MediaProviderInstance);
|
|
291
|
+
const MediaProvider = React.forwardRef(
|
|
292
|
+
({ loaders = [], children, iframeProps, mediaProps, ...props }, forwardRef) => {
|
|
293
|
+
const reactLoaders = React.useMemo(() => loaders.map((Loader) => new Loader()), loaders);
|
|
294
|
+
return /* @__PURE__ */ React.createElement(MediaProviderBridge, { ...props, loaders: reactLoaders, ref: forwardRef }, (props2, instance) => /* @__PURE__ */ React.createElement("div", { ...props2 }, /* @__PURE__ */ React.createElement(MediaOutlet, { provider: instance, mediaProps, iframeProps }), children));
|
|
295
|
+
}
|
|
296
|
+
);
|
|
297
|
+
MediaProvider.displayName = "MediaProvider";
|
|
298
|
+
function MediaOutlet({ provider, mediaProps, iframeProps }) {
|
|
299
|
+
const { sources, crossOrigin, poster, remotePlaybackInfo, nativeControls, viewType } = useStateContext(mediaState), { loader } = provider.$state, { $provider: $$provider, $providerSetup: $$providerSetup } = useMediaContext$1(), $sources = useSignal(sources), $nativeControls = useSignal(nativeControls), $crossOrigin = useSignal(crossOrigin), $poster = useSignal(poster), $loader = useSignal(loader), $provider = useSignal($$provider), $providerSetup = useSignal($$providerSetup), $remoteInfo = useSignal(remotePlaybackInfo), $mediaType = $loader?.mediaType(), $viewType = useSignal(viewType), isAudioView = $viewType === "audio", isYouTubeEmbed = $loader?.name === "youtube", isVimeoEmbed = $loader?.name === "vimeo", isEmbed = isYouTubeEmbed || isVimeoEmbed, isRemotion = $loader?.name === "remotion", isGoogleCast = $loader?.name === "google-cast", [googleCastIconPaths, setGoogleCastIconPaths] = React.useState(""), [hasMounted, setHasMounted] = React.useState(false);
|
|
300
|
+
React.useEffect(() => {
|
|
301
|
+
if (!isGoogleCast || googleCastIconPaths) return;
|
|
302
|
+
import('./chunks/vidstack-D_bWd66h.js').then(function (n) { return n.chromecast; }).then((mod) => {
|
|
303
|
+
setGoogleCastIconPaths(mod.default);
|
|
304
|
+
});
|
|
305
|
+
}, [isGoogleCast]);
|
|
306
|
+
React.useLayoutEffect(() => {
|
|
307
|
+
setHasMounted(true);
|
|
308
|
+
}, []);
|
|
309
|
+
if (isGoogleCast) {
|
|
310
|
+
return /* @__PURE__ */ React.createElement(
|
|
311
|
+
"div",
|
|
312
|
+
{
|
|
313
|
+
className: "vds-google-cast",
|
|
314
|
+
ref: (el) => {
|
|
315
|
+
provider.load(el);
|
|
316
|
+
}
|
|
317
|
+
},
|
|
318
|
+
/* @__PURE__ */ React.createElement(Icon, { paths: googleCastIconPaths }),
|
|
319
|
+
$remoteInfo?.deviceName ? /* @__PURE__ */ React.createElement("span", { className: "vds-google-cast-info" }, "Google Cast on", " ", /* @__PURE__ */ React.createElement("span", { className: "vds-google-cast-device-name" }, $remoteInfo.deviceName)) : null
|
|
320
|
+
);
|
|
321
|
+
}
|
|
322
|
+
if (isRemotion) {
|
|
323
|
+
return /* @__PURE__ */ React.createElement("div", { "data-remotion-canvas": true }, /* @__PURE__ */ React.createElement(
|
|
324
|
+
"div",
|
|
325
|
+
{
|
|
326
|
+
"data-remotion-container": true,
|
|
327
|
+
ref: (el) => {
|
|
328
|
+
provider.load(el);
|
|
329
|
+
}
|
|
330
|
+
},
|
|
331
|
+
isRemotionProvider($provider) && $providerSetup ? React.createElement($provider.render) : null
|
|
332
|
+
));
|
|
333
|
+
}
|
|
334
|
+
return isEmbed ? React.createElement(
|
|
335
|
+
React.Fragment,
|
|
336
|
+
null,
|
|
337
|
+
React.createElement("iframe", {
|
|
338
|
+
...iframeProps,
|
|
339
|
+
className: (iframeProps?.className ? `${iframeProps.className} ` : "") + isYouTubeEmbed ? "vds-youtube" : "vds-vimeo",
|
|
340
|
+
suppressHydrationWarning: true,
|
|
341
|
+
tabIndex: !$nativeControls ? -1 : void 0,
|
|
342
|
+
"aria-hidden": "true",
|
|
343
|
+
"data-no-controls": !$nativeControls ? "" : void 0,
|
|
344
|
+
ref(el) {
|
|
345
|
+
provider.load(el);
|
|
346
|
+
}
|
|
347
|
+
}),
|
|
348
|
+
!$nativeControls && !isAudioView ? React.createElement("div", { className: "vds-blocker" }) : null
|
|
349
|
+
) : $mediaType ? React.createElement($mediaType === "audio" ? "audio" : "video", {
|
|
350
|
+
...mediaProps,
|
|
351
|
+
controls: $nativeControls ? true : null,
|
|
352
|
+
crossOrigin: typeof $crossOrigin === "boolean" ? "" : $crossOrigin,
|
|
353
|
+
poster: $mediaType === "video" && $nativeControls && $poster ? $poster : null,
|
|
354
|
+
suppressHydrationWarning: true,
|
|
355
|
+
children: !hasMounted ? $sources.map(
|
|
356
|
+
({ src, type }) => isString(src) ? /* @__PURE__ */ React.createElement("source", { src, type: type !== "?" ? type : void 0, key: src }) : null
|
|
357
|
+
) : null,
|
|
358
|
+
ref(el) {
|
|
359
|
+
provider.load(el);
|
|
360
|
+
}
|
|
361
|
+
}) : null;
|
|
362
|
+
}
|
|
363
|
+
MediaOutlet.displayName = "MediaOutlet";
|
|
364
|
+
|
|
365
|
+
function createTextTrack(init) {
|
|
366
|
+
const media = useMediaContext$1(), track = React.useMemo(() => new TextTrack(init), Object.values(init));
|
|
367
|
+
React.useEffect(() => {
|
|
368
|
+
media.textTracks.add(track);
|
|
369
|
+
return () => void media.textTracks.remove(track);
|
|
370
|
+
}, [track]);
|
|
371
|
+
return track;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
function Track({ lang, ...props }) {
|
|
375
|
+
createTextTrack({ language: lang, ...props });
|
|
376
|
+
return null;
|
|
377
|
+
}
|
|
378
|
+
Track.displayName = "Track";
|
|
379
|
+
|
|
380
|
+
const ToggleButtonBridge = createReactComponent(ToggleButtonInstance);
|
|
381
|
+
const ToggleButton = React.forwardRef(
|
|
382
|
+
({ children, ...props }, forwardRef) => {
|
|
383
|
+
return /* @__PURE__ */ React.createElement(ToggleButtonBridge, { ...props }, (props2) => /* @__PURE__ */ React.createElement(
|
|
384
|
+
Primitive.button,
|
|
385
|
+
{
|
|
386
|
+
...props2,
|
|
387
|
+
ref: composeRefs(props2.ref, forwardRef)
|
|
388
|
+
},
|
|
389
|
+
children
|
|
390
|
+
));
|
|
391
|
+
}
|
|
392
|
+
);
|
|
393
|
+
ToggleButton.displayName = "ToggleButton";
|
|
394
|
+
|
|
395
|
+
const PosterBridge = createReactComponent(PosterInstance);
|
|
396
|
+
const Poster = React.forwardRef(
|
|
397
|
+
({ children, ...props }, forwardRef) => {
|
|
398
|
+
return /* @__PURE__ */ React.createElement(
|
|
399
|
+
PosterBridge,
|
|
400
|
+
{
|
|
401
|
+
src: props.asChild && React.isValidElement(children) ? children.props.src : void 0,
|
|
402
|
+
...props
|
|
403
|
+
},
|
|
404
|
+
(props2, instance) => /* @__PURE__ */ React.createElement(
|
|
405
|
+
PosterImg,
|
|
406
|
+
{
|
|
407
|
+
...props2,
|
|
408
|
+
instance,
|
|
409
|
+
ref: composeRefs(props2.ref, forwardRef)
|
|
410
|
+
},
|
|
411
|
+
children
|
|
412
|
+
)
|
|
413
|
+
);
|
|
414
|
+
}
|
|
415
|
+
);
|
|
416
|
+
Poster.displayName = "Poster";
|
|
417
|
+
const PosterImg = React.forwardRef(
|
|
418
|
+
({ instance, children, ...props }, forwardRef) => {
|
|
419
|
+
const { src, img, alt, crossOrigin, hidden } = instance.$state, $src = useSignal(src), $alt = useSignal(alt), $crossOrigin = useSignal(crossOrigin), $hidden = useSignal(hidden);
|
|
420
|
+
return /* @__PURE__ */ React.createElement(
|
|
421
|
+
Primitive.img,
|
|
422
|
+
{
|
|
423
|
+
...props,
|
|
424
|
+
src: $src || void 0,
|
|
425
|
+
alt: $alt || void 0,
|
|
426
|
+
crossOrigin: $crossOrigin || void 0,
|
|
427
|
+
ref: composeRefs(img.set, forwardRef),
|
|
428
|
+
style: { display: $hidden ? "none" : void 0 }
|
|
429
|
+
},
|
|
430
|
+
children
|
|
431
|
+
);
|
|
432
|
+
}
|
|
433
|
+
);
|
|
434
|
+
PosterImg.displayName = "PosterImg";
|
|
435
|
+
|
|
436
|
+
const Root = React.forwardRef(({ children, ...props }, forwardRef) => {
|
|
437
|
+
return /* @__PURE__ */ React.createElement(
|
|
438
|
+
Primitive.div,
|
|
439
|
+
{
|
|
440
|
+
translate: "yes",
|
|
441
|
+
"aria-live": "off",
|
|
442
|
+
"aria-atomic": "true",
|
|
443
|
+
...props,
|
|
444
|
+
ref: forwardRef
|
|
445
|
+
},
|
|
446
|
+
children
|
|
447
|
+
);
|
|
448
|
+
});
|
|
449
|
+
Root.displayName = "Caption";
|
|
450
|
+
const Text = React.forwardRef((props, forwardRef) => {
|
|
451
|
+
const textTrack = useMediaState("textTrack"), [activeCue, setActiveCue] = React.useState();
|
|
452
|
+
React.useEffect(() => {
|
|
453
|
+
if (!textTrack) return;
|
|
454
|
+
function onCueChange() {
|
|
455
|
+
setActiveCue(textTrack?.activeCues[0]);
|
|
456
|
+
}
|
|
457
|
+
textTrack.addEventListener("cue-change", onCueChange);
|
|
458
|
+
return () => {
|
|
459
|
+
textTrack.removeEventListener("cue-change", onCueChange);
|
|
460
|
+
setActiveCue(void 0);
|
|
461
|
+
};
|
|
462
|
+
}, [textTrack]);
|
|
463
|
+
return /* @__PURE__ */ React.createElement(
|
|
464
|
+
Primitive.span,
|
|
465
|
+
{
|
|
466
|
+
...props,
|
|
467
|
+
"data-part": "cue",
|
|
468
|
+
dangerouslySetInnerHTML: {
|
|
469
|
+
__html: activeCue?.text || ""
|
|
470
|
+
},
|
|
471
|
+
ref: forwardRef
|
|
472
|
+
}
|
|
473
|
+
);
|
|
474
|
+
});
|
|
475
|
+
Text.displayName = "CaptionText";
|
|
476
|
+
|
|
477
|
+
var caption = /*#__PURE__*/Object.freeze({
|
|
478
|
+
__proto__: null,
|
|
479
|
+
Root: Root,
|
|
480
|
+
Text: Text
|
|
481
|
+
});
|
|
482
|
+
|
|
483
|
+
function useState(ctor, prop, ref) {
|
|
484
|
+
const initialValue = React.useMemo(() => ctor.state.record[prop], [ctor, prop]);
|
|
485
|
+
return useSignal(ref.current ? ref.current.$state[prop] : initialValue);
|
|
486
|
+
}
|
|
487
|
+
const storesCache = /* @__PURE__ */ new Map();
|
|
488
|
+
function useStore(ctor, ref) {
|
|
489
|
+
const initialStore = React.useMemo(() => {
|
|
490
|
+
let store = storesCache.get(ctor);
|
|
491
|
+
if (!store) {
|
|
492
|
+
store = new Proxy(ctor.state.record, {
|
|
493
|
+
get: (_, prop) => () => ctor.state.record[prop]
|
|
494
|
+
});
|
|
495
|
+
storesCache.set(ctor, store);
|
|
496
|
+
}
|
|
497
|
+
return store;
|
|
498
|
+
}, [ctor]);
|
|
499
|
+
return useSignalRecord(ref.current ? ref.current.$state : initialStore);
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
function useMediaProvider() {
|
|
503
|
+
const [provider, setProvider] = React.useState(null), context = useMediaContext$1();
|
|
504
|
+
React.useEffect(() => {
|
|
505
|
+
if (!context) return;
|
|
506
|
+
return effect(() => {
|
|
507
|
+
setProvider(context.$provider());
|
|
508
|
+
});
|
|
509
|
+
}, []);
|
|
510
|
+
return provider;
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
function useThumbnails(src, crossOrigin = null) {
|
|
514
|
+
useReactScope(); const $src = createSignal(src), $crossOrigin = createSignal(crossOrigin), loader = useScoped(() => ThumbnailsLoader.create($src, $crossOrigin));
|
|
515
|
+
React.useEffect(() => {
|
|
516
|
+
$src.set(src);
|
|
517
|
+
}, [src]);
|
|
518
|
+
React.useEffect(() => {
|
|
519
|
+
$crossOrigin.set(crossOrigin);
|
|
520
|
+
}, [crossOrigin]);
|
|
521
|
+
return useSignal(loader.$images);
|
|
522
|
+
}
|
|
523
|
+
function useActiveThumbnail(thumbnails, time) {
|
|
524
|
+
return React.useMemo(() => {
|
|
525
|
+
let activeIndex = -1;
|
|
526
|
+
for (let i = thumbnails.length - 1; i >= 0; i--) {
|
|
527
|
+
const image = thumbnails[i];
|
|
528
|
+
if (time >= image.startTime && (!image.endTime || time < image.endTime)) {
|
|
529
|
+
activeIndex = i;
|
|
530
|
+
break;
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
return thumbnails[activeIndex] || null;
|
|
534
|
+
}, [thumbnails, time]);
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
function useSliderPreview({
|
|
538
|
+
clamp = false,
|
|
539
|
+
offset = 0,
|
|
540
|
+
orientation = "horizontal"
|
|
541
|
+
} = {}) {
|
|
542
|
+
const [rootRef, setRootRef] = React.useState(null), [previewRef, setPreviewRef] = React.useState(null), [pointerValue, setPointerValue] = React.useState(0), [isVisible, setIsVisible] = React.useState(false);
|
|
543
|
+
React.useEffect(() => {
|
|
544
|
+
if (!rootRef) return;
|
|
545
|
+
const dragging = signal(false);
|
|
546
|
+
function updatePointerValue(event) {
|
|
547
|
+
if (!rootRef) return;
|
|
548
|
+
setPointerValue(getPointerValue(rootRef, event, orientation));
|
|
549
|
+
}
|
|
550
|
+
return effect(() => {
|
|
551
|
+
if (!dragging()) {
|
|
552
|
+
new EventsController(rootRef).add("pointerenter", () => {
|
|
553
|
+
setIsVisible(true);
|
|
554
|
+
previewRef?.setAttribute("data-visible", "");
|
|
555
|
+
}).add("pointerdown", (event) => {
|
|
556
|
+
dragging.set(true);
|
|
557
|
+
updatePointerValue(event);
|
|
558
|
+
}).add("pointerleave", () => {
|
|
559
|
+
setIsVisible(false);
|
|
560
|
+
previewRef?.removeAttribute("data-visible");
|
|
561
|
+
}).add("pointermove", updatePointerValue);
|
|
562
|
+
}
|
|
563
|
+
previewRef?.setAttribute("data-dragging", "");
|
|
564
|
+
new EventsController(document).add("pointerup", (event) => {
|
|
565
|
+
dragging.set(false);
|
|
566
|
+
previewRef?.removeAttribute("data-dragging");
|
|
567
|
+
updatePointerValue(event);
|
|
568
|
+
}).add("pointermove", updatePointerValue).add("touchmove", (e) => e.preventDefault(), { passive: false });
|
|
569
|
+
});
|
|
570
|
+
}, [rootRef]);
|
|
571
|
+
React.useEffect(() => {
|
|
572
|
+
if (previewRef) {
|
|
573
|
+
previewRef.style.setProperty("--slider-pointer", pointerValue + "%");
|
|
574
|
+
}
|
|
575
|
+
}, [previewRef, pointerValue]);
|
|
576
|
+
React.useEffect(() => {
|
|
577
|
+
if (!previewRef) return;
|
|
578
|
+
const update = () => {
|
|
579
|
+
updateSliderPreviewPlacement(previewRef, {
|
|
580
|
+
offset,
|
|
581
|
+
clamp,
|
|
582
|
+
orientation
|
|
583
|
+
});
|
|
584
|
+
};
|
|
585
|
+
update();
|
|
586
|
+
const resize = new ResizeObserver(update);
|
|
587
|
+
resize.observe(previewRef);
|
|
588
|
+
return () => resize.disconnect();
|
|
589
|
+
}, [previewRef, clamp, offset, orientation]);
|
|
590
|
+
return {
|
|
591
|
+
previewRootRef: setRootRef,
|
|
592
|
+
previewRef: setPreviewRef,
|
|
593
|
+
previewValue: pointerValue,
|
|
594
|
+
isPreviewVisible: isVisible
|
|
595
|
+
};
|
|
596
|
+
}
|
|
597
|
+
function getPointerValue(root, event, orientation) {
|
|
598
|
+
let thumbPositionRate, rect = root.getBoundingClientRect();
|
|
599
|
+
if (orientation === "vertical") {
|
|
600
|
+
const { bottom: trackBottom, height: trackHeight } = rect;
|
|
601
|
+
thumbPositionRate = (trackBottom - event.clientY) / trackHeight;
|
|
602
|
+
} else {
|
|
603
|
+
const { left: trackLeft, width: trackWidth } = rect;
|
|
604
|
+
thumbPositionRate = (event.clientX - trackLeft) / trackWidth;
|
|
605
|
+
}
|
|
606
|
+
return round(Math.max(0, Math.min(100, 100 * thumbPositionRate)));
|
|
607
|
+
}
|
|
608
|
+
function round(num) {
|
|
609
|
+
return Number(num.toFixed(3));
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
function useAudioGainOptions({
|
|
613
|
+
gains = DEFAULT_AUDIO_GAINS,
|
|
614
|
+
disabledLabel = "disabled"
|
|
615
|
+
} = {}) {
|
|
616
|
+
const media = useMediaContext$1(), { audioGain, canSetAudioGain } = media.$state;
|
|
617
|
+
useSignal(audioGain);
|
|
618
|
+
useSignal(canSetAudioGain);
|
|
619
|
+
return React.useMemo(() => {
|
|
620
|
+
const options = gains.map((opt) => {
|
|
621
|
+
const label = typeof opt === "number" ? opt === 1 && disabledLabel ? disabledLabel : opt * 100 + "%" : opt.label, gain = typeof opt === "number" ? opt : opt.gain;
|
|
622
|
+
return {
|
|
623
|
+
label,
|
|
624
|
+
value: gain.toString(),
|
|
625
|
+
gain,
|
|
626
|
+
get selected() {
|
|
627
|
+
return audioGain() === gain;
|
|
628
|
+
},
|
|
629
|
+
select(trigger) {
|
|
630
|
+
media.remote.changeAudioGain(gain, trigger);
|
|
631
|
+
}
|
|
632
|
+
};
|
|
633
|
+
});
|
|
634
|
+
Object.defineProperty(options, "disabled", {
|
|
635
|
+
get() {
|
|
636
|
+
return !canSetAudioGain() || !options.length;
|
|
637
|
+
}
|
|
638
|
+
});
|
|
639
|
+
Object.defineProperty(options, "selectedValue", {
|
|
640
|
+
get() {
|
|
641
|
+
return audioGain()?.toString();
|
|
642
|
+
}
|
|
643
|
+
});
|
|
644
|
+
return options;
|
|
645
|
+
}, [gains]);
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
export { caption as Caption, DEFAULT_AUDIO_GAINS, Icon, LibASSTextRenderer, Logger, MediaPlayer, MediaPlayerInstance, MediaProvider, MediaProviderInstance, Poster, PosterInstance, TextTrack, ToggleButton, ToggleButtonInstance, Track, createTextTrack, mediaState, useActiveThumbnail, useAudioGainOptions, useMediaContext$1 as useMediaContext, useMediaProvider, useMediaState, useSliderPreview, useState, useStore, useThumbnails };
|