@therealtinhtute/baroiplayer 1.0.6 → 1.0.8
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/dist/index.d.ts +1 -1
- package/dist/index.js +1 -7
- package/dist/index.mjs +1 -2
- package/dist/package.json +1 -1
- package/package.json +1 -1
- package/dist/context/media.js +0 -2
- package/dist/context/media.js.map +0 -1
- package/dist/context/media.mjs +0 -15
- package/dist/context/media.mjs.map +0 -1
- package/dist/context/store.js +0 -2
- package/dist/context/store.js.map +0 -1
- package/dist/context/store.mjs +0 -5
- package/dist/context/store.mjs.map +0 -1
- package/dist/context-Af84FynT.js +0 -1179
- package/dist/context-Af84FynT.js.map +0 -1
- package/dist/context-CwZnPdz0.cjs +0 -23
- package/dist/context-CwZnPdz0.cjs.map +0 -1
- package/dist/core-events-B5W_j8yU.js +0 -480
- package/dist/core-events-B5W_j8yU.js.map +0 -1
- package/dist/core-events-CN0-Vhhq.cjs +0 -2
- package/dist/core-events-CN0-Vhhq.cjs.map +0 -1
- package/dist/core-plugins-Bq9KLany.js +0 -696
- package/dist/core-plugins-Bq9KLany.js.map +0 -1
- package/dist/core-plugins-CPDSHMiQ.cjs +0 -2
- package/dist/core-plugins-CPDSHMiQ.cjs.map +0 -1
- package/dist/core.js +0 -37
- package/dist/core.js.map +0 -1
- package/dist/core.mjs +0 -1217
- package/dist/core.mjs.map +0 -1
- package/dist/enhanced-components-CXnYiOt6.cjs +0 -2
- package/dist/enhanced-components-CXnYiOt6.cjs.map +0 -1
- package/dist/enhanced-components-Da0TSvKe.js +0 -1073
- package/dist/enhanced-components-Da0TSvKe.js.map +0 -1
- package/dist/hooks-BCMilGRf.cjs +0 -4
- package/dist/hooks-BCMilGRf.cjs.map +0 -1
- package/dist/hooks-BPtHV1ZT.js +0 -2042
- package/dist/hooks-BPtHV1ZT.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/minimal-components-BHJMuaL7.cjs +0 -2
- package/dist/minimal-components-BHJMuaL7.cjs.map +0 -1
- package/dist/minimal-components-BmqRefl1.js +0 -2002
- package/dist/minimal-components-BmqRefl1.js.map +0 -1
- package/dist/mona-loading.gif +0 -0
- package/dist/performance-monitor--rzKTlbj.js +0 -302
- package/dist/performance-monitor--rzKTlbj.js.map +0 -1
- package/dist/performance-monitor-cjIvZE2D.cjs +0 -2
- package/dist/performance-monitor-cjIvZE2D.cjs.map +0 -1
- package/dist/src/adapters/videojs-adapter.d.ts.map +0 -1
- package/dist/src/adapters/videojs-adapter.js +0 -350
- package/dist/src/assets/mona-loading.gif +0 -0
- package/dist/src/components/AnimateLoading.d.ts.map +0 -1
- package/dist/src/components/AnimateLoading.js +0 -41
- package/dist/src/components/LoadingState.d.ts.map +0 -1
- package/dist/src/components/LoadingState.js +0 -111
- package/dist/src/components/accessibility/keyboard-help-overlay.d.ts.map +0 -1
- package/dist/src/components/accessibility/keyboard-help-overlay.js +0 -90
- package/dist/src/components/audio-player.d.ts.map +0 -1
- package/dist/src/components/audio-player.js +0 -31
- package/dist/src/components/basic/index.d.ts.map +0 -1
- package/dist/src/components/basic/index.js +0 -29
- package/dist/src/components/enhanced/advanced-features.d.ts.map +0 -1
- package/dist/src/components/enhanced/advanced-features.js +0 -64
- package/dist/src/components/enhanced/debug-panel.d.ts.map +0 -1
- package/dist/src/components/enhanced/debug-panel.js +0 -94
- package/dist/src/components/enhanced/enhanced-controls.d.ts.map +0 -1
- package/dist/src/components/enhanced/enhanced-controls.js +0 -233
- package/dist/src/components/enhanced/enhanced-media-player.d.ts.map +0 -1
- package/dist/src/components/enhanced/enhanced-media-player.js +0 -316
- package/dist/src/components/enhanced/error-handling.d.ts.map +0 -1
- package/dist/src/components/enhanced/error-handling.js +0 -153
- package/dist/src/components/enhanced/index.d.ts.map +0 -1
- package/dist/src/components/enhanced/index.js +0 -10
- package/dist/src/components/enhanced/media-player-enhanced.d.ts.map +0 -1
- package/dist/src/components/enhanced/media-player-enhanced.js +0 -250
- package/dist/src/components/examples/basic-video-player.d.ts.map +0 -1
- package/dist/src/components/examples/basic-video-player.js +0 -16
- package/dist/src/components/examples/custom-controls-example.d.ts.map +0 -1
- package/dist/src/components/examples/custom-controls-example.js +0 -12
- package/dist/src/components/examples/enhanced-controls-example.d.ts.map +0 -1
- package/dist/src/components/examples/enhanced-controls-example.js +0 -18
- package/dist/src/components/examples/enhanced-media-player-example.d.ts.map +0 -1
- package/dist/src/components/examples/enhanced-media-player-example.js +0 -13
- package/dist/src/components/examples/loading-states-demo.d.ts.map +0 -1
- package/dist/src/components/examples/loading-states-demo.js +0 -41
- package/dist/src/components/examples/react-19-demo.d.ts.map +0 -1
- package/dist/src/components/examples/react-19-demo.js +0 -104
- package/dist/src/components/examples/volume-orientation-demo.d.ts.map +0 -1
- package/dist/src/components/examples/volume-orientation-demo.js +0 -31
- package/dist/src/components/icon-demo.d.ts.map +0 -1
- package/dist/src/components/icon-demo.js +0 -16
- package/dist/src/components/icons/index.d.ts.map +0 -1
- package/dist/src/components/icons/index.js +0 -59
- package/dist/src/components/icons/svg-icons/ArrowLeftIcon.d.ts.map +0 -1
- package/dist/src/components/icons/svg-icons/ArrowLeftIcon.js +0 -3
- package/dist/src/components/icons/svg-icons/ArrowRightIcon.d.ts.map +0 -1
- package/dist/src/components/icons/svg-icons/ArrowRightIcon.js +0 -3
- package/dist/src/components/icons/svg-icons/AudioIcon.d.ts.map +0 -1
- package/dist/src/components/icons/svg-icons/AudioIcon.js +0 -4
- package/dist/src/components/icons/svg-icons/BackwardIcon.d.ts.map +0 -1
- package/dist/src/components/icons/svg-icons/BackwardIcon.js +0 -3
- package/dist/src/components/icons/svg-icons/CameraIcon.d.ts.map +0 -1
- package/dist/src/components/icons/svg-icons/CameraIcon.js +0 -4
- package/dist/src/components/icons/svg-icons/CheckIcon.d.ts.map +0 -1
- package/dist/src/components/icons/svg-icons/CheckIcon.js +0 -4
- package/dist/src/components/icons/svg-icons/EnablePiPIcon.d.ts.map +0 -1
- package/dist/src/components/icons/svg-icons/EnablePiPIcon.js +0 -5
- package/dist/src/components/icons/svg-icons/ForwardIcon.d.ts.map +0 -1
- package/dist/src/components/icons/svg-icons/ForwardIcon.js +0 -3
- package/dist/src/components/icons/svg-icons/FullscreenEnterIcon.d.ts.map +0 -1
- package/dist/src/components/icons/svg-icons/FullscreenEnterIcon.js +0 -3
- package/dist/src/components/icons/svg-icons/FullscreenExitIcon.d.ts.map +0 -1
- package/dist/src/components/icons/svg-icons/FullscreenExitIcon.js +0 -3
- package/dist/src/components/icons/svg-icons/LoadingIcon.d.ts.map +0 -1
- package/dist/src/components/icons/svg-icons/LoadingIcon.js +0 -3
- package/dist/src/components/icons/svg-icons/PauseIcon.d.ts.map +0 -1
- package/dist/src/components/icons/svg-icons/PauseIcon.js +0 -3
- package/dist/src/components/icons/svg-icons/PlayIcon.d.ts.map +0 -1
- package/dist/src/components/icons/svg-icons/PlayIcon.js +0 -3
- package/dist/src/components/icons/svg-icons/PlaybackSpeedIcon.d.ts.map +0 -1
- package/dist/src/components/icons/svg-icons/PlaybackSpeedIcon.js +0 -3
- package/dist/src/components/icons/svg-icons/QualityIcon.d.ts.map +0 -1
- package/dist/src/components/icons/svg-icons/QualityIcon.js +0 -3
- package/dist/src/components/icons/svg-icons/SettingsIcon.d.ts.map +0 -1
- package/dist/src/components/icons/svg-icons/SettingsIcon.js +0 -3
- package/dist/src/components/icons/svg-icons/SliderIcon.d.ts.map +0 -1
- package/dist/src/components/icons/svg-icons/SliderIcon.js +0 -3
- package/dist/src/components/icons/svg-icons/SubtitleIcon.d.ts.map +0 -1
- package/dist/src/components/icons/svg-icons/SubtitleIcon.js +0 -3
- package/dist/src/components/icons/svg-icons/SubtitleOffIcon.d.ts.map +0 -1
- package/dist/src/components/icons/svg-icons/SubtitleOffIcon.js +0 -3
- package/dist/src/components/icons/svg-icons/UnPiPIcon.d.ts.map +0 -1
- package/dist/src/components/icons/svg-icons/UnPiPIcon.js +0 -5
- package/dist/src/components/icons/svg-icons/VolumeMutedIcon.d.ts.map +0 -1
- package/dist/src/components/icons/svg-icons/VolumeMutedIcon.js +0 -3
- package/dist/src/components/icons/svg-icons/VolumeOneIcon.d.ts.map +0 -1
- package/dist/src/components/icons/svg-icons/VolumeOneIcon.js +0 -3
- package/dist/src/components/icons/svg-icons/VolumeThreeIcon.d.ts.map +0 -1
- package/dist/src/components/icons/svg-icons/VolumeThreeIcon.js +0 -3
- package/dist/src/components/icons/svg-icons/VolumeTwoIcon.d.ts.map +0 -1
- package/dist/src/components/icons/svg-icons/VolumeTwoIcon.js +0 -3
- package/dist/src/components/legacy.d.ts.map +0 -1
- package/dist/src/components/legacy.js +0 -52
- package/dist/src/components/media-metadata-display.d.ts.map +0 -1
- package/dist/src/components/media-metadata-display.js +0 -20
- package/dist/src/components/media-player-audio.d.ts.map +0 -1
- package/dist/src/components/media-player-audio.js +0 -18
- package/dist/src/components/media-player-controls.d.ts.map +0 -1
- package/dist/src/components/media-player-controls.js +0 -150
- package/dist/src/components/media-player-error.d.ts.map +0 -1
- package/dist/src/components/media-player-error.js +0 -85
- package/dist/src/components/media-player-fullscreen.d.ts.map +0 -1
- package/dist/src/components/media-player-fullscreen.js +0 -68
- package/dist/src/components/media-player-hls.d.ts.map +0 -1
- package/dist/src/components/media-player-hls.js +0 -20
- package/dist/src/components/media-player-loading.d.ts.map +0 -1
- package/dist/src/components/media-player-loading.js +0 -53
- package/dist/src/components/media-player-play.d.ts.map +0 -1
- package/dist/src/components/media-player-play.js +0 -44
- package/dist/src/components/media-player-root.d.ts.map +0 -1
- package/dist/src/components/media-player-root.js +0 -243
- package/dist/src/components/media-player-seek.d.ts.map +0 -1
- package/dist/src/components/media-player-seek.js +0 -92
- package/dist/src/components/media-player-time.d.ts.map +0 -1
- package/dist/src/components/media-player-time.js +0 -57
- package/dist/src/components/media-player-tooltip.d.ts.map +0 -1
- package/dist/src/components/media-player-tooltip.js +0 -14
- package/dist/src/components/media-player-video.d.ts.map +0 -1
- package/dist/src/components/media-player-video.js +0 -18
- package/dist/src/components/media-player-volume.d.ts.map +0 -1
- package/dist/src/components/media-player-volume.js +0 -88
- package/dist/src/components/media-player.d.ts.map +0 -1
- package/dist/src/components/media-player.js +0 -67
- package/dist/src/components/media-suspense.d.ts.map +0 -1
- package/dist/src/components/media-suspense.js +0 -173
- package/dist/src/components/player-settings-form.d.ts.map +0 -1
- package/dist/src/components/player-settings-form.js +0 -46
- package/dist/src/components/react-player-wrapper.d.ts.map +0 -1
- package/dist/src/components/react-player-wrapper.js +0 -163
- package/dist/src/components/simple-video-player.d.ts.map +0 -1
- package/dist/src/components/simple-video-player.js +0 -41
- package/dist/src/components/ui/enhanced-seek-bar.d.ts.map +0 -1
- package/dist/src/components/ui/enhanced-seek-bar.js +0 -112
- package/dist/src/components/ui/fullscreen-button.d.ts.map +0 -1
- package/dist/src/components/ui/fullscreen-button.js +0 -21
- package/dist/src/components/ui/media-resource-preloader.d.ts.map +0 -1
- package/dist/src/components/ui/media-resource-preloader.js +0 -295
- package/dist/src/components/ui/play-button.d.ts.map +0 -1
- package/dist/src/components/ui/play-button.js +0 -26
- package/dist/src/components/ui/seek-bar.d.ts.map +0 -1
- package/dist/src/components/ui/seek-bar.js +0 -54
- package/dist/src/components/ui/time-display.d.ts.map +0 -1
- package/dist/src/components/ui/time-display.js +0 -18
- package/dist/src/components/ui/volume-control.d.ts.map +0 -1
- package/dist/src/components/ui/volume-control.js +0 -71
- package/dist/src/components/unified/base-media-player.d.ts.map +0 -1
- package/dist/src/components/unified/base-media-player.js +0 -104
- package/dist/src/components/unified/media-player.d.ts.map +0 -1
- package/dist/src/components/unified/media-player.js +0 -41
- package/dist/src/components/variants/minimal/AccessibleMinimalPlayer.d.ts.map +0 -1
- package/dist/src/components/variants/minimal/AccessibleMinimalPlayer.js +0 -322
- package/dist/src/components/variants/minimal/EnhancedMinimalMediaPlayer.d.ts.map +0 -1
- package/dist/src/components/variants/minimal/EnhancedMinimalMediaPlayer.js +0 -280
- package/dist/src/components/variants/minimal/MinimalControls.d.ts.map +0 -1
- package/dist/src/components/variants/minimal/MinimalControls.js +0 -19
- package/dist/src/components/variants/minimal/MinimalLoading.d.ts.map +0 -1
- package/dist/src/components/variants/minimal/MinimalLoading.js +0 -6
- package/dist/src/components/variants/minimal/MinimalMediaPlayer.d.ts.map +0 -1
- package/dist/src/components/variants/minimal/MinimalMediaPlayer.js +0 -135
- package/dist/src/components/variants/minimal/MinimalOverlay.d.ts.map +0 -1
- package/dist/src/components/variants/minimal/MinimalOverlay.js +0 -15
- package/dist/src/components/variants/minimal/MinimalPlayButton.d.ts.map +0 -1
- package/dist/src/components/variants/minimal/MinimalPlayButton.js +0 -29
- package/dist/src/components/variants/minimal/MinimalSeekBar.d.ts.map +0 -1
- package/dist/src/components/variants/minimal/MinimalSeekBar.js +0 -73
- package/dist/src/components/variants/minimal/MinimalVolumeControl.d.ts.map +0 -1
- package/dist/src/components/variants/minimal/MinimalVolumeControl.js +0 -29
- package/dist/src/components/variants/minimal/SimpleMinimalPlayer.d.ts.map +0 -1
- package/dist/src/components/variants/minimal/SimpleMinimalPlayer.js +0 -51
- package/dist/src/components/variants/minimal/components/CenterPlayButton.d.ts.map +0 -1
- package/dist/src/components/variants/minimal/components/CenterPlayButton.js +0 -8
- package/dist/src/components/variants/minimal/components/ControlBar.d.ts.map +0 -1
- package/dist/src/components/variants/minimal/components/ControlBar.js +0 -10
- package/dist/src/components/variants/minimal/components/EnhancedSettingsMenu.d.ts.map +0 -1
- package/dist/src/components/variants/minimal/components/EnhancedSettingsMenu.js +0 -68
- package/dist/src/components/variants/minimal/components/PlaybackControls.d.ts.map +0 -1
- package/dist/src/components/variants/minimal/components/PlaybackControls.js +0 -9
- package/dist/src/components/variants/minimal/components/RightControls.d.ts.map +0 -1
- package/dist/src/components/variants/minimal/components/RightControls.js +0 -40
- package/dist/src/components/variants/minimal/components/SeekBar.d.ts.map +0 -1
- package/dist/src/components/variants/minimal/components/SeekBar.js +0 -43
- package/dist/src/components/variants/minimal/components/SettingsDropdown.d.ts.map +0 -1
- package/dist/src/components/variants/minimal/components/SettingsDropdown.js +0 -18
- package/dist/src/components/variants/minimal/components/SubtitleDisplay.d.ts.map +0 -1
- package/dist/src/components/variants/minimal/components/SubtitleDisplay.js +0 -6
- package/dist/src/components/variants/minimal/components/TimeDisplay.d.ts.map +0 -1
- package/dist/src/components/variants/minimal/components/TimeDisplay.js +0 -5
- package/dist/src/components/variants/minimal/components/VideoElement.d.ts.map +0 -1
- package/dist/src/components/variants/minimal/components/VideoElement.js +0 -4
- package/dist/src/components/variants/minimal/components/VolumeControl.d.ts.map +0 -1
- package/dist/src/components/variants/minimal/components/VolumeControl.js +0 -99
- package/dist/src/components/variants/minimal/index.d.ts.map +0 -1
- package/dist/src/components/variants/minimal/index.js +0 -8
- package/dist/src/components/video-player.d.ts.map +0 -1
- package/dist/src/components/video-player.js +0 -38
- package/dist/src/context/error-handling.d.ts.map +0 -1
- package/dist/src/context/error-handling.js +0 -300
- package/dist/src/context/media-context.d.ts.map +0 -1
- package/dist/src/context/media-context.js +0 -121
- package/dist/src/context/media-provider.d.ts.map +0 -1
- package/dist/src/context/media-provider.js +0 -164
- package/dist/src/context/media-store.d.ts.map +0 -1
- package/dist/src/context/media-store.js +0 -273
- package/dist/src/context/persistence.d.ts.map +0 -1
- package/dist/src/context/persistence.js +0 -356
- package/dist/src/core/events/event-system.d.ts.map +0 -1
- package/dist/src/core/events/event-system.js +0 -288
- package/dist/src/core/events/hooks.d.ts.map +0 -1
- package/dist/src/core/events/hooks.js +0 -198
- package/dist/src/core/events/index.d.ts.map +0 -1
- package/dist/src/core/events/index.js +0 -7
- package/dist/src/core/events/middleware.d.ts.map +0 -1
- package/dist/src/core/events/middleware.js +0 -219
- package/dist/src/core/index.d.ts.map +0 -1
- package/dist/src/core/index.js +0 -15
- package/dist/src/core/optimization/bundle-optimizer.d.ts.map +0 -1
- package/dist/src/core/optimization/bundle-optimizer.js +0 -217
- package/dist/src/core/performance/cicd.d.ts.map +0 -1
- package/dist/src/core/performance/cicd.js +0 -83
- package/dist/src/core/performance/index.d.ts.map +0 -1
- package/dist/src/core/performance/index.js +0 -14
- package/dist/src/core/performance/media-loading-optimizer.d.ts.map +0 -1
- package/dist/src/core/performance/media-loading-optimizer.js +0 -404
- package/dist/src/core/performance/performance-budgets.d.ts.map +0 -1
- package/dist/src/core/performance/performance-budgets.js +0 -326
- package/dist/src/core/performance/performance-monitor.d.ts.map +0 -1
- package/dist/src/core/performance/performance-monitor.js +0 -297
- package/dist/src/core/performance/performance-testing.d.ts.map +0 -1
- package/dist/src/core/performance/performance-testing.js +0 -314
- package/dist/src/core/plugins/base-plugin.d.ts.map +0 -1
- package/dist/src/core/plugins/base-plugin.js +0 -151
- package/dist/src/core/plugins/enhanced-plugin-system.d.ts.map +0 -1
- package/dist/src/core/plugins/enhanced-plugin-system.js +0 -305
- package/dist/src/core/plugins/examples/analytics-plugin.d.ts.map +0 -1
- package/dist/src/core/plugins/examples/analytics-plugin.js +0 -191
- package/dist/src/core/plugins/index.d.ts.map +0 -1
- package/dist/src/core/plugins/index.js +0 -9
- package/dist/src/core/plugins/registry.d.ts.map +0 -1
- package/dist/src/core/plugins/registry.js +0 -261
- package/dist/src/core/plugins/types.d.ts.map +0 -1
- package/dist/src/core/plugins/types.js +0 -31
- package/dist/src/core/plugins/utils.d.ts.map +0 -1
- package/dist/src/core/plugins/utils.js +0 -274
- package/dist/src/core/progressive-loading.d.ts.map +0 -1
- package/dist/src/core/progressive-loading.js +0 -239
- package/dist/src/core/providers/enhanced-hls-provider.d.ts.map +0 -1
- package/dist/src/core/providers/enhanced-hls-provider.js +0 -273
- package/dist/src/core/providers/service-provider.d.ts.map +0 -1
- package/dist/src/core/providers/service-provider.js +0 -105
- package/dist/src/core/utils.d.ts.map +0 -1
- package/dist/src/core/utils.js +0 -21
- package/dist/src/features/media-session/media-session-manager.d.ts.map +0 -1
- package/dist/src/features/media-session/media-session-manager.js +0 -331
- package/dist/src/features/picture-in-picture/pip-manager.d.ts.map +0 -1
- package/dist/src/features/picture-in-picture/pip-manager.js +0 -353
- package/dist/src/features/playlist/playlist-manager.d.ts.map +0 -1
- package/dist/src/features/playlist/playlist-manager.js +0 -475
- package/dist/src/features/subtitles/subtitle-manager.d.ts.map +0 -1
- package/dist/src/features/subtitles/subtitle-manager.js +0 -335
- package/dist/src/features/subtitles/subtitle-parser.d.ts.map +0 -1
- package/dist/src/features/subtitles/subtitle-parser.js +0 -217
- package/dist/src/features/thumbnails/thumbnail-generator.d.ts.map +0 -1
- package/dist/src/features/thumbnails/thumbnail-generator.js +0 -388
- package/dist/src/hooks/accessibility/index.d.ts.map +0 -1
- package/dist/src/hooks/accessibility/index.js +0 -4
- package/dist/src/hooks/accessibility/use-accessibility-preferences.d.ts.map +0 -1
- package/dist/src/hooks/accessibility/use-accessibility-preferences.js +0 -156
- package/dist/src/hooks/accessibility/use-focus-management.d.ts.map +0 -1
- package/dist/src/hooks/accessibility/use-focus-management.js +0 -142
- package/dist/src/hooks/accessibility/use-keyboard-shortcuts.d.ts.map +0 -1
- package/dist/src/hooks/accessibility/use-keyboard-shortcuts.js +0 -101
- package/dist/src/hooks/accessibility/use-screen-reader.d.ts.map +0 -1
- package/dist/src/hooks/accessibility/use-screen-reader.js +0 -148
- package/dist/src/hooks/core/index.d.ts.map +0 -1
- package/dist/src/hooks/core/index.js +0 -19
- package/dist/src/hooks/legacy.d.ts.map +0 -1
- package/dist/src/hooks/legacy.js +0 -17
- package/dist/src/hooks/use-enhanced-media-player.d.ts.map +0 -1
- package/dist/src/hooks/use-enhanced-media-player.js +0 -395
- package/dist/src/hooks/use-intelligent-preloading.d.ts.map +0 -1
- package/dist/src/hooks/use-intelligent-preloading.js +0 -258
- package/dist/src/hooks/use-keyboard-controls.d.ts.map +0 -1
- package/dist/src/hooks/use-keyboard-controls.js +0 -83
- package/dist/src/hooks/use-media-actions.d.ts.map +0 -1
- package/dist/src/hooks/use-media-actions.js +0 -121
- package/dist/src/hooks/use-media-metadata.d.ts.map +0 -1
- package/dist/src/hooks/use-media-metadata.js +0 -74
- package/dist/src/hooks/use-media-optimistic.d.ts.map +0 -1
- package/dist/src/hooks/use-media-optimistic.js +0 -205
- package/dist/src/hooks/use-media-player.d.ts.map +0 -1
- package/dist/src/hooks/use-media-player.js +0 -251
- package/dist/src/hooks/use-media-state.d.ts.map +0 -1
- package/dist/src/hooks/use-media-state.js +0 -162
- package/dist/src/hooks/use-memory-optimization.d.ts.map +0 -1
- package/dist/src/hooks/use-memory-optimization.js +0 -288
- package/dist/src/hooks/use-optimistic-controls.d.ts.map +0 -1
- package/dist/src/hooks/use-optimistic-controls.js +0 -60
- package/dist/src/hooks/use-optimized-media.d.ts.map +0 -1
- package/dist/src/hooks/use-optimized-media.js +0 -211
- package/dist/src/hooks/use-touch-gestures.d.ts.map +0 -1
- package/dist/src/hooks/use-touch-gestures.js +0 -289
- package/dist/src/hooks/useEnhancedSubtitles.d.ts.map +0 -1
- package/dist/src/hooks/useEnhancedSubtitles.js +0 -205
- package/dist/src/hooks/useKeyboardShortcuts.d.ts.map +0 -1
- package/dist/src/hooks/useKeyboardShortcuts.js +0 -59
- package/dist/src/hooks/useMediaControls.d.ts.map +0 -1
- package/dist/src/hooks/useMediaControls.js +0 -44
- package/dist/src/hooks/useScreenshot.d.ts.map +0 -1
- package/dist/src/hooks/useScreenshot.js +0 -56
- package/dist/src/hooks/useSubtitles.d.ts.map +0 -1
- package/dist/src/hooks/useSubtitles.js +0 -73
- package/dist/src/hooks/useVideoPlayer.d.ts.map +0 -1
- package/dist/src/hooks/useVideoPlayer.js +0 -184
- package/dist/src/icons/components/FullscreenIcon.d.ts.map +0 -1
- package/dist/src/icons/components/FullscreenIcon.js +0 -11
- package/dist/src/icons/components/SettingsIcon.d.ts.map +0 -1
- package/dist/src/icons/components/SettingsIcon.js +0 -11
- package/dist/src/icons/components/animated/LoadingIcon.d.ts.map +0 -1
- package/dist/src/icons/components/animated/LoadingIcon.js +0 -11
- package/dist/src/icons/components/animated/PlayPauseIcon.d.ts.map +0 -1
- package/dist/src/icons/components/animated/PlayPauseIcon.js +0 -9
- package/dist/src/icons/components/media/PauseIcon.d.ts.map +0 -1
- package/dist/src/icons/components/media/PauseIcon.js +0 -12
- package/dist/src/icons/components/media/PlayIcon.d.ts.map +0 -1
- package/dist/src/icons/components/media/PlayIcon.js +0 -12
- package/dist/src/icons/components/volume/VolumeIcon.d.ts.map +0 -1
- package/dist/src/icons/components/volume/VolumeIcon.js +0 -11
- package/dist/src/icons/components/volume/VolumeOffIcon.d.ts.map +0 -1
- package/dist/src/icons/components/volume/VolumeOffIcon.js +0 -11
- package/dist/src/icons/index.d.ts.map +0 -1
- package/dist/src/icons/index.js +0 -45
- package/dist/src/icons/provider.d.ts.map +0 -1
- package/dist/src/icons/provider.js +0 -37
- package/dist/src/icons/types.d.ts.map +0 -1
- package/dist/src/icons/types.js +0 -1
- package/dist/src/index-enhanced.d.ts.map +0 -1
- package/dist/src/index-enhanced.js +0 -16
- package/dist/src/index-legacy.d.ts.map +0 -1
- package/dist/src/index-legacy.js +0 -97
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/index.js +0 -90
- package/dist/src/index.minimal.d.ts.map +0 -1
- package/dist/src/index.minimal.js +0 -3
- package/dist/src/lib/deprecation.d.ts.map +0 -1
- package/dist/src/lib/deprecation.js +0 -31
- package/dist/src/lib/format-time.d.ts.map +0 -1
- package/dist/src/lib/format-time.js +0 -32
- package/dist/src/lib/index.d.ts.map +0 -1
- package/dist/src/lib/index.js +0 -3
- package/dist/src/lib/utils.d.ts.map +0 -1
- package/dist/src/lib/utils.js +0 -5
- package/dist/src/test/setup.d.ts.map +0 -1
- package/dist/src/test/setup.js +0 -65
- package/dist/src/types/events.d.ts.map +0 -1
- package/dist/src/types/events.js +0 -2
- package/dist/src/types/formats.d.ts.map +0 -1
- package/dist/src/types/formats.js +0 -63
- package/dist/src/types/index.d.ts.map +0 -1
- package/dist/src/types/index.js +0 -4
- package/dist/utils-Db13763z.cjs +0 -9
- package/dist/utils-Db13763z.cjs.map +0 -1
- package/dist/utils-nTO4AnHo.js +0 -2809
- package/dist/utils-nTO4AnHo.js.map +0 -1
- package/dist/utils.js +0 -2
- package/dist/utils.js.map +0 -1
- package/dist/utils.mjs +0 -7
- package/dist/utils.mjs.map +0 -1
- package/src/adapters/videojs-adapter.js +0 -350
- package/src/components/AnimateLoading.js +0 -41
- package/src/components/LoadingState.js +0 -111
- package/src/components/accessibility/keyboard-help-overlay.js +0 -90
- package/src/components/audio-player.js +0 -31
- package/src/components/basic/index.js +0 -29
- package/src/components/enhanced/advanced-features.js +0 -64
- package/src/components/enhanced/debug-panel.js +0 -94
- package/src/components/enhanced/enhanced-controls.js +0 -233
- package/src/components/enhanced/enhanced-media-player.js +0 -316
- package/src/components/enhanced/error-handling.js +0 -153
- package/src/components/enhanced/index.js +0 -10
- package/src/components/enhanced/media-player-enhanced.js +0 -250
- package/src/components/examples/basic-video-player.js +0 -16
- package/src/components/examples/custom-controls-example.js +0 -12
- package/src/components/examples/enhanced-controls-example.js +0 -18
- package/src/components/examples/enhanced-media-player-example.js +0 -13
- package/src/components/examples/loading-states-demo.js +0 -41
- package/src/components/examples/react-19-demo.js +0 -104
- package/src/components/examples/volume-orientation-demo.js +0 -31
- package/src/components/icon-demo.js +0 -16
- package/src/components/icons/index.js +0 -59
- package/src/components/icons/svg-icons/ArrowLeftIcon.js +0 -3
- package/src/components/icons/svg-icons/ArrowRightIcon.js +0 -3
- package/src/components/icons/svg-icons/AudioIcon.js +0 -4
- package/src/components/icons/svg-icons/BackwardIcon.js +0 -3
- package/src/components/icons/svg-icons/CameraIcon.js +0 -4
- package/src/components/icons/svg-icons/CheckIcon.js +0 -4
- package/src/components/icons/svg-icons/EnablePiPIcon.js +0 -5
- package/src/components/icons/svg-icons/ForwardIcon.js +0 -3
- package/src/components/icons/svg-icons/FullscreenEnterIcon.js +0 -3
- package/src/components/icons/svg-icons/FullscreenExitIcon.js +0 -3
- package/src/components/icons/svg-icons/LoadingIcon.js +0 -3
- package/src/components/icons/svg-icons/PauseIcon.js +0 -3
- package/src/components/icons/svg-icons/PlayIcon.js +0 -3
- package/src/components/icons/svg-icons/PlaybackSpeedIcon.js +0 -3
- package/src/components/icons/svg-icons/QualityIcon.js +0 -3
- package/src/components/icons/svg-icons/SettingsIcon.js +0 -3
- package/src/components/icons/svg-icons/SliderIcon.js +0 -3
- package/src/components/icons/svg-icons/SubtitleIcon.js +0 -3
- package/src/components/icons/svg-icons/SubtitleOffIcon.js +0 -3
- package/src/components/icons/svg-icons/UnPiPIcon.js +0 -5
- package/src/components/icons/svg-icons/VolumeMutedIcon.js +0 -3
- package/src/components/icons/svg-icons/VolumeOneIcon.js +0 -3
- package/src/components/icons/svg-icons/VolumeThreeIcon.js +0 -3
- package/src/components/icons/svg-icons/VolumeTwoIcon.js +0 -3
- package/src/components/legacy.js +0 -52
- package/src/components/media-metadata-display.js +0 -20
- package/src/components/media-player-audio.js +0 -18
- package/src/components/media-player-controls.js +0 -150
- package/src/components/media-player-error.js +0 -85
- package/src/components/media-player-fullscreen.js +0 -68
- package/src/components/media-player-hls.js +0 -20
- package/src/components/media-player-loading.js +0 -53
- package/src/components/media-player-play.js +0 -44
- package/src/components/media-player-root.js +0 -243
- package/src/components/media-player-seek.js +0 -92
- package/src/components/media-player-time.js +0 -57
- package/src/components/media-player-tooltip.js +0 -14
- package/src/components/media-player-video.js +0 -18
- package/src/components/media-player-volume.js +0 -88
- package/src/components/media-player.js +0 -67
- package/src/components/media-suspense.js +0 -173
- package/src/components/player-settings-form.js +0 -46
- package/src/components/react-player-wrapper.js +0 -163
- package/src/components/simple-video-player.js +0 -41
- package/src/components/ui/enhanced-seek-bar.js +0 -112
- package/src/components/ui/fullscreen-button.js +0 -21
- package/src/components/ui/media-resource-preloader.js +0 -295
- package/src/components/ui/play-button.js +0 -26
- package/src/components/ui/seek-bar.js +0 -54
- package/src/components/ui/time-display.js +0 -18
- package/src/components/ui/volume-control.js +0 -71
- package/src/components/unified/base-media-player.js +0 -104
- package/src/components/unified/media-player.js +0 -41
- package/src/components/variants/minimal/AccessibleMinimalPlayer.js +0 -322
- package/src/components/variants/minimal/EnhancedMinimalMediaPlayer.js +0 -280
- package/src/components/variants/minimal/MinimalControls.js +0 -19
- package/src/components/variants/minimal/MinimalLoading.js +0 -6
- package/src/components/variants/minimal/MinimalMediaPlayer.js +0 -135
- package/src/components/variants/minimal/MinimalOverlay.js +0 -15
- package/src/components/variants/minimal/MinimalPlayButton.js +0 -29
- package/src/components/variants/minimal/MinimalSeekBar.js +0 -73
- package/src/components/variants/minimal/MinimalVolumeControl.js +0 -29
- package/src/components/variants/minimal/SimpleMinimalPlayer.js +0 -51
- package/src/components/variants/minimal/components/CenterPlayButton.js +0 -8
- package/src/components/variants/minimal/components/ControlBar.js +0 -10
- package/src/components/variants/minimal/components/EnhancedSettingsMenu.js +0 -68
- package/src/components/variants/minimal/components/PlaybackControls.js +0 -9
- package/src/components/variants/minimal/components/RightControls.js +0 -40
- package/src/components/variants/minimal/components/SeekBar.js +0 -43
- package/src/components/variants/minimal/components/SettingsDropdown.js +0 -18
- package/src/components/variants/minimal/components/SubtitleDisplay.js +0 -6
- package/src/components/variants/minimal/components/TimeDisplay.js +0 -5
- package/src/components/variants/minimal/components/VideoElement.js +0 -4
- package/src/components/variants/minimal/components/VolumeControl.js +0 -99
- package/src/components/variants/minimal/index.js +0 -8
- package/src/components/video-player.js +0 -38
- package/src/context/error-handling.js +0 -300
- package/src/context/media-context.js +0 -121
- package/src/context/media-provider.js +0 -164
- package/src/context/media-store.js +0 -273
- package/src/context/persistence.js +0 -356
- package/src/core/events/event-system.js +0 -288
- package/src/core/events/hooks.js +0 -198
- package/src/core/events/index.js +0 -7
- package/src/core/events/middleware.js +0 -219
- package/src/core/index.js +0 -15
- package/src/core/optimization/bundle-optimizer.js +0 -217
- package/src/core/performance/cicd.js +0 -83
- package/src/core/performance/index.js +0 -14
- package/src/core/performance/media-loading-optimizer.js +0 -404
- package/src/core/performance/performance-budgets.js +0 -326
- package/src/core/performance/performance-monitor.js +0 -297
- package/src/core/performance/performance-testing.js +0 -314
- package/src/core/plugins/base-plugin.js +0 -151
- package/src/core/plugins/enhanced-plugin-system.js +0 -305
- package/src/core/plugins/examples/analytics-plugin.js +0 -191
- package/src/core/plugins/index.js +0 -9
- package/src/core/plugins/registry.js +0 -261
- package/src/core/plugins/types.js +0 -31
- package/src/core/plugins/utils.js +0 -274
- package/src/core/progressive-loading.js +0 -239
- package/src/core/providers/enhanced-hls-provider.js +0 -273
- package/src/core/providers/service-provider.js +0 -105
- package/src/core/utils.js +0 -21
- package/src/features/media-session/media-session-manager.js +0 -331
- package/src/features/picture-in-picture/pip-manager.js +0 -353
- package/src/features/playlist/playlist-manager.js +0 -475
- package/src/features/subtitles/subtitle-manager.js +0 -335
- package/src/features/subtitles/subtitle-parser.js +0 -217
- package/src/features/thumbnails/thumbnail-generator.js +0 -388
- package/src/hooks/accessibility/index.js +0 -4
- package/src/hooks/accessibility/use-accessibility-preferences.js +0 -156
- package/src/hooks/accessibility/use-focus-management.js +0 -142
- package/src/hooks/accessibility/use-keyboard-shortcuts.js +0 -101
- package/src/hooks/accessibility/use-screen-reader.js +0 -148
- package/src/hooks/core/index.js +0 -19
- package/src/hooks/legacy.js +0 -17
- package/src/hooks/use-enhanced-media-player.js +0 -395
- package/src/hooks/use-intelligent-preloading.js +0 -258
- package/src/hooks/use-keyboard-controls.js +0 -83
- package/src/hooks/use-media-actions.js +0 -121
- package/src/hooks/use-media-metadata.js +0 -74
- package/src/hooks/use-media-optimistic.js +0 -205
- package/src/hooks/use-media-player.js +0 -251
- package/src/hooks/use-media-state.js +0 -162
- package/src/hooks/use-memory-optimization.js +0 -288
- package/src/hooks/use-optimistic-controls.js +0 -60
- package/src/hooks/use-optimized-media.js +0 -211
- package/src/hooks/use-touch-gestures.js +0 -289
- package/src/hooks/useEnhancedSubtitles.js +0 -205
- package/src/hooks/useKeyboardShortcuts.js +0 -59
- package/src/hooks/useMediaControls.js +0 -44
- package/src/hooks/useScreenshot.js +0 -56
- package/src/hooks/useSubtitles.js +0 -73
- package/src/hooks/useVideoPlayer.js +0 -184
- package/src/icons/components/FullscreenIcon.js +0 -11
- package/src/icons/components/SettingsIcon.js +0 -11
- package/src/icons/components/animated/LoadingIcon.js +0 -11
- package/src/icons/components/animated/PlayPauseIcon.js +0 -9
- package/src/icons/components/media/PauseIcon.js +0 -12
- package/src/icons/components/media/PlayIcon.js +0 -12
- package/src/icons/components/volume/VolumeIcon.js +0 -11
- package/src/icons/components/volume/VolumeOffIcon.js +0 -11
- package/src/icons/index.js +0 -45
- package/src/icons/provider.js +0 -37
- package/src/icons/types.js +0 -1
- package/src/index-enhanced.js +0 -16
- package/src/index-legacy.js +0 -97
- package/src/index.js +0 -90
- package/src/index.minimal.js +0 -3
- package/src/lib/deprecation.js +0 -31
- package/src/lib/format-time.js +0 -32
- package/src/lib/index.js +0 -3
- package/src/lib/utils.js +0 -5
- package/src/test/setup.js +0 -65
- package/src/types/events.js +0 -2
- package/src/types/formats.js +0 -63
- package/src/types/index.js +0 -4
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useState, useEffect, useRef } from "react";
|
|
4
|
-
import { cn } from "../../../lib/utils";
|
|
5
|
-
import { useVideoPlayer } from "../../../hooks/useVideoPlayer";
|
|
6
|
-
import { useEnhancedSubtitles } from "../../../hooks/useEnhancedSubtitles";
|
|
7
|
-
import { useMediaControls } from "../../../hooks/useMediaControls";
|
|
8
|
-
import { useKeyboardShortcuts } from "../../../hooks/useKeyboardShortcuts";
|
|
9
|
-
import { useScreenshot } from "../../../hooks/useScreenshot";
|
|
10
|
-
import { VideoElement } from "./components/VideoElement";
|
|
11
|
-
import { SubtitleDisplay } from "./components/SubtitleDisplay";
|
|
12
|
-
import { CenterPlayButton } from "./components/CenterPlayButton";
|
|
13
|
-
import { ControlBar } from "./components/ControlBar";
|
|
14
|
-
import { CustomLoading, LoadingPresets } from "../../LoadingState";
|
|
15
|
-
export function SimpleMinimalPlayer(props) {
|
|
16
|
-
const { src, poster, className, subtitleSrc, subtitleTracks, crossOrigin, volumeOrientation = "horizontal", loadingComponent: LoadingComponent = undefined, showLoadingState = true, loadingProps = {} } = props;
|
|
17
|
-
const containerRef = useRef(null);
|
|
18
|
-
const [showSettings, setShowSettings] = useState(false);
|
|
19
|
-
const [playbackRate, setPlaybackRate] = useState(1);
|
|
20
|
-
const { videoRef, state: videoState, controls: videoControls } = useVideoPlayer(containerRef);
|
|
21
|
-
const { subtitlesEnabled, currentSubtitle, toggleSubtitles, getCurrentSubtitle, setCurrentSubtitle, selectSubtitleTrack, availableTracks, currentTrackId, loadError, hasSubtitles } = useEnhancedSubtitles({
|
|
22
|
-
subtitleSrc,
|
|
23
|
-
subtitleTracks,
|
|
24
|
-
onLoadError: (error) => console.error("Subtitle load error:", error)
|
|
25
|
-
});
|
|
26
|
-
const { takeScreenshot } = useScreenshot(videoRef);
|
|
27
|
-
const { controlsVisible, showVolumeSlider, setShowVolumeSlider, handleMouseMove, handleMouseEnter, handleMouseLeave } = useMediaControls(videoState.isPlaying, showSettings);
|
|
28
|
-
// Update subtitle display based on current time
|
|
29
|
-
useEffect(() => {
|
|
30
|
-
if (subtitlesEnabled) {
|
|
31
|
-
const subtitle = getCurrentSubtitle(videoState.currentTime);
|
|
32
|
-
setCurrentSubtitle(subtitle);
|
|
33
|
-
}
|
|
34
|
-
}, [videoState.currentTime, subtitlesEnabled, getCurrentSubtitle, setCurrentSubtitle]);
|
|
35
|
-
// Change playback rate
|
|
36
|
-
const changePlaybackRate = (rate) => {
|
|
37
|
-
if (!videoRef.current)
|
|
38
|
-
return;
|
|
39
|
-
videoRef.current.playbackRate = rate;
|
|
40
|
-
setPlaybackRate(rate);
|
|
41
|
-
setShowSettings(false);
|
|
42
|
-
};
|
|
43
|
-
// Keyboard shortcuts
|
|
44
|
-
useKeyboardShortcuts({
|
|
45
|
-
videoControls,
|
|
46
|
-
toggleSubtitles,
|
|
47
|
-
takeScreenshot,
|
|
48
|
-
duration: videoState.duration
|
|
49
|
-
});
|
|
50
|
-
return (_jsxs("div", { ref: containerRef, className: cn("minimal-player relative rounded-lg bg-black", className), style: { overflow: "hidden" }, onMouseMove: handleMouseMove, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, children: [_jsx(VideoElement, { videoRef: videoRef, src: src, poster: poster, subtitleSrc: subtitleSrc, subtitlesEnabled: subtitlesEnabled, crossOrigin: crossOrigin, onTogglePlay: videoControls.togglePlay }), _jsx(SubtitleDisplay, { subtitlesEnabled: subtitlesEnabled, subtitleText: currentSubtitle }), !videoState.isLoading && (_jsx(CenterPlayButton, { isPlaying: videoState.isPlaying, onTogglePlay: videoControls.togglePlay })), _jsx(ControlBar, { controlsVisible: controlsVisible, currentTime: videoState.currentTime, duration: videoState.duration, isPlaying: videoState.isPlaying, volume: videoState.volume, isMuted: videoState.isMuted, showVolumeSlider: showVolumeSlider, isFullscreen: videoState.isFullscreen, showSettings: showSettings, playbackRate: playbackRate, subtitleSrc: subtitleSrc, subtitlesEnabled: subtitlesEnabled, subtitleTracks: availableTracks, currentTrackId: currentTrackId, hasSubtitles: hasSubtitles, subtitleLoadError: loadError, volumeOrientation: volumeOrientation, bufferedRanges: videoState.bufferedRanges, isSeeking: videoState.isSeeking, onSeek: videoControls.seekTo, onTogglePlay: videoControls.togglePlay, onSeekBackward: videoControls.seekBackward, onSeekForward: videoControls.seekForward, onToggleMute: videoControls.toggleMute, onVolumeChange: videoControls.setVolume, onShowVolumeSlider: setShowVolumeSlider, onToggleSubtitles: toggleSubtitles, onSelectSubtitleTrack: selectSubtitleTrack, onTakeScreenshot: takeScreenshot, onToggleFullscreen: videoControls.toggleFullscreen, onToggleSettings: () => setShowSettings(!showSettings), onChangePlaybackRate: changePlaybackRate }), showLoadingState && (_jsxs(_Fragment, { children: [videoState.isLoading && !videoState.isSeeking && !videoState.isBuffering && (LoadingComponent ? (_jsx(CustomLoading, { context: "initial", children: _jsx(LoadingComponent, { context: "initial" }) })) : (_jsx(LoadingPresets.Initial, { ...loadingProps }))), videoState.isSeeking && (LoadingComponent ? (_jsx(CustomLoading, { context: "seeking", children: _jsx(LoadingComponent, { context: "seeking" }) })) : (_jsx(LoadingPresets.Seeking, { ...loadingProps }))), videoState.isBuffering && !videoState.isSeeking && (LoadingComponent ? (_jsx(CustomLoading, { context: "buffering", children: _jsx(LoadingComponent, { context: "buffering" }) })) : (_jsx(LoadingPresets.Buffering, { ...loadingProps })))] }))] }));
|
|
51
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { defaultMinimalIcons } from "../../../icons";
|
|
3
|
-
export const CenterPlayButton = function CenterPlayButton({ isPlaying, onTogglePlay }) {
|
|
4
|
-
if (isPlaying)
|
|
5
|
-
return null;
|
|
6
|
-
const PlayIcon = defaultMinimalIcons.play;
|
|
7
|
-
return (_jsx("div", { className: "minimal-center-play cursor-pointer", onClick: onTogglePlay, children: PlayIcon && _jsx(PlayIcon, { size: 60 }) }));
|
|
8
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { cn } from "../../../../lib/utils";
|
|
3
|
-
import { SeekBar } from "./SeekBar";
|
|
4
|
-
import { PlaybackControls } from "./PlaybackControls";
|
|
5
|
-
import { VolumeControl } from "./VolumeControl";
|
|
6
|
-
import { TimeDisplay } from "./TimeDisplay";
|
|
7
|
-
import { RightControls } from "./RightControls";
|
|
8
|
-
export const ControlBar = function ControlBar({ controlsVisible, currentTime, duration, isPlaying, volume, isMuted, showVolumeSlider, isFullscreen, showSettings, playbackRate, subtitleSrc, subtitlesEnabled, subtitleTracks, currentTrackId, hasSubtitles, subtitleLoadError, volumeOrientation = "horizontal", bufferedRanges, isSeeking, onSeek, onTogglePlay, onSeekBackward, onSeekForward, onToggleMute, onVolumeChange, onShowVolumeSlider, onToggleSubtitles, onSelectSubtitleTrack, onTakeScreenshot, onToggleFullscreen, onToggleSettings, onChangePlaybackRate }) {
|
|
9
|
-
return (_jsxs("div", { className: cn("minimal-control-bar", "absolute right-0 bottom-0 left-0 z-40", "px-6 py-3 transition-all duration-200", controlsVisible ? "minimal-controls-visible" : "minimal-controls-hidden"), children: [_jsx(SeekBar, { currentTime: currentTime, duration: duration, bufferedRanges: bufferedRanges, isSeeking: isSeeking, onSeek: onSeek }), _jsxs("div", { className: "flex items-center justify-between", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(PlaybackControls, { isPlaying: isPlaying, onTogglePlay: onTogglePlay, onSeekBackward: onSeekBackward, onSeekForward: onSeekForward }), _jsx(VolumeControl, { volume: volume, isMuted: isMuted, showVolumeSlider: showVolumeSlider, onToggleMute: onToggleMute, onVolumeChange: onVolumeChange, onShowVolumeSlider: onShowVolumeSlider, orientation: volumeOrientation }), _jsx(TimeDisplay, { currentTime: currentTime, duration: duration })] }), _jsx(RightControls, { subtitleSrc: subtitleSrc, subtitlesEnabled: subtitlesEnabled, subtitleTracks: subtitleTracks, currentTrackId: currentTrackId, hasSubtitles: hasSubtitles, subtitleLoadError: subtitleLoadError, isFullscreen: isFullscreen, showSettings: showSettings, playbackRate: playbackRate, onToggleSubtitles: onToggleSubtitles, onSelectSubtitleTrack: onSelectSubtitleTrack, onTakeScreenshot: onTakeScreenshot, onToggleFullscreen: onToggleFullscreen, onToggleSettings: onToggleSettings, onChangePlaybackRate: onChangePlaybackRate })] })] }));
|
|
10
|
-
};
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useState, useCallback, useEffect } from "react";
|
|
3
|
-
import { cn } from "../../../../lib/utils";
|
|
4
|
-
import { defaultMinimalIcons } from "../../../icons";
|
|
5
|
-
export const EnhancedSettingsMenu = function EnhancedSettingsMenu({ showSettings, playbackRate, subtitlesEnabled, subtitleTracks, currentSubtitleTrack, subtitleFontSize = "medium", hasSubtitles, subtitleLoadError, onToggleSettings, onChangePlaybackRate, onToggleSubtitles, onSelectSubtitleTrack, onChangeSubtitleFontSize }) {
|
|
6
|
-
const [currentView, setCurrentView] = useState("main");
|
|
7
|
-
const playbackRates = [0.5, 0.75, 1, 1.25, 1.5, 2];
|
|
8
|
-
const fontSizes = [
|
|
9
|
-
{ value: "small", label: "Small", size: "12px" },
|
|
10
|
-
{ value: "medium", label: "Medium", size: "16px" },
|
|
11
|
-
{ value: "large", label: "Large", size: "20px" }
|
|
12
|
-
];
|
|
13
|
-
// Reset to main menu when settings close
|
|
14
|
-
useEffect(() => {
|
|
15
|
-
if (!showSettings) {
|
|
16
|
-
setCurrentView("main");
|
|
17
|
-
}
|
|
18
|
-
}, [showSettings]);
|
|
19
|
-
const handleSettingsClick = useCallback((e) => {
|
|
20
|
-
e.stopPropagation();
|
|
21
|
-
onToggleSettings();
|
|
22
|
-
}, [onToggleSettings]);
|
|
23
|
-
const handleDropdownClick = useCallback((e) => {
|
|
24
|
-
e.stopPropagation();
|
|
25
|
-
}, []);
|
|
26
|
-
const handleBackClick = useCallback(() => {
|
|
27
|
-
setCurrentView("main");
|
|
28
|
-
}, []);
|
|
29
|
-
const handleSelectSpeed = useCallback((rate) => {
|
|
30
|
-
onChangePlaybackRate(rate);
|
|
31
|
-
setCurrentView("main");
|
|
32
|
-
}, [onChangePlaybackRate]);
|
|
33
|
-
const handleSelectFontSize = useCallback((size) => {
|
|
34
|
-
onChangeSubtitleFontSize(size);
|
|
35
|
-
setCurrentView("main");
|
|
36
|
-
}, [onChangeSubtitleFontSize]);
|
|
37
|
-
const handleSelectSubtitle = useCallback((trackId) => {
|
|
38
|
-
if (trackId === null) {
|
|
39
|
-
// Turn off subtitles
|
|
40
|
-
if (subtitlesEnabled) {
|
|
41
|
-
onToggleSubtitles();
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
45
|
-
// Select track and enable if needed
|
|
46
|
-
if (!subtitlesEnabled) {
|
|
47
|
-
onToggleSubtitles();
|
|
48
|
-
}
|
|
49
|
-
onSelectSubtitleTrack?.(trackId);
|
|
50
|
-
}
|
|
51
|
-
setCurrentView("main");
|
|
52
|
-
}, [subtitlesEnabled, onToggleSubtitles, onSelectSubtitleTrack]);
|
|
53
|
-
const renderMainMenu = () => (_jsxs(_Fragment, { children: [_jsx("div", { className: "border-gray-700 border-b px-3 py-2 font-semibold text-gray-400 text-xs uppercase tracking-wider", children: "Settings" }), _jsxs("div", { className: "py-1", children: [_jsxs("button", { className: cn("flex w-full items-center justify-between px-3 py-2 text-left text-sm transition-colors hover:bg-gray-800", !hasSubtitles && "cursor-not-allowed opacity-50"), onClick: () => hasSubtitles && setCurrentView("subtitles"), disabled: !hasSubtitles, children: [_jsxs("div", { className: "flex items-center gap-2", children: [defaultMinimalIcons.subtitle && _jsx(defaultMinimalIcons.subtitle, { size: 16 }), _jsx("span", { children: "Subtitles" })] }), _jsxs("div", { className: "flex items-center gap-1 text-gray-400 text-xs", children: [!hasSubtitles ? (_jsx("span", { className: "text-gray-500", children: "Unavailable" })) : subtitleLoadError ? (_jsx("span", { className: "text-red-400", children: "Error" })) : subtitlesEnabled ? (_jsx("span", { className: "text-cyan-400", children: "On" })) : (_jsx("span", { children: "Off" })), hasSubtitles && (_jsx("svg", { className: "h-4 w-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 5l7 7-7 7" }) }))] })] }), hasSubtitles && (_jsxs("button", { className: "flex w-full items-center justify-between px-3 py-2 text-left text-sm transition-colors hover:bg-gray-800", onClick: () => setCurrentView("fontSize"), children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("svg", { className: "h-4 w-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M4 7h16M4 7v10m0-10l4 10m8-10l4 10m-4-10v10" }) }), _jsx("span", { children: "Font Size" })] }), _jsxs("div", { className: "flex items-center gap-1 text-gray-400 text-xs", children: [_jsx("span", { className: "capitalize", children: subtitleFontSize }), _jsx("svg", { className: "h-4 w-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 5l7 7-7 7" }) })] })] })), _jsxs("button", { className: "flex w-full items-center justify-between px-3 py-2 text-left text-sm transition-colors hover:bg-gray-800", onClick: () => setCurrentView("speed"), children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("svg", { className: "h-4 w-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M13 10V3L4 14h7v7l9-11h-7z" }) }), _jsx("span", { children: "Playback Speed" })] }), _jsxs("div", { className: "flex items-center gap-1 text-gray-400 text-xs", children: [_jsx("span", { children: playbackRate === 1 ? "Normal" : `${playbackRate}x` }), _jsx("svg", { className: "h-4 w-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 5l7 7-7 7" }) })] })] })] })] }));
|
|
54
|
-
const renderSubtitlesMenu = () => (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex items-center justify-between border-gray-700 border-b px-3 py-2", children: [_jsx("button", { onClick: handleBackClick, className: "text-gray-400 transition-colors hover:text-white", children: _jsx("svg", { className: "h-4 w-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M15 19l-7-7 7-7" }) }) }), _jsx("span", { className: "font-semibold text-gray-300 text-sm", children: "Subtitles" }), _jsx("div", { className: "w-4" })] }), _jsxs("div", { className: "py-1", children: [_jsxs("button", { className: cn("flex w-full items-center justify-between px-3 py-2 text-left text-sm transition-colors hover:bg-gray-800", !subtitlesEnabled && "bg-cyan-700/20 text-cyan-400"), onClick: () => handleSelectSubtitle(null), children: [_jsx("span", { children: "Off" }), !subtitlesEnabled && (_jsx("svg", { className: "h-4 w-4 text-cyan-400", fill: "currentColor", viewBox: "0 0 20 20", children: _jsx("path", { fillRule: "evenodd", d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z" }) }))] }), subtitleTracks.length > 0 ? (subtitleTracks.map((track) => (_jsxs("button", { className: cn("flex w-full items-center justify-between px-3 py-2 text-left text-sm transition-colors hover:bg-gray-800", subtitlesEnabled && currentSubtitleTrack === track.id && "bg-cyan-700/20 text-cyan-400"), onClick: () => handleSelectSubtitle(track.id), children: [_jsx("span", { children: track.label }), subtitlesEnabled && currentSubtitleTrack === track.id && (_jsx("svg", { className: "h-4 w-4 text-cyan-400", fill: "currentColor", viewBox: "0 0 20 20", children: _jsx("path", { fillRule: "evenodd", d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z" }) }))] }, track.id)))) : (_jsxs("button", { className: cn("flex w-full items-center justify-between px-3 py-2 text-left text-sm transition-colors hover:bg-gray-800", subtitlesEnabled && "bg-cyan-700/20 text-cyan-400"), onClick: () => {
|
|
55
|
-
if (!subtitlesEnabled) {
|
|
56
|
-
onToggleSubtitles();
|
|
57
|
-
}
|
|
58
|
-
setCurrentView("main");
|
|
59
|
-
}, children: [_jsx("span", { children: "Default" }), subtitlesEnabled && (_jsx("svg", { className: "h-4 w-4 text-cyan-400", fill: "currentColor", viewBox: "0 0 20 20", children: _jsx("path", { fillRule: "evenodd", d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z" }) }))] }))] })] }));
|
|
60
|
-
const renderFontSizeMenu = () => (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex items-center justify-between border-gray-700 border-b px-3 py-2", children: [_jsx("button", { onClick: handleBackClick, className: "text-gray-400 transition-colors hover:text-white", children: _jsx("svg", { className: "h-4 w-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M15 19l-7-7 7-7" }) }) }), _jsx("span", { className: "font-semibold text-gray-300 text-sm", children: "Font Size" }), _jsx("div", { className: "w-4" })] }), _jsx("div", { className: "py-1", children: fontSizes.map((size) => (_jsxs("button", { className: cn("flex w-full items-center justify-between px-3 py-2 text-left text-sm transition-colors hover:bg-gray-800", subtitleFontSize === size.value && "bg-cyan-700/20 text-cyan-400"), onClick: () => handleSelectFontSize(size.value), children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsx("span", { className: "text-gray-400", style: { fontSize: size.size }, children: "Aa" }), _jsx("span", { children: size.label })] }), subtitleFontSize === size.value && (_jsx("svg", { className: "h-4 w-4 text-cyan-400", fill: "currentColor", viewBox: "0 0 20 20", children: _jsx("path", { fillRule: "evenodd", d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z" }) }))] }, size.value))) })] }));
|
|
61
|
-
const renderSpeedMenu = () => (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex items-center justify-between border-gray-700 border-b px-3 py-2", children: [_jsx("button", { onClick: handleBackClick, className: "text-gray-400 transition-colors hover:text-white", children: _jsx("svg", { className: "h-4 w-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M15 19l-7-7 7-7" }) }) }), _jsx("span", { className: "font-semibold text-gray-300 text-sm", children: "Playback Speed" }), _jsx("div", { className: "w-4" })] }), _jsx("div", { className: "py-1", children: playbackRates.map((rate) => (_jsxs("button", { className: cn("flex w-full items-center justify-between px-3 py-2 text-left text-sm transition-colors hover:bg-gray-800", playbackRate === rate && "bg-cyan-700/20 text-cyan-400"), onClick: () => handleSelectSpeed(rate), children: [_jsx("span", { children: rate === 1 ? "Normal" : `${rate}x` }), playbackRate === rate && (_jsx("svg", { className: "h-4 w-4 text-cyan-400", fill: "currentColor", viewBox: "0 0 20 20", children: _jsx("path", { fillRule: "evenodd", d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z" }) }))] }, rate))) })] }));
|
|
62
|
-
return (_jsxs("div", { className: "relative", style: { zIndex: showSettings ? 60 : "auto" }, children: [_jsx("button", { className: cn("minimal-btn h-9 w-9", showSettings && "text-cyan-500"), onClick: handleSettingsClick, "aria-label": "Settings", title: "Settings", children: defaultMinimalIcons.settings && _jsx(defaultMinimalIcons.settings, { size: 18 }) }), showSettings && (_jsxs("div", { className: "absolute right-0 mb-2 min-w-[240px] overflow-hidden rounded-lg border border-gray-700 bg-gray-900 shadow-xl", style: {
|
|
63
|
-
bottom: "100%",
|
|
64
|
-
zIndex: 1000,
|
|
65
|
-
maxHeight: "400px",
|
|
66
|
-
overflowY: "auto"
|
|
67
|
-
}, onClick: handleDropdownClick, children: [currentView === "main" && renderMainMenu(), currentView === "subtitles" && renderSubtitlesMenu(), currentView === "fontSize" && renderFontSizeMenu(), currentView === "speed" && renderSpeedMenu()] }))] }));
|
|
68
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { defaultMinimalIcons, MinimalBackward10Icon, MinimalForward10Icon } from "../../../icons";
|
|
3
|
-
export const PlaybackControls = function PlaybackControls({ isPlaying, onTogglePlay, onSeekBackward, onSeekForward }) {
|
|
4
|
-
const PlayIcon = defaultMinimalIcons.play;
|
|
5
|
-
const PauseIcon = defaultMinimalIcons.pause;
|
|
6
|
-
return (_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("button", { className: "minimal-btn size-15", onClick: onTogglePlay, "aria-label": isPlaying ? "Pause" : "Play", children: isPlaying
|
|
7
|
-
? PauseIcon && _jsx(PauseIcon, { size: 32 })
|
|
8
|
-
: PlayIcon && _jsx(PlayIcon, { size: 32 }) }), _jsx("button", { className: "minimal-btn h-9 w-9", onClick: onSeekBackward, "aria-label": "Backward 10 seconds", title: "Backward 10s (J)", children: _jsx(MinimalBackward10Icon, { size: 18 }) }), _jsx("button", { className: "minimal-btn h-9 w-9", onClick: onSeekForward, "aria-label": "Forward 10 seconds", title: "Forward 10s (L)", children: _jsx(MinimalForward10Icon, { size: 18 }) })] }));
|
|
9
|
-
};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState, useRef, useEffect } from "react";
|
|
3
|
-
import { cn } from "../../../../lib/utils";
|
|
4
|
-
import { MinimalSubtitleIcon, MinimalScreenshotIcon, defaultMinimalIcons } from "../../../icons";
|
|
5
|
-
import { SettingsDropdown } from "./SettingsDropdown";
|
|
6
|
-
export const RightControls = function RightControls({ subtitleSrc, subtitlesEnabled, subtitleTracks, currentTrackId, hasSubtitles, subtitleLoadError, isFullscreen, showSettings, playbackRate, onToggleSubtitles, onSelectSubtitleTrack, onTakeScreenshot, onToggleFullscreen, onToggleSettings, onChangePlaybackRate }) {
|
|
7
|
-
const [showSubtitleMenu, setShowSubtitleMenu] = useState(false);
|
|
8
|
-
const subtitleMenuRef = useRef(null);
|
|
9
|
-
const FullscreenIcon = defaultMinimalIcons.fullscreen;
|
|
10
|
-
const ExitFullscreenIcon = defaultMinimalIcons.exitFullscreen;
|
|
11
|
-
// Close subtitle menu when clicking outside
|
|
12
|
-
useEffect(() => {
|
|
13
|
-
const handleClickOutside = (event) => {
|
|
14
|
-
if (subtitleMenuRef.current && !subtitleMenuRef.current.contains(event.target)) {
|
|
15
|
-
setShowSubtitleMenu(false);
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
if (showSubtitleMenu) {
|
|
19
|
-
document.addEventListener("mousedown", handleClickOutside);
|
|
20
|
-
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
21
|
-
}
|
|
22
|
-
}, [showSubtitleMenu]);
|
|
23
|
-
const handleSubtitleClick = () => {
|
|
24
|
-
if (subtitleTracks && subtitleTracks.length > 0) {
|
|
25
|
-
setShowSubtitleMenu(!showSubtitleMenu);
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
onToggleSubtitles();
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
return (_jsxs("div", { className: "flex items-center gap-2", children: [hasSubtitles && (_jsxs("div", { className: "relative", ref: subtitleMenuRef, children: [_jsx("button", { className: cn("minimal-btn h-9 w-9", subtitlesEnabled && "text-cyan-500", subtitleLoadError && "text-red-500"), onClick: handleSubtitleClick, "aria-label": "Subtitles", title: subtitleLoadError ? "Subtitle Error" : "Subtitles (C)", children: _jsx(MinimalSubtitleIcon, { size: 18 }) }), showSubtitleMenu && subtitleTracks && subtitleTracks.length > 0 && (_jsxs("div", { className: "absolute right-0 bottom-full mb-2 w-48 rounded-md bg-gray-900/95 py-2 shadow-lg backdrop-blur-sm", children: [_jsx("div", { className: "px-3 py-1 font-semibold text-gray-400 text-xs", children: "Subtitles" }), _jsx("button", { className: cn("flex w-full items-center px-3 py-1.5 text-gray-300 text-sm hover:bg-gray-800", !subtitlesEnabled && "bg-gray-800 text-cyan-500"), onClick: () => {
|
|
32
|
-
onSelectSubtitleTrack?.(null);
|
|
33
|
-
setShowSubtitleMenu(false);
|
|
34
|
-
}, children: "Off" }), subtitleTracks.map((track) => (_jsxs("button", { className: cn("flex w-full items-center px-3 py-1.5 text-gray-300 text-sm hover:bg-gray-800", currentTrackId === track.id && "bg-gray-800 text-cyan-500"), onClick: () => {
|
|
35
|
-
onSelectSubtitleTrack?.(track.id);
|
|
36
|
-
setShowSubtitleMenu(false);
|
|
37
|
-
}, children: [_jsx("span", { children: track.label }), track.language && (_jsxs("span", { className: "ml-2 text-gray-500 text-xs", children: ["(", track.language, ")"] }))] }, track.id))), subtitleLoadError && (_jsx("div", { className: "mt-2 border-gray-800 border-t px-3 py-2", children: _jsx("p", { className: "text-red-400 text-xs", children: "Failed to load subtitles" }) }))] }))] })), _jsx("button", { className: "minimal-btn h-9 w-9", onClick: (e) => onTakeScreenshot(e.ctrlKey || e.metaKey), "aria-label": "Take Screenshot", title: "Screenshot (S) - Ctrl+Click to copy", children: _jsx(MinimalScreenshotIcon, { size: 18 }) }), _jsx(SettingsDropdown, { showSettings: showSettings, playbackRate: playbackRate, onToggleSettings: onToggleSettings, onChangePlaybackRate: onChangePlaybackRate }), _jsx("button", { className: "minimal-btn h-9 w-9", onClick: onToggleFullscreen, "aria-label": isFullscreen ? "Exit Fullscreen" : "Enter Fullscreen", title: "Fullscreen (F)", children: isFullscreen
|
|
38
|
-
? ExitFullscreenIcon && _jsx(ExitFullscreenIcon, { size: 18 })
|
|
39
|
-
: FullscreenIcon && _jsx(FullscreenIcon, { size: 18 }) })] }));
|
|
40
|
-
};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState, useRef } from "react";
|
|
3
|
-
import { cn } from "../../../../lib/utils";
|
|
4
|
-
export const SeekBar = function SeekBar({ currentTime, duration, bufferedRanges = [], isSeeking = false, onSeek }) {
|
|
5
|
-
const [isHovering, setIsHovering] = useState(false);
|
|
6
|
-
const [hoverPosition, setHoverPosition] = useState(0);
|
|
7
|
-
const [showRipple, setShowRipple] = useState(false);
|
|
8
|
-
const [ripplePosition, setRipplePosition] = useState({ x: 0, y: 0 });
|
|
9
|
-
const seekBarRef = useRef(null);
|
|
10
|
-
const progress = duration > 0 ? (currentTime / duration) * 100 : 0;
|
|
11
|
-
const handleClick = (e) => {
|
|
12
|
-
if (duration === 0)
|
|
13
|
-
return;
|
|
14
|
-
const rect = e.currentTarget.getBoundingClientRect();
|
|
15
|
-
const position = (e.clientX - rect.left) / rect.width;
|
|
16
|
-
const newTime = Math.max(0, Math.min(duration, position * duration));
|
|
17
|
-
// Add ripple effect
|
|
18
|
-
setRipplePosition({ x: e.clientX - rect.left, y: e.clientY - rect.top });
|
|
19
|
-
setShowRipple(true);
|
|
20
|
-
setTimeout(() => setShowRipple(false), 600);
|
|
21
|
-
onSeek(newTime);
|
|
22
|
-
};
|
|
23
|
-
const handleMouseMove = (e) => {
|
|
24
|
-
if (!seekBarRef.current)
|
|
25
|
-
return;
|
|
26
|
-
const rect = seekBarRef.current.getBoundingClientRect();
|
|
27
|
-
const position = ((e.clientX - rect.left) / rect.width) * 100;
|
|
28
|
-
setHoverPosition(Math.max(0, Math.min(100, position)));
|
|
29
|
-
};
|
|
30
|
-
const handleMouseEnter = () => setIsHovering(true);
|
|
31
|
-
const handleMouseLeave = () => setIsHovering(false);
|
|
32
|
-
return (_jsxs("div", { className: "relative mb-3", children: [_jsxs("div", { ref: seekBarRef, className: cn("minimal-seekbar group relative cursor-pointer", isSeeking && "minimal-seekbar-seeking"), onClick: handleClick, onMouseMove: handleMouseMove, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, children: [bufferedRanges.map((range, index) => {
|
|
33
|
-
const startPercent = duration > 0 ? (range.start / duration) * 100 : 0;
|
|
34
|
-
const widthPercent = duration > 0 ? ((range.end - range.start) / duration) * 100 : 0;
|
|
35
|
-
return (_jsx("div", { className: "minimal-seekbar-buffered", style: {
|
|
36
|
-
left: `${startPercent}%`,
|
|
37
|
-
width: `${widthPercent}%`
|
|
38
|
-
} }, index));
|
|
39
|
-
}), _jsx("div", { className: cn("minimal-seekbar-progress", isSeeking && "minimal-seekbar-progress-seeking"), style: { width: `${progress}%` } }), isHovering && !isSeeking && (_jsx("div", { className: "minimal-seekbar-hover-indicator", style: { left: `${hoverPosition}%` } })), _jsx("div", { className: cn("minimal-seekbar-thumb", (isHovering || isSeeking) && "opacity-100", isSeeking && "minimal-seekbar-thumb-seeking"), style: { left: `${progress}%` } }), showRipple && (_jsx("div", { className: "minimal-seekbar-ripple", style: {
|
|
40
|
-
left: ripplePosition.x,
|
|
41
|
-
top: ripplePosition.y
|
|
42
|
-
} }))] }), isSeeking && (_jsx("div", { className: "-top-6 -translate-x-1/2 absolute left-1/2 transform", children: _jsx("div", { className: "rounded bg-black/80 px-2 py-1 text-white text-xs backdrop-blur-sm", children: "Seeking..." }) }))] }));
|
|
43
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback } from "react";
|
|
3
|
-
import { cn } from "../../../../lib/utils";
|
|
4
|
-
import { defaultMinimalIcons } from "../../../icons";
|
|
5
|
-
export const SettingsDropdown = function SettingsDropdown({ showSettings, playbackRate, onToggleSettings, onChangePlaybackRate }) {
|
|
6
|
-
const playbackRates = [0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2];
|
|
7
|
-
const handleSettingsClick = useCallback((e) => {
|
|
8
|
-
e.stopPropagation();
|
|
9
|
-
onToggleSettings();
|
|
10
|
-
}, [onToggleSettings]);
|
|
11
|
-
const handleDropdownClick = useCallback((e) => {
|
|
12
|
-
e.stopPropagation();
|
|
13
|
-
}, []);
|
|
14
|
-
return (_jsxs("div", { className: "relative", style: { zIndex: showSettings ? 60 : "auto" }, children: [_jsx("button", { className: cn("minimal-btn h-9 w-9", showSettings && "text-cyan-500"), onClick: handleSettingsClick, "aria-label": "Settings", children: defaultMinimalIcons.settings && _jsx(defaultMinimalIcons.settings, { size: 18 }) }), showSettings && (_jsxs("div", { className: "absolute right-0 mb-2 min-w-[200px] rounded-lg border border-gray-700 bg-gray-900 py-2 shadow-xl", style: {
|
|
15
|
-
bottom: "100%",
|
|
16
|
-
zIndex: 1000
|
|
17
|
-
}, onClick: handleDropdownClick, children: [_jsx("div", { className: "px-3 py-1 text-gray-400 text-xs uppercase tracking-wider", children: "Speed" }), _jsx("div", { className: "px-1", children: playbackRates.map((rate) => (_jsx("button", { className: cn("w-full rounded px-3 py-1.5 text-left text-sm transition-colors hover:bg-gray-800", "text-white", playbackRate === rate && "bg-cyan-700/20 text-cyan-400"), onClick: () => onChangePlaybackRate(rate), children: rate === 1 ? "Normal" : `${rate}x` }, rate))) })] }))] }));
|
|
18
|
-
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
export const SubtitleDisplay = function SubtitleDisplay({ subtitlesEnabled, subtitleText }) {
|
|
3
|
-
if (!subtitlesEnabled || !subtitleText)
|
|
4
|
-
return null;
|
|
5
|
-
return (_jsx("div", { className: "pointer-events-none absolute right-0 bottom-20 left-0 px-4 text-center", children: _jsx("div", { className: "inline-block rounded bg-black/75 px-4 py-2 font-medium text-lg text-white", children: subtitleText }) }));
|
|
6
|
-
};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { formatTime } from "../../../../lib/format-time";
|
|
3
|
-
export const TimeDisplay = function TimeDisplay({ currentTime, duration }) {
|
|
4
|
-
return (_jsxs("div", { className: "font-mono text-sm text-white", children: [formatTime(currentTime), " / ", formatTime(duration)] }));
|
|
5
|
-
};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
export const VideoElement = function VideoElement({ videoRef, src, poster, subtitleSrc, subtitlesEnabled, crossOrigin, onTogglePlay }) {
|
|
3
|
-
return (_jsx("video", { ref: videoRef, src: src, poster: poster, crossOrigin: crossOrigin, className: "h-full w-full object-contain", onClick: onTogglePlay, children: subtitleSrc && (_jsx("track", { kind: "subtitles", src: subtitleSrc, default: subtitlesEnabled })) }));
|
|
4
|
-
};
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import React, { useCallback, useRef, useEffect } from "react";
|
|
3
|
-
import { cn } from "../../../../lib/utils";
|
|
4
|
-
import { defaultMinimalIcons } from "../../../icons";
|
|
5
|
-
export const VolumeControl = function VolumeControl({ volume, isMuted, showVolumeSlider, onToggleMute, onVolumeChange, onShowVolumeSlider, orientation = "horizontal", className }) {
|
|
6
|
-
const VolumeIcon = defaultMinimalIcons.volume;
|
|
7
|
-
const VolumeMutedIcon = defaultMinimalIcons.volumeMuted;
|
|
8
|
-
const sliderRefHorizontal = useRef(null);
|
|
9
|
-
const sliderRefVertical = useRef(null);
|
|
10
|
-
const isDragging = useRef(false);
|
|
11
|
-
const [isDraggingState, setIsDraggingState] = React.useState(false);
|
|
12
|
-
const [isHovering, setIsHovering] = React.useState(false);
|
|
13
|
-
const hideTimeoutRef = useRef(null);
|
|
14
|
-
const handleVolumeChange = useCallback((e) => {
|
|
15
|
-
const newVolume = parseFloat(e.target.value);
|
|
16
|
-
onVolumeChange(newVolume);
|
|
17
|
-
}, [onVolumeChange]);
|
|
18
|
-
const handleSliderClick = useCallback((e, isVertical) => {
|
|
19
|
-
const sliderRef = isVertical ? sliderRefVertical : sliderRefHorizontal;
|
|
20
|
-
if (!sliderRef.current)
|
|
21
|
-
return;
|
|
22
|
-
const rect = sliderRef.current.getBoundingClientRect();
|
|
23
|
-
let percentage;
|
|
24
|
-
if (!isVertical) {
|
|
25
|
-
percentage = Math.max(0, Math.min(1, (e.clientX - rect.left) / rect.width));
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
percentage = Math.max(0, Math.min(1, 1 - (e.clientY - rect.top) / rect.height));
|
|
29
|
-
}
|
|
30
|
-
onVolumeChange(percentage);
|
|
31
|
-
}, [onVolumeChange]);
|
|
32
|
-
const handleMouseDown = useCallback((e, isVertical) => {
|
|
33
|
-
e.preventDefault();
|
|
34
|
-
e.stopPropagation();
|
|
35
|
-
isDragging.current = true;
|
|
36
|
-
setIsDraggingState(true);
|
|
37
|
-
handleSliderClick(e, isVertical);
|
|
38
|
-
}, [handleSliderClick]);
|
|
39
|
-
useEffect(() => {
|
|
40
|
-
const handleMouseMove = (e) => {
|
|
41
|
-
if (!isDragging.current)
|
|
42
|
-
return;
|
|
43
|
-
const sliderRef = orientation === "vertical" ? sliderRefVertical : sliderRefHorizontal;
|
|
44
|
-
if (!sliderRef.current)
|
|
45
|
-
return;
|
|
46
|
-
const rect = sliderRef.current.getBoundingClientRect();
|
|
47
|
-
let percentage;
|
|
48
|
-
if (orientation === "horizontal") {
|
|
49
|
-
percentage = Math.max(0, Math.min(1, (e.clientX - rect.left) / rect.width));
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
percentage = Math.max(0, Math.min(1, 1 - (e.clientY - rect.top) / rect.height));
|
|
53
|
-
}
|
|
54
|
-
onVolumeChange(percentage);
|
|
55
|
-
};
|
|
56
|
-
const handleMouseUp = () => {
|
|
57
|
-
isDragging.current = false;
|
|
58
|
-
setIsDraggingState(false);
|
|
59
|
-
};
|
|
60
|
-
if (isDraggingState) {
|
|
61
|
-
document.addEventListener("mousemove", handleMouseMove);
|
|
62
|
-
document.addEventListener("mouseup", handleMouseUp);
|
|
63
|
-
return () => {
|
|
64
|
-
document.removeEventListener("mousemove", handleMouseMove);
|
|
65
|
-
document.removeEventListener("mouseup", handleMouseUp);
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
}, [isDraggingState, orientation, onVolumeChange]);
|
|
69
|
-
const handleMouseEnter = useCallback(() => {
|
|
70
|
-
if (hideTimeoutRef.current) {
|
|
71
|
-
clearTimeout(hideTimeoutRef.current);
|
|
72
|
-
}
|
|
73
|
-
setIsHovering(true);
|
|
74
|
-
onShowVolumeSlider(true);
|
|
75
|
-
}, [onShowVolumeSlider]);
|
|
76
|
-
const handleMouseLeave = useCallback(() => {
|
|
77
|
-
// Add a small delay before hiding to prevent flickering
|
|
78
|
-
hideTimeoutRef.current = setTimeout(() => {
|
|
79
|
-
if (!isDragging.current) {
|
|
80
|
-
setIsHovering(false);
|
|
81
|
-
onShowVolumeSlider(false);
|
|
82
|
-
}
|
|
83
|
-
}, 200);
|
|
84
|
-
}, [onShowVolumeSlider]);
|
|
85
|
-
// Clean up timeout on unmount
|
|
86
|
-
useEffect(() => {
|
|
87
|
-
return () => {
|
|
88
|
-
if (hideTimeoutRef.current) {
|
|
89
|
-
clearTimeout(hideTimeoutRef.current);
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
}, []);
|
|
93
|
-
const volumePercentage = (isMuted ? 0 : volume) * 100;
|
|
94
|
-
return (_jsxs("div", { className: cn("volume-control-wrapper", orientation === "vertical" ? "relative" : "flex items-center gap-2", className), onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, children: [orientation === "vertical" && (_jsx("div", { className: cn("volume-slider-vertical", "-translate-x-1/2 absolute bottom-full left-1/2 mb-2", "transition-all duration-300 ease-out", (showVolumeSlider || isHovering || isDraggingState)
|
|
95
|
-
? "pointer-events-auto translate-y-0 opacity-100"
|
|
96
|
-
: "pointer-events-none translate-y-2 opacity-0"), children: _jsxs("div", { className: "rounded-lg bg-black/80 p-3 backdrop-blur-sm", children: [_jsxs("div", { ref: sliderRefVertical, className: "volume-slider-track-vertical group", onMouseDown: (e) => handleMouseDown(e, true), onClick: (e) => handleSliderClick(e, true), children: [_jsx("div", { className: "volume-slider-fill-vertical pointer-events-none", style: { height: `${volumePercentage}%` } }), _jsx("div", { className: cn("volume-slider-thumb-vertical pointer-events-none", isDraggingState && "active"), style: { bottom: `${volumePercentage}%` } })] }), _jsxs("div", { className: "mt-2 text-center text-white/70 text-xs", children: [Math.round(volumePercentage), "%"] })] }) })), _jsx("button", { className: "minimal-btn h-10 w-10", onClick: onToggleMute, "aria-label": isMuted ? "Unmute" : "Mute", children: isMuted || volume === 0
|
|
97
|
-
? VolumeMutedIcon && _jsx(VolumeMutedIcon, { size: 20 })
|
|
98
|
-
: VolumeIcon && _jsx(VolumeIcon, { size: 20 }) }), orientation === "horizontal" && (_jsx("div", { className: cn("volume-slider-horizontal-wrapper", "overflow-hidden transition-all duration-300 ease-out", (showVolumeSlider || isHovering || isDraggingState) ? "w-24 opacity-100" : "w-0 opacity-0"), children: _jsxs("div", { ref: sliderRefHorizontal, className: "volume-slider-track-horizontal group", onMouseDown: (e) => handleMouseDown(e, false), onClick: (e) => handleSliderClick(e, false), children: [_jsx("div", { className: "volume-slider-fill-horizontal pointer-events-none", style: { width: `${volumePercentage}%` } }), _jsx("div", { className: cn("volume-slider-thumb-horizontal pointer-events-none", isDraggingState && "active"), style: { left: `${volumePercentage}%` } })] }) }))] }));
|
|
99
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export { MinimalMediaPlayer } from "./MinimalMediaPlayer";
|
|
2
|
-
export { MinimalControls } from "./MinimalControls";
|
|
3
|
-
export { MinimalPlayButton } from "./MinimalPlayButton";
|
|
4
|
-
export { MinimalSeekBar } from "./MinimalSeekBar";
|
|
5
|
-
export { MinimalVolumeControl } from "./MinimalVolumeControl";
|
|
6
|
-
export { MinimalOverlay } from "./MinimalOverlay";
|
|
7
|
-
export { MinimalLoading } from "./MinimalLoading";
|
|
8
|
-
export { SimpleMinimalPlayer } from "./SimpleMinimalPlayer";
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { forwardRef } from "react";
|
|
4
|
-
import { useKeyboardControls } from "../hooks/use-keyboard-controls";
|
|
5
|
-
import { useMediaPlayer } from "../hooks/use-media-player";
|
|
6
|
-
import { cn } from "../lib/utils";
|
|
7
|
-
export const VideoPlayer = forwardRef(({ src, poster, width = "100%", height = "auto", aspectRatio = "16/9", className, children, keyboardControls = true, showControls = true, customControls = false, crossOrigin, ...options }, ref) => {
|
|
8
|
-
const { state, controls, mediaRef, containerRef } = useMediaPlayer({
|
|
9
|
-
src,
|
|
10
|
-
crossOrigin,
|
|
11
|
-
...options
|
|
12
|
-
});
|
|
13
|
-
useKeyboardControls({
|
|
14
|
-
enabled: keyboardControls,
|
|
15
|
-
state,
|
|
16
|
-
controls
|
|
17
|
-
});
|
|
18
|
-
const renderSources = () => {
|
|
19
|
-
if (Array.isArray(src)) {
|
|
20
|
-
return src.map((source, index) => _jsx("source", { src: source }, index));
|
|
21
|
-
}
|
|
22
|
-
return null;
|
|
23
|
-
};
|
|
24
|
-
const containerStyle = {
|
|
25
|
-
width,
|
|
26
|
-
height,
|
|
27
|
-
aspectRatio: height === "auto" ? aspectRatio : undefined
|
|
28
|
-
};
|
|
29
|
-
const videoProps = {
|
|
30
|
-
ref: mediaRef,
|
|
31
|
-
controls: showControls && !customControls,
|
|
32
|
-
poster,
|
|
33
|
-
className: "w-full h-full object-contain bg-black",
|
|
34
|
-
...(Array.isArray(src) ? {} : { src })
|
|
35
|
-
};
|
|
36
|
-
return (_jsxs("div", { ref: ref || containerRef, style: containerStyle, className: cn("relative overflow-hidden bg-black", "focus-within:outline-none", className), tabIndex: 0, children: [_jsxs("video", { ...videoProps, children: [Array.isArray(src) && renderSources(), "Your browser does not support the video element."] }), state.error && (_jsx("div", { className: "absolute inset-0 flex items-center justify-center bg-black/80", children: _jsxs("div", { className: "text-center text-white", children: [_jsx("p", { className: "font-semibold text-lg", children: "Error" }), _jsx("p", { className: "text-sm opacity-80", children: state.error })] }) })), state.isLoading && (_jsx("div", { className: "absolute inset-0 flex items-center justify-center bg-black/50", children: _jsx("div", { className: "text-white", children: _jsx("div", { className: "h-8 w-8 animate-spin rounded-full border-white border-b-2" }) }) })), customControls && typeof children === "function" && (_jsx("div", { className: "pointer-events-none absolute inset-0", children: _jsx("div", { className: "pointer-events-auto", children: children({ state, controls }) }) })), customControls && typeof children !== "function" && children] }));
|
|
37
|
-
});
|
|
38
|
-
VideoPlayer.displayName = "VideoPlayer";
|