@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
package/dist/core.mjs
ADDED
|
@@ -0,0 +1,1233 @@
|
|
|
1
|
+
var k = Object.defineProperty;
|
|
2
|
+
var A = (o, e, t) => e in o ? k(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
|
|
3
|
+
var u = (o, e, t) => A(o, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { C as B, P as R } from "./core-plugins-DSBWcTuX.js";
|
|
5
|
+
import { A as ye, B as we, a as Te, d as Se, c as ve, i as be, b as Pe, h as Me, j as Le, g as Ee, f as Ce, e as ke, l as Ae, k as Be } from "./core-plugins-DSBWcTuX.js";
|
|
6
|
+
import { E as I } from "./core-events-DunPHKRE.js";
|
|
7
|
+
import { a as Ie, b as Ne, M as $e, f as Fe, c as xe, d as Ue, e as De, n as Oe, u as ze, m as _e, p as Ve, h as He, j as je, k as Ye, g as Qe, l as We, i as Ke, o as Je } from "./core-events-DunPHKRE.js";
|
|
8
|
+
import { j as f } from "./context-BYwDoSRX.js";
|
|
9
|
+
import m, { useMemo as N, createContext as $, useContext as F, lazy as h } from "react";
|
|
10
|
+
import { a as x } from "./performance-monitor-C5k6FDXw.js";
|
|
11
|
+
import { b as Ge, P as Xe, d as Ze, p as et, u as tt, w as rt } from "./performance-monitor-C5k6FDXw.js";
|
|
12
|
+
class P {
|
|
13
|
+
constructor() {
|
|
14
|
+
u(this, "results", []);
|
|
15
|
+
u(this, "regressionDetector", new x());
|
|
16
|
+
}
|
|
17
|
+
async runTest(e, t) {
|
|
18
|
+
const r = [];
|
|
19
|
+
let n = 0, s = 0, i;
|
|
20
|
+
try {
|
|
21
|
+
for (let d = 0; d < e.warmupIterations; d++)
|
|
22
|
+
await t();
|
|
23
|
+
global.gc && global.gc(), n = this.getMemoryUsage();
|
|
24
|
+
for (let d = 0; d < e.iterations; d++) {
|
|
25
|
+
const S = performance.now();
|
|
26
|
+
await t();
|
|
27
|
+
const C = performance.now();
|
|
28
|
+
r.push(C - S);
|
|
29
|
+
}
|
|
30
|
+
s = this.getMemoryUsage();
|
|
31
|
+
} catch (d) {
|
|
32
|
+
i = d instanceof Error ? d.message : String(d);
|
|
33
|
+
}
|
|
34
|
+
const a = r.reduce((d, S) => d + S, 0) / r.length, c = Math.min(...r), g = Math.max(...r), T = s - n, y = !i && a <= e.expectedThreshold.renderTime && T <= e.expectedThreshold.memoryUsage, w = {
|
|
35
|
+
testName: e.name,
|
|
36
|
+
passed: y,
|
|
37
|
+
metrics: {
|
|
38
|
+
averageRenderTime: a,
|
|
39
|
+
minRenderTime: isFinite(c) ? c : 0,
|
|
40
|
+
maxRenderTime: isFinite(g) ? g : 0,
|
|
41
|
+
memoryUsage: T,
|
|
42
|
+
iterations: e.iterations
|
|
43
|
+
},
|
|
44
|
+
threshold: e.expectedThreshold,
|
|
45
|
+
error: i
|
|
46
|
+
};
|
|
47
|
+
return this.results.push(w), w;
|
|
48
|
+
}
|
|
49
|
+
getMemoryUsage() {
|
|
50
|
+
return "memory" in performance && performance.memory.usedJSHeapSize || 0;
|
|
51
|
+
}
|
|
52
|
+
// Component rendering performance test
|
|
53
|
+
async testComponentRender(e, t, r = 16) {
|
|
54
|
+
const n = {
|
|
55
|
+
name: `${e} Render Performance`,
|
|
56
|
+
iterations: 100,
|
|
57
|
+
warmupIterations: 10,
|
|
58
|
+
timeout: 5e3,
|
|
59
|
+
expectedThreshold: {
|
|
60
|
+
renderTime: r,
|
|
61
|
+
memoryUsage: 1048576
|
|
62
|
+
// 1MB
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
return this.runTest(n, t);
|
|
66
|
+
}
|
|
67
|
+
// Bundle loading performance test
|
|
68
|
+
async testBundleLoading(e, t = 1e3) {
|
|
69
|
+
const r = {
|
|
70
|
+
name: `Bundle Loading: ${e}`,
|
|
71
|
+
iterations: 5,
|
|
72
|
+
warmupIterations: 1,
|
|
73
|
+
timeout: 1e4,
|
|
74
|
+
expectedThreshold: {
|
|
75
|
+
renderTime: t,
|
|
76
|
+
memoryUsage: 5242880
|
|
77
|
+
// 5MB
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
return this.runTest(r, async () => {
|
|
81
|
+
const n = performance.now();
|
|
82
|
+
try {
|
|
83
|
+
const i = await fetch(e);
|
|
84
|
+
if (!i.ok)
|
|
85
|
+
throw new Error(`Failed to load bundle: ${i.status}`);
|
|
86
|
+
await i.blob();
|
|
87
|
+
} catch (i) {
|
|
88
|
+
console.warn(`Bundle loading test failed for ${e}:`, i);
|
|
89
|
+
}
|
|
90
|
+
return performance.now() - n;
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
// Memory leak detection test
|
|
94
|
+
async testMemoryLeaks(e, t = 1e3) {
|
|
95
|
+
const r = {
|
|
96
|
+
name: "Memory Leak Detection",
|
|
97
|
+
iterations: t,
|
|
98
|
+
warmupIterations: 100,
|
|
99
|
+
timeout: 3e4,
|
|
100
|
+
expectedThreshold: {
|
|
101
|
+
renderTime: 1 / 0,
|
|
102
|
+
// Not testing render time
|
|
103
|
+
memoryUsage: 10485760
|
|
104
|
+
// 10MB max increase
|
|
105
|
+
}
|
|
106
|
+
}, n = this.getMemoryUsage(), s = await this.runTest(r, e), a = this.getMemoryUsage() - n, c = a > r.expectedThreshold.memoryUsage;
|
|
107
|
+
return {
|
|
108
|
+
...s,
|
|
109
|
+
passed: s.passed && !c,
|
|
110
|
+
error: c ? `Potential memory leak detected: ${Math.round(a / 1024 / 1024)}MB increase` : s.error
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
// Interaction delay test
|
|
114
|
+
async testInteractionDelay(e, t = 100) {
|
|
115
|
+
const r = {
|
|
116
|
+
name: "Interaction Delay",
|
|
117
|
+
iterations: 50,
|
|
118
|
+
warmupIterations: 5,
|
|
119
|
+
timeout: 5e3,
|
|
120
|
+
expectedThreshold: {
|
|
121
|
+
renderTime: t,
|
|
122
|
+
memoryUsage: 1048576
|
|
123
|
+
// 1MB
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
return this.runTest(r, e);
|
|
127
|
+
}
|
|
128
|
+
// Regression testing
|
|
129
|
+
async runRegressionTests(e, t) {
|
|
130
|
+
t && this.regressionDetector.setBaseline(t);
|
|
131
|
+
const r = this.regressionDetector.detectRegression(e);
|
|
132
|
+
return { passed: r.length === 0, regressions: r };
|
|
133
|
+
}
|
|
134
|
+
// Get all test results
|
|
135
|
+
getResults() {
|
|
136
|
+
return [...this.results];
|
|
137
|
+
}
|
|
138
|
+
// Get test summary
|
|
139
|
+
getSummary() {
|
|
140
|
+
const e = this.results.length, t = this.results.filter((s) => s.passed).length, r = e - t, n = e > 0 ? t / e * 100 : 0;
|
|
141
|
+
return { totalTests: e, passedTests: t, failedTests: r, passRate: n };
|
|
142
|
+
}
|
|
143
|
+
// Clear test results
|
|
144
|
+
clearResults() {
|
|
145
|
+
this.results = [];
|
|
146
|
+
}
|
|
147
|
+
// Generate performance report
|
|
148
|
+
generateReport() {
|
|
149
|
+
const e = this.getSummary();
|
|
150
|
+
let t = `Performance Test Report
|
|
151
|
+
`;
|
|
152
|
+
return t += `========================
|
|
153
|
+
|
|
154
|
+
`, t += `Total Tests: ${e.totalTests}
|
|
155
|
+
`, t += `Passed: ${e.passedTests}
|
|
156
|
+
`, t += `Failed: ${e.failedTests}
|
|
157
|
+
`, t += `Pass Rate: ${e.passRate.toFixed(1)}%
|
|
158
|
+
|
|
159
|
+
`, this.results.length > 0 && (t += `Detailed Results:
|
|
160
|
+
`, t += `-----------------
|
|
161
|
+
|
|
162
|
+
`, this.results.forEach((r, n) => {
|
|
163
|
+
t += `${n + 1}. ${r.testName}
|
|
164
|
+
`, t += ` Status: ${r.passed ? "PASS" : "FAIL"}
|
|
165
|
+
`, t += ` Average Render Time: ${r.metrics.averageRenderTime.toFixed(2)}ms
|
|
166
|
+
`, t += ` Min/Max Render Time: ${r.metrics.minRenderTime.toFixed(2)}ms / ${r.metrics.maxRenderTime.toFixed(2)}ms
|
|
167
|
+
`, t += ` Memory Usage: ${Math.round(r.metrics.memoryUsage / 1024)} KB
|
|
168
|
+
`, t += ` Iterations: ${r.metrics.iterations}
|
|
169
|
+
`, r.error && (t += ` Error: ${r.error}
|
|
170
|
+
`), t += `
|
|
171
|
+
`;
|
|
172
|
+
})), t;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
const v = new P(), te = {
|
|
176
|
+
// Test component rendering performance
|
|
177
|
+
async testComponent(o, e = {}, t = 16) {
|
|
178
|
+
return v.testComponentRender(
|
|
179
|
+
o.displayName || o.name || "Component",
|
|
180
|
+
() => ({ type: o, props: e }),
|
|
181
|
+
t
|
|
182
|
+
);
|
|
183
|
+
},
|
|
184
|
+
// Test hook performance
|
|
185
|
+
async testHook(o, e, t = 1) {
|
|
186
|
+
const r = {
|
|
187
|
+
name: `Hook Performance: ${e}`,
|
|
188
|
+
iterations: 1e3,
|
|
189
|
+
warmupIterations: 100,
|
|
190
|
+
timeout: 5e3,
|
|
191
|
+
expectedThreshold: {
|
|
192
|
+
renderTime: t,
|
|
193
|
+
memoryUsage: 1048576
|
|
194
|
+
// 1MB
|
|
195
|
+
}
|
|
196
|
+
};
|
|
197
|
+
return v.runTest(r, o);
|
|
198
|
+
},
|
|
199
|
+
// Test async operation performance
|
|
200
|
+
async testAsyncOperation(o, e, t = 1e3) {
|
|
201
|
+
const r = {
|
|
202
|
+
name: `Async Operation: ${e}`,
|
|
203
|
+
iterations: 10,
|
|
204
|
+
warmupIterations: 2,
|
|
205
|
+
timeout: 3e4,
|
|
206
|
+
expectedThreshold: {
|
|
207
|
+
renderTime: t,
|
|
208
|
+
memoryUsage: 2097152
|
|
209
|
+
// 2MB
|
|
210
|
+
}
|
|
211
|
+
};
|
|
212
|
+
return v.runTest(r, o);
|
|
213
|
+
},
|
|
214
|
+
// Test bundle size impact
|
|
215
|
+
async measureBundleImpact(o, e, t) {
|
|
216
|
+
const r = performance.memory?.usedJSHeapSize || 0, n = performance.now();
|
|
217
|
+
o();
|
|
218
|
+
const s = performance.memory?.usedJSHeapSize || 0, i = performance.now();
|
|
219
|
+
e();
|
|
220
|
+
const a = performance.memory?.usedJSHeapSize || 0, c = performance.now();
|
|
221
|
+
return {
|
|
222
|
+
bundleIncrease: a - r,
|
|
223
|
+
memoryIncrease: s - r,
|
|
224
|
+
renderTimeImpact: c - i - (i - n)
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
};
|
|
228
|
+
class U {
|
|
229
|
+
constructor() {
|
|
230
|
+
u(this, "benchmark", new P());
|
|
231
|
+
u(this, "suites", /* @__PURE__ */ new Map());
|
|
232
|
+
}
|
|
233
|
+
// Register a test suite
|
|
234
|
+
registerSuite(e, t) {
|
|
235
|
+
this.suites.set(e, t);
|
|
236
|
+
}
|
|
237
|
+
// Run all tests in a suite
|
|
238
|
+
async runSuite(e, t) {
|
|
239
|
+
const r = this.suites.get(e);
|
|
240
|
+
if (!r)
|
|
241
|
+
throw new Error(`Test suite '${e}' not found`);
|
|
242
|
+
const n = [];
|
|
243
|
+
for (const s of r) {
|
|
244
|
+
const i = t.get(s.name);
|
|
245
|
+
if (!i) {
|
|
246
|
+
console.warn(`No implementation found for test '${s.name}'`);
|
|
247
|
+
continue;
|
|
248
|
+
}
|
|
249
|
+
const a = await this.benchmark.runTest(s, i);
|
|
250
|
+
n.push(a);
|
|
251
|
+
}
|
|
252
|
+
return n;
|
|
253
|
+
}
|
|
254
|
+
// Run all registered test suites
|
|
255
|
+
async runAllSuites(e) {
|
|
256
|
+
const t = /* @__PURE__ */ new Map();
|
|
257
|
+
for (const [r] of this.suites) {
|
|
258
|
+
const n = e.get(r);
|
|
259
|
+
if (!n) {
|
|
260
|
+
console.warn(`No implementations found for suite '${r}'`);
|
|
261
|
+
continue;
|
|
262
|
+
}
|
|
263
|
+
const s = await this.runSuite(r, n);
|
|
264
|
+
t.set(r, s);
|
|
265
|
+
}
|
|
266
|
+
return t;
|
|
267
|
+
}
|
|
268
|
+
// Generate comprehensive report
|
|
269
|
+
generateComprehensiveReport() {
|
|
270
|
+
this.benchmark.getSummary();
|
|
271
|
+
let e = this.benchmark.generateReport();
|
|
272
|
+
if (this.suites.size > 0) {
|
|
273
|
+
e += `
|
|
274
|
+
Test Suites:
|
|
275
|
+
`, e += `============
|
|
276
|
+
|
|
277
|
+
`;
|
|
278
|
+
for (const [t, r] of this.suites)
|
|
279
|
+
e += `Suite: ${t}
|
|
280
|
+
`, e += `Tests: ${r.length}
|
|
281
|
+
|
|
282
|
+
`;
|
|
283
|
+
}
|
|
284
|
+
return e;
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
const re = new U(), D = [
|
|
288
|
+
// Bundle size budgets
|
|
289
|
+
{
|
|
290
|
+
name: "Main Bundle Size (ESM)",
|
|
291
|
+
category: "bundle",
|
|
292
|
+
limit: 250 * 1024,
|
|
293
|
+
// 250KB
|
|
294
|
+
unit: "bytes",
|
|
295
|
+
severity: "error",
|
|
296
|
+
description: "Main bundle should stay under 250KB for fast initial loading"
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
name: "Main Bundle Size (CJS)",
|
|
300
|
+
category: "bundle",
|
|
301
|
+
limit: 200 * 1024,
|
|
302
|
+
// 200KB
|
|
303
|
+
unit: "bytes",
|
|
304
|
+
severity: "error",
|
|
305
|
+
description: "CJS bundle should be smaller due to better compression"
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
name: "Core Module Size",
|
|
309
|
+
category: "bundle",
|
|
310
|
+
limit: 15 * 1024,
|
|
311
|
+
// 15KB
|
|
312
|
+
unit: "bytes",
|
|
313
|
+
severity: "warning",
|
|
314
|
+
description: "Core architecture should remain lightweight"
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
name: "Enhanced Components Size",
|
|
318
|
+
category: "bundle",
|
|
319
|
+
limit: 40 * 1024,
|
|
320
|
+
// 40KB
|
|
321
|
+
unit: "bytes",
|
|
322
|
+
severity: "warning",
|
|
323
|
+
description: "Enhanced components bundle size"
|
|
324
|
+
},
|
|
325
|
+
// Runtime performance budgets
|
|
326
|
+
{
|
|
327
|
+
name: "Component Render Time",
|
|
328
|
+
category: "runtime",
|
|
329
|
+
limit: 16,
|
|
330
|
+
// 16ms for 60fps
|
|
331
|
+
unit: "ms",
|
|
332
|
+
severity: "error",
|
|
333
|
+
description: "Component rendering should complete within one frame"
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
name: "First Input Delay",
|
|
337
|
+
category: "runtime",
|
|
338
|
+
limit: 100,
|
|
339
|
+
// 100ms
|
|
340
|
+
unit: "ms",
|
|
341
|
+
severity: "error",
|
|
342
|
+
description: "First Input Delay should be under 100ms for good UX"
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
name: "Largest Contentful Paint",
|
|
346
|
+
category: "runtime",
|
|
347
|
+
limit: 2500,
|
|
348
|
+
// 2.5s
|
|
349
|
+
unit: "ms",
|
|
350
|
+
severity: "warning",
|
|
351
|
+
description: "LCP should be under 2.5s for good Core Web Vitals score"
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
name: "Cumulative Layout Shift",
|
|
355
|
+
category: "runtime",
|
|
356
|
+
limit: 0.1,
|
|
357
|
+
unit: "score",
|
|
358
|
+
severity: "warning",
|
|
359
|
+
description: "CLS should be under 0.1 for good visual stability"
|
|
360
|
+
},
|
|
361
|
+
// Memory budgets
|
|
362
|
+
{
|
|
363
|
+
name: "Memory Usage",
|
|
364
|
+
category: "memory",
|
|
365
|
+
limit: 50 * 1024 * 1024,
|
|
366
|
+
// 50MB
|
|
367
|
+
unit: "bytes",
|
|
368
|
+
severity: "warning",
|
|
369
|
+
description: "Memory usage should stay under 50MB for good performance"
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
name: "Memory Increase Per Operation",
|
|
373
|
+
category: "memory",
|
|
374
|
+
limit: 1024 * 1024,
|
|
375
|
+
// 1MB
|
|
376
|
+
unit: "bytes",
|
|
377
|
+
severity: "error",
|
|
378
|
+
description: "Each operation should not increase memory by more than 1MB"
|
|
379
|
+
},
|
|
380
|
+
// Network budgets (for media loading)
|
|
381
|
+
{
|
|
382
|
+
name: "Media Load Time",
|
|
383
|
+
category: "network",
|
|
384
|
+
limit: 3e3,
|
|
385
|
+
// 3s
|
|
386
|
+
unit: "ms",
|
|
387
|
+
severity: "warning",
|
|
388
|
+
description: "Media should start loading within 3 seconds"
|
|
389
|
+
}
|
|
390
|
+
];
|
|
391
|
+
class O {
|
|
392
|
+
constructor(e = D, t = {
|
|
393
|
+
enabled: !0,
|
|
394
|
+
channels: [{ type: "console", config: {} }],
|
|
395
|
+
threshold: 1,
|
|
396
|
+
cooldown: 300 * 1e3
|
|
397
|
+
// 5 minutes
|
|
398
|
+
}) {
|
|
399
|
+
u(this, "budgets", /* @__PURE__ */ new Map());
|
|
400
|
+
u(this, "violations", []);
|
|
401
|
+
u(this, "alertConfig");
|
|
402
|
+
u(this, "lastAlertTime", 0);
|
|
403
|
+
e.forEach((r) => {
|
|
404
|
+
this.budgets.set(r.name, r);
|
|
405
|
+
}), this.alertConfig = t;
|
|
406
|
+
}
|
|
407
|
+
// Check a single metric against budgets
|
|
408
|
+
checkMetric(e, t, r = "runtime") {
|
|
409
|
+
const n = [];
|
|
410
|
+
for (const [s, i] of this.budgets)
|
|
411
|
+
if (i.category === r && (s.includes(e) || e.includes(s.split(" ")[0]?.toLowerCase() || "")) && t > i.limit) {
|
|
412
|
+
const a = {
|
|
413
|
+
budget: i,
|
|
414
|
+
actualValue: t,
|
|
415
|
+
overageAmount: t - i.limit,
|
|
416
|
+
overagePercentage: (t - i.limit) / i.limit * 100,
|
|
417
|
+
timestamp: Date.now()
|
|
418
|
+
};
|
|
419
|
+
n.push(a), this.violations.push(a);
|
|
420
|
+
}
|
|
421
|
+
return n.length > 0 && this.handleViolations(n), n;
|
|
422
|
+
}
|
|
423
|
+
// Check bundle sizes
|
|
424
|
+
async checkBundleSizes(e) {
|
|
425
|
+
const t = [];
|
|
426
|
+
return typeof window < "u" || typeof process > "u" ? (console.warn("Bundle size checking is only available in Node.js environment"), t) : (console.warn(
|
|
427
|
+
"Bundle size checking disabled - use Node.js cicdIntegration from @therealtinhtute/baroiplayer/core/performance/cicd for CI/CD environments"
|
|
428
|
+
), t);
|
|
429
|
+
}
|
|
430
|
+
// Check runtime performance
|
|
431
|
+
checkRuntimeMetrics(e) {
|
|
432
|
+
const t = [];
|
|
433
|
+
return e.renderTime !== void 0 && t.push(
|
|
434
|
+
...this.checkMetric("Component Render Time", e.renderTime, "runtime")
|
|
435
|
+
), e.fid !== void 0 && t.push(...this.checkMetric("First Input Delay", e.fid, "runtime")), e.lcp !== void 0 && t.push(...this.checkMetric("Largest Contentful Paint", e.lcp, "runtime")), e.cls !== void 0 && t.push(...this.checkMetric("Cumulative Layout Shift", e.cls, "runtime")), e.memoryUsage !== void 0 && t.push(...this.checkMetric("Memory Usage", e.memoryUsage, "memory")), e.mediaLoadTime !== void 0 && t.push(...this.checkMetric("Media Load Time", e.mediaLoadTime, "network")), t;
|
|
436
|
+
}
|
|
437
|
+
// Handle budget violations
|
|
438
|
+
async handleViolations(e) {
|
|
439
|
+
if (!this.alertConfig.enabled) return;
|
|
440
|
+
const t = Date.now();
|
|
441
|
+
e.filter((n) => n.budget.severity === "error").length >= this.alertConfig.threshold && t - this.lastAlertTime >= this.alertConfig.cooldown && (await this.sendAlerts(e), this.lastAlertTime = t);
|
|
442
|
+
}
|
|
443
|
+
// Send alerts through configured channels
|
|
444
|
+
async sendAlerts(e) {
|
|
445
|
+
const t = this.formatAlertMessage(e);
|
|
446
|
+
for (const r of this.alertConfig.channels)
|
|
447
|
+
try {
|
|
448
|
+
await this.sendAlert(r, t);
|
|
449
|
+
} catch (n) {
|
|
450
|
+
console.error(`Failed to send alert via ${r.type}:`, n);
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
// Format alert message
|
|
454
|
+
formatAlertMessage(e) {
|
|
455
|
+
let t = `🚨 Performance Budget Violations Detected!
|
|
456
|
+
|
|
457
|
+
`;
|
|
458
|
+
return e.forEach((r) => {
|
|
459
|
+
const { budget: n, actualValue: s, overageAmount: i, overagePercentage: a } = r;
|
|
460
|
+
this.getUnitDisplay(n.unit), t += `❌ ${n.name}
|
|
461
|
+
`, t += ` Limit: ${this.formatValue(n.limit, n.unit)}
|
|
462
|
+
`, t += ` Actual: ${this.formatValue(s, n.unit)}
|
|
463
|
+
`, t += ` Overage: ${this.formatValue(i, n.unit)} (+${a.toFixed(1)}%)
|
|
464
|
+
`, t += ` Severity: ${n.severity.toUpperCase()}
|
|
465
|
+
|
|
466
|
+
`;
|
|
467
|
+
}), t += `Time: ${(/* @__PURE__ */ new Date()).toISOString()}
|
|
468
|
+
`, t += `Total Violations: ${e.length}`, t;
|
|
469
|
+
}
|
|
470
|
+
// Send alert to specific channel
|
|
471
|
+
async sendAlert(e, t) {
|
|
472
|
+
switch (e.type) {
|
|
473
|
+
case "console":
|
|
474
|
+
console.error(t);
|
|
475
|
+
break;
|
|
476
|
+
case "webhook":
|
|
477
|
+
if (e.config.url) {
|
|
478
|
+
const r = await fetch(e.config.url, {
|
|
479
|
+
method: "POST",
|
|
480
|
+
headers: { "Content-Type": "application/json" },
|
|
481
|
+
body: JSON.stringify({ text: t, timestamp: Date.now() })
|
|
482
|
+
});
|
|
483
|
+
if (!r.ok)
|
|
484
|
+
throw new Error(`Webhook failed: ${r.status}`);
|
|
485
|
+
}
|
|
486
|
+
break;
|
|
487
|
+
case "slack":
|
|
488
|
+
if (e.config.url) {
|
|
489
|
+
const r = await fetch(e.config.url, {
|
|
490
|
+
method: "POST",
|
|
491
|
+
headers: { "Content-Type": "application/json" },
|
|
492
|
+
body: JSON.stringify({
|
|
493
|
+
text: t,
|
|
494
|
+
channel: e.config.channel,
|
|
495
|
+
username: "BaroiPlayer Performance Monitor"
|
|
496
|
+
})
|
|
497
|
+
});
|
|
498
|
+
if (!r.ok)
|
|
499
|
+
throw new Error(`Slack webhook failed: ${r.status}`);
|
|
500
|
+
}
|
|
501
|
+
break;
|
|
502
|
+
default:
|
|
503
|
+
console.warn(`Unsupported alert channel: ${e.type}`);
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
// Helper methods
|
|
507
|
+
formatValue(e, t) {
|
|
508
|
+
switch (t) {
|
|
509
|
+
case "bytes":
|
|
510
|
+
return this.formatBytes(e);
|
|
511
|
+
case "ms":
|
|
512
|
+
return `${e.toFixed(2)}ms`;
|
|
513
|
+
case "score":
|
|
514
|
+
return e.toFixed(3);
|
|
515
|
+
case "percent":
|
|
516
|
+
return `${e.toFixed(1)}%`;
|
|
517
|
+
default:
|
|
518
|
+
return e.toString();
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
formatBytes(e) {
|
|
522
|
+
return e >= 1024 * 1024 ? `${(e / 1024 / 1024).toFixed(2)}MB` : e >= 1024 ? `${(e / 1024).toFixed(2)}KB` : `${e}B`;
|
|
523
|
+
}
|
|
524
|
+
getUnitDisplay(e) {
|
|
525
|
+
return {
|
|
526
|
+
bytes: "bytes",
|
|
527
|
+
ms: "milliseconds",
|
|
528
|
+
score: "score",
|
|
529
|
+
percent: "percent"
|
|
530
|
+
}[e] || e;
|
|
531
|
+
}
|
|
532
|
+
// Management methods
|
|
533
|
+
addBudget(e) {
|
|
534
|
+
this.budgets.set(e.name, e);
|
|
535
|
+
}
|
|
536
|
+
removeBudget(e) {
|
|
537
|
+
this.budgets.delete(e);
|
|
538
|
+
}
|
|
539
|
+
updateBudget(e, t) {
|
|
540
|
+
const r = this.budgets.get(e);
|
|
541
|
+
r && this.budgets.set(e, { ...r, ...t });
|
|
542
|
+
}
|
|
543
|
+
getBudgets() {
|
|
544
|
+
return Array.from(this.budgets.values());
|
|
545
|
+
}
|
|
546
|
+
getViolations(e) {
|
|
547
|
+
return e ? this.violations.filter((t) => t.timestamp >= e) : [...this.violations];
|
|
548
|
+
}
|
|
549
|
+
clearViolations() {
|
|
550
|
+
this.violations = [];
|
|
551
|
+
}
|
|
552
|
+
getViolationSummary() {
|
|
553
|
+
const e = {}, t = {};
|
|
554
|
+
return this.violations.forEach((r) => {
|
|
555
|
+
const n = r.budget.category, s = r.budget.severity;
|
|
556
|
+
e[n] = (e[n] || 0) + 1, t[s] = (t[s] || 0) + 1;
|
|
557
|
+
}), {
|
|
558
|
+
total: this.violations.length,
|
|
559
|
+
byCategory: e,
|
|
560
|
+
bySeverity: t
|
|
561
|
+
};
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
const ne = new O(), z = {
|
|
565
|
+
preloadStrategy: "metadata",
|
|
566
|
+
adaptiveBitrate: !0,
|
|
567
|
+
maxPreloadSize: 2 * 1024 * 1024,
|
|
568
|
+
// 2MB
|
|
569
|
+
networkThresholds: {
|
|
570
|
+
"2g": { maxBitrate: 128, preload: !1 },
|
|
571
|
+
// 128 kbps
|
|
572
|
+
"3g": { maxBitrate: 500, preload: !1 },
|
|
573
|
+
// 500 kbps
|
|
574
|
+
"4g": { maxBitrate: 2e3, preload: !0 },
|
|
575
|
+
// 2 Mbps
|
|
576
|
+
"5g": { maxBitrate: 1e4, preload: !0 }
|
|
577
|
+
// 10 Mbps
|
|
578
|
+
},
|
|
579
|
+
bufferSize: 10,
|
|
580
|
+
// 10 seconds
|
|
581
|
+
enableServiceWorker: !0
|
|
582
|
+
};
|
|
583
|
+
class _ {
|
|
584
|
+
constructor() {
|
|
585
|
+
u(this, "connection");
|
|
586
|
+
u(this, "listeners", /* @__PURE__ */ new Set());
|
|
587
|
+
u(this, "currentInfo");
|
|
588
|
+
if (typeof window > "u" || typeof navigator > "u") {
|
|
589
|
+
this.connection = null, this.currentInfo = {
|
|
590
|
+
effectiveType: "unknown",
|
|
591
|
+
downlink: 0,
|
|
592
|
+
rtt: 0,
|
|
593
|
+
saveData: !1,
|
|
594
|
+
isOnline: !0
|
|
595
|
+
};
|
|
596
|
+
return;
|
|
597
|
+
}
|
|
598
|
+
this.connection = navigator.connection || navigator.mozConnection || navigator.webkitConnection, this.currentInfo = this.getNetworkInfo(), this.initializeListeners();
|
|
599
|
+
}
|
|
600
|
+
getNetworkInfo() {
|
|
601
|
+
if (typeof navigator > "u")
|
|
602
|
+
return {
|
|
603
|
+
effectiveType: "unknown",
|
|
604
|
+
downlink: 0,
|
|
605
|
+
rtt: 0,
|
|
606
|
+
saveData: !1,
|
|
607
|
+
isOnline: !0
|
|
608
|
+
};
|
|
609
|
+
const e = navigator.onLine;
|
|
610
|
+
return this.connection ? {
|
|
611
|
+
effectiveType: this.connection.effectiveType || "unknown",
|
|
612
|
+
downlink: this.connection.downlink || 0,
|
|
613
|
+
rtt: this.connection.rtt || 0,
|
|
614
|
+
saveData: this.connection.saveData || !1,
|
|
615
|
+
isOnline: e
|
|
616
|
+
} : {
|
|
617
|
+
effectiveType: "unknown",
|
|
618
|
+
downlink: 0,
|
|
619
|
+
rtt: 0,
|
|
620
|
+
saveData: !1,
|
|
621
|
+
isOnline: e
|
|
622
|
+
};
|
|
623
|
+
}
|
|
624
|
+
initializeListeners() {
|
|
625
|
+
typeof window > "u" || (this.connection && this.connection.addEventListener("change", this.handleNetworkChange.bind(this)), window.addEventListener("online", this.handleNetworkChange.bind(this)), window.addEventListener("offline", this.handleNetworkChange.bind(this)));
|
|
626
|
+
}
|
|
627
|
+
handleNetworkChange() {
|
|
628
|
+
const e = this.getNetworkInfo();
|
|
629
|
+
this.currentInfo = e, this.listeners.forEach((t) => t(e));
|
|
630
|
+
}
|
|
631
|
+
getCurrentNetworkInfo() {
|
|
632
|
+
return { ...this.currentInfo };
|
|
633
|
+
}
|
|
634
|
+
subscribe(e) {
|
|
635
|
+
return this.listeners.add(e), () => this.listeners.delete(e);
|
|
636
|
+
}
|
|
637
|
+
// Estimate available bandwidth with fallback detection
|
|
638
|
+
async estimateBandwidth() {
|
|
639
|
+
if (this.connection && this.connection.downlink)
|
|
640
|
+
return this.connection.downlink * 1e3;
|
|
641
|
+
try {
|
|
642
|
+
const e = performance.now(), n = await (await fetch("/api/bandwidth-test?size=100kb")).blob(), i = (performance.now() - e) / 1e3;
|
|
643
|
+
return n.size * 8 / i / 1e3;
|
|
644
|
+
} catch (e) {
|
|
645
|
+
return console.warn("Bandwidth estimation failed:", e), 1e3;
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
class M {
|
|
650
|
+
constructor(e = {}) {
|
|
651
|
+
u(this, "config");
|
|
652
|
+
u(this, "networkMonitor");
|
|
653
|
+
u(this, "loadingMetrics", /* @__PURE__ */ new Map());
|
|
654
|
+
u(this, "preloadCache", /* @__PURE__ */ new Map());
|
|
655
|
+
this.config = { ...z, ...e }, this.networkMonitor = new _(), this.initializeNetworkMonitoring();
|
|
656
|
+
}
|
|
657
|
+
initializeNetworkMonitoring() {
|
|
658
|
+
this.networkMonitor.subscribe((e) => {
|
|
659
|
+
this.handleNetworkChange(e);
|
|
660
|
+
});
|
|
661
|
+
}
|
|
662
|
+
handleNetworkChange(e) {
|
|
663
|
+
console.log("Network changed:", e), this.config.adaptiveBitrate && this.adjustQualityForNetwork(e), (e.effectiveType === "2g" || e.saveData) && this.clearPreloadCache();
|
|
664
|
+
}
|
|
665
|
+
// Optimize media loading based on network conditions
|
|
666
|
+
async optimizeMediaLoading(e, t, r = {}) {
|
|
667
|
+
const n = performance.now(), s = this.networkMonitor.getCurrentNetworkInfo(), i = {
|
|
668
|
+
loadStartTime: n,
|
|
669
|
+
bytesLoaded: 0,
|
|
670
|
+
loadSpeed: 0,
|
|
671
|
+
networkType: s.effectiveType,
|
|
672
|
+
quality: r.quality || "auto",
|
|
673
|
+
bufferHealth: 0,
|
|
674
|
+
stallsCount: 0,
|
|
675
|
+
stallsDuration: 0
|
|
676
|
+
};
|
|
677
|
+
this.loadingMetrics.set(e, i);
|
|
678
|
+
try {
|
|
679
|
+
const a = this.chooseLoadingStrategy(s, r);
|
|
680
|
+
return a.shouldPreload && await this.preloadMedia(e, a.preloadAmount), t.preload = a.preloadAttribute, this.monitorLoadingProgress(t, i), this.config.adaptiveBitrate && a.suggestedQuality && this.applyQualitySettings(t, a.suggestedQuality), i;
|
|
681
|
+
} catch (a) {
|
|
682
|
+
return console.error("Media loading optimization failed:", a), i;
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
chooseLoadingStrategy(e, t) {
|
|
686
|
+
const r = e.effectiveType === "unknown" ? "4g" : e.effectiveType, n = this.config.networkThresholds[r] || this.config.networkThresholds["4g"];
|
|
687
|
+
return {
|
|
688
|
+
shouldPreload: t.preload !== !1 && n.preload && !e.saveData,
|
|
689
|
+
preloadAmount: e.saveData ? 0 : this.config.maxPreloadSize,
|
|
690
|
+
preloadAttribute: this.getPreloadAttribute(e),
|
|
691
|
+
suggestedQuality: this.getSuggestedQuality(e, n.maxBitrate),
|
|
692
|
+
bufferTarget: this.getBufferTarget(e)
|
|
693
|
+
};
|
|
694
|
+
}
|
|
695
|
+
getPreloadAttribute(e) {
|
|
696
|
+
return e.saveData || e.effectiveType === "2g" ? "none" : e.effectiveType === "3g" ? "metadata" : this.config.preloadStrategy;
|
|
697
|
+
}
|
|
698
|
+
getSuggestedQuality(e, t) {
|
|
699
|
+
const r = e.downlink * 1e3;
|
|
700
|
+
return r >= t * 2 ? "high" : r >= t ? "medium" : "low";
|
|
701
|
+
}
|
|
702
|
+
getBufferTarget(e) {
|
|
703
|
+
switch (e.effectiveType) {
|
|
704
|
+
case "2g":
|
|
705
|
+
return 2;
|
|
706
|
+
// 2 seconds
|
|
707
|
+
case "3g":
|
|
708
|
+
return 5;
|
|
709
|
+
// 5 seconds
|
|
710
|
+
case "4g":
|
|
711
|
+
return this.config.bufferSize;
|
|
712
|
+
case "5g":
|
|
713
|
+
return this.config.bufferSize * 1.5;
|
|
714
|
+
default:
|
|
715
|
+
return this.config.bufferSize;
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
// Preload media content
|
|
719
|
+
async preloadMedia(e, t) {
|
|
720
|
+
if (this.preloadCache.has(e))
|
|
721
|
+
return;
|
|
722
|
+
const r = this.fetchWithProgress(e, t);
|
|
723
|
+
this.preloadCache.set(e, r);
|
|
724
|
+
try {
|
|
725
|
+
await r;
|
|
726
|
+
} catch (n) {
|
|
727
|
+
console.warn(`Preload failed for ${e}:`, n), this.preloadCache.delete(e);
|
|
728
|
+
}
|
|
729
|
+
}
|
|
730
|
+
async fetchWithProgress(e, t) {
|
|
731
|
+
const r = await fetch(e, {
|
|
732
|
+
headers: {
|
|
733
|
+
Range: `bytes=0-${t - 1}`
|
|
734
|
+
// Limit preload size
|
|
735
|
+
}
|
|
736
|
+
});
|
|
737
|
+
if (!r.ok)
|
|
738
|
+
throw new Error(`Failed to preload: ${r.status}`);
|
|
739
|
+
const n = r.body?.getReader();
|
|
740
|
+
if (!n)
|
|
741
|
+
throw new Error("Response body not readable");
|
|
742
|
+
const s = [];
|
|
743
|
+
let i = 0;
|
|
744
|
+
try {
|
|
745
|
+
for (; i < t; ) {
|
|
746
|
+
const { done: a, value: c } = await n.read();
|
|
747
|
+
if (a) break;
|
|
748
|
+
s.push(c), i += c.length;
|
|
749
|
+
}
|
|
750
|
+
} finally {
|
|
751
|
+
n.releaseLock();
|
|
752
|
+
}
|
|
753
|
+
return new Blob(s);
|
|
754
|
+
}
|
|
755
|
+
// Monitor loading progress and update metrics
|
|
756
|
+
monitorLoadingProgress(e, t) {
|
|
757
|
+
let r = null;
|
|
758
|
+
const n = () => {
|
|
759
|
+
if (e.buffered.length > 0) {
|
|
760
|
+
const y = e.buffered.end(e.buffered.length - 1), w = e.currentTime;
|
|
761
|
+
t.bufferHealth = Math.min((y - w) / this.config.bufferSize, 1);
|
|
762
|
+
}
|
|
763
|
+
}, s = () => {
|
|
764
|
+
t.firstByteTime = performance.now();
|
|
765
|
+
}, i = () => {
|
|
766
|
+
t.loadCompleteTime = performance.now(), t.totalLoadTime = t.loadCompleteTime - t.loadStartTime, t.totalLoadTime && t.bytesLoaded > 0 && (t.loadSpeed = t.bytesLoaded / (t.totalLoadTime / 1e3));
|
|
767
|
+
}, a = () => {
|
|
768
|
+
r === null && (r = performance.now(), t.stallsCount++);
|
|
769
|
+
}, c = () => {
|
|
770
|
+
r !== null && (t.stallsDuration += performance.now() - r, r = null), n();
|
|
771
|
+
}, g = () => {
|
|
772
|
+
if (e.buffered.length > 0) {
|
|
773
|
+
const y = e.buffered.end(0) * 1e3;
|
|
774
|
+
t.bytesLoaded = y;
|
|
775
|
+
}
|
|
776
|
+
n();
|
|
777
|
+
};
|
|
778
|
+
e.addEventListener("loadstart", s), e.addEventListener("canplay", i), e.addEventListener("waiting", a), e.addEventListener("playing", c), e.addEventListener("progress", g), setTimeout(() => {
|
|
779
|
+
e.removeEventListener("loadstart", s), e.removeEventListener("canplay", i), e.removeEventListener("waiting", a), e.removeEventListener("playing", c), e.removeEventListener("progress", g);
|
|
780
|
+
}, 300 * 1e3);
|
|
781
|
+
}
|
|
782
|
+
// Apply quality settings (would integrate with HLS.js or similar)
|
|
783
|
+
applyQualitySettings(e, t) {
|
|
784
|
+
console.log(`Applying quality setting: ${t} to`, e);
|
|
785
|
+
}
|
|
786
|
+
adjustQualityForNetwork(e) {
|
|
787
|
+
console.log("Adjusting quality for network conditions:", e.effectiveType);
|
|
788
|
+
}
|
|
789
|
+
// Clear preload cache to save memory
|
|
790
|
+
clearPreloadCache() {
|
|
791
|
+
this.preloadCache.clear();
|
|
792
|
+
}
|
|
793
|
+
// Get loading metrics for a specific media URL
|
|
794
|
+
getLoadingMetrics(e) {
|
|
795
|
+
return this.loadingMetrics.get(e);
|
|
796
|
+
}
|
|
797
|
+
// Get all loading metrics
|
|
798
|
+
getAllMetrics() {
|
|
799
|
+
return Array.from(this.loadingMetrics.values());
|
|
800
|
+
}
|
|
801
|
+
// Calculate average loading performance
|
|
802
|
+
getAverageLoadingTime() {
|
|
803
|
+
const t = this.getAllMetrics().filter((n) => n.totalLoadTime !== void 0);
|
|
804
|
+
return t.length === 0 ? 0 : t.reduce((n, s) => n + (s.totalLoadTime || 0), 0) / t.length;
|
|
805
|
+
}
|
|
806
|
+
// Get network-specific performance stats
|
|
807
|
+
getNetworkPerformanceStats() {
|
|
808
|
+
const e = /* @__PURE__ */ new Map();
|
|
809
|
+
return this.getAllMetrics().forEach((t) => {
|
|
810
|
+
const r = t.networkType;
|
|
811
|
+
e.has(r) || e.set(r, []), e.get(r).push(t);
|
|
812
|
+
}), Array.from(e.entries()).map(([t, r]) => ({
|
|
813
|
+
networkType: t,
|
|
814
|
+
avgLoadTime: r.reduce((n, s) => n + (s.totalLoadTime || 0), 0) / r.length,
|
|
815
|
+
avgStalls: r.reduce((n, s) => n + s.stallsCount, 0) / r.length,
|
|
816
|
+
avgBufferHealth: r.reduce((n, s) => n + s.bufferHealth, 0) / r.length
|
|
817
|
+
}));
|
|
818
|
+
}
|
|
819
|
+
}
|
|
820
|
+
const V = new M();
|
|
821
|
+
function oe(o) {
|
|
822
|
+
const [e] = m.useState(
|
|
823
|
+
() => o ? new M(o) : V
|
|
824
|
+
), [t, r] = m.useState(null), [n, s] = m.useState([]);
|
|
825
|
+
m.useEffect(() => {
|
|
826
|
+
const a = e.networkMonitor.subscribe(r);
|
|
827
|
+
r(e.networkMonitor.getCurrentNetworkInfo());
|
|
828
|
+
const c = setInterval(() => {
|
|
829
|
+
s(e.getAllMetrics());
|
|
830
|
+
}, 1e3);
|
|
831
|
+
return () => {
|
|
832
|
+
a(), clearInterval(c);
|
|
833
|
+
};
|
|
834
|
+
}, [e]);
|
|
835
|
+
const i = m.useCallback(
|
|
836
|
+
(a, c, g) => e.optimizeMediaLoading(a, c, g),
|
|
837
|
+
[e]
|
|
838
|
+
);
|
|
839
|
+
return {
|
|
840
|
+
networkInfo: t,
|
|
841
|
+
loadingMetrics: n,
|
|
842
|
+
optimizeLoading: i,
|
|
843
|
+
averageLoadTime: e.getAverageLoadingTime(),
|
|
844
|
+
networkStats: e.getNetworkPerformanceStats()
|
|
845
|
+
};
|
|
846
|
+
}
|
|
847
|
+
class H {
|
|
848
|
+
get(e) {
|
|
849
|
+
try {
|
|
850
|
+
const t = localStorage.getItem(`baroi-player-${e}`);
|
|
851
|
+
return t ? JSON.parse(t) : null;
|
|
852
|
+
} catch {
|
|
853
|
+
return null;
|
|
854
|
+
}
|
|
855
|
+
}
|
|
856
|
+
set(e, t) {
|
|
857
|
+
try {
|
|
858
|
+
localStorage.setItem(`baroi-player-${e}`, JSON.stringify(t));
|
|
859
|
+
} catch (r) {
|
|
860
|
+
console.warn("Failed to store data:", r);
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
remove(e) {
|
|
864
|
+
try {
|
|
865
|
+
localStorage.removeItem(`baroi-player-${e}`);
|
|
866
|
+
} catch (t) {
|
|
867
|
+
console.warn("Failed to remove data:", t);
|
|
868
|
+
}
|
|
869
|
+
}
|
|
870
|
+
clear() {
|
|
871
|
+
try {
|
|
872
|
+
Object.keys(localStorage).forEach((e) => {
|
|
873
|
+
e.startsWith("baroi-player-") && localStorage.removeItem(e);
|
|
874
|
+
});
|
|
875
|
+
} catch (e) {
|
|
876
|
+
console.warn("Failed to clear data:", e);
|
|
877
|
+
}
|
|
878
|
+
}
|
|
879
|
+
}
|
|
880
|
+
class j {
|
|
881
|
+
track(e, t) {
|
|
882
|
+
console.log("Analytics:", e, t);
|
|
883
|
+
}
|
|
884
|
+
identify(e, t) {
|
|
885
|
+
console.log("Analytics identify:", e, t);
|
|
886
|
+
}
|
|
887
|
+
page(e, t) {
|
|
888
|
+
console.log("Analytics page:", e, t);
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
const L = $(null);
|
|
892
|
+
function Y({ children: o, services: e = {} }) {
|
|
893
|
+
const t = N(() => {
|
|
894
|
+
const r = e.logger || new B("[BaroiPlayer]"), n = e.eventBus || new I(), s = e.pluginRegistry || new R(r), i = e.storage || new H(), a = e.analytics || new j();
|
|
895
|
+
return {
|
|
896
|
+
eventBus: n,
|
|
897
|
+
pluginRegistry: s,
|
|
898
|
+
storage: i,
|
|
899
|
+
analytics: a,
|
|
900
|
+
logger: r
|
|
901
|
+
};
|
|
902
|
+
}, [e]);
|
|
903
|
+
return /* @__PURE__ */ f.jsx(L.Provider, { value: t, children: o });
|
|
904
|
+
}
|
|
905
|
+
function p() {
|
|
906
|
+
const o = F(L);
|
|
907
|
+
if (!o)
|
|
908
|
+
throw new Error("useServices must be used within ServiceProvider");
|
|
909
|
+
return o;
|
|
910
|
+
}
|
|
911
|
+
function se() {
|
|
912
|
+
return p().eventBus;
|
|
913
|
+
}
|
|
914
|
+
function ie() {
|
|
915
|
+
return p().pluginRegistry;
|
|
916
|
+
}
|
|
917
|
+
function ae() {
|
|
918
|
+
return p().storage;
|
|
919
|
+
}
|
|
920
|
+
function ce() {
|
|
921
|
+
return p().analytics;
|
|
922
|
+
}
|
|
923
|
+
function le() {
|
|
924
|
+
return p().logger;
|
|
925
|
+
}
|
|
926
|
+
function ue(o) {
|
|
927
|
+
return function(t) {
|
|
928
|
+
const r = p();
|
|
929
|
+
return /* @__PURE__ */ f.jsx(o, { ...t, services: r });
|
|
930
|
+
};
|
|
931
|
+
}
|
|
932
|
+
function de(o = {}) {
|
|
933
|
+
return function({ children: t }) {
|
|
934
|
+
return /* @__PURE__ */ f.jsx(Y, { services: o.services, children: t });
|
|
935
|
+
};
|
|
936
|
+
}
|
|
937
|
+
const l = {
|
|
938
|
+
SUBTITLES: "subtitles",
|
|
939
|
+
PLAYLISTS: "playlists",
|
|
940
|
+
ADVANCED_CONTROLS: "advanced_controls",
|
|
941
|
+
ANALYTICS: "analytics",
|
|
942
|
+
PICTURE_IN_PICTURE: "picture_in_picture",
|
|
943
|
+
QUALITY_SELECTOR: "quality_selector",
|
|
944
|
+
PLAYBACK_SPEED: "playback_speed",
|
|
945
|
+
CHAPTERS: "chapters",
|
|
946
|
+
THUMBNAILS: "thumbnails",
|
|
947
|
+
KEYBOARD_SHORTCUTS: "keyboard_shortcuts"
|
|
948
|
+
}, Q = {
|
|
949
|
+
enabledFeatures: [l.SUBTITLES, l.ADVANCED_CONTROLS, l.KEYBOARD_SHORTCUTS],
|
|
950
|
+
loadingStrategy: "lazy",
|
|
951
|
+
fallbackTimeout: 5e3,
|
|
952
|
+
retryAttempts: 3
|
|
953
|
+
}, me = {
|
|
954
|
+
// Subtitle system
|
|
955
|
+
SubtitleSelector: h(
|
|
956
|
+
() => import("./enhanced-components-B_l3cist.js").then((o) => o.g).then((o) => ({
|
|
957
|
+
default: o.SubtitleSelector
|
|
958
|
+
}))
|
|
959
|
+
),
|
|
960
|
+
// Playlist functionality
|
|
961
|
+
PlaylistManager: h(
|
|
962
|
+
() => import("./enhanced-components-B_l3cist.js").then((o) => o.g).then((o) => ({
|
|
963
|
+
default: o.SubtitleSelector
|
|
964
|
+
}))
|
|
965
|
+
// Use existing component as placeholder
|
|
966
|
+
),
|
|
967
|
+
// Advanced controls
|
|
968
|
+
QualitySelector: h(
|
|
969
|
+
() => import("./enhanced-components-B_l3cist.js").then((o) => o.g).then((o) => ({
|
|
970
|
+
default: o.QualitySelector
|
|
971
|
+
}))
|
|
972
|
+
),
|
|
973
|
+
PlaybackSpeedSelector: h(
|
|
974
|
+
() => import("./enhanced-components-B_l3cist.js").then((o) => o.g).then((o) => ({
|
|
975
|
+
default: o.PlaybackSpeedSelector
|
|
976
|
+
}))
|
|
977
|
+
),
|
|
978
|
+
ChaptersPanel: h(
|
|
979
|
+
() => import("./enhanced-components-B_l3cist.js").then((o) => o.g).then((o) => ({
|
|
980
|
+
default: o.ChaptersPanel
|
|
981
|
+
}))
|
|
982
|
+
),
|
|
983
|
+
PictureInPictureButton: h(
|
|
984
|
+
() => import("./enhanced-components-B_l3cist.js").then((o) => o.g).then((o) => ({
|
|
985
|
+
default: o.PictureInPictureButton
|
|
986
|
+
}))
|
|
987
|
+
),
|
|
988
|
+
// Analytics
|
|
989
|
+
AnalyticsTracker: h(
|
|
990
|
+
() => import("./enhanced-components-B_l3cist.js").then((o) => o.g).then((o) => ({
|
|
991
|
+
default: o.SubtitleSelector
|
|
992
|
+
}))
|
|
993
|
+
// Use existing component as placeholder
|
|
994
|
+
)
|
|
995
|
+
};
|
|
996
|
+
class E {
|
|
997
|
+
static async isSupported(e) {
|
|
998
|
+
if (this.cache.has(e))
|
|
999
|
+
return this.cache.get(e);
|
|
1000
|
+
const t = await this.checkFeatureSupport(e);
|
|
1001
|
+
return this.cache.set(e, t), t;
|
|
1002
|
+
}
|
|
1003
|
+
static async checkFeatureSupport(e) {
|
|
1004
|
+
if (typeof window > "u" || typeof document > "u")
|
|
1005
|
+
return !0;
|
|
1006
|
+
switch (e) {
|
|
1007
|
+
case l.SUBTITLES:
|
|
1008
|
+
return "TextTrack" in window;
|
|
1009
|
+
case l.PICTURE_IN_PICTURE:
|
|
1010
|
+
return "pictureInPictureEnabled" in document;
|
|
1011
|
+
case l.ADVANCED_CONTROLS:
|
|
1012
|
+
return !0;
|
|
1013
|
+
// Always supported
|
|
1014
|
+
case l.PLAYLISTS:
|
|
1015
|
+
return "MediaSession" in window;
|
|
1016
|
+
case l.ANALYTICS:
|
|
1017
|
+
return "IntersectionObserver" in window;
|
|
1018
|
+
case l.QUALITY_SELECTOR:
|
|
1019
|
+
return "MediaSource" in window;
|
|
1020
|
+
case l.PLAYBACK_SPEED:
|
|
1021
|
+
return !0;
|
|
1022
|
+
// HTML5 video supports this
|
|
1023
|
+
case l.CHAPTERS:
|
|
1024
|
+
return "TextTrack" in window;
|
|
1025
|
+
case l.THUMBNAILS:
|
|
1026
|
+
return "OffscreenCanvas" in window || "canvas" in document.createElement("canvas");
|
|
1027
|
+
case l.KEYBOARD_SHORTCUTS:
|
|
1028
|
+
return "KeyboardEvent" in window;
|
|
1029
|
+
default:
|
|
1030
|
+
return !1;
|
|
1031
|
+
}
|
|
1032
|
+
}
|
|
1033
|
+
}
|
|
1034
|
+
u(E, "cache", /* @__PURE__ */ new Map());
|
|
1035
|
+
class W {
|
|
1036
|
+
constructor(e = {}) {
|
|
1037
|
+
u(this, "config");
|
|
1038
|
+
u(this, "loadedFeatures", /* @__PURE__ */ new Set());
|
|
1039
|
+
u(this, "loadingPromises", /* @__PURE__ */ new Map());
|
|
1040
|
+
this.config = { ...Q, ...e };
|
|
1041
|
+
}
|
|
1042
|
+
async loadFeature(e) {
|
|
1043
|
+
if (!this.config.enabledFeatures.includes(e))
|
|
1044
|
+
return null;
|
|
1045
|
+
if (this.loadedFeatures.has(e))
|
|
1046
|
+
return this.getLoadedFeature(e);
|
|
1047
|
+
if (this.loadingPromises.has(e))
|
|
1048
|
+
return this.loadingPromises.get(e);
|
|
1049
|
+
if (!await E.isSupported(e))
|
|
1050
|
+
return console.warn(`Feature ${e} is not supported in this browser`), null;
|
|
1051
|
+
const r = this.loadWithRetry(e);
|
|
1052
|
+
this.loadingPromises.set(e, r);
|
|
1053
|
+
try {
|
|
1054
|
+
const n = await r;
|
|
1055
|
+
return this.loadedFeatures.add(e), n;
|
|
1056
|
+
} catch (n) {
|
|
1057
|
+
return console.error(`Failed to load feature ${e}:`, n), this.loadingPromises.delete(e), null;
|
|
1058
|
+
}
|
|
1059
|
+
}
|
|
1060
|
+
async loadWithRetry(e, t = 1) {
|
|
1061
|
+
try {
|
|
1062
|
+
return await this.loadFeatureModule(e);
|
|
1063
|
+
} catch (r) {
|
|
1064
|
+
if (t < this.config.retryAttempts)
|
|
1065
|
+
return console.warn(
|
|
1066
|
+
`Loading feature ${e} failed, retrying (${t}/${this.config.retryAttempts})`
|
|
1067
|
+
), await new Promise((n) => setTimeout(n, 1e3 * t)), this.loadWithRetry(e, t + 1);
|
|
1068
|
+
throw r;
|
|
1069
|
+
}
|
|
1070
|
+
}
|
|
1071
|
+
async loadFeatureModule(e) {
|
|
1072
|
+
switch (e) {
|
|
1073
|
+
case l.SUBTITLES:
|
|
1074
|
+
return import("./hooks-Bpi-jDiO.js").then((t) => t.v);
|
|
1075
|
+
case l.PLAYLISTS:
|
|
1076
|
+
return import("./enhanced-components-B_l3cist.js").then((t) => t.g);
|
|
1077
|
+
// Use existing features
|
|
1078
|
+
case l.ADVANCED_CONTROLS:
|
|
1079
|
+
return import("./enhanced-components-B_l3cist.js").then((t) => t.g);
|
|
1080
|
+
case l.ANALYTICS:
|
|
1081
|
+
return import("./enhanced-components-B_l3cist.js").then((t) => t.g);
|
|
1082
|
+
// Use existing features
|
|
1083
|
+
case l.PICTURE_IN_PICTURE:
|
|
1084
|
+
return import("./enhanced-components-B_l3cist.js").then((t) => t.g);
|
|
1085
|
+
// Use existing features
|
|
1086
|
+
case l.QUALITY_SELECTOR:
|
|
1087
|
+
return import("./enhanced-components-B_l3cist.js").then((t) => t.g);
|
|
1088
|
+
// Use existing features
|
|
1089
|
+
case l.PLAYBACK_SPEED:
|
|
1090
|
+
return import("./enhanced-components-B_l3cist.js").then((t) => t.g);
|
|
1091
|
+
// Use existing features
|
|
1092
|
+
case l.CHAPTERS:
|
|
1093
|
+
return import("./enhanced-components-B_l3cist.js").then((t) => t.g);
|
|
1094
|
+
// Use existing features
|
|
1095
|
+
case l.THUMBNAILS:
|
|
1096
|
+
return import("./enhanced-components-B_l3cist.js").then((t) => t.g);
|
|
1097
|
+
// Use existing features
|
|
1098
|
+
case l.KEYBOARD_SHORTCUTS:
|
|
1099
|
+
return import("./hooks-Bpi-jDiO.js").then((t) => t.t);
|
|
1100
|
+
default:
|
|
1101
|
+
throw new Error(`Unknown feature: ${e}`);
|
|
1102
|
+
}
|
|
1103
|
+
}
|
|
1104
|
+
getLoadedFeature(e) {
|
|
1105
|
+
return this.loadingPromises.get(e);
|
|
1106
|
+
}
|
|
1107
|
+
// Preload features for faster access
|
|
1108
|
+
async preloadFeatures(e = this.config.enabledFeatures) {
|
|
1109
|
+
const t = e.map((r) => this.loadFeature(r));
|
|
1110
|
+
await Promise.allSettled(t);
|
|
1111
|
+
}
|
|
1112
|
+
// Get loading state
|
|
1113
|
+
getLoadingState() {
|
|
1114
|
+
return {
|
|
1115
|
+
loaded: Array.from(this.loadedFeatures),
|
|
1116
|
+
loading: Array.from(this.loadingPromises.keys()),
|
|
1117
|
+
enabled: this.config.enabledFeatures
|
|
1118
|
+
};
|
|
1119
|
+
}
|
|
1120
|
+
}
|
|
1121
|
+
const b = new W();
|
|
1122
|
+
function K(o) {
|
|
1123
|
+
const [e, t] = m.useState(null), [r, n] = m.useState(!1), [s, i] = m.useState(null), a = m.useCallback(async () => {
|
|
1124
|
+
if (!(r || e)) {
|
|
1125
|
+
n(!0), i(null);
|
|
1126
|
+
try {
|
|
1127
|
+
const c = await b.loadFeature(o);
|
|
1128
|
+
t(c);
|
|
1129
|
+
} catch (c) {
|
|
1130
|
+
i(c);
|
|
1131
|
+
} finally {
|
|
1132
|
+
n(!1);
|
|
1133
|
+
}
|
|
1134
|
+
}
|
|
1135
|
+
}, [o, r, e]);
|
|
1136
|
+
return m.useEffect(() => {
|
|
1137
|
+
b.config.loadingStrategy === "immediate" && a();
|
|
1138
|
+
}, [a]), {
|
|
1139
|
+
feature: e,
|
|
1140
|
+
loading: r,
|
|
1141
|
+
error: s,
|
|
1142
|
+
load: a
|
|
1143
|
+
};
|
|
1144
|
+
}
|
|
1145
|
+
function ge(o, e, t) {
|
|
1146
|
+
return function(n) {
|
|
1147
|
+
const { feature: s, loading: i, error: a } = K(e);
|
|
1148
|
+
if (i)
|
|
1149
|
+
return /* @__PURE__ */ f.jsx("div", { className: "h-8 animate-pulse rounded bg-gray-200" });
|
|
1150
|
+
if (a || !s) {
|
|
1151
|
+
const c = t;
|
|
1152
|
+
return c ? /* @__PURE__ */ f.jsx(c, { ...n }) : null;
|
|
1153
|
+
}
|
|
1154
|
+
return /* @__PURE__ */ f.jsx(o, { ...n });
|
|
1155
|
+
};
|
|
1156
|
+
}
|
|
1157
|
+
const he = "1.0.0";
|
|
1158
|
+
export {
|
|
1159
|
+
ye as AnalyticsPlugin,
|
|
1160
|
+
we as BasePlugin,
|
|
1161
|
+
he as CORE_ARCHITECTURE_VERSION,
|
|
1162
|
+
B as ConsolePluginLogger,
|
|
1163
|
+
Ie as EVENT_SYSTEM_VERSION,
|
|
1164
|
+
I as EventBus,
|
|
1165
|
+
Ne as EventDelegator,
|
|
1166
|
+
l as FEATURES,
|
|
1167
|
+
E as FeatureDetector,
|
|
1168
|
+
M as MediaLoadingOptimizer,
|
|
1169
|
+
$e as MiddlewareBuilder,
|
|
1170
|
+
_ as NetworkMonitor,
|
|
1171
|
+
Te as PLUGIN_SYSTEM_VERSION,
|
|
1172
|
+
P as PerformanceBenchmark,
|
|
1173
|
+
O as PerformanceBudgetMonitor,
|
|
1174
|
+
Ge as PerformanceDashboard,
|
|
1175
|
+
Xe as PerformanceMonitor,
|
|
1176
|
+
x as PerformanceRegressionDetector,
|
|
1177
|
+
U as PerformanceTestFramework,
|
|
1178
|
+
Se as PluginConflictError,
|
|
1179
|
+
ve as PluginDependencyError,
|
|
1180
|
+
be as PluginDevelopmentHelpers,
|
|
1181
|
+
Pe as PluginError,
|
|
1182
|
+
Me as PluginPerformanceMonitor,
|
|
1183
|
+
R as PluginRegistry,
|
|
1184
|
+
Le as PluginStorage,
|
|
1185
|
+
Ee as PluginValidator,
|
|
1186
|
+
W as ProgressiveLoader,
|
|
1187
|
+
Y as ServiceProvider,
|
|
1188
|
+
Fe as commonMiddlewares,
|
|
1189
|
+
Ce as createAnalyticsPlugin,
|
|
1190
|
+
de as createArchitecture,
|
|
1191
|
+
xe as createMiddleware,
|
|
1192
|
+
ke as createPlugin,
|
|
1193
|
+
Ue as defaultEventBus,
|
|
1194
|
+
z as defaultMediaLoadingConfig,
|
|
1195
|
+
D as defaultPerformanceBudgets,
|
|
1196
|
+
Ae as defaultPerformanceMonitor,
|
|
1197
|
+
Be as defaultPluginLogger,
|
|
1198
|
+
Q as defaultProgressiveConfig,
|
|
1199
|
+
Ze as defaultThresholds,
|
|
1200
|
+
De as eventMiddlewares,
|
|
1201
|
+
me as lazyComponents,
|
|
1202
|
+
V as mediaLoadingOptimizer,
|
|
1203
|
+
v as performanceBenchmark,
|
|
1204
|
+
ne as performanceBudgetMonitor,
|
|
1205
|
+
et as performanceMonitor,
|
|
1206
|
+
re as performanceTestFramework,
|
|
1207
|
+
te as performanceTestUtils,
|
|
1208
|
+
b as progressiveLoader,
|
|
1209
|
+
ce as useAnalytics,
|
|
1210
|
+
Oe as useConditionalEventListener,
|
|
1211
|
+
ze as useEventBus,
|
|
1212
|
+
_e as useEventDebugger,
|
|
1213
|
+
Ve as useEventEffect,
|
|
1214
|
+
He as useEventEmitter,
|
|
1215
|
+
je as useEventHandlers,
|
|
1216
|
+
Ye as useEventHistory,
|
|
1217
|
+
Qe as useEventListener,
|
|
1218
|
+
We as useEventMetrics,
|
|
1219
|
+
Ke as useEventOnce,
|
|
1220
|
+
Je as useEventState,
|
|
1221
|
+
le as useLogger,
|
|
1222
|
+
oe as useMediaLoadingOptimizer,
|
|
1223
|
+
tt as usePerformanceMonitor,
|
|
1224
|
+
ie as usePluginRegistry,
|
|
1225
|
+
K as useProgressiveFeature,
|
|
1226
|
+
se as useServiceEventBus,
|
|
1227
|
+
p as useServices,
|
|
1228
|
+
ae as useStorage,
|
|
1229
|
+
rt as withPerformanceMonitoring,
|
|
1230
|
+
ge as withProgressiveFeature,
|
|
1231
|
+
ue as withServices
|
|
1232
|
+
};
|
|
1233
|
+
//# sourceMappingURL=core.mjs.map
|