@therealtinhtute/baroiplayer 1.0.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 +21 -0
- package/README.md +384 -0
- 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-BMteAJDN.js +1140 -0
- package/dist/context-BMteAJDN.js.map +1 -0
- package/dist/context-DCJ_scmO.cjs +23 -0
- package/dist/context-DCJ_scmO.cjs.map +1 -0
- package/dist/core-events-B5W_j8yU.js +480 -0
- package/dist/core-events-B5W_j8yU.js.map +1 -0
- package/dist/core-events-CN0-Vhhq.cjs +2 -0
- package/dist/core-events-CN0-Vhhq.cjs.map +1 -0
- package/dist/core-plugins-Bq9KLany.js +696 -0
- package/dist/core-plugins-Bq9KLany.js.map +1 -0
- package/dist/core-plugins-CPDSHMiQ.cjs +2 -0
- package/dist/core-plugins-CPDSHMiQ.cjs.map +1 -0
- package/dist/core.js +37 -0
- package/dist/core.js.map +1 -0
- package/dist/core.mjs +1217 -0
- package/dist/core.mjs.map +1 -0
- package/dist/enhanced-components-DHv0MFvG.js +1073 -0
- package/dist/enhanced-components-DHv0MFvG.js.map +1 -0
- package/dist/enhanced-components-DTIObgB7.cjs +2 -0
- package/dist/enhanced-components-DTIObgB7.cjs.map +1 -0
- package/dist/hooks-C_r8wexn.cjs +4 -0
- package/dist/hooks-C_r8wexn.cjs.map +1 -0
- package/dist/hooks-Da2wVXlF.js +1630 -0
- package/dist/hooks-Da2wVXlF.js.map +1 -0
- package/dist/index.css +1 -0
- package/dist/index.js +112 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +6126 -0
- package/dist/index.mjs.map +1 -0
- package/dist/minimal-components-DSq5sQpy.js +2002 -0
- package/dist/minimal-components-DSq5sQpy.js.map +1 -0
- package/dist/minimal-components-DflWiihN.cjs +2 -0
- package/dist/minimal-components-DflWiihN.cjs.map +1 -0
- package/dist/minimal-components.css +1 -0
- package/dist/mona-loading.gif +0 -0
- package/dist/performance-monitor-CUW6f5ll.cjs +2 -0
- package/dist/performance-monitor-CUW6f5ll.cjs.map +1 -0
- package/dist/performance-monitor-rMW1RgV3.js +302 -0
- package/dist/performance-monitor-rMW1RgV3.js.map +1 -0
- package/dist/utils-BnscpYYd.js +2798 -0
- package/dist/utils-BnscpYYd.js.map +1 -0
- package/dist/utils-D_czS_0K.cjs +9 -0
- package/dist/utils-D_czS_0K.cjs.map +1 -0
- package/dist/utils.js +2 -0
- package/dist/utils.js.map +1 -0
- package/dist/utils.mjs +7 -0
- package/dist/utils.mjs.map +1 -0
- package/package.json +114 -0
- package/src/adapters/videojs-adapter.tsx +470 -0
- package/src/assets/mona-loading.gif +0 -0
- package/src/components/AnimateLoading.tsx +115 -0
- package/src/components/LoadingState.tsx +248 -0
- package/src/components/accessibility/keyboard-help-overlay.tsx +213 -0
- package/src/components/audio-player.tsx +85 -0
- package/src/components/basic/index.ts +37 -0
- package/src/components/enhanced/advanced-features.tsx +316 -0
- package/src/components/enhanced/debug-panel.tsx +422 -0
- package/src/components/enhanced/enhanced-controls.tsx +600 -0
- package/src/components/enhanced/enhanced-media-player.tsx +509 -0
- package/src/components/enhanced/error-handling.tsx +345 -0
- package/src/components/enhanced/index.ts +39 -0
- package/src/components/enhanced/media-player-enhanced.tsx +349 -0
- package/src/components/examples/basic-video-player.tsx +55 -0
- package/src/components/examples/custom-controls-example.tsx +63 -0
- package/src/components/examples/enhanced-controls-example.tsx +114 -0
- package/src/components/examples/enhanced-media-player-example.tsx +293 -0
- package/src/components/examples/loading-states-demo.tsx +142 -0
- package/src/components/examples/react-19-demo.tsx +381 -0
- package/src/components/examples/volume-orientation-demo.tsx +114 -0
- package/src/components/icon-demo.tsx +209 -0
- package/src/components/icons/index.tsx +166 -0
- package/src/components/icons/svg-icons/ArrowLeftIcon.tsx +18 -0
- package/src/components/icons/svg-icons/ArrowRightIcon.tsx +18 -0
- package/src/components/icons/svg-icons/AudioIcon.tsx +22 -0
- package/src/components/icons/svg-icons/BackwardIcon.tsx +12 -0
- package/src/components/icons/svg-icons/CameraIcon.tsx +19 -0
- package/src/components/icons/svg-icons/CheckIcon.tsx +19 -0
- package/src/components/icons/svg-icons/EnablePiPIcon.tsx +17 -0
- package/src/components/icons/svg-icons/ForwardIcon.tsx +12 -0
- package/src/components/icons/svg-icons/FullscreenEnterIcon.tsx +23 -0
- package/src/components/icons/svg-icons/FullscreenExitIcon.tsx +23 -0
- package/src/components/icons/svg-icons/LoadingIcon.tsx +32 -0
- package/src/components/icons/svg-icons/PauseIcon.tsx +23 -0
- package/src/components/icons/svg-icons/PlayIcon.tsx +21 -0
- package/src/components/icons/svg-icons/PlaybackSpeedIcon.tsx +23 -0
- package/src/components/icons/svg-icons/QualityIcon.tsx +21 -0
- package/src/components/icons/svg-icons/SettingsIcon.tsx +12 -0
- package/src/components/icons/svg-icons/SliderIcon.tsx +21 -0
- package/src/components/icons/svg-icons/SubtitleIcon.tsx +21 -0
- package/src/components/icons/svg-icons/SubtitleOffIcon.tsx +25 -0
- package/src/components/icons/svg-icons/UnPiPIcon.tsx +17 -0
- package/src/components/icons/svg-icons/VolumeMutedIcon.tsx +16 -0
- package/src/components/icons/svg-icons/VolumeOneIcon.tsx +22 -0
- package/src/components/icons/svg-icons/VolumeThreeIcon.tsx +16 -0
- package/src/components/icons/svg-icons/VolumeTwoIcon.tsx +16 -0
- package/src/components/legacy.tsx +93 -0
- package/src/components/media-metadata-display.tsx +100 -0
- package/src/components/media-player-audio.tsx +39 -0
- package/src/components/media-player-controls.tsx +226 -0
- package/src/components/media-player-error.tsx +163 -0
- package/src/components/media-player-fullscreen.tsx +109 -0
- package/src/components/media-player-hls.tsx +111 -0
- package/src/components/media-player-loading.tsx +76 -0
- package/src/components/media-player-play.tsx +75 -0
- package/src/components/media-player-root.tsx +340 -0
- package/src/components/media-player-seek.tsx +168 -0
- package/src/components/media-player-time.tsx +99 -0
- package/src/components/media-player-tooltip.tsx +58 -0
- package/src/components/media-player-video.tsx +39 -0
- package/src/components/media-player-volume.tsx +155 -0
- package/src/components/media-player.tsx +257 -0
- package/src/components/media-suspense.tsx +362 -0
- package/src/components/player-settings-form.tsx +163 -0
- package/src/components/react-player-wrapper.tsx +651 -0
- package/src/components/simple-video-player.tsx +60 -0
- package/src/components/ui/enhanced-seek-bar.tsx +235 -0
- package/src/components/ui/fullscreen-button.tsx +60 -0
- package/src/components/ui/media-resource-preloader.tsx +395 -0
- package/src/components/ui/play-button.tsx +107 -0
- package/src/components/ui/seek-bar.tsx +161 -0
- package/src/components/ui/time-display.tsx +40 -0
- package/src/components/ui/volume-control.tsx +143 -0
- package/src/components/unified/base-media-player.tsx +246 -0
- package/src/components/unified/media-player.tsx +75 -0
- package/src/components/variants/minimal/AccessibleMinimalPlayer.tsx +561 -0
- package/src/components/variants/minimal/EnhancedMinimalMediaPlayer.tsx +552 -0
- package/src/components/variants/minimal/MinimalControls.tsx +142 -0
- package/src/components/variants/minimal/MinimalLoading.tsx +32 -0
- package/src/components/variants/minimal/MinimalMediaPlayer.tsx +315 -0
- package/src/components/variants/minimal/MinimalOverlay.tsx +64 -0
- package/src/components/variants/minimal/MinimalPlayButton.tsx +65 -0
- package/src/components/variants/minimal/MinimalSeekBar.tsx +150 -0
- package/src/components/variants/minimal/MinimalVolumeControl.tsx +80 -0
- package/src/components/variants/minimal/SimpleMinimalPlayer.tsx +210 -0
- package/src/components/variants/minimal/components/CenterPlayButton.tsx +22 -0
- package/src/components/variants/minimal/components/ControlBar.tsx +146 -0
- package/src/components/variants/minimal/components/EnhancedSettingsMenu.tsx +361 -0
- package/src/components/variants/minimal/components/PlaybackControls.tsx +51 -0
- package/src/components/variants/minimal/components/RightControls.tsx +173 -0
- package/src/components/variants/minimal/components/SeekBar.tsx +131 -0
- package/src/components/variants/minimal/components/SettingsDropdown.tsx +70 -0
- package/src/components/variants/minimal/components/SubtitleDisplay.tsx +21 -0
- package/src/components/variants/minimal/components/TimeDisplay.tsx +18 -0
- package/src/components/variants/minimal/components/VideoElement.tsx +40 -0
- package/src/components/variants/minimal/components/VolumeControl.tsx +217 -0
- package/src/components/variants/minimal/index.ts +23 -0
- package/src/components/video-player.tsx +100 -0
- package/src/context/error-handling.ts +394 -0
- package/src/context/media-context.tsx +208 -0
- package/src/context/media-provider.tsx +265 -0
- package/src/context/media-store.ts +379 -0
- package/src/context/persistence.ts +453 -0
- package/src/core/events/event-system.ts +442 -0
- package/src/core/events/hooks.ts +302 -0
- package/src/core/events/index.ts +22 -0
- package/src/core/events/middleware.ts +269 -0
- package/src/core/index.ts +22 -0
- package/src/core/optimization/bundle-optimizer.tsx +308 -0
- package/src/core/performance/cicd.ts +96 -0
- package/src/core/performance/index.ts +38 -0
- package/src/core/performance/media-loading-optimizer.ts +538 -0
- package/src/core/performance/performance-budgets.ts +432 -0
- package/src/core/performance/performance-monitor.tsx +476 -0
- package/src/core/performance/performance-testing.ts +459 -0
- package/src/core/plugins/base-plugin.ts +224 -0
- package/src/core/plugins/enhanced-plugin-system.ts +411 -0
- package/src/core/plugins/examples/analytics-plugin.ts +242 -0
- package/src/core/plugins/index.ts +39 -0
- package/src/core/plugins/registry.ts +327 -0
- package/src/core/plugins/types.ts +159 -0
- package/src/core/plugins/utils.ts +316 -0
- package/src/core/progressive-loading.tsx +322 -0
- package/src/core/providers/enhanced-hls-provider.ts +339 -0
- package/src/core/providers/service-provider.tsx +168 -0
- package/src/core/utils.tsx +38 -0
- package/src/features/media-session/media-session-manager.ts +429 -0
- package/src/features/picture-in-picture/pip-manager.ts +429 -0
- package/src/features/playlist/playlist-manager.ts +606 -0
- package/src/features/subtitles/subtitle-manager.ts +441 -0
- package/src/features/subtitles/subtitle-parser.ts +280 -0
- package/src/features/thumbnails/thumbnail-generator.ts +519 -0
- package/src/hooks/accessibility/index.ts +27 -0
- package/src/hooks/accessibility/use-accessibility-preferences.ts +188 -0
- package/src/hooks/accessibility/use-focus-management.ts +176 -0
- package/src/hooks/accessibility/use-keyboard-shortcuts.ts +144 -0
- package/src/hooks/accessibility/use-screen-reader.ts +182 -0
- package/src/hooks/core/index.ts +47 -0
- package/src/hooks/legacy.ts +27 -0
- package/src/hooks/use-enhanced-media-player.ts +468 -0
- package/src/hooks/use-intelligent-preloading.ts +358 -0
- package/src/hooks/use-keyboard-controls.ts +115 -0
- package/src/hooks/use-media-actions.ts +175 -0
- package/src/hooks/use-media-metadata.ts +89 -0
- package/src/hooks/use-media-optimistic.ts +270 -0
- package/src/hooks/use-media-player.ts +312 -0
- package/src/hooks/use-media-state.ts +190 -0
- package/src/hooks/use-memory-optimization.ts +358 -0
- package/src/hooks/use-optimistic-controls.ts +92 -0
- package/src/hooks/use-optimized-media.ts +263 -0
- package/src/hooks/use-touch-gestures.ts +417 -0
- package/src/hooks/useEnhancedSubtitles.ts +258 -0
- package/src/hooks/useKeyboardShortcuts.ts +74 -0
- package/src/hooks/useMediaControls.ts +52 -0
- package/src/hooks/useScreenshot.ts +57 -0
- package/src/hooks/useSubtitles.ts +91 -0
- package/src/hooks/useVideoPlayer.ts +232 -0
- package/src/icons/components/FullscreenIcon.tsx +37 -0
- package/src/icons/components/SettingsIcon.tsx +38 -0
- package/src/icons/components/animated/LoadingIcon.tsx +43 -0
- package/src/icons/components/animated/PlayPauseIcon.tsx +50 -0
- package/src/icons/components/media/PauseIcon.tsx +39 -0
- package/src/icons/components/media/PlayIcon.tsx +38 -0
- package/src/icons/components/volume/VolumeIcon.tsx +39 -0
- package/src/icons/components/volume/VolumeOffIcon.tsx +39 -0
- package/src/icons/index.ts +56 -0
- package/src/icons/provider.tsx +64 -0
- package/src/icons/types.ts +40 -0
- package/src/index-enhanced.ts +35 -0
- package/src/index-legacy.ts +326 -0
- package/src/index.css +102 -0
- package/src/index.ts +216 -0
- package/src/lib/deprecation.ts +51 -0
- package/src/lib/format-time.ts +37 -0
- package/src/lib/index.ts +3 -0
- package/src/lib/utils.ts +6 -0
- package/src/styles/globals.css +462 -0
- package/src/styles/minimal-player.css +589 -0
- package/src/styles/pixel-art.css +46 -0
- package/src/styles/videojs.css +100 -0
- package/src/test/setup.ts +79 -0
- package/src/types/events.ts +47 -0
- package/src/types/formats.ts +95 -0
- package/src/types/index.ts +190 -0
- package/src/types/videojs-plugins.d.ts +14 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { SVGProps } from 'react'
|
|
2
|
+
|
|
3
|
+
export interface IconProps extends Omit<SVGProps<SVGSVGElement>, 'width' | 'height' | 'viewBox'> {
|
|
4
|
+
size?: number | string
|
|
5
|
+
color?: string
|
|
6
|
+
strokeWidth?: number | string
|
|
7
|
+
className?: string
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface IconTheme {
|
|
11
|
+
size?: number | string
|
|
12
|
+
color?: string
|
|
13
|
+
strokeWidth?: number | string
|
|
14
|
+
animation?: string
|
|
15
|
+
className?: string
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export type IconName =
|
|
19
|
+
| 'play' | 'pause' | 'stop'
|
|
20
|
+
| 'skip-forward' | 'skip-backward'
|
|
21
|
+
| 'fast-forward' | 'rewind'
|
|
22
|
+
| 'loop' | 'shuffle'
|
|
23
|
+
| 'volume' | 'volume-off'
|
|
24
|
+
| 'volume-low' | 'volume-high'
|
|
25
|
+
| 'fullscreen' | 'exit-fullscreen'
|
|
26
|
+
| 'picture-in-picture' | 'exit-picture-in-picture'
|
|
27
|
+
| 'theater-mode'
|
|
28
|
+
| 'settings' | 'settings-gear'
|
|
29
|
+
| 'quality' | 'speed'
|
|
30
|
+
| 'subtitles' | 'closed-captions'
|
|
31
|
+
| 'download' | 'share'
|
|
32
|
+
| 'heart' | 'heart-filled'
|
|
33
|
+
| 'info' | 'warning' | 'error'
|
|
34
|
+
| 'chevron-up' | 'chevron-down' | 'chevron-left' | 'chevron-right'
|
|
35
|
+
| 'check' | 'close'
|
|
36
|
+
| 'loading'
|
|
37
|
+
|
|
38
|
+
export type IconComponent = React.FC<IconProps>
|
|
39
|
+
|
|
40
|
+
export type IconSet = Record<IconName, IconComponent>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enhanced BaroiPlayer Exports
|
|
3
|
+
* Includes all new optimized components and utilities
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
// Enhanced Core Components
|
|
7
|
+
export { EnhancedMediaPlayer } from './components/enhanced/enhanced-media-player';
|
|
8
|
+
|
|
9
|
+
// Enhanced HLS Provider
|
|
10
|
+
export { EnhancedHLSProvider, ENHANCED_HLS_DEFAULTS } from './core/providers/enhanced-hls-provider';
|
|
11
|
+
export type { EnhancedHLSConfig } from './core/providers/enhanced-hls-provider';
|
|
12
|
+
|
|
13
|
+
// Enhanced Plugin System
|
|
14
|
+
export {
|
|
15
|
+
EnhancedMediaPlugin,
|
|
16
|
+
EnhancedPluginRegistry,
|
|
17
|
+
EnhancedPluginManager,
|
|
18
|
+
createPerformanceMiddleware,
|
|
19
|
+
createErrorHandlingMiddleware,
|
|
20
|
+
createLoggingMiddleware,
|
|
21
|
+
} from './core/plugins/enhanced-plugin-system';
|
|
22
|
+
export type {
|
|
23
|
+
MediaPluginHooks,
|
|
24
|
+
PluginMiddleware,
|
|
25
|
+
PluginContext,
|
|
26
|
+
} from './core/plugins/enhanced-plugin-system';
|
|
27
|
+
|
|
28
|
+
// Enhanced Hooks
|
|
29
|
+
export { useIntelligentPreloading } from './hooks/use-intelligent-preloading';
|
|
30
|
+
|
|
31
|
+
// Media Resource Preloader
|
|
32
|
+
export { MediaResourcePreloader } from './components/ui/media-resource-preloader';
|
|
33
|
+
|
|
34
|
+
// Re-export all existing components and utilities
|
|
35
|
+
export * from './index';
|
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
// Core Components (Legacy)
|
|
2
|
+
export { AudioPlayer } from "./components/audio-player"
|
|
3
|
+
export { MediaPlayer } from "./components/media-player"
|
|
4
|
+
export { VideoPlayer } from "./components/video-player"
|
|
5
|
+
|
|
6
|
+
// HLS Streaming Components
|
|
7
|
+
export { MediaPlayerHLS } from "./components/media-player-hls"
|
|
8
|
+
export type { MediaPlayerHLSProps } from "./components/media-player-hls"
|
|
9
|
+
export { VideoJSAdapter } from "./adapters/videojs-adapter"
|
|
10
|
+
export type { VideoSource, TextTrack, VideoJSAdapterProps } from "./adapters/videojs-adapter"
|
|
11
|
+
export { SimpleVideoPlayer } from "./components/simple-video-player"
|
|
12
|
+
|
|
13
|
+
// Modern React Player
|
|
14
|
+
export { ModernMediaPlayer } from "./components/react-player-wrapper"
|
|
15
|
+
export type { ModernMediaPlayerProps } from "./components/react-player-wrapper"
|
|
16
|
+
|
|
17
|
+
// New DiceUI-style Components
|
|
18
|
+
export { MediaPlayerAudio } from "./components/media-player-audio"
|
|
19
|
+
export {
|
|
20
|
+
MediaPlayerControls,
|
|
21
|
+
MediaPlayerControlsOverlay
|
|
22
|
+
} from "./components/media-player-controls"
|
|
23
|
+
export { MediaPlayerError } from "./components/media-player-error"
|
|
24
|
+
export { MediaPlayerFullscreen } from "./components/media-player-fullscreen"
|
|
25
|
+
export { MediaPlayerLoading } from "./components/media-player-loading"
|
|
26
|
+
export { MediaPlayerPlay } from "./components/media-player-play"
|
|
27
|
+
export { MediaPlayerRoot } from "./components/media-player-root"
|
|
28
|
+
export { MediaPlayerSeek } from "./components/media-player-seek"
|
|
29
|
+
export { MediaPlayerTime } from "./components/media-player-time"
|
|
30
|
+
export { MediaPlayerTooltip } from "./components/media-player-tooltip"
|
|
31
|
+
export { MediaPlayerVideo } from "./components/media-player-video"
|
|
32
|
+
export { MediaPlayerVolume } from "./components/media-player-volume"
|
|
33
|
+
|
|
34
|
+
// Example Components
|
|
35
|
+
export { BasicVideoPlayer } from "./components/examples/basic-video-player"
|
|
36
|
+
export { CustomControlsExample } from "./components/examples/custom-controls-example"
|
|
37
|
+
export {
|
|
38
|
+
EnhancedControlsExample,
|
|
39
|
+
CustomEnhancedControlsExample,
|
|
40
|
+
SkipButtonsOnlyExample
|
|
41
|
+
} from "./components/examples/enhanced-controls-example"
|
|
42
|
+
export type { EnhancedControlsExampleProps } from "./components/examples/enhanced-controls-example"
|
|
43
|
+
|
|
44
|
+
// Minimal Variant Components (Doodstream-style)
|
|
45
|
+
export {
|
|
46
|
+
MinimalMediaPlayer,
|
|
47
|
+
MinimalControls,
|
|
48
|
+
MinimalPlayButton,
|
|
49
|
+
MinimalSeekBar,
|
|
50
|
+
MinimalVolumeControl,
|
|
51
|
+
MinimalOverlay,
|
|
52
|
+
MinimalLoading,
|
|
53
|
+
SimpleMinimalPlayer
|
|
54
|
+
} from "./components/variants/minimal"
|
|
55
|
+
export type {
|
|
56
|
+
MinimalMediaPlayerProps,
|
|
57
|
+
MinimalControlsProps,
|
|
58
|
+
MinimalPlayButtonProps,
|
|
59
|
+
MinimalSeekBarProps,
|
|
60
|
+
MinimalVolumeControlProps,
|
|
61
|
+
MinimalOverlayProps,
|
|
62
|
+
MinimalLoadingProps
|
|
63
|
+
} from "./components/variants/minimal"
|
|
64
|
+
|
|
65
|
+
// Custom Icons
|
|
66
|
+
export {
|
|
67
|
+
MinimalPlayIcon,
|
|
68
|
+
MinimalPauseIcon,
|
|
69
|
+
MinimalVolumeIcon,
|
|
70
|
+
MinimalVolumeMutedIcon,
|
|
71
|
+
MinimalFullscreenIcon,
|
|
72
|
+
MinimalExitFullscreenIcon,
|
|
73
|
+
MinimalSettingsIcon,
|
|
74
|
+
MinimalSpinner,
|
|
75
|
+
MinimalForwardIcon,
|
|
76
|
+
MinimalBackwardIcon,
|
|
77
|
+
defaultMinimalIcons
|
|
78
|
+
} from "./components/icons"
|
|
79
|
+
export type { IconProps, IconSet } from "./components/icons"
|
|
80
|
+
|
|
81
|
+
// Enhanced Components
|
|
82
|
+
export {
|
|
83
|
+
ChaptersPanel,
|
|
84
|
+
PictureInPictureButton,
|
|
85
|
+
PlaybackSpeedSelector,
|
|
86
|
+
QualitySelector,
|
|
87
|
+
SubtitleSelector
|
|
88
|
+
} from "./components/enhanced/advanced-features"
|
|
89
|
+
export {
|
|
90
|
+
EnhancedPlayButton,
|
|
91
|
+
EnhancedSeekBar,
|
|
92
|
+
EnhancedTimeDisplay,
|
|
93
|
+
EnhancedVolumeControl,
|
|
94
|
+
EnhancedBackwardButton,
|
|
95
|
+
EnhancedForwardButton,
|
|
96
|
+
EnhancedControlBar
|
|
97
|
+
} from "./components/enhanced/enhanced-controls"
|
|
98
|
+
export {
|
|
99
|
+
BufferHealthIndicator,
|
|
100
|
+
ConnectionStatus,
|
|
101
|
+
EnhancedError,
|
|
102
|
+
EnhancedLoading,
|
|
103
|
+
MediaPlayerErrorBoundary
|
|
104
|
+
} from "./components/enhanced/error-handling"
|
|
105
|
+
export { EnhancedMediaPlayer } from "./components/enhanced/media-player-enhanced"
|
|
106
|
+
export type { EnhancedMediaPlayerProps } from "./components/enhanced/media-player-enhanced"
|
|
107
|
+
|
|
108
|
+
// Enhanced Core System Exports
|
|
109
|
+
export {
|
|
110
|
+
EnhancedHLSProvider,
|
|
111
|
+
ENHANCED_HLS_DEFAULTS
|
|
112
|
+
} from "./core/providers/enhanced-hls-provider"
|
|
113
|
+
export type { EnhancedHLSConfig } from "./core/providers/enhanced-hls-provider"
|
|
114
|
+
|
|
115
|
+
export {
|
|
116
|
+
EnhancedMediaPlugin,
|
|
117
|
+
EnhancedPluginRegistry,
|
|
118
|
+
EnhancedPluginManager,
|
|
119
|
+
createPerformanceMiddleware,
|
|
120
|
+
createErrorHandlingMiddleware,
|
|
121
|
+
createLoggingMiddleware,
|
|
122
|
+
} from "./core/plugins/enhanced-plugin-system"
|
|
123
|
+
export type {
|
|
124
|
+
MediaPluginHooks,
|
|
125
|
+
PluginMiddleware,
|
|
126
|
+
PluginContext,
|
|
127
|
+
} from "./core/plugins/enhanced-plugin-system"
|
|
128
|
+
|
|
129
|
+
// Enhanced Hooks
|
|
130
|
+
export { useIntelligentPreloading } from "./hooks/use-intelligent-preloading"
|
|
131
|
+
export { useEnhancedMediaPlayer } from "./hooks/use-enhanced-media-player"
|
|
132
|
+
|
|
133
|
+
// Performance Monitoring
|
|
134
|
+
export {
|
|
135
|
+
PerformanceMonitor,
|
|
136
|
+
PerformanceMetrics,
|
|
137
|
+
usePerformanceMonitor as usePerformanceMonitoring
|
|
138
|
+
} from "./core/performance"
|
|
139
|
+
|
|
140
|
+
// Media Resource Preloader
|
|
141
|
+
export { MediaResourcePreloader } from "./components/ui/media-resource-preloader"
|
|
142
|
+
|
|
143
|
+
// Development Tools
|
|
144
|
+
export { DebugPanel, PerformanceDebugPanel } from "./components/enhanced/debug-panel"
|
|
145
|
+
|
|
146
|
+
// React 19 Concurrent Components
|
|
147
|
+
export {
|
|
148
|
+
ConcurrentMedia,
|
|
149
|
+
EnhancedMediaLoading,
|
|
150
|
+
EnhancedMediaSuspense,
|
|
151
|
+
EnhancedMediaWrapper,
|
|
152
|
+
MediaErrorBoundary,
|
|
153
|
+
MediaLoading,
|
|
154
|
+
MediaSuspense,
|
|
155
|
+
useDeferredMediaLoading,
|
|
156
|
+
// Hooks
|
|
157
|
+
useMediaConcurrent,
|
|
158
|
+
useMediaPerformance,
|
|
159
|
+
// HOCs
|
|
160
|
+
withMediaSuspense
|
|
161
|
+
} from "./components/media-suspense"
|
|
162
|
+
export type {
|
|
163
|
+
ConcurrentMediaProps,
|
|
164
|
+
EnhancedMediaWrapperProps,
|
|
165
|
+
MediaErrorBoundaryProps,
|
|
166
|
+
MediaLoadingProps,
|
|
167
|
+
MediaSuspenseProps
|
|
168
|
+
} from "./components/media-suspense"
|
|
169
|
+
|
|
170
|
+
// Context and Hooks
|
|
171
|
+
export {
|
|
172
|
+
MediaActionTypes,
|
|
173
|
+
useMediaContext,
|
|
174
|
+
useMediaDispatch,
|
|
175
|
+
useMediaEnhancements,
|
|
176
|
+
useMediaSelector,
|
|
177
|
+
// React 19 enhancements
|
|
178
|
+
useOptimisticMediaSelector
|
|
179
|
+
} from "./context/media-context"
|
|
180
|
+
export { MediaProvider } from "./context/media-provider"
|
|
181
|
+
|
|
182
|
+
// React 19 Enhanced State Management
|
|
183
|
+
export { createEnhancedMediaStore } from "./context/media-store"
|
|
184
|
+
export type {
|
|
185
|
+
EnhancedMediaStore,
|
|
186
|
+
MediaActionState,
|
|
187
|
+
OptimisticMediaAction
|
|
188
|
+
} from "./context/media-store"
|
|
189
|
+
|
|
190
|
+
// React 19 Persistence Layer
|
|
191
|
+
export {
|
|
192
|
+
defaultStorageAdapter,
|
|
193
|
+
MediaPersistenceManager,
|
|
194
|
+
STORAGE_KEYS,
|
|
195
|
+
useAutoMediaPersistence,
|
|
196
|
+
useMediaPersistence
|
|
197
|
+
} from "./context/persistence"
|
|
198
|
+
export type {
|
|
199
|
+
PersistenceConfig,
|
|
200
|
+
PlaybackHistoryItem,
|
|
201
|
+
SessionState,
|
|
202
|
+
StorageAdapter,
|
|
203
|
+
UserPreferences
|
|
204
|
+
} from "./context/persistence"
|
|
205
|
+
|
|
206
|
+
// React 19 Error Handling
|
|
207
|
+
export {
|
|
208
|
+
MediaErrorHandler,
|
|
209
|
+
MediaErrorType,
|
|
210
|
+
useMediaErrorBoundary,
|
|
211
|
+
useMediaErrorHandler
|
|
212
|
+
} from "./context/error-handling"
|
|
213
|
+
export type {
|
|
214
|
+
ErrorRecoveryStrategy,
|
|
215
|
+
MediaError,
|
|
216
|
+
RetryConfig
|
|
217
|
+
} from "./context/error-handling"
|
|
218
|
+
|
|
219
|
+
// Core Architecture (New)
|
|
220
|
+
export * from "./core"
|
|
221
|
+
|
|
222
|
+
// Legacy UI Components
|
|
223
|
+
export { FullscreenButton } from "./components/ui/fullscreen-button"
|
|
224
|
+
export { PlayButton } from "./components/ui/play-button"
|
|
225
|
+
export { SeekBar } from "./components/ui/seek-bar"
|
|
226
|
+
export { TimeDisplay } from "./components/ui/time-display"
|
|
227
|
+
export { VolumeControl } from "./components/ui/volume-control"
|
|
228
|
+
|
|
229
|
+
// Legacy Hooks
|
|
230
|
+
export { useKeyboardControls } from "./hooks/use-keyboard-controls"
|
|
231
|
+
export { useMediaPlayer } from "./hooks/use-media-player"
|
|
232
|
+
export {
|
|
233
|
+
useAdaptiveMediaState,
|
|
234
|
+
// React 19 enhanced versions
|
|
235
|
+
useEnhancedMediaState,
|
|
236
|
+
useMediaState
|
|
237
|
+
} from "./hooks/use-media-state"
|
|
238
|
+
|
|
239
|
+
// React 19 Advanced Hooks
|
|
240
|
+
export {
|
|
241
|
+
useMediaActions,
|
|
242
|
+
useMediaActionState
|
|
243
|
+
} from "./hooks/use-media-actions"
|
|
244
|
+
export {
|
|
245
|
+
useMediaOptimistic,
|
|
246
|
+
useMediaStateComparison,
|
|
247
|
+
useOptimisticUpdates
|
|
248
|
+
} from "./hooks/use-media-optimistic"
|
|
249
|
+
|
|
250
|
+
// Optimized Hooks
|
|
251
|
+
export {
|
|
252
|
+
useDebouncedSeek,
|
|
253
|
+
useFormattedTime,
|
|
254
|
+
useIntersectionObserver,
|
|
255
|
+
useMediaQuery,
|
|
256
|
+
useOptimizedMediaControls,
|
|
257
|
+
useOptimizedMediaState,
|
|
258
|
+
useThrottledVolume
|
|
259
|
+
} from "./hooks/use-optimized-media"
|
|
260
|
+
|
|
261
|
+
// Mobile-First Touch Gestures
|
|
262
|
+
export {
|
|
263
|
+
useMediaGestures,
|
|
264
|
+
useTouchGestures
|
|
265
|
+
} from "./hooks/use-touch-gestures"
|
|
266
|
+
export type {
|
|
267
|
+
GestureConfig,
|
|
268
|
+
GestureEvent,
|
|
269
|
+
GestureType
|
|
270
|
+
} from "./hooks/use-touch-gestures"
|
|
271
|
+
|
|
272
|
+
// Refactored Hooks (React 19 optimized)
|
|
273
|
+
export { useVideoPlayer } from "./hooks/useVideoPlayer"
|
|
274
|
+
export { useSubtitles } from "./hooks/useSubtitles"
|
|
275
|
+
export { useEnhancedSubtitles } from "./hooks/useEnhancedSubtitles"
|
|
276
|
+
export type { SubtitleTrack, UseEnhancedSubtitlesOptions } from "./hooks/useEnhancedSubtitles"
|
|
277
|
+
export { useMediaControls } from "./hooks/useMediaControls"
|
|
278
|
+
export { useScreenshot } from "./hooks/useScreenshot"
|
|
279
|
+
export type { VideoState, VideoControls } from "./hooks/useVideoPlayer"
|
|
280
|
+
// Utilities
|
|
281
|
+
export { formatTime, parseTime } from "./lib/format-time"
|
|
282
|
+
export { cn } from "./lib/utils"
|
|
283
|
+
// Types
|
|
284
|
+
export type {
|
|
285
|
+
AudioFormat,
|
|
286
|
+
AudioMimeType,
|
|
287
|
+
AudioPlayerProps,
|
|
288
|
+
FullscreenButtonProps,
|
|
289
|
+
MediaCapabilities,
|
|
290
|
+
MediaErrorEvent,
|
|
291
|
+
// Event types
|
|
292
|
+
MediaEventMap,
|
|
293
|
+
MediaEventType,
|
|
294
|
+
MediaFormat,
|
|
295
|
+
MediaMimeType,
|
|
296
|
+
MediaPlayerConfig,
|
|
297
|
+
MediaPlayerControls as MediaPlayerControlsType,
|
|
298
|
+
MediaPlayerProps,
|
|
299
|
+
MediaPlayerState,
|
|
300
|
+
MediaProgressEvent,
|
|
301
|
+
MediaSource,
|
|
302
|
+
MediaTimeUpdateEvent,
|
|
303
|
+
MediaVolumeChangeEvent,
|
|
304
|
+
PlayButtonProps,
|
|
305
|
+
SeekBarProps,
|
|
306
|
+
SupportedFormats,
|
|
307
|
+
TimeDisplayProps,
|
|
308
|
+
// Format types
|
|
309
|
+
VideoFormat,
|
|
310
|
+
VideoMimeType,
|
|
311
|
+
VideoPlayerProps,
|
|
312
|
+
VolumeControlProps
|
|
313
|
+
} from "./types"
|
|
314
|
+
|
|
315
|
+
// React 19 Enhanced Types
|
|
316
|
+
export type { MediaActionPayloads } from "./hooks/use-media-actions"
|
|
317
|
+
|
|
318
|
+
// Format utilities and constants
|
|
319
|
+
export {
|
|
320
|
+
AUDIO_MIME_TYPES,
|
|
321
|
+
getMediaTypeFromUrl,
|
|
322
|
+
getMimeTypeFromUrl,
|
|
323
|
+
SUPPORTED_AUDIO_FORMATS,
|
|
324
|
+
SUPPORTED_VIDEO_FORMATS,
|
|
325
|
+
VIDEO_MIME_TYPES
|
|
326
|
+
} from "./types"
|
package/src/index.css
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/* Import Tailwind v4 */
|
|
2
|
+
@import "tailwindcss";
|
|
3
|
+
|
|
4
|
+
/* Custom theme layer */
|
|
5
|
+
@layer theme {
|
|
6
|
+
:root {
|
|
7
|
+
/* Colors in oklch for better perception */
|
|
8
|
+
--color-primary: oklch(65% 0.3 250);
|
|
9
|
+
--color-primary-hover: oklch(60% 0.3 250);
|
|
10
|
+
--color-secondary: oklch(75% 0.15 150);
|
|
11
|
+
--color-background: oklch(10% 0 0);
|
|
12
|
+
--color-surface: oklch(15% 0 0);
|
|
13
|
+
--color-text: oklch(95% 0 0);
|
|
14
|
+
|
|
15
|
+
/* Spacing scale */
|
|
16
|
+
--spacing-xs: 0.25rem;
|
|
17
|
+
--spacing-sm: 0.5rem;
|
|
18
|
+
--spacing-md: 1rem;
|
|
19
|
+
--spacing-lg: 1.5rem;
|
|
20
|
+
--spacing-xl: 2rem;
|
|
21
|
+
|
|
22
|
+
/* Animation timing */
|
|
23
|
+
--duration-fast: 150ms;
|
|
24
|
+
--duration-normal: 300ms;
|
|
25
|
+
--duration-slow: 500ms;
|
|
26
|
+
|
|
27
|
+
/* Container queries breakpoints */
|
|
28
|
+
--container-sm: 480px;
|
|
29
|
+
--container-md: 768px;
|
|
30
|
+
--container-lg: 1024px;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/* Light theme */
|
|
34
|
+
[data-theme="light"] {
|
|
35
|
+
--color-background: oklch(98% 0 0);
|
|
36
|
+
--color-surface: oklch(100% 0 0);
|
|
37
|
+
--color-text: oklch(10% 0 0);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/* Component styles with container queries */
|
|
42
|
+
@layer components {
|
|
43
|
+
.player-container {
|
|
44
|
+
container-type: inline-size;
|
|
45
|
+
container-name: player;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.player-controls {
|
|
49
|
+
display: grid;
|
|
50
|
+
gap: var(--spacing-sm);
|
|
51
|
+
|
|
52
|
+
@container player (min-width: 480px) {
|
|
53
|
+
grid-template-columns: auto 1fr auto;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
@container player (min-width: 768px) {
|
|
57
|
+
grid-template-columns: auto 1fr auto auto;
|
|
58
|
+
gap: var(--spacing-md);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/* Smooth entry animations with @starting-style */
|
|
63
|
+
.control-button {
|
|
64
|
+
@starting-style {
|
|
65
|
+
opacity: 0;
|
|
66
|
+
scale: 0.9;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
opacity: 1;
|
|
70
|
+
scale: 1;
|
|
71
|
+
transition: all var(--duration-normal);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/* Utility overrides */
|
|
76
|
+
@layer utilities {
|
|
77
|
+
.text-primary {
|
|
78
|
+
color: var(--color-primary);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.bg-surface {
|
|
82
|
+
background-color: var(--color-surface);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.bg-primary {
|
|
86
|
+
background-color: var(--color-primary);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.bg-primary-hover {
|
|
90
|
+
background-color: var(--color-primary-hover);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/* Component Styles */
|
|
95
|
+
@import "./styles/minimal-player.css";
|
|
96
|
+
@import "./styles/pixel-art.css";
|
|
97
|
+
@import "./styles/videojs.css";
|
|
98
|
+
|
|
99
|
+
/* Dark mode support */
|
|
100
|
+
.dark {
|
|
101
|
+
color-scheme: dark;
|
|
102
|
+
}
|