@therealtinhtute/baroiplayer 1.0.8 → 1.2.0
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/LICENSE +2 -2
- package/README.md +15 -15
- package/dist/context/media.js +2 -0
- package/dist/context/media.js.map +1 -0
- package/dist/context/media.mjs +15 -0
- package/dist/context/media.mjs.map +1 -0
- package/dist/context/store.js +2 -0
- package/dist/context/store.js.map +1 -0
- package/dist/context/store.mjs +5 -0
- package/dist/context/store.mjs.map +1 -0
- package/dist/context-BYwDoSRX.js +1172 -0
- package/dist/context-BYwDoSRX.js.map +1 -0
- package/dist/context-eNS62_ac.cjs +23 -0
- package/dist/context-eNS62_ac.cjs.map +1 -0
- package/dist/core-events-B1iM2F46.cjs +2 -0
- package/dist/core-events-B1iM2F46.cjs.map +1 -0
- package/dist/core-events-DunPHKRE.js +484 -0
- package/dist/core-events-DunPHKRE.js.map +1 -0
- package/dist/core-plugins-By-4-kGs.cjs +2 -0
- package/dist/core-plugins-By-4-kGs.cjs.map +1 -0
- package/dist/core-plugins-DSBWcTuX.js +821 -0
- package/dist/core-plugins-DSBWcTuX.js.map +1 -0
- package/dist/core.js +37 -0
- package/dist/core.js.map +1 -0
- package/dist/core.mjs +1233 -0
- package/dist/core.mjs.map +1 -0
- package/dist/enhanced-components-B_l3cist.js +1142 -0
- package/dist/enhanced-components-B_l3cist.js.map +1 -0
- package/dist/enhanced-components-BspFs9OO.cjs +2 -0
- package/dist/enhanced-components-BspFs9OO.cjs.map +1 -0
- package/dist/hooks-BXwI8QG6.cjs +4 -0
- package/dist/hooks-BXwI8QG6.cjs.map +1 -0
- package/dist/hooks-Bpi-jDiO.js +1816 -0
- package/dist/hooks-Bpi-jDiO.js.map +1 -0
- package/dist/index.css +1 -102
- package/dist/index.js +112 -21
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +6273 -16
- package/dist/index.mjs.map +1 -0
- package/dist/minimal-components-C4z900Ro.js +1926 -0
- package/dist/minimal-components-C4z900Ro.js.map +1 -0
- package/dist/minimal-components-v4qBp6jv.cjs +2 -0
- package/dist/minimal-components-v4qBp6jv.cjs.map +1 -0
- package/dist/minimal-components.css +1 -589
- package/dist/mona-loading.gif +0 -0
- package/dist/performance-monitor-C5k6FDXw.js +301 -0
- package/dist/performance-monitor-C5k6FDXw.js.map +1 -0
- package/dist/performance-monitor-lJmuUjQQ.cjs +2 -0
- package/dist/performance-monitor-lJmuUjQQ.cjs.map +1 -0
- package/dist/utils-CFOue_9K.cjs +9 -0
- package/dist/utils-CFOue_9K.cjs.map +1 -0
- package/dist/utils-Dzpl2ArK.js +2844 -0
- package/dist/utils-Dzpl2ArK.js.map +1 -0
- package/dist/utils.js +2 -0
- package/dist/utils.js.map +1 -0
- package/dist/utils.mjs +11 -0
- package/dist/utils.mjs.map +1 -0
- package/package.json +11 -40
- package/src/adapters/videojs-adapter.tsx +441 -441
- package/src/components/AnimateLoading.tsx +85 -93
- package/src/components/LoadingState.tsx +199 -208
- package/src/components/__tests__/media-player-accessibility.test.tsx +510 -0
- package/src/components/__tests__/media-player-react19.test.tsx +457 -0
- package/src/components/accessibility/keyboard-help-overlay.tsx +201 -207
- package/src/components/basic/index.ts +28 -28
- package/src/components/enhanced/advanced-features.tsx +49 -54
- package/src/components/enhanced/debug-panel.tsx +148 -122
- package/src/components/enhanced/enhanced-controls.tsx +117 -120
- package/src/components/enhanced/enhanced-media-player.tsx +281 -224
- package/src/components/enhanced/error-handling.tsx +50 -57
- package/src/components/enhanced/index.ts +27 -27
- package/src/components/enhanced/media-player-enhanced.tsx +117 -83
- package/src/components/examples/basic-video-player.tsx +35 -40
- package/src/components/examples/enhanced-controls-example.tsx +16 -30
- package/src/components/examples/enhanced-media-player-example.tsx +196 -187
- package/src/components/examples/loading-states-demo.tsx +113 -113
- package/src/components/examples/react-19-demo.tsx +88 -116
- package/src/components/examples/volume-orientation-demo.tsx +77 -85
- package/src/components/icon-demo.tsx +189 -202
- package/src/components/icons/svg-icons/ArrowLeftIcon.tsx +13 -13
- package/src/components/icons/svg-icons/ArrowRightIcon.tsx +13 -13
- package/src/components/icons/svg-icons/AudioIcon.tsx +16 -16
- package/src/components/icons/svg-icons/BackwardIcon.tsx +7 -7
- package/src/components/icons/svg-icons/CameraIcon.tsx +13 -13
- package/src/components/icons/svg-icons/CheckIcon.tsx +13 -13
- package/src/components/icons/svg-icons/EnablePiPIcon.tsx +13 -13
- package/src/components/icons/svg-icons/ForwardIcon.tsx +7 -7
- package/src/components/icons/svg-icons/FullscreenEnterIcon.tsx +18 -18
- package/src/components/icons/svg-icons/FullscreenExitIcon.tsx +18 -18
- package/src/components/icons/svg-icons/LoadingIcon.tsx +27 -27
- package/src/components/icons/svg-icons/PauseIcon.tsx +18 -18
- package/src/components/icons/svg-icons/PlayIcon.tsx +16 -16
- package/src/components/icons/svg-icons/PlaybackSpeedIcon.tsx +18 -18
- package/src/components/icons/svg-icons/QualityIcon.tsx +16 -16
- package/src/components/icons/svg-icons/SettingsIcon.tsx +7 -7
- package/src/components/icons/svg-icons/SliderIcon.tsx +16 -16
- package/src/components/icons/svg-icons/SubtitleIcon.tsx +16 -16
- package/src/components/icons/svg-icons/SubtitleOffIcon.tsx +20 -20
- package/src/components/icons/svg-icons/UnPiPIcon.tsx +13 -13
- package/src/components/icons/svg-icons/VolumeMutedIcon.tsx +11 -11
- package/src/components/icons/svg-icons/VolumeOneIcon.tsx +17 -17
- package/src/components/icons/svg-icons/VolumeThreeIcon.tsx +11 -11
- package/src/components/icons/svg-icons/VolumeTwoIcon.tsx +11 -11
- package/src/components/legacy.tsx +14 -20
- package/src/components/media-metadata-display.tsx +78 -79
- package/src/components/media-player-controls.tsx +37 -40
- package/src/components/media-player-error.tsx +2 -2
- package/src/components/media-player-fullscreen.tsx +2 -2
- package/src/components/media-player-hls.tsx +89 -89
- package/src/components/media-player-play.tsx +2 -2
- package/src/components/media-player-root.tsx +20 -22
- package/src/components/media-player-seek.tsx +1 -1
- package/src/components/media-player-tooltip.tsx +1 -1
- package/src/components/media-player-video.tsx +21 -6
- package/src/components/media-player-volume.tsx +3 -3
- package/src/components/media-player.tsx +209 -174
- package/src/components/media-suspense.tsx +71 -89
- package/src/components/player-settings-form.tsx +143 -148
- package/src/components/react-player-wrapper.tsx +23 -23
- package/src/components/simple-video-player.tsx +53 -51
- package/src/components/ui/blur-poster.tsx +93 -0
- package/src/components/ui/empty-state.tsx +91 -0
- package/src/components/ui/enhanced-seek-bar.tsx +77 -58
- package/src/components/ui/error-state.tsx +124 -0
- package/src/components/ui/fullscreen-button.tsx +71 -50
- package/src/components/ui/loading-skeleton.tsx +107 -0
- package/src/components/ui/media-resource-preloader.tsx +262 -197
- package/src/components/ui/offline-message.tsx +98 -0
- package/src/components/ui/play-button.tsx +79 -87
- package/src/components/ui/seek-bar.tsx +170 -140
- package/src/components/ui/time-display.tsx +33 -12
- package/src/components/ui/volume-control.tsx +91 -44
- package/src/components/unified/base-media-player.tsx +61 -55
- package/src/components/unified/media-player.tsx +3 -3
- package/src/components/variants/minimal/AccessibleMinimalPlayer.tsx +528 -502
- package/src/components/variants/minimal/EnhancedMinimalMediaPlayer.tsx +110 -89
- package/src/components/variants/minimal/MinimalControls.tsx +100 -118
- package/src/components/variants/minimal/MinimalLoading.tsx +19 -23
- package/src/components/variants/minimal/MinimalMediaPlayer.tsx +283 -280
- package/src/components/variants/minimal/MinimalOverlay.tsx +43 -49
- package/src/components/variants/minimal/MinimalPlayButton.tsx +44 -53
- package/src/components/variants/minimal/MinimalSeekBar.tsx +130 -140
- package/src/components/variants/minimal/MinimalVolumeControl.tsx +59 -64
- package/src/components/variants/minimal/SimpleMinimalPlayer.tsx +29 -32
- package/src/components/variants/minimal/components/CenterPlayButton.tsx +1 -1
- package/src/components/variants/minimal/components/ControlBar.tsx +7 -11
- package/src/components/variants/minimal/components/EnhancedSettingsMenu.tsx +381 -330
- package/src/components/variants/minimal/components/PlaybackControls.tsx +6 -11
- package/src/components/variants/minimal/components/RightControls.tsx +8 -17
- package/src/components/variants/minimal/components/SeekBar.tsx +16 -20
- package/src/components/variants/minimal/components/SettingsDropdown.tsx +12 -14
- package/src/components/variants/minimal/components/SubtitleDisplay.tsx +1 -1
- package/src/components/variants/minimal/components/TimeDisplay.tsx +2 -5
- package/src/components/variants/minimal/components/VideoElement.tsx +3 -10
- package/src/components/variants/minimal/components/VolumeControl.tsx +42 -39
- package/src/components/video-player.tsx +10 -10
- package/src/context/__tests__/media-store.test.ts +509 -0
- package/src/context/error-handling.ts +106 -102
- package/src/context/media-context.tsx +56 -10
- package/src/context/media-provider.tsx +16 -17
- package/src/context/media-store.ts +68 -60
- package/src/context/persistence.ts +74 -65
- package/src/core/events/event-system.ts +422 -416
- package/src/core/events/hooks.ts +275 -252
- package/src/core/events/index.ts +14 -14
- package/src/core/events/middleware.ts +269 -252
- package/src/core/index.ts +8 -8
- package/src/core/optimization/bundle-optimizer.tsx +76 -72
- package/src/core/performance/cicd.ts +91 -89
- package/src/core/performance/index.ts +22 -22
- package/src/core/performance/media-loading-optimizer.ts +518 -512
- package/src/core/performance/performance-budgets.ts +414 -409
- package/src/core/performance/performance-monitor.tsx +451 -439
- package/src/core/performance/performance-testing.ts +439 -437
- package/src/core/plugins/__tests__/registry.test.ts +595 -0
- package/src/core/plugins/base-plugin.ts +197 -196
- package/src/core/plugins/enhanced-plugin-system.ts +157 -139
- package/src/core/plugins/examples/analytics-plugin.ts +229 -230
- package/src/core/plugins/index.ts +26 -26
- package/src/core/plugins/registry.ts +544 -325
- package/src/core/plugins/types.ts +115 -105
- package/src/core/plugins/utils.ts +292 -291
- package/src/core/progressive-loading.tsx +297 -288
- package/src/core/providers/enhanced-hls-provider.ts +98 -99
- package/src/core/providers/lazy-provider.tsx +14 -0
- package/src/core/providers/service-provider.tsx +104 -108
- package/src/core/utils.tsx +22 -26
- package/src/features/media-session/media-session-manager.ts +391 -409
- package/src/features/picture-in-picture/pip-manager.ts +364 -365
- package/src/features/playlist/playlist-manager.ts +605 -585
- package/src/features/subtitles/subtitle-manager.ts +424 -430
- package/src/features/subtitles/subtitle-parser.ts +277 -273
- package/src/features/thumbnails/thumbnail-generator.ts +511 -502
- package/src/hooks/__tests__/currentTime-fix.test.ts +149 -0
- package/src/hooks/__tests__/use-media-player.test.ts +712 -0
- package/src/hooks/__tests__/use-media-state.test.tsx +316 -0
- package/src/hooks/accessibility/index.ts +20 -20
- package/src/hooks/accessibility/use-accessibility-preferences.ts +177 -175
- package/src/hooks/accessibility/use-focus-management.ts +170 -163
- package/src/hooks/accessibility/use-keyboard-shortcuts.ts +132 -124
- package/src/hooks/accessibility/use-screen-reader.ts +191 -161
- package/src/hooks/core/index.ts +30 -30
- package/src/hooks/legacy.ts +3 -9
- package/src/hooks/use-buffer-health.ts +218 -0
- package/src/hooks/use-enhanced-media-player.ts +171 -81
- package/src/hooks/use-focus-trap.tsx +162 -0
- package/src/hooks/use-intelligent-preloading.ts +256 -232
- package/src/hooks/use-keyboard-controls.ts +80 -80
- package/src/hooks/use-keyboard-shortcuts.ts +255 -0
- package/src/hooks/use-media-actions.ts +81 -72
- package/src/hooks/use-media-metadata.ts +75 -73
- package/src/hooks/use-media-optimistic.ts +145 -151
- package/src/hooks/use-media-player.ts +193 -160
- package/src/hooks/use-media-state.ts +63 -59
- package/src/hooks/use-memory-optimization.ts +121 -119
- package/src/hooks/use-network-status.ts +124 -0
- package/src/hooks/use-optimistic-controls.ts +91 -88
- package/src/hooks/use-optimized-media.ts +76 -56
- package/src/hooks/use-smart-preload.ts +229 -0
- package/src/hooks/use-touch-gestures.ts +427 -383
- package/src/hooks/useEnhancedSubtitles.ts +245 -245
- package/src/hooks/useKeyboardShortcuts.ts +84 -52
- package/src/hooks/useMediaControls.ts +22 -22
- package/src/hooks/useScreenshot.ts +51 -47
- package/src/hooks/useSubtitles.ts +53 -53
- package/src/hooks/useVideoPlayer.ts +107 -61
- package/src/icons/components/FullscreenIcon.tsx +34 -35
- package/src/icons/components/SettingsIcon.tsx +35 -36
- package/src/icons/components/animated/LoadingIcon.tsx +25 -41
- package/src/icons/components/animated/PlayPauseIcon.tsx +38 -46
- package/src/icons/components/media/PauseIcon.tsx +36 -37
- package/src/icons/components/media/PlayIcon.tsx +35 -36
- package/src/icons/components/volume/VolumeIcon.tsx +36 -37
- package/src/icons/components/volume/VolumeOffIcon.tsx +36 -37
- package/src/icons/index.ts +38 -38
- package/src/icons/provider.tsx +40 -46
- package/src/icons/types.ts +51 -31
- package/src/index-enhanced.ts +10 -10
- package/src/index-legacy.ts +4 -7
- package/src/index.css +80 -80
- package/src/index.ts +8 -23
- package/src/lib/__tests__/async-utils.test.ts +291 -0
- package/src/lib/async-utils.ts +194 -0
- package/src/lib/deprecation.ts +4 -4
- package/src/lib/index.ts +3 -2
- package/src/lib/utils.ts +3 -3
- package/src/styles/globals.css +3 -3
- package/src/styles/minimal-player.css +606 -574
- package/src/styles/pixel-art.css +23 -28
- package/src/styles/videojs.css +43 -43
- package/src/test/accessibility-utils.ts +208 -0
- package/src/test/browser-simulation.ts +235 -0
- package/src/test/media-mocks.ts +169 -0
- package/src/test/performance-utils.ts +192 -0
- package/src/test/setup.ts +256 -41
- package/src/types/events.ts +30 -30
- package/src/types/formats.ts +56 -72
- package/src/types/index.ts +16 -38
- package/src/types/videojs-plugins.d.ts +6 -6
- package/dist/index.d.ts +0 -1425
- package/dist/package.json +0 -62
- package/dist/src/adapters/videojs-adapter.d.ts +0 -38
- package/dist/src/adapters/videojs-adapter.tsx +0 -470
- package/dist/src/components/AnimateLoading.d.ts +0 -9
- package/dist/src/components/AnimateLoading.tsx +0 -115
- package/dist/src/components/LoadingState.d.ts +0 -33
- package/dist/src/components/LoadingState.tsx +0 -248
- package/dist/src/components/accessibility/keyboard-help-overlay.d.ts +0 -17
- package/dist/src/components/accessibility/keyboard-help-overlay.tsx +0 -213
- package/dist/src/components/audio-player.d.ts +0 -3
- package/dist/src/components/audio-player.tsx +0 -85
- package/dist/src/components/basic/index.d.ts +0 -26
- package/dist/src/components/basic/index.ts +0 -37
- package/dist/src/components/enhanced/advanced-features.d.ts +0 -45
- package/dist/src/components/enhanced/advanced-features.tsx +0 -316
- package/dist/src/components/enhanced/debug-panel.d.ts +0 -70
- package/dist/src/components/enhanced/debug-panel.tsx +0 -422
- package/dist/src/components/enhanced/enhanced-controls.d.ts +0 -50
- package/dist/src/components/enhanced/enhanced-controls.tsx +0 -600
- package/dist/src/components/enhanced/enhanced-media-player.d.ts +0 -26
- package/dist/src/components/enhanced/enhanced-media-player.tsx +0 -509
- package/dist/src/components/enhanced/error-handling.d.ts +0 -36
- package/dist/src/components/enhanced/error-handling.tsx +0 -345
- package/dist/src/components/enhanced/index.d.ts +0 -7
- package/dist/src/components/enhanced/index.ts +0 -39
- package/dist/src/components/enhanced/media-player-enhanced.d.ts +0 -21
- package/dist/src/components/enhanced/media-player-enhanced.tsx +0 -349
- package/dist/src/components/examples/basic-video-player.d.ts +0 -10
- package/dist/src/components/examples/basic-video-player.tsx +0 -55
- package/dist/src/components/examples/custom-controls-example.d.ts +0 -10
- package/dist/src/components/examples/custom-controls-example.tsx +0 -63
- package/dist/src/components/examples/enhanced-controls-example.d.ts +0 -9
- package/dist/src/components/examples/enhanced-controls-example.tsx +0 -114
- package/dist/src/components/examples/enhanced-media-player-example.d.ts +0 -9
- package/dist/src/components/examples/enhanced-media-player-example.tsx +0 -293
- package/dist/src/components/examples/loading-states-demo.d.ts +0 -2
- package/dist/src/components/examples/loading-states-demo.tsx +0 -142
- package/dist/src/components/examples/react-19-demo.d.ts +0 -10
- package/dist/src/components/examples/react-19-demo.tsx +0 -381
- package/dist/src/components/examples/volume-orientation-demo.d.ts +0 -2
- package/dist/src/components/examples/volume-orientation-demo.tsx +0 -114
- package/dist/src/components/icon-demo.d.ts +0 -2
- package/dist/src/components/icon-demo.tsx +0 -209
- package/dist/src/components/icons/index.d.ts +0 -36
- package/dist/src/components/icons/index.tsx +0 -166
- package/dist/src/components/icons/svg-icons/ArrowLeftIcon.d.ts +0 -4
- package/dist/src/components/icons/svg-icons/ArrowLeftIcon.tsx +0 -18
- package/dist/src/components/icons/svg-icons/ArrowRightIcon.d.ts +0 -4
- package/dist/src/components/icons/svg-icons/ArrowRightIcon.tsx +0 -18
- package/dist/src/components/icons/svg-icons/AudioIcon.d.ts +0 -4
- package/dist/src/components/icons/svg-icons/AudioIcon.tsx +0 -22
- package/dist/src/components/icons/svg-icons/BackwardIcon.d.ts +0 -4
- package/dist/src/components/icons/svg-icons/BackwardIcon.tsx +0 -12
- package/dist/src/components/icons/svg-icons/CameraIcon.d.ts +0 -4
- package/dist/src/components/icons/svg-icons/CameraIcon.tsx +0 -19
- package/dist/src/components/icons/svg-icons/CheckIcon.d.ts +0 -4
- package/dist/src/components/icons/svg-icons/CheckIcon.tsx +0 -19
- package/dist/src/components/icons/svg-icons/EnablePiPIcon.d.ts +0 -4
- package/dist/src/components/icons/svg-icons/EnablePiPIcon.tsx +0 -17
- package/dist/src/components/icons/svg-icons/ForwardIcon.d.ts +0 -4
- package/dist/src/components/icons/svg-icons/ForwardIcon.tsx +0 -12
- package/dist/src/components/icons/svg-icons/FullscreenEnterIcon.d.ts +0 -4
- package/dist/src/components/icons/svg-icons/FullscreenEnterIcon.tsx +0 -23
- package/dist/src/components/icons/svg-icons/FullscreenExitIcon.d.ts +0 -4
- package/dist/src/components/icons/svg-icons/FullscreenExitIcon.tsx +0 -23
- package/dist/src/components/icons/svg-icons/LoadingIcon.d.ts +0 -4
- package/dist/src/components/icons/svg-icons/LoadingIcon.tsx +0 -32
- package/dist/src/components/icons/svg-icons/PauseIcon.d.ts +0 -4
- package/dist/src/components/icons/svg-icons/PauseIcon.tsx +0 -23
- package/dist/src/components/icons/svg-icons/PlayIcon.d.ts +0 -4
- package/dist/src/components/icons/svg-icons/PlayIcon.tsx +0 -21
- package/dist/src/components/icons/svg-icons/PlaybackSpeedIcon.d.ts +0 -4
- package/dist/src/components/icons/svg-icons/PlaybackSpeedIcon.tsx +0 -23
- package/dist/src/components/icons/svg-icons/QualityIcon.d.ts +0 -4
- package/dist/src/components/icons/svg-icons/QualityIcon.tsx +0 -21
- package/dist/src/components/icons/svg-icons/SettingsIcon.d.ts +0 -4
- package/dist/src/components/icons/svg-icons/SettingsIcon.tsx +0 -12
- package/dist/src/components/icons/svg-icons/SliderIcon.d.ts +0 -4
- package/dist/src/components/icons/svg-icons/SliderIcon.tsx +0 -21
- package/dist/src/components/icons/svg-icons/SubtitleIcon.d.ts +0 -4
- package/dist/src/components/icons/svg-icons/SubtitleIcon.tsx +0 -21
- package/dist/src/components/icons/svg-icons/SubtitleOffIcon.d.ts +0 -4
- package/dist/src/components/icons/svg-icons/SubtitleOffIcon.tsx +0 -25
- package/dist/src/components/icons/svg-icons/UnPiPIcon.d.ts +0 -4
- package/dist/src/components/icons/svg-icons/UnPiPIcon.tsx +0 -17
- package/dist/src/components/icons/svg-icons/VolumeMutedIcon.d.ts +0 -4
- package/dist/src/components/icons/svg-icons/VolumeMutedIcon.tsx +0 -16
- package/dist/src/components/icons/svg-icons/VolumeOneIcon.d.ts +0 -4
- package/dist/src/components/icons/svg-icons/VolumeOneIcon.tsx +0 -22
- package/dist/src/components/icons/svg-icons/VolumeThreeIcon.d.ts +0 -4
- package/dist/src/components/icons/svg-icons/VolumeThreeIcon.tsx +0 -16
- package/dist/src/components/icons/svg-icons/VolumeTwoIcon.d.ts +0 -4
- package/dist/src/components/icons/svg-icons/VolumeTwoIcon.tsx +0 -16
- package/dist/src/components/legacy.d.ts +0 -13
- package/dist/src/components/legacy.tsx +0 -93
- package/dist/src/components/media-metadata-display.d.ts +0 -11
- package/dist/src/components/media-metadata-display.tsx +0 -100
- package/dist/src/components/media-player-audio.d.ts +0 -9
- package/dist/src/components/media-player-audio.tsx +0 -39
- package/dist/src/components/media-player-controls.d.ts +0 -23
- package/dist/src/components/media-player-controls.tsx +0 -226
- package/dist/src/components/media-player-error.d.ts +0 -16
- package/dist/src/components/media-player-error.tsx +0 -163
- package/dist/src/components/media-player-fullscreen.d.ts +0 -12
- package/dist/src/components/media-player-fullscreen.tsx +0 -109
- package/dist/src/components/media-player-hls.d.ts +0 -23
- package/dist/src/components/media-player-hls.tsx +0 -111
- package/dist/src/components/media-player-loading.d.ts +0 -12
- package/dist/src/components/media-player-loading.tsx +0 -76
- package/dist/src/components/media-player-play.d.ts +0 -11
- package/dist/src/components/media-player-play.tsx +0 -75
- package/dist/src/components/media-player-root.d.ts +0 -28
- package/dist/src/components/media-player-root.tsx +0 -340
- package/dist/src/components/media-player-seek.d.ts +0 -15
- package/dist/src/components/media-player-seek.tsx +0 -168
- package/dist/src/components/media-player-time.d.ts +0 -12
- package/dist/src/components/media-player-time.tsx +0 -99
- package/dist/src/components/media-player-tooltip.d.ts +0 -13
- package/dist/src/components/media-player-tooltip.tsx +0 -58
- package/dist/src/components/media-player-video.d.ts +0 -9
- package/dist/src/components/media-player-video.tsx +0 -39
- package/dist/src/components/media-player-volume.d.ts +0 -13
- package/dist/src/components/media-player-volume.tsx +0 -155
- package/dist/src/components/media-player.d.ts +0 -3
- package/dist/src/components/media-player.tsx +0 -257
- package/dist/src/components/media-suspense.d.ts +0 -78
- package/dist/src/components/media-suspense.tsx +0 -362
- package/dist/src/components/player-settings-form.d.ts +0 -8
- package/dist/src/components/player-settings-form.tsx +0 -163
- package/dist/src/components/react-player-wrapper.d.ts +0 -64
- package/dist/src/components/react-player-wrapper.tsx +0 -651
- package/dist/src/components/simple-video-player.d.ts +0 -9
- package/dist/src/components/simple-video-player.tsx +0 -60
- package/dist/src/components/ui/button.tsx +0 -49
- package/dist/src/components/ui/dropdown-menu.tsx +0 -137
- package/dist/src/components/ui/enhanced-seek-bar.d.ts +0 -3
- package/dist/src/components/ui/enhanced-seek-bar.tsx +0 -235
- package/dist/src/components/ui/fullscreen-button.d.ts +0 -3
- package/dist/src/components/ui/fullscreen-button.tsx +0 -60
- package/dist/src/components/ui/icons.tsx +0 -174
- package/dist/src/components/ui/media-resource-preloader.d.ts +0 -21
- package/dist/src/components/ui/media-resource-preloader.tsx +0 -393
- package/dist/src/components/ui/play-button.d.ts +0 -3
- package/dist/src/components/ui/play-button.tsx +0 -107
- package/dist/src/components/ui/seek-bar.d.ts +0 -3
- package/dist/src/components/ui/seek-bar.tsx +0 -161
- package/dist/src/components/ui/slider.tsx +0 -55
- package/dist/src/components/ui/time-display.d.ts +0 -3
- package/dist/src/components/ui/time-display.tsx +0 -40
- package/dist/src/components/ui/tooltip.tsx +0 -131
- package/dist/src/components/ui/volume-control.d.ts +0 -3
- package/dist/src/components/ui/volume-control.tsx +0 -143
- package/dist/src/components/unified/base-media-player.d.ts +0 -18
- package/dist/src/components/unified/base-media-player.tsx +0 -246
- package/dist/src/components/unified/media-player.d.ts +0 -37
- package/dist/src/components/unified/media-player.tsx +0 -75
- package/dist/src/components/variants/minimal/AccessibleMinimalPlayer.d.ts +0 -42
- package/dist/src/components/variants/minimal/AccessibleMinimalPlayer.tsx +0 -561
- package/dist/src/components/variants/minimal/EnhancedMinimalMediaPlayer.d.ts +0 -44
- package/dist/src/components/variants/minimal/EnhancedMinimalMediaPlayer.tsx +0 -552
- package/dist/src/components/variants/minimal/MinimalControls.d.ts +0 -19
- package/dist/src/components/variants/minimal/MinimalControls.tsx +0 -142
- package/dist/src/components/variants/minimal/MinimalLoading.d.ts +0 -10
- package/dist/src/components/variants/minimal/MinimalLoading.tsx +0 -32
- package/dist/src/components/variants/minimal/MinimalMediaPlayer.d.ts +0 -38
- package/dist/src/components/variants/minimal/MinimalMediaPlayer.tsx +0 -315
- package/dist/src/components/variants/minimal/MinimalOverlay.d.ts +0 -11
- package/dist/src/components/variants/minimal/MinimalOverlay.tsx +0 -64
- package/dist/src/components/variants/minimal/MinimalPlayButton.d.ts +0 -9
- package/dist/src/components/variants/minimal/MinimalPlayButton.tsx +0 -65
- package/dist/src/components/variants/minimal/MinimalSeekBar.d.ts +0 -7
- package/dist/src/components/variants/minimal/MinimalSeekBar.tsx +0 -150
- package/dist/src/components/variants/minimal/MinimalVolumeControl.d.ts +0 -7
- package/dist/src/components/variants/minimal/MinimalVolumeControl.tsx +0 -80
- package/dist/src/components/variants/minimal/SimpleMinimalPlayer.d.ts +0 -22
- package/dist/src/components/variants/minimal/SimpleMinimalPlayer.tsx +0 -209
- package/dist/src/components/variants/minimal/components/CenterPlayButton.d.ts +0 -7
- package/dist/src/components/variants/minimal/components/CenterPlayButton.tsx +0 -22
- package/dist/src/components/variants/minimal/components/ControlBar.d.ts +0 -43
- package/dist/src/components/variants/minimal/components/ControlBar.tsx +0 -146
- package/dist/src/components/variants/minimal/components/EnhancedSettingsMenu.d.ts +0 -24
- package/dist/src/components/variants/minimal/components/EnhancedSettingsMenu.tsx +0 -361
- package/dist/src/components/variants/minimal/components/PlaybackControls.d.ts +0 -9
- package/dist/src/components/variants/minimal/components/PlaybackControls.tsx +0 -51
- package/dist/src/components/variants/minimal/components/RightControls.d.ts +0 -25
- package/dist/src/components/variants/minimal/components/RightControls.tsx +0 -173
- package/dist/src/components/variants/minimal/components/SeekBar.d.ts +0 -11
- package/dist/src/components/variants/minimal/components/SeekBar.tsx +0 -131
- package/dist/src/components/variants/minimal/components/SettingsDropdown.d.ts +0 -9
- package/dist/src/components/variants/minimal/components/SettingsDropdown.tsx +0 -70
- package/dist/src/components/variants/minimal/components/SubtitleDisplay.d.ts +0 -7
- package/dist/src/components/variants/minimal/components/SubtitleDisplay.tsx +0 -21
- package/dist/src/components/variants/minimal/components/TimeDisplay.d.ts +0 -7
- package/dist/src/components/variants/minimal/components/TimeDisplay.tsx +0 -18
- package/dist/src/components/variants/minimal/components/VideoElement.d.ts +0 -13
- package/dist/src/components/variants/minimal/components/VideoElement.tsx +0 -40
- package/dist/src/components/variants/minimal/components/VolumeControl.d.ts +0 -13
- package/dist/src/components/variants/minimal/components/VolumeControl.tsx +0 -217
- package/dist/src/components/variants/minimal/index.d.ts +0 -17
- package/dist/src/components/variants/minimal/index.ts +0 -23
- package/dist/src/components/video-player.d.ts +0 -3
- package/dist/src/components/video-player.tsx +0 -100
- package/dist/src/context/error-handling.d.ts +0 -72
- package/dist/src/context/error-handling.ts +0 -394
- package/dist/src/context/media-context.d.ts +0 -104
- package/dist/src/context/media-context.tsx +0 -208
- package/dist/src/context/media-provider.d.ts +0 -26
- package/dist/src/context/media-provider.tsx +0 -265
- package/dist/src/context/media-store.d.ts +0 -33
- package/dist/src/context/media-store.ts +0 -379
- package/dist/src/context/persistence.d.ts +0 -83
- package/dist/src/context/persistence.ts +0 -453
- package/dist/src/core/events/event-system.d.ts +0 -170
- package/dist/src/core/events/event-system.ts +0 -442
- package/dist/src/core/events/hooks.d.ts +0 -33
- package/dist/src/core/events/hooks.ts +0 -302
- package/dist/src/core/events/index.d.ts +0 -6
- package/dist/src/core/events/index.ts +0 -22
- package/dist/src/core/events/middleware.d.ts +0 -39
- package/dist/src/core/events/middleware.ts +0 -269
- package/dist/src/core/index.d.ts +0 -8
- package/dist/src/core/index.ts +0 -22
- package/dist/src/core/optimization/bundle-optimizer.d.ts +0 -44
- package/dist/src/core/optimization/bundle-optimizer.tsx +0 -308
- package/dist/src/core/performance/cicd.d.ts +0 -8
- package/dist/src/core/performance/cicd.ts +0 -96
- package/dist/src/core/performance/index.d.ts +0 -10
- package/dist/src/core/performance/index.ts +0 -38
- package/dist/src/core/performance/media-loading-optimizer.d.ts +0 -105
- package/dist/src/core/performance/media-loading-optimizer.ts +0 -538
- package/dist/src/core/performance/performance-budgets.d.ts +0 -68
- package/dist/src/core/performance/performance-budgets.ts +0 -432
- package/dist/src/core/performance/performance-monitor.d.ts +0 -95
- package/dist/src/core/performance/performance-monitor.tsx +0 -476
- package/dist/src/core/performance/performance-testing.d.ts +0 -69
- package/dist/src/core/performance/performance-testing.ts +0 -459
- package/dist/src/core/plugins/base-plugin.d.ts +0 -52
- package/dist/src/core/plugins/base-plugin.ts +0 -224
- package/dist/src/core/plugins/enhanced-plugin-system.d.ts +0 -160
- package/dist/src/core/plugins/enhanced-plugin-system.ts +0 -417
- package/dist/src/core/plugins/examples/analytics-plugin.d.ts +0 -30
- package/dist/src/core/plugins/examples/analytics-plugin.ts +0 -242
- package/dist/src/core/plugins/index.d.ts +0 -8
- package/dist/src/core/plugins/index.ts +0 -39
- package/dist/src/core/plugins/registry.d.ts +0 -31
- package/dist/src/core/plugins/registry.ts +0 -327
- package/dist/src/core/plugins/types.d.ts +0 -101
- package/dist/src/core/plugins/types.ts +0 -159
- package/dist/src/core/plugins/utils.d.ts +0 -38
- package/dist/src/core/plugins/utils.ts +0 -316
- package/dist/src/core/progressive-loading.d.ts +0 -88
- package/dist/src/core/progressive-loading.tsx +0 -322
- package/dist/src/core/providers/enhanced-hls-provider.d.ts +0 -50
- package/dist/src/core/providers/enhanced-hls-provider.ts +0 -308
- package/dist/src/core/providers/service-provider.d.ts +0 -49
- package/dist/src/core/providers/service-provider.tsx +0 -168
- package/dist/src/core/utils.d.ts +0 -25
- package/dist/src/core/utils.tsx +0 -38
- package/dist/src/features/media-session/media-session-manager.d.ts +0 -132
- package/dist/src/features/media-session/media-session-manager.ts +0 -429
- package/dist/src/features/picture-in-picture/pip-manager.d.ts +0 -94
- package/dist/src/features/picture-in-picture/pip-manager.ts +0 -429
- package/dist/src/features/playlist/playlist-manager.d.ts +0 -208
- package/dist/src/features/playlist/playlist-manager.ts +0 -606
- package/dist/src/features/subtitles/subtitle-manager.d.ts +0 -136
- package/dist/src/features/subtitles/subtitle-manager.ts +0 -441
- package/dist/src/features/subtitles/subtitle-parser.d.ts +0 -60
- package/dist/src/features/subtitles/subtitle-parser.ts +0 -280
- package/dist/src/features/thumbnails/thumbnail-generator.d.ts +0 -136
- package/dist/src/features/thumbnails/thumbnail-generator.ts +0 -519
- package/dist/src/hooks/accessibility/index.d.ts +0 -5
- package/dist/src/hooks/accessibility/index.ts +0 -27
- package/dist/src/hooks/accessibility/use-accessibility-preferences.d.ts +0 -14
- package/dist/src/hooks/accessibility/use-accessibility-preferences.ts +0 -188
- package/dist/src/hooks/accessibility/use-focus-management.d.ts +0 -31
- package/dist/src/hooks/accessibility/use-focus-management.ts +0 -176
- package/dist/src/hooks/accessibility/use-keyboard-shortcuts.d.ts +0 -38
- package/dist/src/hooks/accessibility/use-keyboard-shortcuts.ts +0 -144
- package/dist/src/hooks/accessibility/use-screen-reader.d.ts +0 -22
- package/dist/src/hooks/accessibility/use-screen-reader.ts +0 -182
- package/dist/src/hooks/core/index.d.ts +0 -18
- package/dist/src/hooks/core/index.ts +0 -47
- package/dist/src/hooks/legacy.d.ts +0 -18
- package/dist/src/hooks/legacy.ts +0 -27
- package/dist/src/hooks/use-enhanced-media-player.d.ts +0 -88
- package/dist/src/hooks/use-enhanced-media-player.ts +0 -485
- package/dist/src/hooks/use-intelligent-preloading.d.ts +0 -66
- package/dist/src/hooks/use-intelligent-preloading.ts +0 -363
- package/dist/src/hooks/use-keyboard-controls.d.ts +0 -13
- package/dist/src/hooks/use-keyboard-controls.ts +0 -115
- package/dist/src/hooks/use-media-actions.d.ts +0 -62
- package/dist/src/hooks/use-media-actions.ts +0 -175
- package/dist/src/hooks/use-media-metadata.d.ts +0 -11
- package/dist/src/hooks/use-media-metadata.ts +0 -89
- package/dist/src/hooks/use-media-optimistic.d.ts +0 -36
- package/dist/src/hooks/use-media-optimistic.ts +0 -270
- package/dist/src/hooks/use-media-player.d.ts +0 -31
- package/dist/src/hooks/use-media-player.ts +0 -310
- package/dist/src/hooks/use-media-state.d.ts +0 -17
- package/dist/src/hooks/use-media-state.ts +0 -190
- package/dist/src/hooks/use-memory-optimization.d.ts +0 -40
- package/dist/src/hooks/use-memory-optimization.ts +0 -358
- package/dist/src/hooks/use-mobile.ts +0 -125
- package/dist/src/hooks/use-optimistic-controls.d.ts +0 -22
- package/dist/src/hooks/use-optimistic-controls.ts +0 -92
- package/dist/src/hooks/use-optimized-media.d.ts +0 -46
- package/dist/src/hooks/use-optimized-media.ts +0 -263
- package/dist/src/hooks/use-touch-gestures.d.ts +0 -47
- package/dist/src/hooks/use-touch-gestures.ts +0 -417
- package/dist/src/hooks/useEnhancedSubtitles.d.ts +0 -39
- package/dist/src/hooks/useEnhancedSubtitles.ts +0 -258
- package/dist/src/hooks/useKeyboardShortcuts.d.ts +0 -10
- package/dist/src/hooks/useKeyboardShortcuts.ts +0 -74
- package/dist/src/hooks/useMediaControls.d.ts +0 -9
- package/dist/src/hooks/useMediaControls.ts +0 -52
- package/dist/src/hooks/useScreenshot.d.ts +0 -4
- package/dist/src/hooks/useScreenshot.ts +0 -57
- package/dist/src/hooks/useSubtitles.d.ts +0 -8
- package/dist/src/hooks/useSubtitles.ts +0 -91
- package/dist/src/hooks/useVideoPlayer.d.ts +0 -32
- package/dist/src/hooks/useVideoPlayer.ts +0 -232
- package/dist/src/icons/components/FullscreenIcon.d.ts +0 -3
- package/dist/src/icons/components/FullscreenIcon.tsx +0 -37
- package/dist/src/icons/components/SettingsIcon.d.ts +0 -3
- package/dist/src/icons/components/SettingsIcon.tsx +0 -38
- package/dist/src/icons/components/animated/LoadingIcon.d.ts +0 -3
- package/dist/src/icons/components/animated/LoadingIcon.tsx +0 -43
- package/dist/src/icons/components/animated/PlayPauseIcon.d.ts +0 -7
- package/dist/src/icons/components/animated/PlayPauseIcon.tsx +0 -50
- package/dist/src/icons/components/media/PauseIcon.d.ts +0 -3
- package/dist/src/icons/components/media/PauseIcon.tsx +0 -39
- package/dist/src/icons/components/media/PlayIcon.d.ts +0 -3
- package/dist/src/icons/components/media/PlayIcon.tsx +0 -38
- package/dist/src/icons/components/volume/VolumeIcon.d.ts +0 -3
- package/dist/src/icons/components/volume/VolumeIcon.tsx +0 -39
- package/dist/src/icons/components/volume/VolumeOffIcon.d.ts +0 -3
- package/dist/src/icons/components/volume/VolumeOffIcon.tsx +0 -39
- package/dist/src/icons/index.d.ts +0 -28
- package/dist/src/icons/index.ts +0 -56
- package/dist/src/icons/provider.d.ts +0 -13
- package/dist/src/icons/provider.tsx +0 -64
- package/dist/src/icons/types.d.ts +0 -18
- package/dist/src/icons/types.ts +0 -40
- package/dist/src/index-enhanced.d.ts +0 -13
- package/dist/src/index-enhanced.ts +0 -35
- package/dist/src/index-legacy.d.ts +0 -81
- package/dist/src/index-legacy.ts +0 -327
- package/dist/src/index.css +0 -102
- package/dist/src/index.d.ts +0 -38
- package/dist/src/index.minimal.d.ts +0 -2
- package/dist/src/index.minimal.ts +0 -4
- package/dist/src/index.ts +0 -216
- package/dist/src/lib/deprecation.d.ts +0 -7
- package/dist/src/lib/deprecation.ts +0 -51
- package/dist/src/lib/format-time.d.ts +0 -9
- package/dist/src/lib/format-time.ts +0 -37
- package/dist/src/lib/index.d.ts +0 -3
- package/dist/src/lib/index.ts +0 -3
- package/dist/src/lib/utils.d.ts +0 -3
- package/dist/src/lib/utils.ts +0 -6
- package/dist/src/styles/globals.css +0 -462
- package/dist/src/styles/minimal-player.css +0 -589
- package/dist/src/styles/pixel-art.css +0 -46
- package/dist/src/styles/videojs.css +0 -100
- package/dist/src/test/setup.d.ts +0 -2
- package/dist/src/test/setup.ts +0 -79
- package/dist/src/types/events.d.ts +0 -41
- package/dist/src/types/events.ts +0 -47
- package/dist/src/types/formats.d.ts +0 -45
- package/dist/src/types/formats.ts +0 -95
- package/dist/src/types/index.d.ts +0 -128
- package/dist/src/types/index.ts +0 -225
- package/dist/src/types/videojs-plugins.d.ts +0 -14
- package/dist/styles/globals.css +0 -462
- package/dist/styles/minimal-player.css +0 -589
- package/dist/styles/pixel-art.css +0 -46
- package/dist/styles/videojs.css +0 -100
- package/src/adapters/videojs-adapter.d.ts +0 -38
- package/src/adapters/videojs-adapter.d.ts.map +0 -1
- package/src/components/AnimateLoading.d.ts +0 -9
- package/src/components/AnimateLoading.d.ts.map +0 -1
- package/src/components/LoadingState.d.ts +0 -33
- package/src/components/LoadingState.d.ts.map +0 -1
- package/src/components/accessibility/keyboard-help-overlay.d.ts +0 -17
- package/src/components/accessibility/keyboard-help-overlay.d.ts.map +0 -1
- package/src/components/audio-player.d.ts +0 -3
- package/src/components/audio-player.d.ts.map +0 -1
- package/src/components/basic/index.d.ts +0 -26
- package/src/components/basic/index.d.ts.map +0 -1
- package/src/components/enhanced/advanced-features.d.ts +0 -45
- package/src/components/enhanced/advanced-features.d.ts.map +0 -1
- package/src/components/enhanced/debug-panel.d.ts +0 -70
- package/src/components/enhanced/debug-panel.d.ts.map +0 -1
- package/src/components/enhanced/enhanced-controls.d.ts +0 -50
- package/src/components/enhanced/enhanced-controls.d.ts.map +0 -1
- package/src/components/enhanced/enhanced-media-player.d.ts +0 -26
- package/src/components/enhanced/enhanced-media-player.d.ts.map +0 -1
- package/src/components/enhanced/error-handling.d.ts +0 -36
- package/src/components/enhanced/error-handling.d.ts.map +0 -1
- package/src/components/enhanced/index.d.ts +0 -7
- package/src/components/enhanced/index.d.ts.map +0 -1
- package/src/components/enhanced/media-player-enhanced.d.ts +0 -21
- package/src/components/enhanced/media-player-enhanced.d.ts.map +0 -1
- package/src/components/examples/basic-video-player.d.ts +0 -10
- package/src/components/examples/basic-video-player.d.ts.map +0 -1
- package/src/components/examples/custom-controls-example.d.ts +0 -10
- package/src/components/examples/custom-controls-example.d.ts.map +0 -1
- package/src/components/examples/enhanced-controls-example.d.ts +0 -9
- package/src/components/examples/enhanced-controls-example.d.ts.map +0 -1
- package/src/components/examples/enhanced-media-player-example.d.ts +0 -9
- package/src/components/examples/enhanced-media-player-example.d.ts.map +0 -1
- package/src/components/examples/loading-states-demo.d.ts +0 -2
- package/src/components/examples/loading-states-demo.d.ts.map +0 -1
- package/src/components/examples/react-19-demo.d.ts +0 -10
- package/src/components/examples/react-19-demo.d.ts.map +0 -1
- package/src/components/examples/volume-orientation-demo.d.ts +0 -2
- package/src/components/examples/volume-orientation-demo.d.ts.map +0 -1
- package/src/components/icon-demo.d.ts +0 -2
- package/src/components/icon-demo.d.ts.map +0 -1
- package/src/components/icons/index.d.ts +0 -36
- package/src/components/icons/index.d.ts.map +0 -1
- package/src/components/icons/svg-icons/ArrowLeftIcon.d.ts +0 -4
- package/src/components/icons/svg-icons/ArrowLeftIcon.d.ts.map +0 -1
- package/src/components/icons/svg-icons/ArrowRightIcon.d.ts +0 -4
- package/src/components/icons/svg-icons/ArrowRightIcon.d.ts.map +0 -1
- package/src/components/icons/svg-icons/AudioIcon.d.ts +0 -4
- package/src/components/icons/svg-icons/AudioIcon.d.ts.map +0 -1
- package/src/components/icons/svg-icons/BackwardIcon.d.ts +0 -4
- package/src/components/icons/svg-icons/BackwardIcon.d.ts.map +0 -1
- package/src/components/icons/svg-icons/CameraIcon.d.ts +0 -4
- package/src/components/icons/svg-icons/CameraIcon.d.ts.map +0 -1
- package/src/components/icons/svg-icons/CheckIcon.d.ts +0 -4
- package/src/components/icons/svg-icons/CheckIcon.d.ts.map +0 -1
- package/src/components/icons/svg-icons/EnablePiPIcon.d.ts +0 -4
- package/src/components/icons/svg-icons/EnablePiPIcon.d.ts.map +0 -1
- package/src/components/icons/svg-icons/ForwardIcon.d.ts +0 -4
- package/src/components/icons/svg-icons/ForwardIcon.d.ts.map +0 -1
- package/src/components/icons/svg-icons/FullscreenEnterIcon.d.ts +0 -4
- package/src/components/icons/svg-icons/FullscreenEnterIcon.d.ts.map +0 -1
- package/src/components/icons/svg-icons/FullscreenExitIcon.d.ts +0 -4
- package/src/components/icons/svg-icons/FullscreenExitIcon.d.ts.map +0 -1
- package/src/components/icons/svg-icons/LoadingIcon.d.ts +0 -4
- package/src/components/icons/svg-icons/LoadingIcon.d.ts.map +0 -1
- package/src/components/icons/svg-icons/PauseIcon.d.ts +0 -4
- package/src/components/icons/svg-icons/PauseIcon.d.ts.map +0 -1
- package/src/components/icons/svg-icons/PlayIcon.d.ts +0 -4
- package/src/components/icons/svg-icons/PlayIcon.d.ts.map +0 -1
- package/src/components/icons/svg-icons/PlaybackSpeedIcon.d.ts +0 -4
- package/src/components/icons/svg-icons/PlaybackSpeedIcon.d.ts.map +0 -1
- package/src/components/icons/svg-icons/QualityIcon.d.ts +0 -4
- package/src/components/icons/svg-icons/QualityIcon.d.ts.map +0 -1
- package/src/components/icons/svg-icons/SettingsIcon.d.ts +0 -4
- package/src/components/icons/svg-icons/SettingsIcon.d.ts.map +0 -1
- package/src/components/icons/svg-icons/SliderIcon.d.ts +0 -4
- package/src/components/icons/svg-icons/SliderIcon.d.ts.map +0 -1
- package/src/components/icons/svg-icons/SubtitleIcon.d.ts +0 -4
- package/src/components/icons/svg-icons/SubtitleIcon.d.ts.map +0 -1
- package/src/components/icons/svg-icons/SubtitleOffIcon.d.ts +0 -4
- package/src/components/icons/svg-icons/SubtitleOffIcon.d.ts.map +0 -1
- package/src/components/icons/svg-icons/UnPiPIcon.d.ts +0 -4
- package/src/components/icons/svg-icons/UnPiPIcon.d.ts.map +0 -1
- package/src/components/icons/svg-icons/VolumeMutedIcon.d.ts +0 -4
- package/src/components/icons/svg-icons/VolumeMutedIcon.d.ts.map +0 -1
- package/src/components/icons/svg-icons/VolumeOneIcon.d.ts +0 -4
- package/src/components/icons/svg-icons/VolumeOneIcon.d.ts.map +0 -1
- package/src/components/icons/svg-icons/VolumeThreeIcon.d.ts +0 -4
- package/src/components/icons/svg-icons/VolumeThreeIcon.d.ts.map +0 -1
- package/src/components/icons/svg-icons/VolumeTwoIcon.d.ts +0 -4
- package/src/components/icons/svg-icons/VolumeTwoIcon.d.ts.map +0 -1
- package/src/components/legacy.d.ts +0 -13
- package/src/components/legacy.d.ts.map +0 -1
- package/src/components/media-metadata-display.d.ts +0 -11
- package/src/components/media-metadata-display.d.ts.map +0 -1
- package/src/components/media-player-audio.d.ts +0 -9
- package/src/components/media-player-audio.d.ts.map +0 -1
- package/src/components/media-player-controls.d.ts +0 -23
- package/src/components/media-player-controls.d.ts.map +0 -1
- package/src/components/media-player-error.d.ts +0 -16
- package/src/components/media-player-error.d.ts.map +0 -1
- package/src/components/media-player-fullscreen.d.ts +0 -12
- package/src/components/media-player-fullscreen.d.ts.map +0 -1
- package/src/components/media-player-hls.d.ts +0 -23
- package/src/components/media-player-hls.d.ts.map +0 -1
- package/src/components/media-player-loading.d.ts +0 -12
- package/src/components/media-player-loading.d.ts.map +0 -1
- package/src/components/media-player-play.d.ts +0 -11
- package/src/components/media-player-play.d.ts.map +0 -1
- package/src/components/media-player-root.d.ts +0 -28
- package/src/components/media-player-root.d.ts.map +0 -1
- package/src/components/media-player-seek.d.ts +0 -15
- package/src/components/media-player-seek.d.ts.map +0 -1
- package/src/components/media-player-time.d.ts +0 -12
- package/src/components/media-player-time.d.ts.map +0 -1
- package/src/components/media-player-tooltip.d.ts +0 -13
- package/src/components/media-player-tooltip.d.ts.map +0 -1
- package/src/components/media-player-video.d.ts +0 -9
- package/src/components/media-player-video.d.ts.map +0 -1
- package/src/components/media-player-volume.d.ts +0 -13
- package/src/components/media-player-volume.d.ts.map +0 -1
- package/src/components/media-player.d.ts +0 -3
- package/src/components/media-player.d.ts.map +0 -1
- package/src/components/media-suspense.d.ts +0 -78
- package/src/components/media-suspense.d.ts.map +0 -1
- package/src/components/player-settings-form.d.ts +0 -8
- package/src/components/player-settings-form.d.ts.map +0 -1
- package/src/components/react-player-wrapper.d.ts +0 -64
- package/src/components/react-player-wrapper.d.ts.map +0 -1
- package/src/components/simple-video-player.d.ts +0 -9
- package/src/components/simple-video-player.d.ts.map +0 -1
- package/src/components/ui/button.tsx +0 -49
- package/src/components/ui/dropdown-menu.tsx +0 -137
- package/src/components/ui/enhanced-seek-bar.d.ts +0 -3
- package/src/components/ui/enhanced-seek-bar.d.ts.map +0 -1
- package/src/components/ui/fullscreen-button.d.ts +0 -3
- package/src/components/ui/fullscreen-button.d.ts.map +0 -1
- package/src/components/ui/icons.tsx +0 -174
- package/src/components/ui/media-resource-preloader.d.ts +0 -21
- package/src/components/ui/media-resource-preloader.d.ts.map +0 -1
- package/src/components/ui/play-button.d.ts +0 -3
- package/src/components/ui/play-button.d.ts.map +0 -1
- package/src/components/ui/seek-bar.d.ts +0 -3
- package/src/components/ui/seek-bar.d.ts.map +0 -1
- package/src/components/ui/slider.tsx +0 -55
- package/src/components/ui/time-display.d.ts +0 -3
- package/src/components/ui/time-display.d.ts.map +0 -1
- package/src/components/ui/tooltip.tsx +0 -131
- package/src/components/ui/volume-control.d.ts +0 -3
- package/src/components/ui/volume-control.d.ts.map +0 -1
- package/src/components/unified/base-media-player.d.ts +0 -18
- package/src/components/unified/base-media-player.d.ts.map +0 -1
- package/src/components/unified/media-player.d.ts +0 -37
- package/src/components/unified/media-player.d.ts.map +0 -1
- package/src/components/variants/minimal/AccessibleMinimalPlayer.d.ts +0 -42
- package/src/components/variants/minimal/AccessibleMinimalPlayer.d.ts.map +0 -1
- package/src/components/variants/minimal/EnhancedMinimalMediaPlayer.d.ts +0 -44
- package/src/components/variants/minimal/EnhancedMinimalMediaPlayer.d.ts.map +0 -1
- package/src/components/variants/minimal/MinimalControls.d.ts +0 -19
- package/src/components/variants/minimal/MinimalControls.d.ts.map +0 -1
- package/src/components/variants/minimal/MinimalLoading.d.ts +0 -10
- package/src/components/variants/minimal/MinimalLoading.d.ts.map +0 -1
- package/src/components/variants/minimal/MinimalMediaPlayer.d.ts +0 -38
- package/src/components/variants/minimal/MinimalMediaPlayer.d.ts.map +0 -1
- package/src/components/variants/minimal/MinimalOverlay.d.ts +0 -11
- package/src/components/variants/minimal/MinimalOverlay.d.ts.map +0 -1
- package/src/components/variants/minimal/MinimalPlayButton.d.ts +0 -9
- package/src/components/variants/minimal/MinimalPlayButton.d.ts.map +0 -1
- package/src/components/variants/minimal/MinimalSeekBar.d.ts +0 -7
- package/src/components/variants/minimal/MinimalSeekBar.d.ts.map +0 -1
- package/src/components/variants/minimal/MinimalVolumeControl.d.ts +0 -7
- package/src/components/variants/minimal/MinimalVolumeControl.d.ts.map +0 -1
- package/src/components/variants/minimal/SimpleMinimalPlayer.d.ts +0 -22
- package/src/components/variants/minimal/SimpleMinimalPlayer.d.ts.map +0 -1
- package/src/components/variants/minimal/components/CenterPlayButton.d.ts +0 -7
- package/src/components/variants/minimal/components/CenterPlayButton.d.ts.map +0 -1
- package/src/components/variants/minimal/components/ControlBar.d.ts +0 -43
- package/src/components/variants/minimal/components/ControlBar.d.ts.map +0 -1
- package/src/components/variants/minimal/components/EnhancedSettingsMenu.d.ts +0 -24
- package/src/components/variants/minimal/components/EnhancedSettingsMenu.d.ts.map +0 -1
- package/src/components/variants/minimal/components/PlaybackControls.d.ts +0 -9
- package/src/components/variants/minimal/components/PlaybackControls.d.ts.map +0 -1
- package/src/components/variants/minimal/components/RightControls.d.ts +0 -25
- package/src/components/variants/minimal/components/RightControls.d.ts.map +0 -1
- package/src/components/variants/minimal/components/SeekBar.d.ts +0 -11
- package/src/components/variants/minimal/components/SeekBar.d.ts.map +0 -1
- package/src/components/variants/minimal/components/SettingsDropdown.d.ts +0 -9
- package/src/components/variants/minimal/components/SettingsDropdown.d.ts.map +0 -1
- package/src/components/variants/minimal/components/SubtitleDisplay.d.ts +0 -7
- package/src/components/variants/minimal/components/SubtitleDisplay.d.ts.map +0 -1
- package/src/components/variants/minimal/components/TimeDisplay.d.ts +0 -7
- package/src/components/variants/minimal/components/TimeDisplay.d.ts.map +0 -1
- package/src/components/variants/minimal/components/VideoElement.d.ts +0 -13
- package/src/components/variants/minimal/components/VideoElement.d.ts.map +0 -1
- package/src/components/variants/minimal/components/VolumeControl.d.ts +0 -13
- package/src/components/variants/minimal/components/VolumeControl.d.ts.map +0 -1
- package/src/components/variants/minimal/index.d.ts +0 -17
- package/src/components/variants/minimal/index.d.ts.map +0 -1
- package/src/components/video-player.d.ts +0 -3
- package/src/components/video-player.d.ts.map +0 -1
- package/src/context/error-handling.d.ts +0 -72
- package/src/context/error-handling.d.ts.map +0 -1
- package/src/context/media-context.d.ts +0 -104
- package/src/context/media-context.d.ts.map +0 -1
- package/src/context/media-provider.d.ts +0 -26
- package/src/context/media-provider.d.ts.map +0 -1
- package/src/context/media-store.d.ts +0 -33
- package/src/context/media-store.d.ts.map +0 -1
- package/src/context/persistence.d.ts +0 -83
- package/src/context/persistence.d.ts.map +0 -1
- package/src/core/events/event-system.d.ts +0 -170
- package/src/core/events/event-system.d.ts.map +0 -1
- package/src/core/events/hooks.d.ts +0 -33
- package/src/core/events/hooks.d.ts.map +0 -1
- package/src/core/events/index.d.ts +0 -6
- package/src/core/events/index.d.ts.map +0 -1
- package/src/core/events/middleware.d.ts +0 -39
- package/src/core/events/middleware.d.ts.map +0 -1
- package/src/core/index.d.ts +0 -8
- package/src/core/index.d.ts.map +0 -1
- package/src/core/optimization/bundle-optimizer.d.ts +0 -44
- package/src/core/optimization/bundle-optimizer.d.ts.map +0 -1
- package/src/core/performance/cicd.d.ts +0 -8
- package/src/core/performance/cicd.d.ts.map +0 -1
- package/src/core/performance/index.d.ts +0 -10
- package/src/core/performance/index.d.ts.map +0 -1
- package/src/core/performance/media-loading-optimizer.d.ts +0 -105
- package/src/core/performance/media-loading-optimizer.d.ts.map +0 -1
- package/src/core/performance/performance-budgets.d.ts +0 -68
- package/src/core/performance/performance-budgets.d.ts.map +0 -1
- package/src/core/performance/performance-monitor.d.ts +0 -95
- package/src/core/performance/performance-monitor.d.ts.map +0 -1
- package/src/core/performance/performance-testing.d.ts +0 -69
- package/src/core/performance/performance-testing.d.ts.map +0 -1
- package/src/core/plugins/base-plugin.d.ts +0 -52
- package/src/core/plugins/base-plugin.d.ts.map +0 -1
- package/src/core/plugins/enhanced-plugin-system.d.ts +0 -160
- package/src/core/plugins/enhanced-plugin-system.d.ts.map +0 -1
- package/src/core/plugins/examples/analytics-plugin.d.ts +0 -30
- package/src/core/plugins/examples/analytics-plugin.d.ts.map +0 -1
- package/src/core/plugins/index.d.ts +0 -8
- package/src/core/plugins/index.d.ts.map +0 -1
- package/src/core/plugins/registry.d.ts +0 -31
- package/src/core/plugins/registry.d.ts.map +0 -1
- package/src/core/plugins/types.d.ts +0 -101
- package/src/core/plugins/types.d.ts.map +0 -1
- package/src/core/plugins/utils.d.ts +0 -38
- package/src/core/plugins/utils.d.ts.map +0 -1
- package/src/core/progressive-loading.d.ts +0 -88
- package/src/core/progressive-loading.d.ts.map +0 -1
- package/src/core/providers/enhanced-hls-provider.d.ts +0 -50
- package/src/core/providers/enhanced-hls-provider.d.ts.map +0 -1
- package/src/core/providers/service-provider.d.ts +0 -49
- package/src/core/providers/service-provider.d.ts.map +0 -1
- package/src/core/utils.d.ts +0 -25
- package/src/core/utils.d.ts.map +0 -1
- package/src/features/media-session/media-session-manager.d.ts +0 -132
- package/src/features/media-session/media-session-manager.d.ts.map +0 -1
- package/src/features/picture-in-picture/pip-manager.d.ts +0 -94
- package/src/features/picture-in-picture/pip-manager.d.ts.map +0 -1
- package/src/features/playlist/playlist-manager.d.ts +0 -208
- package/src/features/playlist/playlist-manager.d.ts.map +0 -1
- package/src/features/subtitles/subtitle-manager.d.ts +0 -136
- package/src/features/subtitles/subtitle-manager.d.ts.map +0 -1
- package/src/features/subtitles/subtitle-parser.d.ts +0 -60
- package/src/features/subtitles/subtitle-parser.d.ts.map +0 -1
- package/src/features/thumbnails/thumbnail-generator.d.ts +0 -136
- package/src/features/thumbnails/thumbnail-generator.d.ts.map +0 -1
- package/src/hooks/accessibility/index.d.ts +0 -5
- package/src/hooks/accessibility/index.d.ts.map +0 -1
- package/src/hooks/accessibility/use-accessibility-preferences.d.ts +0 -14
- package/src/hooks/accessibility/use-accessibility-preferences.d.ts.map +0 -1
- package/src/hooks/accessibility/use-focus-management.d.ts +0 -31
- package/src/hooks/accessibility/use-focus-management.d.ts.map +0 -1
- package/src/hooks/accessibility/use-keyboard-shortcuts.d.ts +0 -38
- package/src/hooks/accessibility/use-keyboard-shortcuts.d.ts.map +0 -1
- package/src/hooks/accessibility/use-screen-reader.d.ts +0 -22
- package/src/hooks/accessibility/use-screen-reader.d.ts.map +0 -1
- package/src/hooks/core/index.d.ts +0 -18
- package/src/hooks/core/index.d.ts.map +0 -1
- package/src/hooks/legacy.d.ts +0 -18
- package/src/hooks/legacy.d.ts.map +0 -1
- package/src/hooks/use-enhanced-media-player.d.ts +0 -88
- package/src/hooks/use-enhanced-media-player.d.ts.map +0 -1
- package/src/hooks/use-intelligent-preloading.d.ts +0 -66
- package/src/hooks/use-intelligent-preloading.d.ts.map +0 -1
- package/src/hooks/use-keyboard-controls.d.ts +0 -13
- package/src/hooks/use-keyboard-controls.d.ts.map +0 -1
- package/src/hooks/use-media-actions.d.ts +0 -62
- package/src/hooks/use-media-actions.d.ts.map +0 -1
- package/src/hooks/use-media-metadata.d.ts +0 -11
- package/src/hooks/use-media-metadata.d.ts.map +0 -1
- package/src/hooks/use-media-optimistic.d.ts +0 -36
- package/src/hooks/use-media-optimistic.d.ts.map +0 -1
- package/src/hooks/use-media-player.d.ts +0 -31
- package/src/hooks/use-media-player.d.ts.map +0 -1
- package/src/hooks/use-media-state.d.ts +0 -17
- package/src/hooks/use-media-state.d.ts.map +0 -1
- package/src/hooks/use-memory-optimization.d.ts +0 -40
- package/src/hooks/use-memory-optimization.d.ts.map +0 -1
- package/src/hooks/use-mobile.ts +0 -125
- package/src/hooks/use-optimistic-controls.d.ts +0 -22
- package/src/hooks/use-optimistic-controls.d.ts.map +0 -1
- package/src/hooks/use-optimized-media.d.ts +0 -46
- package/src/hooks/use-optimized-media.d.ts.map +0 -1
- package/src/hooks/use-touch-gestures.d.ts +0 -47
- package/src/hooks/use-touch-gestures.d.ts.map +0 -1
- package/src/hooks/useEnhancedSubtitles.d.ts +0 -39
- package/src/hooks/useEnhancedSubtitles.d.ts.map +0 -1
- package/src/hooks/useKeyboardShortcuts.d.ts +0 -10
- package/src/hooks/useKeyboardShortcuts.d.ts.map +0 -1
- package/src/hooks/useMediaControls.d.ts +0 -9
- package/src/hooks/useMediaControls.d.ts.map +0 -1
- package/src/hooks/useScreenshot.d.ts +0 -4
- package/src/hooks/useScreenshot.d.ts.map +0 -1
- package/src/hooks/useSubtitles.d.ts +0 -8
- package/src/hooks/useSubtitles.d.ts.map +0 -1
- package/src/hooks/useVideoPlayer.d.ts +0 -32
- package/src/hooks/useVideoPlayer.d.ts.map +0 -1
- package/src/icons/components/FullscreenIcon.d.ts +0 -3
- package/src/icons/components/FullscreenIcon.d.ts.map +0 -1
- package/src/icons/components/SettingsIcon.d.ts +0 -3
- package/src/icons/components/SettingsIcon.d.ts.map +0 -1
- package/src/icons/components/animated/LoadingIcon.d.ts +0 -3
- package/src/icons/components/animated/LoadingIcon.d.ts.map +0 -1
- package/src/icons/components/animated/PlayPauseIcon.d.ts +0 -7
- package/src/icons/components/animated/PlayPauseIcon.d.ts.map +0 -1
- package/src/icons/components/media/PauseIcon.d.ts +0 -3
- package/src/icons/components/media/PauseIcon.d.ts.map +0 -1
- package/src/icons/components/media/PlayIcon.d.ts +0 -3
- package/src/icons/components/media/PlayIcon.d.ts.map +0 -1
- package/src/icons/components/volume/VolumeIcon.d.ts +0 -3
- package/src/icons/components/volume/VolumeIcon.d.ts.map +0 -1
- package/src/icons/components/volume/VolumeOffIcon.d.ts +0 -3
- package/src/icons/components/volume/VolumeOffIcon.d.ts.map +0 -1
- package/src/icons/index.d.ts +0 -28
- package/src/icons/index.d.ts.map +0 -1
- package/src/icons/provider.d.ts +0 -13
- package/src/icons/provider.d.ts.map +0 -1
- package/src/icons/types.d.ts +0 -18
- package/src/icons/types.d.ts.map +0 -1
- package/src/index-enhanced.d.ts +0 -13
- package/src/index-enhanced.d.ts.map +0 -1
- package/src/index-legacy.d.ts +0 -81
- package/src/index-legacy.d.ts.map +0 -1
- package/src/index.d.ts +0 -38
- package/src/index.d.ts.map +0 -1
- package/src/index.minimal.d.ts +0 -2
- package/src/index.minimal.d.ts.map +0 -1
- package/src/index.minimal.ts +0 -4
- package/src/lib/deprecation.d.ts +0 -7
- package/src/lib/deprecation.d.ts.map +0 -1
- package/src/lib/format-time.d.ts +0 -9
- package/src/lib/format-time.d.ts.map +0 -1
- package/src/lib/index.d.ts +0 -3
- package/src/lib/index.d.ts.map +0 -1
- package/src/lib/utils.d.ts +0 -3
- package/src/lib/utils.d.ts.map +0 -1
- package/src/test/setup.d.ts +0 -2
- package/src/test/setup.d.ts.map +0 -1
- package/src/types/events.d.ts +0 -41
- package/src/types/events.d.ts.map +0 -1
- package/src/types/formats.d.ts +0 -45
- package/src/types/formats.d.ts.map +0 -1
- package/src/types/index.d.ts +0 -128
- package/src/types/index.d.ts.map +0 -1
|
@@ -1,89 +1,91 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { cache, use } from "react"
|
|
2
2
|
|
|
3
3
|
export interface MediaMetadata {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
title?: string
|
|
5
|
+
artist?: string
|
|
6
|
+
duration: number
|
|
7
|
+
format: string
|
|
8
|
+
width?: number
|
|
9
|
+
height?: number
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
// Cache metadata fetches to prevent duplicate requests
|
|
13
13
|
const fetchMetadata = cache(async (src: string): Promise<MediaMetadata> => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
14
|
+
try {
|
|
15
|
+
// Create a video element to get metadata
|
|
16
|
+
const video = document.createElement("video")
|
|
17
|
+
video.crossOrigin = "anonymous"
|
|
18
|
+
video.preload = "metadata"
|
|
19
|
+
|
|
20
|
+
return new Promise((resolve, reject) => {
|
|
21
|
+
const timeout = setTimeout(() => {
|
|
22
|
+
video.removeEventListener("loadedmetadata", onMetadata)
|
|
23
|
+
video.removeEventListener("error", onError)
|
|
24
|
+
reject(new Error("Metadata loading timeout"))
|
|
25
|
+
}, 10000) // 10 second timeout
|
|
26
|
+
|
|
27
|
+
const onMetadata = () => {
|
|
28
|
+
clearTimeout(timeout)
|
|
29
|
+
video.removeEventListener("loadedmetadata", onMetadata)
|
|
30
|
+
video.removeEventListener("error", onError)
|
|
31
|
+
|
|
32
|
+
const metadata: MediaMetadata = {
|
|
33
|
+
duration: video.duration || 0,
|
|
34
|
+
format: getFormatFromSrc(src),
|
|
35
|
+
width: video.videoWidth || undefined,
|
|
36
|
+
height: video.videoHeight || undefined
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
resolve(metadata)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const onError = (error: Event) => {
|
|
43
|
+
clearTimeout(timeout)
|
|
44
|
+
video.removeEventListener("loadedmetadata", onMetadata)
|
|
45
|
+
video.removeEventListener("error", onError)
|
|
46
|
+
reject(new Error("Failed to load media metadata"))
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
video.addEventListener("loadedmetadata", onMetadata)
|
|
50
|
+
video.addEventListener("error", onError)
|
|
51
|
+
video.src = src
|
|
52
|
+
})
|
|
53
|
+
} catch (error) {
|
|
54
|
+
throw new Error(
|
|
55
|
+
`Failed to fetch metadata: ${error instanceof Error ? error.message : "Unknown error"}`
|
|
56
|
+
)
|
|
57
|
+
}
|
|
56
58
|
})
|
|
57
59
|
|
|
58
60
|
function getFormatFromSrc(src: string): string {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
61
|
+
const url = new URL(src, window.location.href)
|
|
62
|
+
const pathname = url.pathname.toLowerCase()
|
|
63
|
+
|
|
64
|
+
if (pathname.endsWith(".mp4")) return "MP4"
|
|
65
|
+
if (pathname.endsWith(".webm")) return "WebM"
|
|
66
|
+
if (pathname.endsWith(".ogg")) return "OGG"
|
|
67
|
+
if (pathname.endsWith(".m3u8")) return "HLS"
|
|
68
|
+
if (pathname.endsWith(".mpd")) return "DASH"
|
|
69
|
+
|
|
70
|
+
return "Unknown"
|
|
69
71
|
}
|
|
70
72
|
|
|
71
73
|
export function useMediaMetadata(src: string): MediaMetadata {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
+
// Use the React 19 use() hook for async data
|
|
75
|
+
return use(fetchMetadata(src))
|
|
74
76
|
}
|
|
75
77
|
|
|
76
78
|
// Utility function to format time
|
|
77
79
|
export function formatTime(seconds: number): string {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}
|
|
80
|
+
if (!isFinite(seconds) || isNaN(seconds)) return "0:00"
|
|
81
|
+
|
|
82
|
+
const hours = Math.floor(seconds / 3600)
|
|
83
|
+
const minutes = Math.floor((seconds % 3600) / 60)
|
|
84
|
+
const secs = Math.floor(seconds % 60)
|
|
85
|
+
|
|
86
|
+
if (hours > 0) {
|
|
87
|
+
return `${hours}:${minutes.toString().padStart(2, "0")}:${secs.toString().padStart(2, "0")}`
|
|
88
|
+
} else {
|
|
89
|
+
return `${minutes}:${secs.toString().padStart(2, "0")}`
|
|
90
|
+
}
|
|
91
|
+
}
|
|
@@ -2,61 +2,58 @@
|
|
|
2
2
|
|
|
3
3
|
import React, { useOptimistic } from "react"
|
|
4
4
|
import type { MediaState } from "../context/media-context"
|
|
5
|
-
import type {
|
|
5
|
+
import type { EnhancedMediaStore, OptimisticMediaAction } from "../context/media-store"
|
|
6
6
|
|
|
7
7
|
// Optimistic update reducer function
|
|
8
|
-
function optimisticMediaReducer(
|
|
9
|
-
state: MediaState,
|
|
10
|
-
action: OptimisticMediaAction
|
|
11
|
-
): MediaState {
|
|
8
|
+
function optimisticMediaReducer(state: MediaState, action: OptimisticMediaAction): MediaState {
|
|
12
9
|
if (!action.optimistic) return state
|
|
13
10
|
|
|
14
11
|
// Apply immediate optimistic updates for better UX
|
|
15
12
|
switch (action.type) {
|
|
16
13
|
case "PLAY":
|
|
17
14
|
return { ...state, isPlaying: true, error: null }
|
|
18
|
-
|
|
15
|
+
|
|
19
16
|
case "PAUSE":
|
|
20
17
|
return { ...state, isPlaying: false }
|
|
21
|
-
|
|
18
|
+
|
|
22
19
|
case "SEEK":
|
|
23
20
|
return { ...state, currentTime: action.detail }
|
|
24
|
-
|
|
21
|
+
|
|
25
22
|
case "SET_VOLUME":
|
|
26
23
|
return { ...state, volume: Math.max(0, Math.min(1, action.detail)) }
|
|
27
|
-
|
|
24
|
+
|
|
28
25
|
case "MUTE":
|
|
29
26
|
return { ...state, isMuted: true }
|
|
30
|
-
|
|
27
|
+
|
|
31
28
|
case "UNMUTE":
|
|
32
29
|
return { ...state, isMuted: false }
|
|
33
|
-
|
|
30
|
+
|
|
34
31
|
case "TOGGLE_MUTE":
|
|
35
32
|
return { ...state, isMuted: !state.isMuted }
|
|
36
|
-
|
|
33
|
+
|
|
37
34
|
case "ENTER_FULLSCREEN":
|
|
38
35
|
return { ...state, isFullscreen: true }
|
|
39
|
-
|
|
36
|
+
|
|
40
37
|
case "EXIT_FULLSCREEN":
|
|
41
38
|
return { ...state, isFullscreen: false }
|
|
42
|
-
|
|
39
|
+
|
|
43
40
|
case "SET_PLAYBACK_RATE":
|
|
44
41
|
return { ...state, playbackRate: action.detail }
|
|
45
|
-
|
|
42
|
+
|
|
46
43
|
case "TOGGLE_SUBTITLES":
|
|
47
44
|
return { ...state, subtitlesShowing: !state.subtitlesShowing }
|
|
48
|
-
|
|
45
|
+
|
|
49
46
|
case "PREVIEW_TIME":
|
|
50
47
|
return { ...state, previewTime: action.detail }
|
|
51
|
-
|
|
48
|
+
|
|
52
49
|
case "CLEAR_PREVIEW":
|
|
53
|
-
return {
|
|
54
|
-
...state,
|
|
55
|
-
previewTime: null,
|
|
56
|
-
previewImage: null,
|
|
57
|
-
previewCoords: null
|
|
50
|
+
return {
|
|
51
|
+
...state,
|
|
52
|
+
previewTime: null,
|
|
53
|
+
previewImage: null,
|
|
54
|
+
previewCoords: null
|
|
58
55
|
}
|
|
59
|
-
|
|
56
|
+
|
|
60
57
|
default:
|
|
61
58
|
return state
|
|
62
59
|
}
|
|
@@ -64,128 +61,129 @@ function optimisticMediaReducer(
|
|
|
64
61
|
|
|
65
62
|
// Media optimistic state hook using React 19's useOptimistic
|
|
66
63
|
export function useMediaOptimistic(store: EnhancedMediaStore) {
|
|
67
|
-
const actualState = React.useSyncExternalStore(
|
|
68
|
-
store.subscribe,
|
|
69
|
-
store.getState,
|
|
70
|
-
store.getState
|
|
71
|
-
)
|
|
64
|
+
const actualState = React.useSyncExternalStore(store.subscribe, store.getState, store.getState)
|
|
72
65
|
|
|
73
|
-
const [optimisticState, addOptimistic] = useOptimistic(
|
|
74
|
-
actualState,
|
|
75
|
-
optimisticMediaReducer
|
|
76
|
-
)
|
|
66
|
+
const [optimisticState, addOptimistic] = useOptimistic(actualState, optimisticMediaReducer)
|
|
77
67
|
|
|
78
68
|
// Enhanced dispatch that uses optimistic updates
|
|
79
|
-
const dispatchOptimistic = React.useCallback(
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
// Dispatch the actual action
|
|
86
|
-
await store.dispatchOptimistic(action)
|
|
87
|
-
}, [store, addOptimistic])
|
|
88
|
-
|
|
89
|
-
// Quick actions with optimistic updates
|
|
90
|
-
const optimisticActions = React.useMemo(() => ({
|
|
91
|
-
// Play/Pause with immediate feedback
|
|
92
|
-
togglePlayPause: async () => {
|
|
93
|
-
const action: OptimisticMediaAction = {
|
|
94
|
-
type: optimisticState.isPlaying ? "PAUSE" : "PLAY",
|
|
95
|
-
optimistic: true,
|
|
96
|
-
timestamp: Date.now()
|
|
69
|
+
const dispatchOptimistic = React.useCallback(
|
|
70
|
+
async (action: OptimisticMediaAction) => {
|
|
71
|
+
// Add optimistic update immediately
|
|
72
|
+
if (action.optimistic) {
|
|
73
|
+
addOptimistic(action)
|
|
97
74
|
}
|
|
98
|
-
await dispatchOptimistic(action)
|
|
99
|
-
},
|
|
100
75
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
const action: OptimisticMediaAction = {
|
|
104
|
-
type: "SET_VOLUME",
|
|
105
|
-
detail: Math.max(0, Math.min(1, volume)),
|
|
106
|
-
optimistic: true,
|
|
107
|
-
timestamp: Date.now()
|
|
108
|
-
}
|
|
109
|
-
await dispatchOptimistic(action)
|
|
76
|
+
// Dispatch the actual action
|
|
77
|
+
await store.dispatchOptimistic(action)
|
|
110
78
|
},
|
|
79
|
+
[store, addOptimistic]
|
|
80
|
+
)
|
|
111
81
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
82
|
+
// Quick actions with optimistic updates
|
|
83
|
+
const optimisticActions = React.useMemo(
|
|
84
|
+
() => ({
|
|
85
|
+
// Play/Pause with immediate feedback
|
|
86
|
+
togglePlayPause: async () => {
|
|
87
|
+
const action: OptimisticMediaAction = {
|
|
88
|
+
type: optimisticState.isPlaying ? "PAUSE" : "PLAY",
|
|
89
|
+
optimistic: true,
|
|
90
|
+
timestamp: Date.now()
|
|
91
|
+
}
|
|
92
|
+
await dispatchOptimistic(action)
|
|
93
|
+
},
|
|
122
94
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
95
|
+
// Volume control with immediate slider feedback
|
|
96
|
+
setVolumeOptimistic: async (volume: number) => {
|
|
97
|
+
const action: OptimisticMediaAction = {
|
|
98
|
+
type: "SET_VOLUME",
|
|
99
|
+
detail: Math.max(0, Math.min(1, volume)),
|
|
100
|
+
optimistic: true,
|
|
101
|
+
timestamp: Date.now()
|
|
102
|
+
}
|
|
103
|
+
await dispatchOptimistic(action)
|
|
104
|
+
},
|
|
132
105
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
106
|
+
// Seek with immediate scrub feedback
|
|
107
|
+
seekOptimistic: async (time: number) => {
|
|
108
|
+
const action: OptimisticMediaAction = {
|
|
109
|
+
type: "SEEK",
|
|
110
|
+
detail: time,
|
|
111
|
+
optimistic: true,
|
|
112
|
+
timestamp: Date.now()
|
|
113
|
+
}
|
|
114
|
+
await dispatchOptimistic(action)
|
|
115
|
+
},
|
|
142
116
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
117
|
+
// Mute toggle with immediate icon change
|
|
118
|
+
toggleMuteOptimistic: async () => {
|
|
119
|
+
const action: OptimisticMediaAction = {
|
|
120
|
+
type: "TOGGLE_MUTE",
|
|
121
|
+
optimistic: true,
|
|
122
|
+
timestamp: Date.now()
|
|
123
|
+
}
|
|
124
|
+
await dispatchOptimistic(action)
|
|
125
|
+
},
|
|
126
|
+
|
|
127
|
+
// Fullscreen toggle with immediate layout change
|
|
128
|
+
toggleFullscreenOptimistic: async () => {
|
|
129
|
+
const action: OptimisticMediaAction = {
|
|
130
|
+
type: optimisticState.isFullscreen ? "EXIT_FULLSCREEN" : "ENTER_FULLSCREEN",
|
|
131
|
+
optimistic: true,
|
|
132
|
+
timestamp: Date.now()
|
|
133
|
+
}
|
|
134
|
+
await dispatchOptimistic(action)
|
|
135
|
+
},
|
|
136
|
+
|
|
137
|
+
// Playback rate with immediate feedback
|
|
138
|
+
setPlaybackRateOptimistic: async (rate: number) => {
|
|
139
|
+
const action: OptimisticMediaAction = {
|
|
140
|
+
type: "SET_PLAYBACK_RATE",
|
|
141
|
+
detail: rate,
|
|
142
|
+
optimistic: true,
|
|
143
|
+
timestamp: Date.now()
|
|
144
|
+
}
|
|
145
|
+
await dispatchOptimistic(action)
|
|
146
|
+
},
|
|
153
147
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
148
|
+
// Subtitle toggle with immediate visibility change
|
|
149
|
+
toggleSubtitlesOptimistic: async () => {
|
|
150
|
+
const action: OptimisticMediaAction = {
|
|
151
|
+
type: "TOGGLE_SUBTITLES",
|
|
152
|
+
optimistic: true,
|
|
153
|
+
timestamp: Date.now()
|
|
154
|
+
}
|
|
155
|
+
await dispatchOptimistic(action)
|
|
160
156
|
}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
157
|
+
}),
|
|
158
|
+
[optimisticState, dispatchOptimistic]
|
|
159
|
+
)
|
|
164
160
|
|
|
165
161
|
// State selectors that return optimistic values
|
|
166
|
-
const selectors = React.useMemo(
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
162
|
+
const selectors = React.useMemo(
|
|
163
|
+
() => ({
|
|
164
|
+
isPlaying: optimisticState.isPlaying,
|
|
165
|
+
currentTime: optimisticState.currentTime,
|
|
166
|
+
volume: optimisticState.volume,
|
|
167
|
+
isMuted: optimisticState.isMuted,
|
|
168
|
+
isFullscreen: optimisticState.isFullscreen,
|
|
169
|
+
playbackRate: optimisticState.playbackRate,
|
|
170
|
+
subtitlesShowing: optimisticState.subtitlesShowing,
|
|
171
|
+
previewTime: optimisticState.previewTime,
|
|
172
|
+
|
|
173
|
+
// Computed values
|
|
174
|
+
progress:
|
|
175
|
+
optimisticState.duration > 0 ? optimisticState.currentTime / optimisticState.duration : 0,
|
|
176
|
+
|
|
177
|
+
formattedTime: formatTime(optimisticState.currentTime),
|
|
178
|
+
formattedDuration: formatTime(optimisticState.duration),
|
|
179
|
+
|
|
180
|
+
// State checks
|
|
181
|
+
canPlay: !optimisticState.isLoading && !optimisticState.error,
|
|
182
|
+
hasError: !!optimisticState.error,
|
|
183
|
+
isBuffering: optimisticState.isLoading
|
|
184
|
+
}),
|
|
185
|
+
[optimisticState]
|
|
186
|
+
)
|
|
189
187
|
|
|
190
188
|
return {
|
|
191
189
|
state: optimisticState,
|
|
@@ -199,56 +197,52 @@ export function useMediaOptimistic(store: EnhancedMediaStore) {
|
|
|
199
197
|
// Time formatting utility
|
|
200
198
|
function formatTime(seconds: number): string {
|
|
201
199
|
if (!seconds || !isFinite(seconds)) return "0:00"
|
|
202
|
-
|
|
200
|
+
|
|
203
201
|
const mins = Math.floor(seconds / 60)
|
|
204
202
|
const secs = Math.floor(seconds % 60)
|
|
205
203
|
const hours = Math.floor(mins / 60)
|
|
206
|
-
|
|
204
|
+
|
|
207
205
|
if (hours > 0) {
|
|
208
|
-
return `${hours}:${String(mins % 60).padStart(2,
|
|
206
|
+
return `${hours}:${String(mins % 60).padStart(2, "0")}:${String(secs).padStart(2, "0")}`
|
|
209
207
|
}
|
|
210
|
-
|
|
211
|
-
return `${mins}:${String(secs).padStart(2,
|
|
208
|
+
|
|
209
|
+
return `${mins}:${String(secs).padStart(2, "0")}`
|
|
212
210
|
}
|
|
213
211
|
|
|
214
212
|
// Hook for components that need to detect optimistic updates
|
|
215
213
|
export function useOptimisticUpdates(store: EnhancedMediaStore) {
|
|
216
214
|
const [hasOptimisticUpdates, setHasOptimisticUpdates] = React.useState(false)
|
|
217
|
-
|
|
215
|
+
|
|
218
216
|
React.useEffect(() => {
|
|
219
217
|
const unsubscribe = store.subscribe(() => {
|
|
220
218
|
const actualState = store.getState()
|
|
221
219
|
const optimisticState = store.getOptimisticState()
|
|
222
|
-
|
|
220
|
+
|
|
223
221
|
const hasUpdates = JSON.stringify(actualState) !== JSON.stringify(optimisticState)
|
|
224
222
|
setHasOptimisticUpdates(hasUpdates)
|
|
225
223
|
})
|
|
226
|
-
|
|
224
|
+
|
|
227
225
|
return unsubscribe
|
|
228
226
|
}, [store])
|
|
229
|
-
|
|
227
|
+
|
|
230
228
|
return hasOptimisticUpdates
|
|
231
229
|
}
|
|
232
230
|
|
|
233
231
|
// Hook to get both actual and optimistic state for debugging
|
|
234
232
|
export function useMediaStateComparison(store: EnhancedMediaStore) {
|
|
235
|
-
const actualState = React.useSyncExternalStore(
|
|
236
|
-
|
|
237
|
-
store.getState,
|
|
238
|
-
store.getState
|
|
239
|
-
)
|
|
240
|
-
|
|
233
|
+
const actualState = React.useSyncExternalStore(store.subscribe, store.getState, store.getState)
|
|
234
|
+
|
|
241
235
|
const optimisticState = React.useSyncExternalStore(
|
|
242
236
|
store.subscribe,
|
|
243
237
|
store.getOptimisticState,
|
|
244
238
|
store.getOptimisticState
|
|
245
239
|
)
|
|
246
|
-
|
|
240
|
+
|
|
247
241
|
const differences = React.useMemo(() => {
|
|
248
242
|
const diffs: any[] = []
|
|
249
|
-
|
|
243
|
+
|
|
250
244
|
const stateKeys = Object.keys(actualState) as Array<keyof MediaState>
|
|
251
|
-
stateKeys.forEach(key => {
|
|
245
|
+
stateKeys.forEach((key) => {
|
|
252
246
|
if (JSON.stringify(actualState[key]) !== JSON.stringify(optimisticState[key])) {
|
|
253
247
|
diffs.push({
|
|
254
248
|
key: key as string,
|
|
@@ -257,10 +251,10 @@ export function useMediaStateComparison(store: EnhancedMediaStore) {
|
|
|
257
251
|
})
|
|
258
252
|
}
|
|
259
253
|
})
|
|
260
|
-
|
|
254
|
+
|
|
261
255
|
return diffs
|
|
262
256
|
}, [actualState, optimisticState])
|
|
263
|
-
|
|
257
|
+
|
|
264
258
|
return {
|
|
265
259
|
actualState,
|
|
266
260
|
optimisticState,
|