@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,23 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
import { SVGProps, memo } from 'react'
|
|
3
|
+
|
|
4
|
+
const PlaybackSpeedIcon = (props: SVGProps<SVGSVGElement>) => (
|
|
5
|
+
<svg
|
|
6
|
+
width='24'
|
|
7
|
+
height='24'
|
|
8
|
+
viewBox='0 0 24 24'
|
|
9
|
+
fill='none'
|
|
10
|
+
xmlns='http://www.w3.org/2000/svg'
|
|
11
|
+
className='Hawkins-Icon Hawkins-Icon-Standard'
|
|
12
|
+
style={{ width: '100%', height: '100%' }}
|
|
13
|
+
{...props}>
|
|
14
|
+
<path
|
|
15
|
+
fillRule='evenodd'
|
|
16
|
+
clipRule='evenodd'
|
|
17
|
+
d='M17.643 7.438c-3.122-3.25-8.164-3.25-11.286 0-3.143 3.273-3.143 8.596 0 11.87l-1.442 1.385c-3.887-4.048-3.887-10.593 0-14.64 3.908-4.07 10.262-4.07 14.17 0 3.887 4.047 3.887 10.592 0 14.64l-1.442-1.386c3.143-3.273 3.143-8.596 0-11.87ZM14 14a2 2 0 1 1-1.482-1.932l3.275-3.275 1.414 1.414-3.275 3.275c.044.165.068.339.068.518Z'
|
|
18
|
+
fill='currentColor'
|
|
19
|
+
/>
|
|
20
|
+
</svg>
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
export default PlaybackSpeedIcon
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
import { SVGProps, memo } from 'react'
|
|
3
|
+
|
|
4
|
+
const QualityIcon = (props: SVGProps<SVGSVGElement>) => (
|
|
5
|
+
<svg
|
|
6
|
+
xmlns='http://www.w3.org/2000/svg'
|
|
7
|
+
aria-hidden='true'
|
|
8
|
+
className='iconify iconify--ic'
|
|
9
|
+
width='24'
|
|
10
|
+
height='24'
|
|
11
|
+
viewBox='0 0 24 24'
|
|
12
|
+
style={{ width: '100%', height: '100%' }}
|
|
13
|
+
{...props}>
|
|
14
|
+
<path
|
|
15
|
+
fill='currentColor'
|
|
16
|
+
d='M19 4H5a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 14H5V6h14v12zM7.5 13h2v2H11V9H9.5v2.5h-2V9H6v6h1.5zm6.5 2h.75v1.5h1.5V15H17c.55 0 1-.45 1-1v-4c0-.55-.45-1-1-1h-3c-.55 0-1 .45-1 1v4c0 .55.45 1 1 1zm.5-4.5h2v3h-2v-3z'
|
|
17
|
+
/>
|
|
18
|
+
</svg>
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
export default QualityIcon
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
import { SVGProps } from 'react'
|
|
3
|
+
|
|
4
|
+
const SettingsIcon = (props: SVGProps<SVGSVGElement>) => (
|
|
5
|
+
<svg width='24' height='24' viewBox='0 0 24 24' {...props}>
|
|
6
|
+
<path
|
|
7
|
+
fill='currentColor'
|
|
8
|
+
d='M2 12c0-.865.11-1.703.316-2.504A3 3 0 0 0 4.99 4.867a9.99 9.99 0 0 1 4.335-2.505a3 3 0 0 0 5.348 0a9.99 9.99 0 0 1 4.335 2.505a3 3 0 0 0 2.675 4.63a10.036 10.036 0 0 1 0 5.007a3 3 0 0 0-2.675 4.629a9.99 9.99 0 0 1-4.335 2.505a3 3 0 0 0-5.348 0a9.99 9.99 0 0 1-4.335-2.505a3 3 0 0 0-2.675-4.63A10.056 10.056 0 0 1 2 12zm4.804 3c.63 1.091.81 2.346.564 3.524c.408.29.842.541 1.297.75A4.993 4.993 0 0 1 12 18c1.26 0 2.438.471 3.335 1.274c.455-.209.889-.46 1.297-.75A4.993 4.993 0 0 1 17.196 15a4.993 4.993 0 0 1 2.77-2.25a8.126 8.126 0 0 0 0-1.5A4.993 4.993 0 0 1 17.195 9a4.993 4.993 0 0 1-.564-3.524a7.989 7.989 0 0 0-1.297-.75A4.993 4.993 0 0 1 12 6a4.993 4.993 0 0 1-3.335-1.274a7.99 7.99 0 0 0-1.297.75A4.993 4.993 0 0 1 6.804 9a4.993 4.993 0 0 1-2.77 2.25a8.126 8.126 0 0 0 0 1.5A4.993 4.993 0 0 1 6.805 15zM12 15a3 3 0 1 1 0-6a3 3 0 0 1 0 6zm0-2a1 1 0 1 0 0-2a1 1 0 0 0 0 2z'></path>
|
|
9
|
+
</svg>
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
export default SettingsIcon
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
import { SVGProps, memo } from 'react'
|
|
3
|
+
|
|
4
|
+
const SliderIcon = (props: SVGProps<SVGSVGElement>) => (
|
|
5
|
+
<svg
|
|
6
|
+
xmlns='http://www.w3.org/2000/svg'
|
|
7
|
+
aria-hidden='true'
|
|
8
|
+
className='iconify iconify--uil'
|
|
9
|
+
width={32}
|
|
10
|
+
height={32}
|
|
11
|
+
viewBox='0 0 24 24'
|
|
12
|
+
style={{ width: '100%', height: '100%' }}
|
|
13
|
+
{...props}>
|
|
14
|
+
<path
|
|
15
|
+
fill='currentColor'
|
|
16
|
+
d='M21 11h-3.184a2.982 2.982 0 0 0-5.632 0H3a1 1 0 0 0 0 2h9.184a2.982 2.982 0 0 0 5.632 0H21a1 1 0 0 0 0-2Zm-6 2a1 1 0 1 1 1-1 1.001 1.001 0 0 1-1 1Z'
|
|
17
|
+
/>
|
|
18
|
+
</svg>
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
export default SliderIcon
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
import { SVGProps, memo } from 'react'
|
|
3
|
+
|
|
4
|
+
const SubtitleIcon = (props: SVGProps<SVGSVGElement>) => (
|
|
5
|
+
<svg
|
|
6
|
+
width='24'
|
|
7
|
+
height='24'
|
|
8
|
+
viewBox='0 0 24 24'
|
|
9
|
+
fill='none'
|
|
10
|
+
xmlns='http://www.w3.org/2000/svg'
|
|
11
|
+
className='Hawkins-Icon Hawkins-Icon-Standard'
|
|
12
|
+
style={{ width: '100%', height: '100%' }}
|
|
13
|
+
{...props}>
|
|
14
|
+
<path
|
|
15
|
+
fill='currentColor'
|
|
16
|
+
d='M20 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 14H4V6h16v12zM6 10h2v2H6zm0 4h8v2H6zm10 0h2v2h-2zm-6-4h8v2h-8z'
|
|
17
|
+
/>
|
|
18
|
+
</svg>
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
export default SubtitleIcon
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
import { SVGProps, memo } from 'react'
|
|
3
|
+
|
|
4
|
+
const SubtitleOffIcon = (props: SVGProps<SVGSVGElement>) => (
|
|
5
|
+
<svg
|
|
6
|
+
width='24'
|
|
7
|
+
height='24'
|
|
8
|
+
viewBox='0 0 24 24'
|
|
9
|
+
fill='none'
|
|
10
|
+
xmlns='http://www.w3.org/2000/svg'
|
|
11
|
+
className='Hawkins-Icon Hawkins-Icon-Standard'
|
|
12
|
+
style={{ width: '100%', height: '100%' }}
|
|
13
|
+
{...props}>
|
|
14
|
+
<path
|
|
15
|
+
fill='currentColor'
|
|
16
|
+
d='M20 4H6.83l2 2H20v11.17l1.76 1.76c.15-.28.24-.59.24-.93V6c0-1.1-.9-2-2-2z'
|
|
17
|
+
/>
|
|
18
|
+
<path
|
|
19
|
+
fill='currentColor'
|
|
20
|
+
d='M18 10h-5.17l2 2H18zM1.04 3.87l1.2 1.2C2.09 5.35 2 5.66 2 6v12c0 1.1.9 2 2 2h13.17l2.96 2.96 1.41-1.41L2.45 2.45 1.04 3.87zM4 6.83 7.17 10H6v2h2v-1.17L11.17 14H6v2h7.17l2 2H4V6.83z'
|
|
21
|
+
/>
|
|
22
|
+
</svg>
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
export default SubtitleOffIcon
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { memo, SVGProps } from 'react'
|
|
3
|
+
|
|
4
|
+
export function UnPiPIcon(props: SVGProps<SVGSVGElement>) {
|
|
5
|
+
return (
|
|
6
|
+
<svg xmlns='http://www.w3.org/2000/svg' width='1em' height='1em' viewBox='0 0 24 24' {...props}>
|
|
7
|
+
<g fill='currentColor'>
|
|
8
|
+
<path
|
|
9
|
+
fillRule='evenodd'
|
|
10
|
+
d='M10 3h4c3.771 0 5.657 0 6.828 1.172c.95.949 1.13 2.694 1.164 5.328c.012.937.018 1.405-.275 1.703c-.294.297-.768.297-1.717.297h-2.5c-2.828 0-4.243 0-5.121.879c-.879.878-.879 2.293-.879 5.121v2c0 .466 0 .699-.076.883a1 1 0 0 1-.541.54C10.699 21 10.466 21 10 21c-3.771 0-5.657 0-6.828-1.172C2 18.657 2 16.771 2 13v-2c0-3.771 0-5.657 1.172-6.828C4.343 3 6.229 3 10 3Zm.97 9.03a.75.75 0 1 0 1.06-1.06L9.31 8.25h1.19a.75.75 0 0 0 0-1.5h-3a.75.75 0 0 0-.75.75v3a.75.75 0 0 0 1.5 0V9.31l2.72 2.72Z'
|
|
11
|
+
clipRule='evenodd'></path>
|
|
12
|
+
<path d='M13.586 13.586C13 14.172 13 15.114 13 17c0 1.886 0 2.828.586 3.414C14.172 21 15.114 21 17 21h1c1.886 0 2.828 0 3.414-.586C22 19.828 22 18.886 22 17c0-1.886 0-2.828-.586-3.414C20.828 13 19.886 13 18 13h-1c-1.886 0-2.828 0-3.414.586Z'></path>
|
|
13
|
+
</g>
|
|
14
|
+
</svg>
|
|
15
|
+
)
|
|
16
|
+
}
|
|
17
|
+
export default UnPiPIcon
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
import { SVGProps, memo } from 'react'
|
|
3
|
+
|
|
4
|
+
const VolumeMutedIcon = (props: SVGProps<SVGSVGElement>) => (
|
|
5
|
+
<svg xmlns='http://www.w3.org/2000/svg' width='1em' height='1em' viewBox='0 0 24 24' {...props}>
|
|
6
|
+
<g fill='currentColor'>
|
|
7
|
+
<path
|
|
8
|
+
fillRule='evenodd'
|
|
9
|
+
d='M20.515 6.316a.75.75 0 0 1 .991.376c.468 1.035.994 2.768.994 5.308c0 2.192-.392 3.783-.8 4.844a7.72 7.72 0 0 1-.572 1.195a4.73 4.73 0 0 1-.289.425l-.007.01l-.003.003l-.002.002L20.25 18l.576.48a.75.75 0 0 1-1.156-.956l.003-.004l.031-.041a3.27 3.27 0 0 0 .137-.212c.12-.199.288-.516.459-.961c.342-.889.7-2.298.7-4.306c0-2.326-.48-3.849-.86-4.692a.75.75 0 0 1 .375-.992Zm-2.101 2.95a.75.75 0 0 1 .887.582c.11.53.199 1.24.199 2.152c0 1.11-.132 1.923-.273 2.474a5.172 5.172 0 0 1-.203.631a2.977 2.977 0 0 1-.102.228l-.01.018l-.003.007l-.002.003v.002s-.001.001-.657-.363l.656.364a.75.75 0 0 1-1.317-.719l.005-.01a1.85 1.85 0 0 0 .038-.087a3.66 3.66 0 0 0 .141-.447c.11-.424.227-1.111.227-2.101a9.17 9.17 0 0 0-.168-1.848a.75.75 0 0 1 .582-.886Z'
|
|
10
|
+
clipRule='evenodd'></path>
|
|
11
|
+
<path d='M21.78 3.53a.75.75 0 0 0-1.06-1.06l-4.45 4.449a11.265 11.265 0 0 0-.193-1.39c-.172-.788-.477-1.473-1.116-1.923a3.066 3.066 0 0 0-.769-.39c-.818-.28-1.631-.057-2.457.345c-.814.395-1.8 1.046-3.032 1.857l-.267.176c-.447.295-.602.394-.76.464a2.17 2.17 0 0 1-.535.16c-.171.03-.354.032-.89.032h-.162c-1.217 0-2.062-.001-2.814.347A3.962 3.962 0 0 0 1.548 8.22c-.392.729-.438 1.491-.504 2.575l-.008.13C1.014 11.294 1 11.658 1 12c0 .342.014.706.036 1.074l.008.13c.066 1.084.112 1.846.504 2.575a3.962 3.962 0 0 0 1.727 1.624c.61.283 1.283.336 2.166.345L2.72 20.47a.75.75 0 1 0 1.06 1.06l18-18ZM16.5 12a.75.75 0 0 0-1.255-.554l-.071.074l-6 6.274A.778.778 0 0 0 9.34 19c1.039.68 1.899 1.225 2.631 1.549c.743.328 1.48.489 2.222.236a3.08 3.08 0 0 0 .769-.391c.706-.497 1.005-1.28 1.167-2.18c.159-.884.213-2.056.281-3.516l.003-.058a68.23 68.23 0 0 0 .088-2.64Z'></path>
|
|
12
|
+
</g>
|
|
13
|
+
</svg>
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
export default VolumeMutedIcon
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
import { SVGProps, memo } from 'react'
|
|
3
|
+
|
|
4
|
+
const VolumeOneIcon = (props: SVGProps<SVGSVGElement>) => (
|
|
5
|
+
<svg xmlns='http://www.w3.org/2000/svg' width='1em' height='1em' viewBox='0 0 24 24' {...props}>
|
|
6
|
+
<g fill='currentColor'>
|
|
7
|
+
<path d='M2.003 11.716c.037-1.843.056-2.764.668-3.552a3.18 3.18 0 0 1 .413-.431c.752-.636 1.746-.636 3.733-.636c.71 0 1.065 0 1.403-.092c.07-.02.14-.042.209-.067c.33-.121.627-.33 1.22-.746c2.338-1.645 3.508-2.467 4.489-2.11c.188.069.37.168.533.29c.848.635.913 2.115 1.042 5.073a70.58 70.58 0 0 1 .08 2.555c0 .521-.032 1.46-.08 2.555c-.13 2.958-.194 4.438-1.042 5.073a2.109 2.109 0 0 1-.533.29c-.982.357-2.15-.465-4.49-2.11c-.592-.416-.889-.625-1.22-.746a2.61 2.61 0 0 0-.208-.067c-.338-.092-.693-.092-1.403-.092c-1.987 0-2.98 0-3.733-.636a3.145 3.145 0 0 1-.413-.43c-.612-.79-.63-1.71-.668-3.553a14.06 14.06 0 0 1 0-.569Z'></path>
|
|
8
|
+
<path
|
|
9
|
+
fillRule='evenodd'
|
|
10
|
+
d='M19.49 5.552a.66.66 0 0 1 .97.094l-.53.471l.53-.47h.002v.002l.004.004l.007.009a2.572 2.572 0 0 1 .078.112a4.6 4.6 0 0 1 .187.305c.149.265.339.652.526 1.171C21.64 8.291 22 9.851 22 12c0 2.15-.36 3.71-.736 4.75c-.187.52-.377.907-.526 1.172a4.605 4.605 0 0 1-.265.417l-.007.009l-.003.003l-.001.002s-.001.001-.531-.47l.53.471a.66.66 0 0 1-.972.094a.77.77 0 0 1-.091-1.03l.003-.005l.028-.04a3.2 3.2 0 0 0 .126-.208c.11-.195.264-.506.422-.943c.314-.871.643-2.252.643-4.222c0-1.969-.329-3.35-.643-4.222a6.268 6.268 0 0 0-.422-.942a3.208 3.208 0 0 0-.126-.207l-.028-.041l-.003-.004'
|
|
11
|
+
clipRule='evenodd'
|
|
12
|
+
opacity='.4'></path>
|
|
13
|
+
<path
|
|
14
|
+
fillRule='evenodd'
|
|
15
|
+
d='M17.757 8.416c.333-.197.753-.07.938.286l-.603.357l.603-.357l.001.002l.002.003l.003.007l.01.018l.024.053c.018.042.042.099.07.17c.053.145.12.35.185.62c.13.54.252 1.337.252 2.425c0 1.089-.122 1.886-.252 2.426c-.065.27-.132.475-.186.619a3.036 3.036 0 0 1-.094.223l-.009.018l-.003.007l-.002.003v.002s-.001.001-.604-.356l.603.357c-.185.355-.605.483-.938.286c-.33-.196-.45-.638-.272-.991l.004-.01a3.774 3.774 0 0 0 .165-.523c.1-.416.208-1.09.208-2.06c0-.971-.108-1.645-.208-2.061a3.772 3.772 0 0 0-.165-.523l-.004-.01c-.179-.354-.058-.796.272-.991Z'
|
|
16
|
+
clipRule='evenodd'
|
|
17
|
+
opacity='.7'></path>
|
|
18
|
+
</g>
|
|
19
|
+
</svg>
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
export default VolumeOneIcon
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
import { SVGProps, memo } from 'react'
|
|
3
|
+
|
|
4
|
+
const VolumeThreeIcon = (props: SVGProps<SVGSVGElement>) => (
|
|
5
|
+
<svg xmlns='http://www.w3.org/2000/svg' width='1em' height='1em' viewBox='0 0 24 24' {...props}>
|
|
6
|
+
<g fill='currentColor'>
|
|
7
|
+
<path d='M2.003 11.716c.037-1.843.056-2.764.668-3.552a3.18 3.18 0 0 1 .413-.431c.752-.636 1.746-.636 3.733-.636c.71 0 1.065 0 1.403-.092c.07-.02.14-.042.209-.067c.33-.121.627-.33 1.22-.746c2.338-1.645 3.508-2.467 4.489-2.11c.188.069.37.168.533.29c.848.635.913 2.115 1.042 5.073a70.58 70.58 0 0 1 .08 2.555c0 .521-.032 1.46-.08 2.555c-.13 2.958-.194 4.438-1.042 5.073a2.109 2.109 0 0 1-.533.29c-.982.357-2.15-.465-4.49-2.11c-.592-.416-.889-.625-1.22-.746a2.61 2.61 0 0 0-.208-.067c-.338-.092-.693-.092-1.403-.092c-1.987 0-2.98 0-3.733-.636a3.145 3.145 0 0 1-.413-.43c-.612-.79-.63-1.71-.668-3.553a14.06 14.06 0 0 1 0-.569Z'></path>
|
|
8
|
+
<path
|
|
9
|
+
fillRule='evenodd'
|
|
10
|
+
d='M19.49 5.552a.66.66 0 0 1 .97.094l-.529.471l.53-.47l.002.002l.003.004l.007.009a2.572 2.572 0 0 1 .079.112c.047.071.111.173.186.305c.149.264.339.652.526 1.171C21.64 8.291 22 9.851 22 12c0 2.15-.36 3.71-.736 4.75c-.187.52-.377.907-.526 1.172a4.655 4.655 0 0 1-.265.417l-.007.009l-.003.003l-.001.002s-.001.001-.531-.47l.53.471a.66.66 0 0 1-.971.094a.77.77 0 0 1-.09-1.035l.03-.041c.026-.04.07-.11.125-.207a6.28 6.28 0 0 0 .422-.943c.314-.871.644-2.253.644-4.222c0-1.97-.33-3.35-.644-4.222a6.28 6.28 0 0 0-.422-.942a3.152 3.152 0 0 0-.157-.253m-1.641 1.833c.333-.197.753-.07.938.286l-.603.357l.603-.357l.001.002l.002.003l.003.007l.01.018l.024.053c.018.042.042.099.07.17c.053.145.12.35.185.62c.13.54.252 1.337.252 2.425c0 1.089-.122 1.886-.252 2.426c-.065.27-.132.475-.186.619a3.04 3.04 0 0 1-.094.223l-.009.018l-.003.007l-.002.003v.002s-.001.001-.604-.356l.603.357c-.185.355-.605.483-.938.286c-.33-.196-.45-.638-.272-.991l.004-.01l.035-.085c.032-.086.08-.23.13-.438c.1-.416.208-1.09.208-2.06c0-.971-.108-1.645-.208-2.06a3.757 3.757 0 0 0-.165-.524l-.004-.01a.76.76 0 0 1 .272-.991Z'
|
|
11
|
+
clipRule='evenodd'></path>
|
|
12
|
+
</g>
|
|
13
|
+
</svg>
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
export default VolumeThreeIcon
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
import { SVGProps, memo } from 'react'
|
|
3
|
+
|
|
4
|
+
const VolumeTwoIcon = (props: SVGProps<SVGSVGElement>) => (
|
|
5
|
+
<svg xmlns='http://www.w3.org/2000/svg' width='1em' height='1em' viewBox='0 0 24 24' {...props}>
|
|
6
|
+
<g fill='currentColor'>
|
|
7
|
+
<path d='M2.003 11.716c.037-1.843.056-2.764.668-3.552a3.18 3.18 0 0 1 .413-.431c.752-.636 1.746-.636 3.733-.636c.71 0 1.065 0 1.403-.092c.07-.02.14-.042.209-.067c.33-.121.627-.33 1.22-.746c2.338-1.645 3.508-2.467 4.489-2.11c.188.069.37.168.533.29c.848.635.913 2.115 1.042 5.073a70.58 70.58 0 0 1 .08 2.555c0 .521-.032 1.46-.08 2.555c-.13 2.958-.194 4.438-1.042 5.073a2.109 2.109 0 0 1-.533.29c-.982.357-2.15-.465-4.49-2.11c-.592-.416-.889-.625-1.22-.746a2.61 2.61 0 0 0-.208-.067c-.338-.092-.693-.092-1.403-.092c-1.987 0-2.98 0-3.733-.636a3.145 3.145 0 0 1-.413-.43c-.612-.79-.63-1.71-.668-3.553a14.06 14.06 0 0 1 0-.569Z'></path>
|
|
8
|
+
<path
|
|
9
|
+
fillRule='evenodd'
|
|
10
|
+
d='M19.49 5.552a.66.66 0 0 1 .97.094l-.529.471l.53-.47l.002.002l.003.004l.007.009a2.572 2.572 0 0 1 .079.112c.047.071.111.173.186.305c.149.264.339.652.526 1.171C21.64 8.291 22 9.851 22 12c0 2.15-.36 3.71-.736 4.75c-.187.52-.377.907-.526 1.172a4.655 4.655 0 0 1-.265.417l-.007.009l-.003.003l-.001.002s-.001.001-.531-.47l.53.471a.66.66 0 0 1-.971.094a.77.77 0 0 1-.09-1.035l.03-.041c.026-.04.07-.11.125-.207a6.28 6.28 0 0 0 .422-.943c.314-.871.644-2.253.644-4.222c0-1.97-.33-3.35-.644-4.222a6.28 6.28 0 0 0-.422-.942a3.152 3.152 0 0 0-.157-.253m-1.641 1.833c.333-.197.753-.07.938.286l-.603.357l.603-.357l.001.002l.002.003l.003.007l.01.018l.024.053c.018.042.042.099.07.17c.053.145.12.35.185.62c.13.54.252 1.337.252 2.425c0 1.089-.122 1.886-.252 2.426c-.065.27-.132.475-.186.619a3.04 3.04 0 0 1-.094.223l-.009.018l-.003.007l-.002.003v.002s-.001.001-.604-.356l.603.357c-.185.355-.605.483-.938.286c-.33-.196-.45-.638-.272-.991l.004-.01l.035-.085c.032-.086.08-.23.13-.438c.1-.416.208-1.09.208-2.06c0-.971-.108-1.645-.208-2.06a3.757 3.757 0 0 0-.165-.524l-.004-.01a.76.76 0 0 1 .272-.991Z'
|
|
11
|
+
clipRule='evenodd'></path>
|
|
12
|
+
</g>
|
|
13
|
+
</svg>
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
export default VolumeTwoIcon
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Legacy Components (Deprecated)
|
|
3
|
+
* These components are wrapped with deprecation warnings
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
"use client"
|
|
7
|
+
|
|
8
|
+
import React from "react"
|
|
9
|
+
import { showDeprecationWarning } from "../lib/deprecation"
|
|
10
|
+
|
|
11
|
+
// Import current components
|
|
12
|
+
import { MediaPlayer } from "./media-player"
|
|
13
|
+
import { VideoPlayer } from "./video-player"
|
|
14
|
+
import { AudioPlayer } from "./audio-player"
|
|
15
|
+
import { PlayButton } from "./ui/play-button"
|
|
16
|
+
import { SeekBar } from "./ui/seek-bar"
|
|
17
|
+
import { TimeDisplay } from "./ui/time-display"
|
|
18
|
+
import { VolumeControl } from "./ui/volume-control"
|
|
19
|
+
import { FullscreenButton } from "./ui/fullscreen-button"
|
|
20
|
+
import { ModernMediaPlayer as ReactPlayerWrapper } from "./react-player-wrapper"
|
|
21
|
+
import { SimpleVideoPlayer as SimpleVideoPlayerBase } from "./simple-video-player"
|
|
22
|
+
|
|
23
|
+
// Legacy component wrappers with deprecation warnings
|
|
24
|
+
export const ModernMediaPlayer = React.forwardRef<any, any>((props, ref) => {
|
|
25
|
+
showDeprecationWarning(
|
|
26
|
+
"ModernMediaPlayer",
|
|
27
|
+
"MediaPlayer (the primary media player component)"
|
|
28
|
+
)
|
|
29
|
+
return <ReactPlayerWrapper {...props} ref={ref} />
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
ModernMediaPlayer.displayName = "DeprecatedModernMediaPlayer"
|
|
33
|
+
|
|
34
|
+
export const SimpleVideoPlayer = React.forwardRef<any, any>((props, ref) => {
|
|
35
|
+
showDeprecationWarning(
|
|
36
|
+
"SimpleVideoPlayer",
|
|
37
|
+
"VideoPlayer (the primary video player component)"
|
|
38
|
+
)
|
|
39
|
+
return <SimpleVideoPlayerBase {...props} ref={ref} />
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
SimpleVideoPlayer.displayName = "DeprecatedSimpleVideoPlayer"
|
|
43
|
+
|
|
44
|
+
// Legacy UI components with deprecation warnings
|
|
45
|
+
export const LegacyPlayButton = React.forwardRef<any, any>((props, ref) => {
|
|
46
|
+
showDeprecationWarning(
|
|
47
|
+
"PlayButton",
|
|
48
|
+
"Use MediaPlayer compound components or MediaPlayer (all-in-one)"
|
|
49
|
+
)
|
|
50
|
+
return <PlayButton {...props} ref={ref} />
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
LegacyPlayButton.displayName = "DeprecatedPlayButton"
|
|
54
|
+
|
|
55
|
+
export const LegacySeekBar = React.forwardRef<any, any>((props, ref) => {
|
|
56
|
+
showDeprecationWarning(
|
|
57
|
+
"SeekBar",
|
|
58
|
+
"Use MediaPlayer compound components or MediaPlayer (all-in-one)"
|
|
59
|
+
)
|
|
60
|
+
return <SeekBar {...props} ref={ref} />
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
LegacySeekBar.displayName = "DeprecatedSeekBar"
|
|
64
|
+
|
|
65
|
+
export const LegacyTimeDisplay = React.forwardRef<any, any>((props, ref) => {
|
|
66
|
+
showDeprecationWarning(
|
|
67
|
+
"TimeDisplay",
|
|
68
|
+
"Use MediaPlayer compound components or MediaPlayer (all-in-one)"
|
|
69
|
+
)
|
|
70
|
+
return <TimeDisplay {...props} ref={ref} />
|
|
71
|
+
})
|
|
72
|
+
|
|
73
|
+
LegacyTimeDisplay.displayName = "DeprecatedTimeDisplay"
|
|
74
|
+
|
|
75
|
+
export const LegacyVolumeControl = React.forwardRef<any, any>((props, ref) => {
|
|
76
|
+
showDeprecationWarning(
|
|
77
|
+
"VolumeControl",
|
|
78
|
+
"Use MediaPlayer compound components or MediaPlayer (all-in-one)"
|
|
79
|
+
)
|
|
80
|
+
return <VolumeControl {...props} ref={ref} />
|
|
81
|
+
})
|
|
82
|
+
|
|
83
|
+
LegacyVolumeControl.displayName = "DeprecatedVolumeControl"
|
|
84
|
+
|
|
85
|
+
export const LegacyFullscreenButton = React.forwardRef<any, any>((props, ref) => {
|
|
86
|
+
showDeprecationWarning(
|
|
87
|
+
"FullscreenButton",
|
|
88
|
+
"Use MediaPlayer compound components or MediaPlayer (all-in-one)"
|
|
89
|
+
)
|
|
90
|
+
return <FullscreenButton {...props} ref={ref} />
|
|
91
|
+
})
|
|
92
|
+
|
|
93
|
+
LegacyFullscreenButton.displayName = "DeprecatedFullscreenButton"
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { Suspense } from 'react'
|
|
2
|
+
import { useMediaMetadata, formatTime, type MediaMetadata } from '../hooks/use-media-metadata'
|
|
3
|
+
|
|
4
|
+
interface MediaMetadataDisplayProps {
|
|
5
|
+
src: string
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
function MetadataSkeleton() {
|
|
9
|
+
return (
|
|
10
|
+
<div className="animate-pulse space-y-2">
|
|
11
|
+
<div className="h-4 w-3/4 rounded bg-gray-700"></div>
|
|
12
|
+
<div className="h-3 w-1/2 rounded bg-gray-700"></div>
|
|
13
|
+
<div className="h-3 w-2/3 rounded bg-gray-700"></div>
|
|
14
|
+
</div>
|
|
15
|
+
)
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function MediaMetadataContent({ src }: MediaMetadataDisplayProps) {
|
|
19
|
+
// Use the use() hook for async data - this will suspend until data loads
|
|
20
|
+
const metadata = useMediaMetadata(src)
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<div className="media-metadata space-y-2 text-white">
|
|
24
|
+
<div>
|
|
25
|
+
<span className="text-gray-400 text-sm">Duration: </span>
|
|
26
|
+
<span>{formatTime(metadata.duration)}</span>
|
|
27
|
+
</div>
|
|
28
|
+
|
|
29
|
+
<div>
|
|
30
|
+
<span className="text-gray-400 text-sm">Format: </span>
|
|
31
|
+
<span>{metadata.format}</span>
|
|
32
|
+
</div>
|
|
33
|
+
|
|
34
|
+
{metadata.width && metadata.height && (
|
|
35
|
+
<div>
|
|
36
|
+
<span className="text-gray-400 text-sm">Resolution: </span>
|
|
37
|
+
<span>{metadata.width} x {metadata.height}</span>
|
|
38
|
+
</div>
|
|
39
|
+
)}
|
|
40
|
+
|
|
41
|
+
{metadata.title && (
|
|
42
|
+
<div>
|
|
43
|
+
<span className="text-gray-400 text-sm">Title: </span>
|
|
44
|
+
<span>{metadata.title}</span>
|
|
45
|
+
</div>
|
|
46
|
+
)}
|
|
47
|
+
|
|
48
|
+
{metadata.artist && (
|
|
49
|
+
<div>
|
|
50
|
+
<span className="text-gray-400 text-sm">Artist: </span>
|
|
51
|
+
<span>{metadata.artist}</span>
|
|
52
|
+
</div>
|
|
53
|
+
)}
|
|
54
|
+
</div>
|
|
55
|
+
)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function MediaMetadataDisplay({ src }: MediaMetadataDisplayProps) {
|
|
59
|
+
return (
|
|
60
|
+
<div className="rounded-lg bg-gray-800 p-4">
|
|
61
|
+
<h4 className="mb-3 font-medium text-white">Media Information</h4>
|
|
62
|
+
<Suspense fallback={<MetadataSkeleton />}>
|
|
63
|
+
<MediaMetadataContent src={src} />
|
|
64
|
+
</Suspense>
|
|
65
|
+
</div>
|
|
66
|
+
)
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Enhanced version with error boundary
|
|
70
|
+
interface MediaInfoProps {
|
|
71
|
+
src: string
|
|
72
|
+
title?: string
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function MediaErrorFallback({ error, retry }: { error: Error; retry: () => void }) {
|
|
76
|
+
return (
|
|
77
|
+
<div className="rounded-lg border border-red-700 bg-red-900/20 p-4">
|
|
78
|
+
<h4 className="mb-2 font-medium text-red-400">Failed to load metadata</h4>
|
|
79
|
+
<p className="mb-3 text-red-300 text-sm">{error.message}</p>
|
|
80
|
+
<button
|
|
81
|
+
onClick={retry}
|
|
82
|
+
className="rounded bg-red-700 px-3 py-1 text-sm text-white transition-colors hover:bg-red-600"
|
|
83
|
+
>
|
|
84
|
+
Retry
|
|
85
|
+
</button>
|
|
86
|
+
</div>
|
|
87
|
+
)
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export function MediaInfo({ src, title }: MediaInfoProps) {
|
|
91
|
+
return (
|
|
92
|
+
<div className="space-y-4">
|
|
93
|
+
{title && (
|
|
94
|
+
<h3 className="font-semibold text-white text-xl">{title}</h3>
|
|
95
|
+
)}
|
|
96
|
+
|
|
97
|
+
<MediaMetadataDisplay src={src} />
|
|
98
|
+
</div>
|
|
99
|
+
)
|
|
100
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import React from "react"
|
|
4
|
+
import { useMediaContext } from "../context/media-context"
|
|
5
|
+
|
|
6
|
+
export interface MediaPlayerAudioProps extends React.AudioHTMLAttributes<HTMLAudioElement> {
|
|
7
|
+
asChild?: boolean
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function MediaPlayerAudio({
|
|
11
|
+
asChild = false,
|
|
12
|
+
className,
|
|
13
|
+
children,
|
|
14
|
+
...props
|
|
15
|
+
}: MediaPlayerAudioProps) {
|
|
16
|
+
const context = useMediaContext()
|
|
17
|
+
|
|
18
|
+
if (asChild) {
|
|
19
|
+
// When asChild is true, clone the child element and add our props
|
|
20
|
+
const child = React.Children.only(children) as React.ReactElement
|
|
21
|
+
return React.cloneElement(child, {
|
|
22
|
+
...props,
|
|
23
|
+
ref: context.mediaRef,
|
|
24
|
+
"data-slot": "media-player-audio"
|
|
25
|
+
} as any)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<audio
|
|
30
|
+
ref={context.mediaRef as React.RefObject<HTMLAudioElement>}
|
|
31
|
+
data-slot="media-player-audio"
|
|
32
|
+
className={className}
|
|
33
|
+
{...props}>
|
|
34
|
+
{children}
|
|
35
|
+
</audio>
|
|
36
|
+
)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
MediaPlayerAudio.displayName = "MediaPlayerAudio"
|