@therealtinhtute/baroiplayer 1.0.5 → 1.0.7
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/package.json +1 -1
- package/dist/src/components/media-player-error.tsx +2 -2
- package/dist/src/components/media-player-fullscreen.tsx +2 -2
- package/dist/src/components/media-player-play.tsx +2 -2
- package/dist/src/components/media-player-seek.tsx +1 -1
- package/dist/src/components/media-player-tooltip.tsx +1 -1
- package/dist/src/components/media-player-volume.tsx +3 -3
- package/dist/src/components/react-player-wrapper.tsx +5 -5
- package/dist/src/hooks/use-touch-gestures.ts +1 -1
- package/package.json +1 -1
- package/src/components/media-player-error.tsx +2 -2
- package/src/components/media-player-fullscreen.tsx +2 -2
- package/src/components/media-player-play.tsx +2 -2
- package/src/components/media-player-seek.tsx +1 -1
- package/src/components/media-player-tooltip.tsx +1 -1
- package/src/components/media-player-volume.tsx +3 -3
- package/src/components/react-player-wrapper.tsx +5 -5
- package/src/hooks/use-touch-gestures.ts +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,101 +0,0 @@
|
|
|
1
|
-
import { useEffect, useCallback, useRef } from 'react';
|
|
2
|
-
export function useKeyboardShortcuts({ shortcuts, enabled = true, target }) {
|
|
3
|
-
const shortcutsRef = useRef(shortcuts);
|
|
4
|
-
shortcutsRef.current = shortcuts;
|
|
5
|
-
const handleKeyDown = useCallback((event) => {
|
|
6
|
-
if (!enabled)
|
|
7
|
-
return;
|
|
8
|
-
// Don't trigger shortcuts when user is typing in inputs
|
|
9
|
-
if (event.target instanceof HTMLInputElement ||
|
|
10
|
-
event.target instanceof HTMLTextAreaElement ||
|
|
11
|
-
event.target?.contentEditable === 'true') {
|
|
12
|
-
return;
|
|
13
|
-
}
|
|
14
|
-
const shortcut = shortcutsRef.current.find(s => s.key.toLowerCase() === event.key.toLowerCase() &&
|
|
15
|
-
!!s.ctrlKey === event.ctrlKey &&
|
|
16
|
-
!!s.altKey === event.altKey &&
|
|
17
|
-
!!s.shiftKey === event.shiftKey);
|
|
18
|
-
if (shortcut) {
|
|
19
|
-
if (shortcut.preventDefault !== false) {
|
|
20
|
-
event.preventDefault();
|
|
21
|
-
}
|
|
22
|
-
shortcut.action();
|
|
23
|
-
}
|
|
24
|
-
}, [enabled]);
|
|
25
|
-
useEffect(() => {
|
|
26
|
-
const element = target || document;
|
|
27
|
-
element.addEventListener('keydown', handleKeyDown);
|
|
28
|
-
return () => {
|
|
29
|
-
element.removeEventListener('keydown', handleKeyDown);
|
|
30
|
-
};
|
|
31
|
-
}, [handleKeyDown, target]);
|
|
32
|
-
return {
|
|
33
|
-
shortcuts: shortcuts.map(s => ({
|
|
34
|
-
key: s.key,
|
|
35
|
-
description: s.description,
|
|
36
|
-
modifiers: {
|
|
37
|
-
ctrl: s.ctrlKey,
|
|
38
|
-
alt: s.altKey,
|
|
39
|
-
shift: s.shiftKey
|
|
40
|
-
}
|
|
41
|
-
}))
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
// Pre-defined media player shortcuts
|
|
45
|
-
export const createMediaKeyboardShortcuts = (controls) => [
|
|
46
|
-
{
|
|
47
|
-
key: ' ',
|
|
48
|
-
action: controls.togglePlayPause,
|
|
49
|
-
description: 'Play/Pause'
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
key: 'k',
|
|
53
|
-
action: controls.togglePlayPause,
|
|
54
|
-
description: 'Play/Pause (K)'
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
key: 'ArrowLeft',
|
|
58
|
-
action: () => controls.seekBackward(10),
|
|
59
|
-
description: 'Seek backward 10 seconds'
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
key: 'ArrowRight',
|
|
63
|
-
action: () => controls.seekForward(10),
|
|
64
|
-
description: 'Seek forward 10 seconds'
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
key: 'j',
|
|
68
|
-
action: () => controls.seekBackward(10),
|
|
69
|
-
description: 'Seek backward 10 seconds (J)'
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
key: 'l',
|
|
73
|
-
action: () => controls.seekForward(10),
|
|
74
|
-
description: 'Seek forward 10 seconds (L)'
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
key: 'ArrowUp',
|
|
78
|
-
action: controls.volumeUp,
|
|
79
|
-
description: 'Volume up'
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
key: 'ArrowDown',
|
|
83
|
-
action: controls.volumeDown,
|
|
84
|
-
description: 'Volume down'
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
key: 'm',
|
|
88
|
-
action: controls.toggleMute,
|
|
89
|
-
description: 'Toggle mute'
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
key: 'f',
|
|
93
|
-
action: controls.toggleFullscreen,
|
|
94
|
-
description: 'Toggle fullscreen'
|
|
95
|
-
},
|
|
96
|
-
...(controls.showHelp ? [{
|
|
97
|
-
key: '?',
|
|
98
|
-
action: controls.showHelp,
|
|
99
|
-
description: 'Show keyboard shortcuts help'
|
|
100
|
-
}] : [])
|
|
101
|
-
];
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
import { useRef, useCallback, useEffect } from 'react';
|
|
2
|
-
export function useScreenReader({ defaultPriority = 'polite', debounceMs = 100 } = {}) {
|
|
3
|
-
const liveRegionRef = useRef(null);
|
|
4
|
-
const timeoutRef = useRef();
|
|
5
|
-
// Create or get the live region for announcements
|
|
6
|
-
const getLiveRegion = useCallback((priority) => {
|
|
7
|
-
if (!liveRegionRef.current) {
|
|
8
|
-
const liveRegion = document.createElement('div');
|
|
9
|
-
liveRegion.setAttribute('aria-live', priority);
|
|
10
|
-
liveRegion.setAttribute('aria-atomic', 'true');
|
|
11
|
-
liveRegion.setAttribute('class', 'sr-only');
|
|
12
|
-
liveRegion.style.cssText = `
|
|
13
|
-
position: absolute !important;
|
|
14
|
-
width: 1px !important;
|
|
15
|
-
height: 1px !important;
|
|
16
|
-
padding: 0 !important;
|
|
17
|
-
margin: -1px !important;
|
|
18
|
-
overflow: hidden !important;
|
|
19
|
-
clip: rect(0, 0, 0, 0) !important;
|
|
20
|
-
white-space: nowrap !important;
|
|
21
|
-
border: 0 !important;
|
|
22
|
-
`;
|
|
23
|
-
document.body.appendChild(liveRegion);
|
|
24
|
-
liveRegionRef.current = liveRegion;
|
|
25
|
-
}
|
|
26
|
-
// Update priority if needed
|
|
27
|
-
if (liveRegionRef.current.getAttribute('aria-live') !== priority) {
|
|
28
|
-
liveRegionRef.current.setAttribute('aria-live', priority);
|
|
29
|
-
}
|
|
30
|
-
return liveRegionRef.current;
|
|
31
|
-
}, []);
|
|
32
|
-
// Announce a message to screen readers
|
|
33
|
-
const announce = useCallback((message, priority = defaultPriority) => {
|
|
34
|
-
if (!message.trim() || priority === 'off')
|
|
35
|
-
return;
|
|
36
|
-
// Clear existing timeout
|
|
37
|
-
if (timeoutRef.current) {
|
|
38
|
-
clearTimeout(timeoutRef.current);
|
|
39
|
-
}
|
|
40
|
-
// Debounce announcements
|
|
41
|
-
timeoutRef.current = setTimeout(() => {
|
|
42
|
-
const liveRegion = getLiveRegion(priority);
|
|
43
|
-
// Clear and then set the message to ensure it's announced
|
|
44
|
-
liveRegion.textContent = '';
|
|
45
|
-
// Use requestAnimationFrame to ensure the clear happens first
|
|
46
|
-
requestAnimationFrame(() => {
|
|
47
|
-
liveRegion.textContent = message;
|
|
48
|
-
});
|
|
49
|
-
}, debounceMs);
|
|
50
|
-
}, [defaultPriority, debounceMs, getLiveRegion]);
|
|
51
|
-
// Cleanup on unmount
|
|
52
|
-
useEffect(() => {
|
|
53
|
-
return () => {
|
|
54
|
-
if (timeoutRef.current) {
|
|
55
|
-
clearTimeout(timeoutRef.current);
|
|
56
|
-
}
|
|
57
|
-
if (liveRegionRef.current) {
|
|
58
|
-
document.body.removeChild(liveRegionRef.current);
|
|
59
|
-
liveRegionRef.current = null;
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
}, []);
|
|
63
|
-
return { announce };
|
|
64
|
-
}
|
|
65
|
-
// Hook specifically for media player screen reader announcements
|
|
66
|
-
export function useMediaScreenReader() {
|
|
67
|
-
const { announce } = useScreenReader({ defaultPriority: 'polite' });
|
|
68
|
-
// Announce playback state changes
|
|
69
|
-
const announcePlaybackState = useCallback((isPlaying) => {
|
|
70
|
-
announce(isPlaying ? 'Playing' : 'Paused', 'assertive');
|
|
71
|
-
}, [announce]);
|
|
72
|
-
// Announce volume changes
|
|
73
|
-
const announceVolume = useCallback((volume, isMuted) => {
|
|
74
|
-
if (isMuted) {
|
|
75
|
-
announce('Muted', 'assertive');
|
|
76
|
-
}
|
|
77
|
-
else {
|
|
78
|
-
const volumePercent = Math.round(volume * 100);
|
|
79
|
-
announce(`Volume ${volumePercent}%`, 'polite');
|
|
80
|
-
}
|
|
81
|
-
}, [announce]);
|
|
82
|
-
// Announce time position changes
|
|
83
|
-
const announceTime = useCallback((currentTime, duration) => {
|
|
84
|
-
const formatTime = (seconds) => {
|
|
85
|
-
const hours = Math.floor(seconds / 3600);
|
|
86
|
-
const minutes = Math.floor((seconds % 3600) / 60);
|
|
87
|
-
const secs = Math.floor(seconds % 60);
|
|
88
|
-
if (hours > 0) {
|
|
89
|
-
return `${hours}:${minutes.toString().padStart(2, '0')}:${secs.toString().padStart(2, '0')}`;
|
|
90
|
-
}
|
|
91
|
-
return `${minutes}:${secs.toString().padStart(2, '0')}`;
|
|
92
|
-
};
|
|
93
|
-
const current = formatTime(currentTime);
|
|
94
|
-
const total = formatTime(duration);
|
|
95
|
-
announce(`${current} of ${total}`, 'polite');
|
|
96
|
-
}, [announce]);
|
|
97
|
-
// Announce fullscreen state changes
|
|
98
|
-
const announceFullscreen = useCallback((isFullscreen) => {
|
|
99
|
-
announce(isFullscreen ? 'Entered fullscreen' : 'Exited fullscreen', 'assertive');
|
|
100
|
-
}, [announce]);
|
|
101
|
-
// Announce subtitle state changes
|
|
102
|
-
const announceSubtitles = useCallback((enabled, language) => {
|
|
103
|
-
if (enabled) {
|
|
104
|
-
announce(language ? `Subtitles enabled in ${language}` : 'Subtitles enabled', 'assertive');
|
|
105
|
-
}
|
|
106
|
-
else {
|
|
107
|
-
announce('Subtitles disabled', 'assertive');
|
|
108
|
-
}
|
|
109
|
-
}, [announce]);
|
|
110
|
-
// Announce playback speed changes
|
|
111
|
-
const announcePlaybackSpeed = useCallback((speed) => {
|
|
112
|
-
if (speed === 1) {
|
|
113
|
-
announce('Normal playback speed', 'assertive');
|
|
114
|
-
}
|
|
115
|
-
else {
|
|
116
|
-
announce(`Playback speed ${speed}x`, 'assertive');
|
|
117
|
-
}
|
|
118
|
-
}, [announce]);
|
|
119
|
-
// Announce quality changes
|
|
120
|
-
const announceQuality = useCallback((quality) => {
|
|
121
|
-
announce(`Quality changed to ${quality}`, 'polite');
|
|
122
|
-
}, [announce]);
|
|
123
|
-
// Announce loading state
|
|
124
|
-
const announceLoading = useCallback((isLoading) => {
|
|
125
|
-
announce(isLoading ? 'Loading...' : 'Loading complete', 'polite');
|
|
126
|
-
}, [announce]);
|
|
127
|
-
// Announce errors
|
|
128
|
-
const announceError = useCallback((error) => {
|
|
129
|
-
announce(`Error: ${error}`, 'assertive');
|
|
130
|
-
}, [announce]);
|
|
131
|
-
// Announce buffering state
|
|
132
|
-
const announceBuffering = useCallback((isBuffering) => {
|
|
133
|
-
announce(isBuffering ? 'Buffering...' : 'Buffering complete', 'polite');
|
|
134
|
-
}, [announce]);
|
|
135
|
-
return {
|
|
136
|
-
announce,
|
|
137
|
-
announcePlaybackState,
|
|
138
|
-
announceVolume,
|
|
139
|
-
announceTime,
|
|
140
|
-
announceFullscreen,
|
|
141
|
-
announceSubtitles,
|
|
142
|
-
announcePlaybackSpeed,
|
|
143
|
-
announceQuality,
|
|
144
|
-
announceLoading,
|
|
145
|
-
announceError,
|
|
146
|
-
announceBuffering
|
|
147
|
-
};
|
|
148
|
-
}
|
package/src/hooks/core/index.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
// Core Media Player Hooks
|
|
2
|
-
export { useKeyboardControls } from "../use-keyboard-controls";
|
|
3
|
-
export { useMediaPlayer } from "../use-media-player";
|
|
4
|
-
// Media State Hooks
|
|
5
|
-
export { useAdaptiveMediaState, useEnhancedMediaState, useMediaState } from "../use-media-state";
|
|
6
|
-
// React 19 Advanced Hooks
|
|
7
|
-
export { useMediaActions, useMediaActionState } from "../use-media-actions";
|
|
8
|
-
export { useMediaOptimistic, useMediaStateComparison, useOptimisticUpdates } from "../use-media-optimistic";
|
|
9
|
-
// Mobile-First Touch Gestures
|
|
10
|
-
export { useMediaGestures, useTouchGestures } from "../use-touch-gestures";
|
|
11
|
-
// Refactored Hooks (React 19 optimized)
|
|
12
|
-
export { useVideoPlayer } from "../useVideoPlayer";
|
|
13
|
-
export { useSubtitles } from "../useSubtitles";
|
|
14
|
-
export { useEnhancedSubtitles } from "../useEnhancedSubtitles";
|
|
15
|
-
export { useMediaControls } from "../useMediaControls";
|
|
16
|
-
export { useScreenshot } from "../useScreenshot";
|
|
17
|
-
// Specialized hooks
|
|
18
|
-
export { useMediaMetadata } from "../use-media-metadata";
|
|
19
|
-
export { useOptimisticControls } from "../use-optimistic-controls";
|
package/src/hooks/legacy.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Legacy Hooks (Deprecated)
|
|
3
|
-
* These hooks are wrapped with deprecation warnings
|
|
4
|
-
*/
|
|
5
|
-
import { showDeprecationWarning } from "../lib/deprecation";
|
|
6
|
-
// Import current hooks
|
|
7
|
-
import { useMediaPlayer } from "./use-media-player";
|
|
8
|
-
import { useSubtitles } from "./useSubtitles";
|
|
9
|
-
// Legacy hook wrappers with deprecation warnings
|
|
10
|
-
export function useVideoPlayer(props) {
|
|
11
|
-
showDeprecationWarning("useVideoPlayer", "useMediaPlayer (the primary media player hook)");
|
|
12
|
-
return useMediaPlayer(props);
|
|
13
|
-
}
|
|
14
|
-
export function useEnhancedSubtitles(props) {
|
|
15
|
-
showDeprecationWarning("useEnhancedSubtitles", "useSubtitles (the current subtitle hook)");
|
|
16
|
-
return useSubtitles(props);
|
|
17
|
-
}
|
|
@@ -1,395 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import React, { useCallback, useEffect, useRef, useMemo, useTransition, useOptimistic } from "react";
|
|
3
|
-
import { useMediaStore, useMediaSelector } from "../context/media-context";
|
|
4
|
-
import { useMediaOptimistic } from "./use-media-optimistic";
|
|
5
|
-
import { useMediaActions } from "./use-media-actions";
|
|
6
|
-
// Performance-optimized media player hook with React 19 features
|
|
7
|
-
export function useEnhancedMediaPlayer(options) {
|
|
8
|
-
const mediaRef = useRef(null);
|
|
9
|
-
const containerRef = useRef(null);
|
|
10
|
-
// React 19 concurrent features
|
|
11
|
-
const [isPending, startTransition] = useTransition();
|
|
12
|
-
const [isSeeking, startSeekTransition] = useTransition();
|
|
13
|
-
// Performance monitoring
|
|
14
|
-
const renderStartTime = React.useRef(0);
|
|
15
|
-
const frameCount = React.useRef(0);
|
|
16
|
-
const lastFrameTime = React.useRef(0);
|
|
17
|
-
// Throttled time update
|
|
18
|
-
const timeUpdateTimeoutRef = useRef();
|
|
19
|
-
const lastTimeUpdate = useRef(0);
|
|
20
|
-
// Store integration
|
|
21
|
-
const store = useMediaStore();
|
|
22
|
-
const isEnhanced = 'getOptimisticState' in store;
|
|
23
|
-
// Select only the state we need to minimize re-renders
|
|
24
|
-
const isPlaying = useMediaSelector(state => state.isPlaying);
|
|
25
|
-
const currentTime = useMediaSelector(state => state.currentTime);
|
|
26
|
-
const duration = useMediaSelector(state => state.duration);
|
|
27
|
-
const volume = useMediaSelector(state => state.volume);
|
|
28
|
-
const isMuted = useMediaSelector(state => state.isMuted);
|
|
29
|
-
const isLoading = useMediaSelector(state => state.isLoading);
|
|
30
|
-
const isBuffering = useMediaSelector(state => state.isBuffering);
|
|
31
|
-
const error = useMediaSelector(state => state.error);
|
|
32
|
-
const buffered = useMediaSelector(state => state.buffered);
|
|
33
|
-
const isFullscreen = useMediaSelector(state => state.isFullscreen);
|
|
34
|
-
// Enhanced features if available
|
|
35
|
-
const enhancedStore = store;
|
|
36
|
-
const optimisticState = isEnhanced ? useMediaOptimistic(enhancedStore) : null;
|
|
37
|
-
const actions = isEnhanced ? useMediaActions(enhancedStore) : null;
|
|
38
|
-
// Performance state
|
|
39
|
-
const [performanceMetrics, setPerformanceMetrics] = React.useState({
|
|
40
|
-
frameRate: 0,
|
|
41
|
-
averageRenderTime: 0,
|
|
42
|
-
droppedFrames: 0,
|
|
43
|
-
bufferHealth: 0
|
|
44
|
-
});
|
|
45
|
-
// Optimistic state updates for immediate UI feedback
|
|
46
|
-
const [optimisticVolume, setOptimisticVolume] = useOptimistic(volume, (state, newVolume) => {
|
|
47
|
-
return Math.max(0, Math.min(1, newVolume));
|
|
48
|
-
});
|
|
49
|
-
const [optimisticTime, setOptimisticTime] = useOptimistic(currentTime, (state, newTime) => {
|
|
50
|
-
return Math.max(0, Math.min(duration || 0, newTime));
|
|
51
|
-
});
|
|
52
|
-
// Initialize media element with performance optimizations
|
|
53
|
-
useEffect(() => {
|
|
54
|
-
const media = mediaRef.current;
|
|
55
|
-
if (!media)
|
|
56
|
-
return;
|
|
57
|
-
// Set initial properties
|
|
58
|
-
const initProps = {
|
|
59
|
-
volume: options.volume,
|
|
60
|
-
muted: options.muted,
|
|
61
|
-
autoplay: options.autoPlay,
|
|
62
|
-
loop: options.loop,
|
|
63
|
-
preload: options.preload,
|
|
64
|
-
crossOrigin: options.crossOrigin
|
|
65
|
-
};
|
|
66
|
-
Object.entries(initProps).forEach(([key, value]) => {
|
|
67
|
-
if (value !== undefined) {
|
|
68
|
-
media[key] = value;
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
// Performance optimizations
|
|
72
|
-
media.setAttribute('preload', options.preloadStrategy === 'eager' ? 'auto' : 'metadata');
|
|
73
|
-
if (options.bufferingStrategy === 'aggressive') {
|
|
74
|
-
media.setAttribute('buffered', 'auto');
|
|
75
|
-
}
|
|
76
|
-
// Hardware acceleration
|
|
77
|
-
if (media instanceof HTMLVideoElement) {
|
|
78
|
-
media.style.willChange = 'transform';
|
|
79
|
-
media.style.transform = 'translateZ(0)';
|
|
80
|
-
}
|
|
81
|
-
}, [
|
|
82
|
-
options.volume,
|
|
83
|
-
options.muted,
|
|
84
|
-
options.autoPlay,
|
|
85
|
-
options.loop,
|
|
86
|
-
options.preload,
|
|
87
|
-
options.crossOrigin,
|
|
88
|
-
options.preloadStrategy,
|
|
89
|
-
options.bufferingStrategy
|
|
90
|
-
]);
|
|
91
|
-
// Optimized event handlers with React 19 patterns
|
|
92
|
-
const handleTimeUpdate = useCallback(() => {
|
|
93
|
-
const media = mediaRef.current;
|
|
94
|
-
if (!media)
|
|
95
|
-
return;
|
|
96
|
-
const now = performance.now();
|
|
97
|
-
// Throttle time updates for performance
|
|
98
|
-
if (options.enableTimeUpdateThrottling !== false) {
|
|
99
|
-
if (now - lastTimeUpdate.current < (options.timeUpdateThrottleMs || 100)) {
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
|
-
lastTimeUpdate.current = now;
|
|
103
|
-
}
|
|
104
|
-
startTransition(() => {
|
|
105
|
-
if (isEnhanced && actions) {
|
|
106
|
-
actions.setCurrentTime(media.currentTime);
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
|
-
}, [options.enableTimeUpdateThrottling, options.timeUpdateThrottleMs, isEnhanced, actions]);
|
|
110
|
-
const handlePlay = useCallback(() => {
|
|
111
|
-
startTransition(() => {
|
|
112
|
-
if (isEnhanced && actions) {
|
|
113
|
-
actions.play(true); // Optimistic update
|
|
114
|
-
}
|
|
115
|
-
});
|
|
116
|
-
options.onPlay?.();
|
|
117
|
-
}, [isEnhanced, actions, options.onPlay]);
|
|
118
|
-
const handlePause = useCallback(() => {
|
|
119
|
-
startTransition(() => {
|
|
120
|
-
if (isEnhanced && actions) {
|
|
121
|
-
actions.pause(true); // Optimistic update
|
|
122
|
-
}
|
|
123
|
-
});
|
|
124
|
-
options.onPause?.();
|
|
125
|
-
}, [isEnhanced, actions, options.onPause]);
|
|
126
|
-
const handleVolumeChange = useCallback(() => {
|
|
127
|
-
const media = mediaRef.current;
|
|
128
|
-
if (!media)
|
|
129
|
-
return;
|
|
130
|
-
startTransition(() => {
|
|
131
|
-
if (isEnhanced && actions) {
|
|
132
|
-
actions.setVolume(media.volume, true); // Optimistic update
|
|
133
|
-
media.muted ? actions.mute(true) : actions.unmute(true);
|
|
134
|
-
}
|
|
135
|
-
});
|
|
136
|
-
}, [isEnhanced, actions]);
|
|
137
|
-
const handleSeeking = useCallback(() => {
|
|
138
|
-
startSeekTransition(() => {
|
|
139
|
-
// Seek operations get their own transition
|
|
140
|
-
});
|
|
141
|
-
}, []);
|
|
142
|
-
const handleSeeked = useCallback(() => {
|
|
143
|
-
// Seek completed
|
|
144
|
-
}, []);
|
|
145
|
-
const handleProgress = useCallback(() => {
|
|
146
|
-
const media = mediaRef.current;
|
|
147
|
-
if (!media)
|
|
148
|
-
return;
|
|
149
|
-
startTransition(() => {
|
|
150
|
-
if (isEnhanced && actions) {
|
|
151
|
-
actions.setBuffered(media.buffered);
|
|
152
|
-
}
|
|
153
|
-
});
|
|
154
|
-
}, [isEnhanced, actions]);
|
|
155
|
-
// Performance monitoring
|
|
156
|
-
const measureRenderTime = useCallback(() => {
|
|
157
|
-
const now = performance.now();
|
|
158
|
-
const deltaTime = now - lastFrameTime.current;
|
|
159
|
-
if (deltaTime > 0) {
|
|
160
|
-
frameCount.current++;
|
|
161
|
-
// Calculate frame rate every second
|
|
162
|
-
if (frameCount.current >= 60) {
|
|
163
|
-
const fps = Math.round((frameCount.current * 1000) / (now - lastFrameTime.current));
|
|
164
|
-
setPerformanceMetrics(prev => ({
|
|
165
|
-
...prev,
|
|
166
|
-
frameRate: fps,
|
|
167
|
-
droppedFrames: Math.max(0, 60 - fps)
|
|
168
|
-
}));
|
|
169
|
-
frameCount.current = 0;
|
|
170
|
-
lastFrameTime.current = now;
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
}, []);
|
|
174
|
-
// Attach event listeners with performance optimization
|
|
175
|
-
useEffect(() => {
|
|
176
|
-
const media = mediaRef.current;
|
|
177
|
-
if (!media)
|
|
178
|
-
return;
|
|
179
|
-
// Use passive listeners where possible for better performance
|
|
180
|
-
const eventListeners = [
|
|
181
|
-
{ event: "timeupdate", handler: handleTimeUpdate, passive: true },
|
|
182
|
-
{ event: "play", handler: handlePlay },
|
|
183
|
-
{ event: "pause", handler: handlePause },
|
|
184
|
-
{ event: "volumechange", handler: handleVolumeChange },
|
|
185
|
-
{ event: "seeking", handler: handleSeeking },
|
|
186
|
-
{ event: "seeked", handler: handleSeeked },
|
|
187
|
-
{ event: "progress", handler: handleProgress, passive: true },
|
|
188
|
-
{ event: "loadedmetadata", handler: () => measureRenderTime() },
|
|
189
|
-
{ event: "loadeddata", handler: () => measureRenderTime() }
|
|
190
|
-
];
|
|
191
|
-
eventListeners.forEach(({ event, handler, passive }) => {
|
|
192
|
-
const options = passive ? { passive: true } : {};
|
|
193
|
-
media.addEventListener(event, handler, options);
|
|
194
|
-
});
|
|
195
|
-
// Performance monitoring frame loop
|
|
196
|
-
let rafId;
|
|
197
|
-
const performanceLoop = () => {
|
|
198
|
-
measureRenderTime();
|
|
199
|
-
rafId = requestAnimationFrame(performanceLoop);
|
|
200
|
-
};
|
|
201
|
-
if (options.enablePerformanceMonitoring) {
|
|
202
|
-
performanceLoop();
|
|
203
|
-
}
|
|
204
|
-
return () => {
|
|
205
|
-
eventListeners.forEach(({ event, handler }) => {
|
|
206
|
-
media.removeEventListener(event, handler);
|
|
207
|
-
});
|
|
208
|
-
if (rafId) {
|
|
209
|
-
cancelAnimationFrame(rafId);
|
|
210
|
-
}
|
|
211
|
-
};
|
|
212
|
-
}, [
|
|
213
|
-
handleTimeUpdate,
|
|
214
|
-
handlePlay,
|
|
215
|
-
handlePause,
|
|
216
|
-
handleVolumeChange,
|
|
217
|
-
handleSeeking,
|
|
218
|
-
handleSeeked,
|
|
219
|
-
handleProgress,
|
|
220
|
-
measureRenderTime,
|
|
221
|
-
options.enablePerformanceMonitoring
|
|
222
|
-
]);
|
|
223
|
-
// Optimized control functions with React 19 features
|
|
224
|
-
const controls = useMemo(() => {
|
|
225
|
-
const play = async () => {
|
|
226
|
-
const media = mediaRef.current;
|
|
227
|
-
if (!media)
|
|
228
|
-
return;
|
|
229
|
-
if (isEnhanced && actions) {
|
|
230
|
-
await actions.play(true); // Optimistic
|
|
231
|
-
}
|
|
232
|
-
else {
|
|
233
|
-
try {
|
|
234
|
-
await media.play();
|
|
235
|
-
}
|
|
236
|
-
catch (error) {
|
|
237
|
-
console.error("Failed to play media:", error);
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
};
|
|
241
|
-
const pause = () => {
|
|
242
|
-
const media = mediaRef.current;
|
|
243
|
-
if (!media)
|
|
244
|
-
return;
|
|
245
|
-
if (isEnhanced && actions) {
|
|
246
|
-
actions.pause(true); // Optimistic
|
|
247
|
-
}
|
|
248
|
-
else {
|
|
249
|
-
media.pause();
|
|
250
|
-
}
|
|
251
|
-
};
|
|
252
|
-
const toggle = () => {
|
|
253
|
-
if (isPlaying) {
|
|
254
|
-
pause();
|
|
255
|
-
}
|
|
256
|
-
else {
|
|
257
|
-
play();
|
|
258
|
-
}
|
|
259
|
-
};
|
|
260
|
-
const seek = (time) => {
|
|
261
|
-
const media = mediaRef.current;
|
|
262
|
-
if (!media)
|
|
263
|
-
return;
|
|
264
|
-
const clampedTime = Math.max(0, Math.min(time, duration || 0));
|
|
265
|
-
if (isEnhanced && actions) {
|
|
266
|
-
startSeekTransition(() => {
|
|
267
|
-
actions.seek(clampedTime, true); // Optimistic
|
|
268
|
-
});
|
|
269
|
-
}
|
|
270
|
-
else {
|
|
271
|
-
media.currentTime = clampedTime;
|
|
272
|
-
}
|
|
273
|
-
};
|
|
274
|
-
const setVolume = (volume) => {
|
|
275
|
-
const media = mediaRef.current;
|
|
276
|
-
if (!media)
|
|
277
|
-
return;
|
|
278
|
-
const clampedVolume = Math.max(0, Math.min(1, volume));
|
|
279
|
-
if (isEnhanced && actions) {
|
|
280
|
-
setOptimisticVolume(clampedVolume);
|
|
281
|
-
startTransition(() => {
|
|
282
|
-
actions.setVolume(clampedVolume, true);
|
|
283
|
-
});
|
|
284
|
-
}
|
|
285
|
-
else {
|
|
286
|
-
media.volume = clampedVolume;
|
|
287
|
-
}
|
|
288
|
-
};
|
|
289
|
-
const toggleMute = () => {
|
|
290
|
-
const media = mediaRef.current;
|
|
291
|
-
if (!media)
|
|
292
|
-
return;
|
|
293
|
-
if (isEnhanced && actions) {
|
|
294
|
-
actions.toggleMute(true); // Optimistic
|
|
295
|
-
}
|
|
296
|
-
else {
|
|
297
|
-
media.muted = !media.muted;
|
|
298
|
-
}
|
|
299
|
-
};
|
|
300
|
-
const enterFullscreen = async () => {
|
|
301
|
-
const container = containerRef.current;
|
|
302
|
-
if (!container || !document.fullscreenEnabled)
|
|
303
|
-
return;
|
|
304
|
-
try {
|
|
305
|
-
await container.requestFullscreen();
|
|
306
|
-
if (isEnhanced && actions) {
|
|
307
|
-
actions.enterFullscreen(true);
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
catch (error) {
|
|
311
|
-
console.error("Failed to enter fullscreen:", error);
|
|
312
|
-
}
|
|
313
|
-
};
|
|
314
|
-
const exitFullscreen = async () => {
|
|
315
|
-
if (!document.fullscreenElement)
|
|
316
|
-
return;
|
|
317
|
-
try {
|
|
318
|
-
await document.exitFullscreen();
|
|
319
|
-
if (isEnhanced && actions) {
|
|
320
|
-
actions.exitFullscreen(true);
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
catch (error) {
|
|
324
|
-
console.error("Failed to exit fullscreen:", error);
|
|
325
|
-
}
|
|
326
|
-
};
|
|
327
|
-
return {
|
|
328
|
-
play,
|
|
329
|
-
pause,
|
|
330
|
-
toggle,
|
|
331
|
-
seek,
|
|
332
|
-
setVolume,
|
|
333
|
-
toggleMute,
|
|
334
|
-
enterFullscreen,
|
|
335
|
-
exitFullscreen
|
|
336
|
-
};
|
|
337
|
-
}, [
|
|
338
|
-
isPlaying,
|
|
339
|
-
duration,
|
|
340
|
-
isEnhanced,
|
|
341
|
-
actions,
|
|
342
|
-
startTransition,
|
|
343
|
-
startSeekTransition,
|
|
344
|
-
setOptimisticVolume
|
|
345
|
-
]);
|
|
346
|
-
// Computed state
|
|
347
|
-
const computedState = useMemo(() => ({
|
|
348
|
-
isPlaying: optimisticState?.isPlaying ?? isPlaying,
|
|
349
|
-
currentTime: optimisticState?.currentTime ?? currentTime,
|
|
350
|
-
duration: optimisticState?.duration ?? duration,
|
|
351
|
-
volume: optimisticState?.volume ?? optimisticVolume,
|
|
352
|
-
isMuted: optimisticState?.isMuted ?? isMuted,
|
|
353
|
-
isLoading: optimisticState?.isBuffering ?? isLoading,
|
|
354
|
-
isBuffering: optimisticState?.isBuffering ?? isBuffering,
|
|
355
|
-
error: optimisticState?.error ?? error,
|
|
356
|
-
buffered: optimisticState?.buffered ?? buffered,
|
|
357
|
-
isFullscreen: optimisticState?.isFullscreen ?? isFullscreen,
|
|
358
|
-
progress: duration > 0 ? currentTime / duration : 0,
|
|
359
|
-
isTransitioning: isPending || isSeeking,
|
|
360
|
-
canPlay: !isLoading && !isBuffering && !error
|
|
361
|
-
}), [
|
|
362
|
-
optimisticState,
|
|
363
|
-
isPlaying,
|
|
364
|
-
currentTime,
|
|
365
|
-
duration,
|
|
366
|
-
optimisticVolume,
|
|
367
|
-
isMuted,
|
|
368
|
-
isLoading,
|
|
369
|
-
isBuffering,
|
|
370
|
-
error,
|
|
371
|
-
buffered,
|
|
372
|
-
isFullscreen,
|
|
373
|
-
isPending,
|
|
374
|
-
isSeeking
|
|
375
|
-
]);
|
|
376
|
-
return {
|
|
377
|
-
// Refs
|
|
378
|
-
mediaRef,
|
|
379
|
-
containerRef,
|
|
380
|
-
// State
|
|
381
|
-
state: computedState,
|
|
382
|
-
actualState: optimisticState?.actualState,
|
|
383
|
-
// Controls
|
|
384
|
-
controls,
|
|
385
|
-
// Performance metrics
|
|
386
|
-
performanceMetrics,
|
|
387
|
-
isTransitioning: isPending || isSeeking,
|
|
388
|
-
// Enhanced features
|
|
389
|
-
actions: optimisticState?.actions,
|
|
390
|
-
actionState: optimisticState?.actionState,
|
|
391
|
-
// Optimistic features
|
|
392
|
-
optimisticState,
|
|
393
|
-
isEnhanced
|
|
394
|
-
};
|
|
395
|
-
}
|