@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.
Files changed (244) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +384 -0
  3. package/dist/context/media.js +2 -0
  4. package/dist/context/media.js.map +1 -0
  5. package/dist/context/media.mjs +15 -0
  6. package/dist/context/media.mjs.map +1 -0
  7. package/dist/context/store.js +2 -0
  8. package/dist/context/store.js.map +1 -0
  9. package/dist/context/store.mjs +5 -0
  10. package/dist/context/store.mjs.map +1 -0
  11. package/dist/context-BMteAJDN.js +1140 -0
  12. package/dist/context-BMteAJDN.js.map +1 -0
  13. package/dist/context-DCJ_scmO.cjs +23 -0
  14. package/dist/context-DCJ_scmO.cjs.map +1 -0
  15. package/dist/core-events-B5W_j8yU.js +480 -0
  16. package/dist/core-events-B5W_j8yU.js.map +1 -0
  17. package/dist/core-events-CN0-Vhhq.cjs +2 -0
  18. package/dist/core-events-CN0-Vhhq.cjs.map +1 -0
  19. package/dist/core-plugins-Bq9KLany.js +696 -0
  20. package/dist/core-plugins-Bq9KLany.js.map +1 -0
  21. package/dist/core-plugins-CPDSHMiQ.cjs +2 -0
  22. package/dist/core-plugins-CPDSHMiQ.cjs.map +1 -0
  23. package/dist/core.js +37 -0
  24. package/dist/core.js.map +1 -0
  25. package/dist/core.mjs +1217 -0
  26. package/dist/core.mjs.map +1 -0
  27. package/dist/enhanced-components-DHv0MFvG.js +1073 -0
  28. package/dist/enhanced-components-DHv0MFvG.js.map +1 -0
  29. package/dist/enhanced-components-DTIObgB7.cjs +2 -0
  30. package/dist/enhanced-components-DTIObgB7.cjs.map +1 -0
  31. package/dist/hooks-C_r8wexn.cjs +4 -0
  32. package/dist/hooks-C_r8wexn.cjs.map +1 -0
  33. package/dist/hooks-Da2wVXlF.js +1630 -0
  34. package/dist/hooks-Da2wVXlF.js.map +1 -0
  35. package/dist/index.css +1 -0
  36. package/dist/index.js +112 -0
  37. package/dist/index.js.map +1 -0
  38. package/dist/index.mjs +6126 -0
  39. package/dist/index.mjs.map +1 -0
  40. package/dist/minimal-components-DSq5sQpy.js +2002 -0
  41. package/dist/minimal-components-DSq5sQpy.js.map +1 -0
  42. package/dist/minimal-components-DflWiihN.cjs +2 -0
  43. package/dist/minimal-components-DflWiihN.cjs.map +1 -0
  44. package/dist/minimal-components.css +1 -0
  45. package/dist/mona-loading.gif +0 -0
  46. package/dist/performance-monitor-CUW6f5ll.cjs +2 -0
  47. package/dist/performance-monitor-CUW6f5ll.cjs.map +1 -0
  48. package/dist/performance-monitor-rMW1RgV3.js +302 -0
  49. package/dist/performance-monitor-rMW1RgV3.js.map +1 -0
  50. package/dist/utils-BnscpYYd.js +2798 -0
  51. package/dist/utils-BnscpYYd.js.map +1 -0
  52. package/dist/utils-D_czS_0K.cjs +9 -0
  53. package/dist/utils-D_czS_0K.cjs.map +1 -0
  54. package/dist/utils.js +2 -0
  55. package/dist/utils.js.map +1 -0
  56. package/dist/utils.mjs +7 -0
  57. package/dist/utils.mjs.map +1 -0
  58. package/package.json +114 -0
  59. package/src/adapters/videojs-adapter.tsx +470 -0
  60. package/src/assets/mona-loading.gif +0 -0
  61. package/src/components/AnimateLoading.tsx +115 -0
  62. package/src/components/LoadingState.tsx +248 -0
  63. package/src/components/accessibility/keyboard-help-overlay.tsx +213 -0
  64. package/src/components/audio-player.tsx +85 -0
  65. package/src/components/basic/index.ts +37 -0
  66. package/src/components/enhanced/advanced-features.tsx +316 -0
  67. package/src/components/enhanced/debug-panel.tsx +422 -0
  68. package/src/components/enhanced/enhanced-controls.tsx +600 -0
  69. package/src/components/enhanced/enhanced-media-player.tsx +509 -0
  70. package/src/components/enhanced/error-handling.tsx +345 -0
  71. package/src/components/enhanced/index.ts +39 -0
  72. package/src/components/enhanced/media-player-enhanced.tsx +349 -0
  73. package/src/components/examples/basic-video-player.tsx +55 -0
  74. package/src/components/examples/custom-controls-example.tsx +63 -0
  75. package/src/components/examples/enhanced-controls-example.tsx +114 -0
  76. package/src/components/examples/enhanced-media-player-example.tsx +293 -0
  77. package/src/components/examples/loading-states-demo.tsx +142 -0
  78. package/src/components/examples/react-19-demo.tsx +381 -0
  79. package/src/components/examples/volume-orientation-demo.tsx +114 -0
  80. package/src/components/icon-demo.tsx +209 -0
  81. package/src/components/icons/index.tsx +166 -0
  82. package/src/components/icons/svg-icons/ArrowLeftIcon.tsx +18 -0
  83. package/src/components/icons/svg-icons/ArrowRightIcon.tsx +18 -0
  84. package/src/components/icons/svg-icons/AudioIcon.tsx +22 -0
  85. package/src/components/icons/svg-icons/BackwardIcon.tsx +12 -0
  86. package/src/components/icons/svg-icons/CameraIcon.tsx +19 -0
  87. package/src/components/icons/svg-icons/CheckIcon.tsx +19 -0
  88. package/src/components/icons/svg-icons/EnablePiPIcon.tsx +17 -0
  89. package/src/components/icons/svg-icons/ForwardIcon.tsx +12 -0
  90. package/src/components/icons/svg-icons/FullscreenEnterIcon.tsx +23 -0
  91. package/src/components/icons/svg-icons/FullscreenExitIcon.tsx +23 -0
  92. package/src/components/icons/svg-icons/LoadingIcon.tsx +32 -0
  93. package/src/components/icons/svg-icons/PauseIcon.tsx +23 -0
  94. package/src/components/icons/svg-icons/PlayIcon.tsx +21 -0
  95. package/src/components/icons/svg-icons/PlaybackSpeedIcon.tsx +23 -0
  96. package/src/components/icons/svg-icons/QualityIcon.tsx +21 -0
  97. package/src/components/icons/svg-icons/SettingsIcon.tsx +12 -0
  98. package/src/components/icons/svg-icons/SliderIcon.tsx +21 -0
  99. package/src/components/icons/svg-icons/SubtitleIcon.tsx +21 -0
  100. package/src/components/icons/svg-icons/SubtitleOffIcon.tsx +25 -0
  101. package/src/components/icons/svg-icons/UnPiPIcon.tsx +17 -0
  102. package/src/components/icons/svg-icons/VolumeMutedIcon.tsx +16 -0
  103. package/src/components/icons/svg-icons/VolumeOneIcon.tsx +22 -0
  104. package/src/components/icons/svg-icons/VolumeThreeIcon.tsx +16 -0
  105. package/src/components/icons/svg-icons/VolumeTwoIcon.tsx +16 -0
  106. package/src/components/legacy.tsx +93 -0
  107. package/src/components/media-metadata-display.tsx +100 -0
  108. package/src/components/media-player-audio.tsx +39 -0
  109. package/src/components/media-player-controls.tsx +226 -0
  110. package/src/components/media-player-error.tsx +163 -0
  111. package/src/components/media-player-fullscreen.tsx +109 -0
  112. package/src/components/media-player-hls.tsx +111 -0
  113. package/src/components/media-player-loading.tsx +76 -0
  114. package/src/components/media-player-play.tsx +75 -0
  115. package/src/components/media-player-root.tsx +340 -0
  116. package/src/components/media-player-seek.tsx +168 -0
  117. package/src/components/media-player-time.tsx +99 -0
  118. package/src/components/media-player-tooltip.tsx +58 -0
  119. package/src/components/media-player-video.tsx +39 -0
  120. package/src/components/media-player-volume.tsx +155 -0
  121. package/src/components/media-player.tsx +257 -0
  122. package/src/components/media-suspense.tsx +362 -0
  123. package/src/components/player-settings-form.tsx +163 -0
  124. package/src/components/react-player-wrapper.tsx +651 -0
  125. package/src/components/simple-video-player.tsx +60 -0
  126. package/src/components/ui/enhanced-seek-bar.tsx +235 -0
  127. package/src/components/ui/fullscreen-button.tsx +60 -0
  128. package/src/components/ui/media-resource-preloader.tsx +395 -0
  129. package/src/components/ui/play-button.tsx +107 -0
  130. package/src/components/ui/seek-bar.tsx +161 -0
  131. package/src/components/ui/time-display.tsx +40 -0
  132. package/src/components/ui/volume-control.tsx +143 -0
  133. package/src/components/unified/base-media-player.tsx +246 -0
  134. package/src/components/unified/media-player.tsx +75 -0
  135. package/src/components/variants/minimal/AccessibleMinimalPlayer.tsx +561 -0
  136. package/src/components/variants/minimal/EnhancedMinimalMediaPlayer.tsx +552 -0
  137. package/src/components/variants/minimal/MinimalControls.tsx +142 -0
  138. package/src/components/variants/minimal/MinimalLoading.tsx +32 -0
  139. package/src/components/variants/minimal/MinimalMediaPlayer.tsx +315 -0
  140. package/src/components/variants/minimal/MinimalOverlay.tsx +64 -0
  141. package/src/components/variants/minimal/MinimalPlayButton.tsx +65 -0
  142. package/src/components/variants/minimal/MinimalSeekBar.tsx +150 -0
  143. package/src/components/variants/minimal/MinimalVolumeControl.tsx +80 -0
  144. package/src/components/variants/minimal/SimpleMinimalPlayer.tsx +210 -0
  145. package/src/components/variants/minimal/components/CenterPlayButton.tsx +22 -0
  146. package/src/components/variants/minimal/components/ControlBar.tsx +146 -0
  147. package/src/components/variants/minimal/components/EnhancedSettingsMenu.tsx +361 -0
  148. package/src/components/variants/minimal/components/PlaybackControls.tsx +51 -0
  149. package/src/components/variants/minimal/components/RightControls.tsx +173 -0
  150. package/src/components/variants/minimal/components/SeekBar.tsx +131 -0
  151. package/src/components/variants/minimal/components/SettingsDropdown.tsx +70 -0
  152. package/src/components/variants/minimal/components/SubtitleDisplay.tsx +21 -0
  153. package/src/components/variants/minimal/components/TimeDisplay.tsx +18 -0
  154. package/src/components/variants/minimal/components/VideoElement.tsx +40 -0
  155. package/src/components/variants/minimal/components/VolumeControl.tsx +217 -0
  156. package/src/components/variants/minimal/index.ts +23 -0
  157. package/src/components/video-player.tsx +100 -0
  158. package/src/context/error-handling.ts +394 -0
  159. package/src/context/media-context.tsx +208 -0
  160. package/src/context/media-provider.tsx +265 -0
  161. package/src/context/media-store.ts +379 -0
  162. package/src/context/persistence.ts +453 -0
  163. package/src/core/events/event-system.ts +442 -0
  164. package/src/core/events/hooks.ts +302 -0
  165. package/src/core/events/index.ts +22 -0
  166. package/src/core/events/middleware.ts +269 -0
  167. package/src/core/index.ts +22 -0
  168. package/src/core/optimization/bundle-optimizer.tsx +308 -0
  169. package/src/core/performance/cicd.ts +96 -0
  170. package/src/core/performance/index.ts +38 -0
  171. package/src/core/performance/media-loading-optimizer.ts +538 -0
  172. package/src/core/performance/performance-budgets.ts +432 -0
  173. package/src/core/performance/performance-monitor.tsx +476 -0
  174. package/src/core/performance/performance-testing.ts +459 -0
  175. package/src/core/plugins/base-plugin.ts +224 -0
  176. package/src/core/plugins/enhanced-plugin-system.ts +411 -0
  177. package/src/core/plugins/examples/analytics-plugin.ts +242 -0
  178. package/src/core/plugins/index.ts +39 -0
  179. package/src/core/plugins/registry.ts +327 -0
  180. package/src/core/plugins/types.ts +159 -0
  181. package/src/core/plugins/utils.ts +316 -0
  182. package/src/core/progressive-loading.tsx +322 -0
  183. package/src/core/providers/enhanced-hls-provider.ts +339 -0
  184. package/src/core/providers/service-provider.tsx +168 -0
  185. package/src/core/utils.tsx +38 -0
  186. package/src/features/media-session/media-session-manager.ts +429 -0
  187. package/src/features/picture-in-picture/pip-manager.ts +429 -0
  188. package/src/features/playlist/playlist-manager.ts +606 -0
  189. package/src/features/subtitles/subtitle-manager.ts +441 -0
  190. package/src/features/subtitles/subtitle-parser.ts +280 -0
  191. package/src/features/thumbnails/thumbnail-generator.ts +519 -0
  192. package/src/hooks/accessibility/index.ts +27 -0
  193. package/src/hooks/accessibility/use-accessibility-preferences.ts +188 -0
  194. package/src/hooks/accessibility/use-focus-management.ts +176 -0
  195. package/src/hooks/accessibility/use-keyboard-shortcuts.ts +144 -0
  196. package/src/hooks/accessibility/use-screen-reader.ts +182 -0
  197. package/src/hooks/core/index.ts +47 -0
  198. package/src/hooks/legacy.ts +27 -0
  199. package/src/hooks/use-enhanced-media-player.ts +468 -0
  200. package/src/hooks/use-intelligent-preloading.ts +358 -0
  201. package/src/hooks/use-keyboard-controls.ts +115 -0
  202. package/src/hooks/use-media-actions.ts +175 -0
  203. package/src/hooks/use-media-metadata.ts +89 -0
  204. package/src/hooks/use-media-optimistic.ts +270 -0
  205. package/src/hooks/use-media-player.ts +312 -0
  206. package/src/hooks/use-media-state.ts +190 -0
  207. package/src/hooks/use-memory-optimization.ts +358 -0
  208. package/src/hooks/use-optimistic-controls.ts +92 -0
  209. package/src/hooks/use-optimized-media.ts +263 -0
  210. package/src/hooks/use-touch-gestures.ts +417 -0
  211. package/src/hooks/useEnhancedSubtitles.ts +258 -0
  212. package/src/hooks/useKeyboardShortcuts.ts +74 -0
  213. package/src/hooks/useMediaControls.ts +52 -0
  214. package/src/hooks/useScreenshot.ts +57 -0
  215. package/src/hooks/useSubtitles.ts +91 -0
  216. package/src/hooks/useVideoPlayer.ts +232 -0
  217. package/src/icons/components/FullscreenIcon.tsx +37 -0
  218. package/src/icons/components/SettingsIcon.tsx +38 -0
  219. package/src/icons/components/animated/LoadingIcon.tsx +43 -0
  220. package/src/icons/components/animated/PlayPauseIcon.tsx +50 -0
  221. package/src/icons/components/media/PauseIcon.tsx +39 -0
  222. package/src/icons/components/media/PlayIcon.tsx +38 -0
  223. package/src/icons/components/volume/VolumeIcon.tsx +39 -0
  224. package/src/icons/components/volume/VolumeOffIcon.tsx +39 -0
  225. package/src/icons/index.ts +56 -0
  226. package/src/icons/provider.tsx +64 -0
  227. package/src/icons/types.ts +40 -0
  228. package/src/index-enhanced.ts +35 -0
  229. package/src/index-legacy.ts +326 -0
  230. package/src/index.css +102 -0
  231. package/src/index.ts +216 -0
  232. package/src/lib/deprecation.ts +51 -0
  233. package/src/lib/format-time.ts +37 -0
  234. package/src/lib/index.ts +3 -0
  235. package/src/lib/utils.ts +6 -0
  236. package/src/styles/globals.css +462 -0
  237. package/src/styles/minimal-player.css +589 -0
  238. package/src/styles/pixel-art.css +46 -0
  239. package/src/styles/videojs.css +100 -0
  240. package/src/test/setup.ts +79 -0
  241. package/src/types/events.ts +47 -0
  242. package/src/types/formats.ts +95 -0
  243. package/src/types/index.ts +190 -0
  244. 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"