@videojs/react 10.0.0-beta.17 → 10.0.0-beta.21

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 (139) hide show
  1. package/dist/default/index.js +1 -2
  2. package/dist/default/media/dash-video/index.js +2 -2
  3. package/dist/default/media/dash-video/index.js.map +1 -1
  4. package/dist/default/media/hls-video/index.js +2 -2
  5. package/dist/default/media/hls-video/index.js.map +1 -1
  6. package/dist/default/media/mux-audio/index.js +3 -3
  7. package/dist/default/media/mux-audio/index.js.map +1 -1
  8. package/dist/default/media/mux-video/index.js +3 -3
  9. package/dist/default/media/mux-video/index.js.map +1 -1
  10. package/dist/default/media/native-hls-video/index.js +2 -2
  11. package/dist/default/media/native-hls-video/index.js.map +1 -1
  12. package/dist/default/media/simple-hls-video/index.js +1 -2
  13. package/dist/default/media/simple-hls-video/index.js.map +1 -1
  14. package/dist/default/player/context.js.map +1 -1
  15. package/dist/default/ui/alert-dialog/alert-dialog-root.js +1 -1
  16. package/dist/default/ui/buffering-indicator/buffering-indicator.js +1 -1
  17. package/dist/default/ui/captions-button/captions-button.js +1 -1
  18. package/dist/default/ui/controls/controls-root.js +1 -1
  19. package/dist/default/ui/error-dialog/error-dialog-root.js +1 -1
  20. package/dist/default/ui/fullscreen-button/fullscreen-button.js +1 -1
  21. package/dist/default/ui/mute-button/mute-button.js +1 -1
  22. package/dist/default/ui/pip-button/pip-button.js +1 -1
  23. package/dist/default/ui/play-button/play-button.js +1 -1
  24. package/dist/default/ui/playback-rate-button/playback-rate-button.js +1 -1
  25. package/dist/default/ui/popover/popover-root.js +1 -1
  26. package/dist/default/ui/poster/poster.js +1 -1
  27. package/dist/default/ui/seek-button/seek-button.js +1 -1
  28. package/dist/default/ui/slider/slider-root.js +1 -1
  29. package/dist/default/ui/thumbnail/thumbnail.js +1 -1
  30. package/dist/default/ui/time/time-value.js +1 -1
  31. package/dist/default/ui/time-slider/time-slider-root.js +1 -1
  32. package/dist/default/ui/tooltip/tooltip-popup.js +1 -1
  33. package/dist/default/ui/tooltip/tooltip-provider.js +1 -1
  34. package/dist/default/ui/tooltip/tooltip-root.js +1 -1
  35. package/dist/default/ui/volume-slider/volume-slider-root.js +1 -1
  36. package/dist/default/utils/media-props.js.map +1 -1
  37. package/dist/default/utils/use-media-instance.js.map +1 -1
  38. package/dist/dev/index.d.ts +1 -2
  39. package/dist/dev/index.js +1 -2
  40. package/dist/dev/media/dash-video/index.d.ts +4 -4
  41. package/dist/dev/media/dash-video/index.d.ts.map +1 -1
  42. package/dist/dev/media/dash-video/index.js +2 -2
  43. package/dist/dev/media/dash-video/index.js.map +1 -1
  44. package/dist/dev/media/hls-video/index.d.ts +4 -4
  45. package/dist/dev/media/hls-video/index.d.ts.map +1 -1
  46. package/dist/dev/media/hls-video/index.js +2 -2
  47. package/dist/dev/media/hls-video/index.js.map +1 -1
  48. package/dist/dev/media/mux-audio/index.d.ts +4 -4
  49. package/dist/dev/media/mux-audio/index.d.ts.map +1 -1
  50. package/dist/dev/media/mux-audio/index.js +3 -3
  51. package/dist/dev/media/mux-audio/index.js.map +1 -1
  52. package/dist/dev/media/mux-video/index.d.ts +4 -4
  53. package/dist/dev/media/mux-video/index.d.ts.map +1 -1
  54. package/dist/dev/media/mux-video/index.js +3 -3
  55. package/dist/dev/media/mux-video/index.js.map +1 -1
  56. package/dist/dev/media/native-hls-video/index.d.ts +4 -4
  57. package/dist/dev/media/native-hls-video/index.d.ts.map +1 -1
  58. package/dist/dev/media/native-hls-video/index.js +2 -2
  59. package/dist/dev/media/native-hls-video/index.js.map +1 -1
  60. package/dist/dev/media/simple-hls-video/index.d.ts.map +1 -1
  61. package/dist/dev/media/simple-hls-video/index.js +1 -2
  62. package/dist/dev/media/simple-hls-video/index.js.map +1 -1
  63. package/dist/dev/player/context.d.ts +6 -5
  64. package/dist/dev/player/context.d.ts.map +1 -1
  65. package/dist/dev/player/context.js.map +1 -1
  66. package/dist/dev/ui/alert-dialog/alert-dialog-close.d.ts +1 -1
  67. package/dist/dev/ui/alert-dialog/alert-dialog-description.d.ts +1 -1
  68. package/dist/dev/ui/alert-dialog/alert-dialog-popup.d.ts +1 -1
  69. package/dist/dev/ui/alert-dialog/alert-dialog-root.d.ts +1 -1
  70. package/dist/dev/ui/alert-dialog/alert-dialog-root.js +1 -1
  71. package/dist/dev/ui/alert-dialog/alert-dialog-title.d.ts +1 -1
  72. package/dist/dev/ui/alert-dialog/context.d.ts +3 -2
  73. package/dist/dev/ui/alert-dialog/context.d.ts.map +1 -1
  74. package/dist/dev/ui/buffering-indicator/buffering-indicator.d.ts +1 -1
  75. package/dist/dev/ui/buffering-indicator/buffering-indicator.js +1 -1
  76. package/dist/dev/ui/captions-button/captions-button.d.ts +1 -1
  77. package/dist/dev/ui/captions-button/captions-button.js +1 -1
  78. package/dist/dev/ui/controls/controls-group.d.ts +1 -1
  79. package/dist/dev/ui/controls/controls-root.d.ts +1 -1
  80. package/dist/dev/ui/controls/controls-root.js +1 -1
  81. package/dist/dev/ui/error-dialog/context.d.ts +1 -0
  82. package/dist/dev/ui/error-dialog/context.d.ts.map +1 -1
  83. package/dist/dev/ui/error-dialog/error-dialog-description.d.ts +1 -1
  84. package/dist/dev/ui/error-dialog/error-dialog-root.js +1 -1
  85. package/dist/dev/ui/fullscreen-button/fullscreen-button.d.ts +1 -1
  86. package/dist/dev/ui/fullscreen-button/fullscreen-button.js +1 -1
  87. package/dist/dev/ui/hooks/use-slider.d.ts +1 -1
  88. package/dist/dev/ui/mute-button/mute-button.d.ts +1 -1
  89. package/dist/dev/ui/mute-button/mute-button.js +1 -1
  90. package/dist/dev/ui/pip-button/pip-button.d.ts +1 -1
  91. package/dist/dev/ui/pip-button/pip-button.js +1 -1
  92. package/dist/dev/ui/play-button/play-button.d.ts +1 -1
  93. package/dist/dev/ui/play-button/play-button.js +1 -1
  94. package/dist/dev/ui/playback-rate-button/playback-rate-button.d.ts +1 -1
  95. package/dist/dev/ui/playback-rate-button/playback-rate-button.js +1 -1
  96. package/dist/dev/ui/popover/context.d.ts +3 -2
  97. package/dist/dev/ui/popover/context.d.ts.map +1 -1
  98. package/dist/dev/ui/popover/popover-arrow.d.ts +1 -1
  99. package/dist/dev/ui/popover/popover-popup.d.ts +1 -1
  100. package/dist/dev/ui/popover/popover-root.d.ts +1 -1
  101. package/dist/dev/ui/popover/popover-root.js +1 -1
  102. package/dist/dev/ui/popover/popover-trigger.d.ts +1 -1
  103. package/dist/dev/ui/poster/poster.d.ts +1 -1
  104. package/dist/dev/ui/poster/poster.js +1 -1
  105. package/dist/dev/ui/seek-button/seek-button.d.ts +1 -1
  106. package/dist/dev/ui/seek-button/seek-button.js +1 -1
  107. package/dist/dev/ui/slider/slider-buffer.d.ts +1 -1
  108. package/dist/dev/ui/slider/slider-fill.d.ts +1 -1
  109. package/dist/dev/ui/slider/slider-preview.d.ts +1 -1
  110. package/dist/dev/ui/slider/slider-root.d.ts +1 -1
  111. package/dist/dev/ui/slider/slider-root.js +1 -1
  112. package/dist/dev/ui/slider/slider-thumb.d.ts +1 -1
  113. package/dist/dev/ui/slider/slider-thumbnail.d.ts +1 -1
  114. package/dist/dev/ui/slider/slider-track.d.ts +1 -1
  115. package/dist/dev/ui/slider/slider-value.d.ts +1 -1
  116. package/dist/dev/ui/thumbnail/thumbnail.d.ts +1 -1
  117. package/dist/dev/ui/thumbnail/thumbnail.js +1 -1
  118. package/dist/dev/ui/time/time-value.d.ts +1 -1
  119. package/dist/dev/ui/time/time-value.js +1 -1
  120. package/dist/dev/ui/time-slider/time-slider-root.d.ts +1 -1
  121. package/dist/dev/ui/time-slider/time-slider-root.js +1 -1
  122. package/dist/dev/ui/tooltip/context.d.ts +3 -2
  123. package/dist/dev/ui/tooltip/context.d.ts.map +1 -1
  124. package/dist/dev/ui/tooltip/tooltip-arrow.d.ts +1 -1
  125. package/dist/dev/ui/tooltip/tooltip-popup.d.ts +1 -1
  126. package/dist/dev/ui/tooltip/tooltip-popup.js +1 -1
  127. package/dist/dev/ui/tooltip/tooltip-provider.d.ts +1 -1
  128. package/dist/dev/ui/tooltip/tooltip-provider.js +1 -1
  129. package/dist/dev/ui/tooltip/tooltip-root.d.ts +1 -1
  130. package/dist/dev/ui/tooltip/tooltip-root.js +1 -1
  131. package/dist/dev/ui/tooltip/tooltip-trigger.d.ts +1 -1
  132. package/dist/dev/ui/volume-slider/volume-slider-root.d.ts +1 -1
  133. package/dist/dev/ui/volume-slider/volume-slider-root.js +1 -1
  134. package/dist/dev/utils/media-props.d.ts +2 -2
  135. package/dist/dev/utils/media-props.d.ts.map +1 -1
  136. package/dist/dev/utils/media-props.js.map +1 -1
  137. package/dist/dev/utils/use-media-instance.d.ts +1 -1
  138. package/dist/dev/utils/use-media-instance.js.map +1 -1
  139. package/package.json +7 -7
@@ -40,8 +40,7 @@ import { index_parts_exports as index_parts_exports$8 } from "./ui/volume-slider
40
40
  import { attachMediaElement } from "./utils/attach-media-element.js";
41
41
  import { mediaProps } from "./utils/media-props.js";
42
42
  import { useMediaInstance } from "./utils/use-media-instance.js";
43
- import { DelegateMixin } from "@videojs/core";
44
43
  import { createSelector, shallowEqual } from "@videojs/store";
45
44
  import { useSelector, useStore } from "@videojs/store/react";
46
45
  export * from "@videojs/core/dom";
47
- export { index_parts_exports as AlertDialog, BufferingIndicator, CaptionsButton, Container, index_parts_exports$1 as Controls, DelegateMixin, index_parts_exports$2 as ErrorDialog, FullscreenButton, MediaGesture, MediaHotkey, MuteButton, PiPButton, PlayButton, PlaybackRateButton, index_parts_exports$3 as Popover, Poster, SeekButton, index_parts_exports$4 as Slider, Thumbnail, index_parts_exports$5 as Time, index_parts_exports$6 as TimeSlider, index_parts_exports$7 as Tooltip, index_parts_exports$8 as VolumeSlider, attachMediaElement, composeRefs, createPlayer, createSelector, mediaProps, mergeProps, renderElement, shallowEqual, useAlertDialogContext, useAriaKeyShortcuts, useButton, useComposedRefs, useContainer, useContainerAttach, useDestroy, useDoubleTapGesture, useErrorDialogContext, useHotkey, useLatestRef, useMedia, useMediaAttach, useMediaInstance, useOptionalPlayer, usePlayer, usePlayerContext, usePopoverContext, useSelector, useSlider, useStore, useTapGesture, useTooltipContext };
46
+ export { index_parts_exports as AlertDialog, BufferingIndicator, CaptionsButton, Container, index_parts_exports$1 as Controls, index_parts_exports$2 as ErrorDialog, FullscreenButton, MediaGesture, MediaHotkey, MuteButton, PiPButton, PlayButton, PlaybackRateButton, index_parts_exports$3 as Popover, Poster, SeekButton, index_parts_exports$4 as Slider, Thumbnail, index_parts_exports$5 as Time, index_parts_exports$6 as TimeSlider, index_parts_exports$7 as Tooltip, index_parts_exports$8 as VolumeSlider, attachMediaElement, composeRefs, createPlayer, createSelector, mediaProps, mergeProps, renderElement, shallowEqual, useAlertDialogContext, useAriaKeyShortcuts, useButton, useComposedRefs, useContainer, useContainerAttach, useDestroy, useDoubleTapGesture, useErrorDialogContext, useHotkey, useLatestRef, useMedia, useMediaAttach, useMediaInstance, useOptionalPlayer, usePlayer, usePlayerContext, usePopoverContext, useSelector, useSlider, useStore, useTapGesture, useTooltipContext };
@@ -5,13 +5,13 @@ import { mediaProps } from "../../utils/media-props.js";
5
5
  import { useMediaInstance } from "../../utils/use-media-instance.js";
6
6
  import { forwardRef } from "react";
7
7
  import { jsx } from "react/jsx-runtime";
8
- import { DashMedia, DashMediaDelegate } from "@videojs/core/dom/media/dash";
8
+ import { DashMedia } from "@videojs/core/dom/media/dash";
9
9
  //#region src/media/dash-video/index.tsx
10
10
  const DashVideo = forwardRef(function DashVideo({ children, ...props }, ref) {
11
11
  const mediaApi = useMediaInstance(DashMedia);
12
12
  return /* @__PURE__ */ jsx("video", {
13
13
  ref: useComposedRefs(attachMediaElement(mediaApi), ref),
14
- ...mediaProps(mediaApi, DashMediaDelegate, props),
14
+ ...mediaProps(mediaApi, DashMedia, props),
15
15
  children
16
16
  });
17
17
  });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../src/media/dash-video/index.tsx"],"sourcesContent":["'use client';\n\nimport type { InferDelegateProps } from '@videojs/core';\nimport { DashMedia, DashMediaDelegate } from '@videojs/core/dom/media/dash';\nimport type { PropsWithChildren, VideoHTMLAttributes } from 'react';\nimport { forwardRef } from 'react';\nimport { attachMediaElement } from '../../utils/attach-media-element';\nimport { mediaProps } from '../../utils/media-props';\nimport { useComposedRefs } from '../../utils/use-composed-refs';\nimport { useMediaInstance } from '../../utils/use-media-instance';\n\nexport type DashVideoProps = PropsWithChildren<VideoHTMLAttributes<HTMLVideoElement>> &\n InferDelegateProps<typeof DashMediaDelegate>;\n\nexport const DashVideo = forwardRef<HTMLVideoElement, DashVideoProps>(function DashVideo({ children, ...props }, ref) {\n const mediaApi = useMediaInstance(DashMedia);\n\n const composedRef = useComposedRefs(attachMediaElement(mediaApi), ref);\n\n return (\n <video ref={composedRef} {...mediaProps(mediaApi, DashMediaDelegate, props)}>\n {children}\n </video>\n );\n});\n\nexport namespace DashVideo {\n export type Props = DashVideoProps;\n}\n"],"mappings":";;;;;;;;;AAcA,MAAa,YAAY,WAA6C,SAAS,UAAU,EAAE,UAAU,GAAG,SAAS,KAAK;CACpH,MAAM,WAAW,iBAAiB,UAAU;AAI5C,QACE,oBAAC,SAAD;EAAO,KAHW,gBAAgB,mBAAmB,SAAS,EAAE,IAAI;EAG3C,GAAI,WAAW,UAAU,mBAAmB,MAAM;EACxE;EACK,CAAA;EAEV"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../src/media/dash-video/index.tsx"],"sourcesContent":["'use client';\n\nimport { DashMedia } from '@videojs/core/dom/media/dash';\nimport type { InferClassProps } from '@videojs/utils/types';\nimport type { PropsWithChildren, VideoHTMLAttributes } from 'react';\nimport { forwardRef } from 'react';\nimport { attachMediaElement } from '../../utils/attach-media-element';\nimport { mediaProps } from '../../utils/media-props';\nimport { useComposedRefs } from '../../utils/use-composed-refs';\nimport { useMediaInstance } from '../../utils/use-media-instance';\n\nexport type DashVideoProps = PropsWithChildren<VideoHTMLAttributes<HTMLVideoElement>> &\n InferClassProps<typeof DashMedia>;\n\nexport const DashVideo = forwardRef<HTMLVideoElement, DashVideoProps>(function DashVideo({ children, ...props }, ref) {\n const mediaApi = useMediaInstance(DashMedia);\n\n const composedRef = useComposedRefs(attachMediaElement(mediaApi), ref);\n\n return (\n <video ref={composedRef} {...mediaProps(mediaApi, DashMedia, props)}>\n {children}\n </video>\n );\n});\n\nexport namespace DashVideo {\n export type Props = DashVideoProps;\n}\n"],"mappings":";;;;;;;;;AAcA,MAAa,YAAY,WAA6C,SAAS,UAAU,EAAE,UAAU,GAAG,SAAS,KAAK;CACpH,MAAM,WAAW,iBAAiB,UAAU;AAI5C,QACE,oBAAC,SAAD;EAAO,KAHW,gBAAgB,mBAAmB,SAAS,EAAE,IAAI;EAG3C,GAAI,WAAW,UAAU,WAAW,MAAM;EAChE;EACK,CAAA;EAEV"}
@@ -5,13 +5,13 @@ import { mediaProps } from "../../utils/media-props.js";
5
5
  import { useMediaInstance } from "../../utils/use-media-instance.js";
6
6
  import { forwardRef } from "react";
7
7
  import { jsx } from "react/jsx-runtime";
8
- import { HlsMedia, HlsMediaDelegate } from "@videojs/core/dom/media/hls";
8
+ import { HlsMedia } from "@videojs/core/dom/media/hls";
9
9
  //#region src/media/hls-video/index.tsx
10
10
  const HlsVideo = forwardRef(function HlsVideo({ children, ...props }, ref) {
11
11
  const mediaApi = useMediaInstance(HlsMedia);
12
12
  return /* @__PURE__ */ jsx("video", {
13
13
  ref: useComposedRefs(attachMediaElement(mediaApi), ref),
14
- ...mediaProps(mediaApi, HlsMediaDelegate, props),
14
+ ...mediaProps(mediaApi, HlsMedia, props),
15
15
  children
16
16
  });
17
17
  });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../src/media/hls-video/index.tsx"],"sourcesContent":["'use client';\n\nimport type { InferDelegateProps } from '@videojs/core';\nimport { HlsMedia, HlsMediaDelegate } from '@videojs/core/dom/media/hls';\nimport type { PropsWithChildren, VideoHTMLAttributes } from 'react';\nimport { forwardRef } from 'react';\nimport { attachMediaElement } from '../../utils/attach-media-element';\nimport { mediaProps } from '../../utils/media-props';\nimport { useComposedRefs } from '../../utils/use-composed-refs';\nimport { useMediaInstance } from '../../utils/use-media-instance';\n\nexport type HlsVideoProps = PropsWithChildren<VideoHTMLAttributes<HTMLVideoElement>> &\n InferDelegateProps<typeof HlsMediaDelegate>;\n\nexport const HlsVideo = forwardRef<HTMLVideoElement, HlsVideoProps>(function HlsVideo({ children, ...props }, ref) {\n const mediaApi = useMediaInstance(HlsMedia);\n\n const composedRef = useComposedRefs(attachMediaElement(mediaApi), ref);\n\n return (\n <video ref={composedRef} {...mediaProps(mediaApi, HlsMediaDelegate, props)}>\n {children}\n </video>\n );\n});\n\nexport namespace HlsVideo {\n export type Props = HlsVideoProps;\n}\n"],"mappings":";;;;;;;;;AAcA,MAAa,WAAW,WAA4C,SAAS,SAAS,EAAE,UAAU,GAAG,SAAS,KAAK;CACjH,MAAM,WAAW,iBAAiB,SAAS;AAI3C,QACE,oBAAC,SAAD;EAAO,KAHW,gBAAgB,mBAAmB,SAAS,EAAE,IAAI;EAG3C,GAAI,WAAW,UAAU,kBAAkB,MAAM;EACvE;EACK,CAAA;EAEV"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../src/media/hls-video/index.tsx"],"sourcesContent":["'use client';\n\nimport { HlsMedia } from '@videojs/core/dom/media/hls';\nimport type { InferClassProps } from '@videojs/utils/types';\nimport type { PropsWithChildren, VideoHTMLAttributes } from 'react';\nimport { forwardRef } from 'react';\nimport { attachMediaElement } from '../../utils/attach-media-element';\nimport { mediaProps } from '../../utils/media-props';\nimport { useComposedRefs } from '../../utils/use-composed-refs';\nimport { useMediaInstance } from '../../utils/use-media-instance';\n\nexport type HlsVideoProps = PropsWithChildren<VideoHTMLAttributes<HTMLVideoElement>> & InferClassProps<typeof HlsMedia>;\n\nexport const HlsVideo = forwardRef<HTMLVideoElement, HlsVideoProps>(function HlsVideo({ children, ...props }, ref) {\n const mediaApi = useMediaInstance(HlsMedia);\n\n const composedRef = useComposedRefs(attachMediaElement(mediaApi), ref);\n\n return (\n <video ref={composedRef} {...mediaProps(mediaApi, HlsMedia, props)}>\n {children}\n </video>\n );\n});\n\nexport namespace HlsVideo {\n export type Props = HlsVideoProps;\n}\n"],"mappings":";;;;;;;;;AAaA,MAAa,WAAW,WAA4C,SAAS,SAAS,EAAE,UAAU,GAAG,SAAS,KAAK;CACjH,MAAM,WAAW,iBAAiB,SAAS;AAI3C,QACE,oBAAC,SAAD;EAAO,KAHW,gBAAgB,mBAAmB,SAAS,EAAE,IAAI;EAG3C,GAAI,WAAW,UAAU,UAAU,MAAM;EAC/D;EACK,CAAA;EAEV"}
@@ -4,13 +4,13 @@ import { mediaProps } from "../../utils/media-props.js";
4
4
  import { useMediaInstance } from "../../utils/use-media-instance.js";
5
5
  import { forwardRef } from "react";
6
6
  import { jsx } from "react/jsx-runtime";
7
- import { MuxAudio as MuxAudio$1, MuxMediaDelegate } from "@videojs/core/dom/media/mux";
7
+ import { MuxAudioMedia } from "@videojs/core/dom/media/mux";
8
8
  //#region src/media/mux-audio/index.tsx
9
9
  const MuxAudio = forwardRef(({ children, ...props }, ref) => {
10
- const mediaApi = useMediaInstance(MuxAudio$1);
10
+ const mediaApi = useMediaInstance(MuxAudioMedia);
11
11
  return /* @__PURE__ */ jsx("audio", {
12
12
  ref: useComposedRefs(attachMediaElement(mediaApi), ref),
13
- ...mediaProps(mediaApi, MuxMediaDelegate, props),
13
+ ...mediaProps(mediaApi, MuxAudioMedia, props),
14
14
  children
15
15
  });
16
16
  });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["MuxAudioApi"],"sources":["../../../../src/media/mux-audio/index.tsx"],"sourcesContent":["import type { InferDelegateProps } from '@videojs/core';\nimport { MuxAudio as MuxAudioApi, MuxMediaDelegate } from '@videojs/core/dom/media/mux';\nimport type { AudioHTMLAttributes, PropsWithChildren } from 'react';\nimport { forwardRef } from 'react';\nimport { attachMediaElement } from '../../utils/attach-media-element';\nimport { mediaProps } from '../../utils/media-props';\nimport { useComposedRefs } from '../../utils/use-composed-refs';\nimport { useMediaInstance } from '../../utils/use-media-instance';\n\nexport type MuxAudioProps = PropsWithChildren<AudioHTMLAttributes<HTMLAudioElement>> &\n InferDelegateProps<typeof MuxMediaDelegate>;\n\nexport const MuxAudio = forwardRef<HTMLAudioElement, MuxAudioProps>(({ children, ...props }, ref) => {\n const mediaApi = useMediaInstance(MuxAudioApi);\n\n const composedRef = useComposedRefs(attachMediaElement(mediaApi), ref);\n\n return (\n <audio ref={composedRef} {...mediaProps(mediaApi, MuxMediaDelegate, props)}>\n {children}\n </audio>\n );\n});\n\nexport default MuxAudio;\n"],"mappings":";;;;;;;;AAYA,MAAa,WAAW,YAA6C,EAAE,UAAU,GAAG,SAAS,QAAQ;CACnG,MAAM,WAAW,iBAAiBA,WAAY;AAI9C,QACE,oBAAC,SAAD;EAAO,KAHW,gBAAgB,mBAAmB,SAAS,EAAE,IAAI;EAG3C,GAAI,WAAW,UAAU,kBAAkB,MAAM;EACvE;EACK,CAAA;EAEV"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../src/media/mux-audio/index.tsx"],"sourcesContent":["import { MuxAudioMedia } from '@videojs/core/dom/media/mux';\nimport type { InferClassProps } from '@videojs/utils/types';\nimport type { AudioHTMLAttributes, PropsWithChildren } from 'react';\nimport { forwardRef } from 'react';\nimport { attachMediaElement } from '../../utils/attach-media-element';\nimport { mediaProps } from '../../utils/media-props';\nimport { useComposedRefs } from '../../utils/use-composed-refs';\nimport { useMediaInstance } from '../../utils/use-media-instance';\n\nexport type MuxAudioProps = PropsWithChildren<AudioHTMLAttributes<HTMLAudioElement>> &\n InferClassProps<typeof MuxAudioMedia>;\n\nexport const MuxAudio = forwardRef<HTMLAudioElement, MuxAudioProps>(({ children, ...props }, ref) => {\n const mediaApi = useMediaInstance(MuxAudioMedia);\n\n const composedRef = useComposedRefs(attachMediaElement(mediaApi), ref);\n\n return (\n <audio ref={composedRef} {...mediaProps(mediaApi, MuxAudioMedia, props)}>\n {children}\n </audio>\n );\n});\n\nexport default MuxAudio;\n"],"mappings":";;;;;;;;AAYA,MAAa,WAAW,YAA6C,EAAE,UAAU,GAAG,SAAS,QAAQ;CACnG,MAAM,WAAW,iBAAiB,cAAc;AAIhD,QACE,oBAAC,SAAD;EAAO,KAHW,gBAAgB,mBAAmB,SAAS,EAAE,IAAI;EAG3C,GAAI,WAAW,UAAU,eAAe,MAAM;EACpE;EACK,CAAA;EAEV"}
@@ -5,13 +5,13 @@ import { mediaProps } from "../../utils/media-props.js";
5
5
  import { useMediaInstance } from "../../utils/use-media-instance.js";
6
6
  import { forwardRef } from "react";
7
7
  import { jsx } from "react/jsx-runtime";
8
- import { MuxMediaDelegate, MuxVideo as MuxVideo$1 } from "@videojs/core/dom/media/mux";
8
+ import { MuxVideoMedia } from "@videojs/core/dom/media/mux";
9
9
  //#region src/media/mux-video/index.tsx
10
10
  const MuxVideo = forwardRef(function MuxVideo({ children, ...props }, ref) {
11
- const mediaApi = useMediaInstance(MuxVideo$1);
11
+ const mediaApi = useMediaInstance(MuxVideoMedia);
12
12
  return /* @__PURE__ */ jsx("video", {
13
13
  ref: useComposedRefs(attachMediaElement(mediaApi), ref),
14
- ...mediaProps(mediaApi, MuxMediaDelegate, props),
14
+ ...mediaProps(mediaApi, MuxVideoMedia, props),
15
15
  children
16
16
  });
17
17
  });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["MuxVideoApi"],"sources":["../../../../src/media/mux-video/index.tsx"],"sourcesContent":["'use client';\n\nimport type { InferDelegateProps } from '@videojs/core';\nimport { MuxMediaDelegate, MuxVideo as MuxVideoApi } from '@videojs/core/dom/media/mux';\nimport type { PropsWithChildren, VideoHTMLAttributes } from 'react';\nimport { forwardRef } from 'react';\nimport { attachMediaElement } from '../../utils/attach-media-element';\nimport { mediaProps } from '../../utils/media-props';\nimport { useComposedRefs } from '../../utils/use-composed-refs';\nimport { useMediaInstance } from '../../utils/use-media-instance';\n\nexport type MuxVideoProps = PropsWithChildren<VideoHTMLAttributes<HTMLVideoElement>> &\n InferDelegateProps<typeof MuxMediaDelegate>;\n\nexport const MuxVideo = forwardRef<HTMLVideoElement, MuxVideoProps>(function MuxVideo({ children, ...props }, ref) {\n const mediaApi = useMediaInstance(MuxVideoApi);\n\n const composedRef = useComposedRefs(attachMediaElement(mediaApi), ref);\n\n return (\n <video ref={composedRef} {...mediaProps(mediaApi, MuxMediaDelegate, props)}>\n {children}\n </video>\n );\n});\n\nexport namespace MuxVideo {\n export type Props = MuxVideoProps;\n}\n"],"mappings":";;;;;;;;;AAcA,MAAa,WAAW,WAA4C,SAAS,SAAS,EAAE,UAAU,GAAG,SAAS,KAAK;CACjH,MAAM,WAAW,iBAAiBA,WAAY;AAI9C,QACE,oBAAC,SAAD;EAAO,KAHW,gBAAgB,mBAAmB,SAAS,EAAE,IAAI;EAG3C,GAAI,WAAW,UAAU,kBAAkB,MAAM;EACvE;EACK,CAAA;EAEV"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../src/media/mux-video/index.tsx"],"sourcesContent":["'use client';\n\nimport { MuxVideoMedia } from '@videojs/core/dom/media/mux';\nimport type { InferClassProps } from '@videojs/utils/types';\nimport type { PropsWithChildren, VideoHTMLAttributes } from 'react';\nimport { forwardRef } from 'react';\nimport { attachMediaElement } from '../../utils/attach-media-element';\nimport { mediaProps } from '../../utils/media-props';\nimport { useComposedRefs } from '../../utils/use-composed-refs';\nimport { useMediaInstance } from '../../utils/use-media-instance';\n\nexport type MuxVideoProps = PropsWithChildren<VideoHTMLAttributes<HTMLVideoElement>> &\n InferClassProps<typeof MuxVideoMedia>;\n\nexport const MuxVideo = forwardRef<HTMLVideoElement, MuxVideoProps>(function MuxVideo({ children, ...props }, ref) {\n const mediaApi = useMediaInstance(MuxVideoMedia);\n\n const composedRef = useComposedRefs(attachMediaElement(mediaApi), ref);\n\n return (\n <video ref={composedRef} {...mediaProps(mediaApi, MuxVideoMedia, props)}>\n {children}\n </video>\n );\n});\n\nexport namespace MuxVideo {\n export type Props = MuxVideoProps;\n}\n"],"mappings":";;;;;;;;;AAcA,MAAa,WAAW,WAA4C,SAAS,SAAS,EAAE,UAAU,GAAG,SAAS,KAAK;CACjH,MAAM,WAAW,iBAAiB,cAAc;AAIhD,QACE,oBAAC,SAAD;EAAO,KAHW,gBAAgB,mBAAmB,SAAS,EAAE,IAAI;EAG3C,GAAI,WAAW,UAAU,eAAe,MAAM;EACpE;EACK,CAAA;EAEV"}
@@ -5,13 +5,13 @@ import { mediaProps } from "../../utils/media-props.js";
5
5
  import { useMediaInstance } from "../../utils/use-media-instance.js";
6
6
  import { forwardRef } from "react";
7
7
  import { jsx } from "react/jsx-runtime";
8
- import { NativeHlsMedia, NativeHlsMediaDelegate } from "@videojs/core/dom/media/native-hls";
8
+ import { NativeHlsMedia } from "@videojs/core/dom/media/native-hls";
9
9
  //#region src/media/native-hls-video/index.tsx
10
10
  const NativeHlsVideo = forwardRef(function NativeHlsVideo({ children, ...props }, ref) {
11
11
  const mediaApi = useMediaInstance(NativeHlsMedia);
12
12
  return /* @__PURE__ */ jsx("video", {
13
13
  ref: useComposedRefs(attachMediaElement(mediaApi), ref),
14
- ...mediaProps(mediaApi, NativeHlsMediaDelegate, props),
14
+ ...mediaProps(mediaApi, NativeHlsMedia, props),
15
15
  children
16
16
  });
17
17
  });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../src/media/native-hls-video/index.tsx"],"sourcesContent":["'use client';\n\nimport type { InferDelegateProps } from '@videojs/core';\nimport { NativeHlsMedia, NativeHlsMediaDelegate } from '@videojs/core/dom/media/native-hls';\nimport type { PropsWithChildren, VideoHTMLAttributes } from 'react';\nimport { forwardRef } from 'react';\nimport { attachMediaElement } from '../../utils/attach-media-element';\nimport { mediaProps } from '../../utils/media-props';\nimport { useComposedRefs } from '../../utils/use-composed-refs';\nimport { useMediaInstance } from '../../utils/use-media-instance';\n\nexport type NativeHlsVideoProps = PropsWithChildren<VideoHTMLAttributes<HTMLVideoElement>> &\n InferDelegateProps<typeof NativeHlsMediaDelegate>;\n\nexport const NativeHlsVideo = forwardRef<HTMLVideoElement, NativeHlsVideoProps>(function NativeHlsVideo(\n { children, ...props },\n ref\n) {\n const mediaApi = useMediaInstance(NativeHlsMedia);\n\n const composedRef = useComposedRefs(attachMediaElement(mediaApi), ref);\n\n return (\n <video ref={composedRef} {...mediaProps(mediaApi, NativeHlsMediaDelegate, props)}>\n {children}\n </video>\n );\n});\n\nexport namespace NativeHlsVideo {\n export type Props = NativeHlsVideoProps;\n}\n"],"mappings":";;;;;;;;;AAcA,MAAa,iBAAiB,WAAkD,SAAS,eACvF,EAAE,UAAU,GAAG,SACf,KACA;CACA,MAAM,WAAW,iBAAiB,eAAe;AAIjD,QACE,oBAAC,SAAD;EAAO,KAHW,gBAAgB,mBAAmB,SAAS,EAAE,IAAI;EAG3C,GAAI,WAAW,UAAU,wBAAwB,MAAM;EAC7E;EACK,CAAA;EAEV"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../src/media/native-hls-video/index.tsx"],"sourcesContent":["'use client';\n\nimport { NativeHlsMedia } from '@videojs/core/dom/media/native-hls';\nimport type { InferClassProps } from '@videojs/utils/types';\nimport type { PropsWithChildren, VideoHTMLAttributes } from 'react';\nimport { forwardRef } from 'react';\nimport { attachMediaElement } from '../../utils/attach-media-element';\nimport { mediaProps } from '../../utils/media-props';\nimport { useComposedRefs } from '../../utils/use-composed-refs';\nimport { useMediaInstance } from '../../utils/use-media-instance';\n\nexport type NativeHlsVideoProps = PropsWithChildren<VideoHTMLAttributes<HTMLVideoElement>> &\n InferClassProps<typeof NativeHlsMedia>;\n\nexport const NativeHlsVideo = forwardRef<HTMLVideoElement, NativeHlsVideoProps>(function NativeHlsVideo(\n { children, ...props },\n ref\n) {\n const mediaApi = useMediaInstance(NativeHlsMedia);\n\n const composedRef = useComposedRefs(attachMediaElement(mediaApi), ref);\n\n return (\n <video ref={composedRef} {...mediaProps(mediaApi, NativeHlsMedia, props)}>\n {children}\n </video>\n );\n});\n\nexport namespace NativeHlsVideo {\n export type Props = NativeHlsVideoProps;\n}\n"],"mappings":";;;;;;;;;AAcA,MAAa,iBAAiB,WAAkD,SAAS,eACvF,EAAE,UAAU,GAAG,SACf,KACA;CACA,MAAM,WAAW,iBAAiB,eAAe;AAIjD,QACE,oBAAC,SAAD;EAAO,KAHW,gBAAgB,mBAAmB,SAAS,EAAE,IAAI;EAG3C,GAAI,WAAW,UAAU,gBAAgB,MAAM;EACrE;EACK,CAAA;EAEV"}
@@ -6,13 +6,12 @@ import { useMediaInstance } from "../../utils/use-media-instance.js";
6
6
  import { forwardRef } from "react";
7
7
  import { jsx } from "react/jsx-runtime";
8
8
  import { SimpleHlsMedia } from "@videojs/core/dom/media/simple-hls";
9
- import { SpfMedia } from "@videojs/spf/dom";
10
9
  //#region src/media/simple-hls-video/index.tsx
11
10
  const SimpleHlsVideo = forwardRef(function SimpleHlsVideo({ children, ...props }, ref) {
12
11
  const mediaApi = useMediaInstance(SimpleHlsMedia);
13
12
  return /* @__PURE__ */ jsx("video", {
14
13
  ref: useComposedRefs(attachMediaElement(mediaApi), ref),
15
- ...mediaProps(mediaApi, SpfMedia, props),
14
+ ...mediaProps(mediaApi, SimpleHlsMedia, props),
16
15
  children
17
16
  });
18
17
  });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../src/media/simple-hls-video/index.tsx"],"sourcesContent":["'use client';\n\nimport { SimpleHlsMedia } from '@videojs/core/dom/media/simple-hls';\nimport { SpfMedia } from '@videojs/spf/dom';\nimport type { PropsWithChildren, VideoHTMLAttributes } from 'react';\nimport { forwardRef } from 'react';\nimport { attachMediaElement } from '../../utils/attach-media-element';\nimport { mediaProps } from '../../utils/media-props';\nimport { useComposedRefs } from '../../utils/use-composed-refs';\nimport { useMediaInstance } from '../../utils/use-media-instance';\n\nexport type SimpleHlsVideoProps = PropsWithChildren<VideoHTMLAttributes<HTMLVideoElement>>;\n\nexport const SimpleHlsVideo = forwardRef<HTMLVideoElement, SimpleHlsVideoProps>(function SimpleHlsVideo(\n { children, ...props },\n ref\n) {\n const mediaApi = useMediaInstance(SimpleHlsMedia);\n\n const composedRef = useComposedRefs(attachMediaElement(mediaApi), ref);\n\n return (\n <video ref={composedRef} {...mediaProps(mediaApi, SpfMedia, props)}>\n {children}\n </video>\n );\n});\n\nexport namespace SimpleHlsVideo {\n export type Props = SimpleHlsVideoProps;\n}\n"],"mappings":";;;;;;;;;;AAaA,MAAa,iBAAiB,WAAkD,SAAS,eACvF,EAAE,UAAU,GAAG,SACf,KACA;CACA,MAAM,WAAW,iBAAiB,eAAe;AAIjD,QACE,oBAAC,SAAD;EAAO,KAHW,gBAAgB,mBAAmB,SAAS,EAAE,IAAI;EAG3C,GAAI,WAAW,UAAU,UAAU,MAAM;EAC/D;EACK,CAAA;EAEV"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../src/media/simple-hls-video/index.tsx"],"sourcesContent":["'use client';\n\nimport { SimpleHlsMedia } from '@videojs/core/dom/media/simple-hls';\nimport type { PropsWithChildren, VideoHTMLAttributes } from 'react';\nimport { forwardRef } from 'react';\nimport { attachMediaElement } from '../../utils/attach-media-element';\nimport { mediaProps } from '../../utils/media-props';\nimport { useComposedRefs } from '../../utils/use-composed-refs';\nimport { useMediaInstance } from '../../utils/use-media-instance';\n\nexport type SimpleHlsVideoProps = PropsWithChildren<VideoHTMLAttributes<HTMLVideoElement>>;\n\nexport const SimpleHlsVideo = forwardRef<HTMLVideoElement, SimpleHlsVideoProps>(function SimpleHlsVideo(\n { children, ...props },\n ref\n) {\n const mediaApi = useMediaInstance(SimpleHlsMedia);\n\n const composedRef = useComposedRefs(attachMediaElement(mediaApi), ref);\n\n return (\n <video ref={composedRef} {...mediaProps(mediaApi, SimpleHlsMedia, props)}>\n {children}\n </video>\n );\n});\n\nexport namespace SimpleHlsVideo {\n export type Props = SimpleHlsVideoProps;\n}\n"],"mappings":";;;;;;;;;AAYA,MAAa,iBAAiB,WAAkD,SAAS,eACvF,EAAE,UAAU,GAAG,SACf,KACA;CACA,MAAM,WAAW,iBAAiB,eAAe;AAIjD,QACE,oBAAC,SAAD;EAAO,KAHW,gBAAgB,mBAAmB,SAAS,EAAE,IAAI;EAG3C,GAAI,WAAW,UAAU,gBAAgB,MAAM;EACrE;EACK,CAAA;EAEV"}
@@ -1 +1 @@
1
- {"version":3,"file":"context.js","names":[],"sources":["../../../src/player/context.tsx"],"sourcesContent":["'use client';\n\nimport type { Media, MediaContainer } from '@videojs/core/dom';\nimport type { UnknownState, UnknownStore } from '@videojs/store';\nimport { useStore } from '@videojs/store/react';\nimport type { Dispatch, HTMLAttributes, ReactNode, PointerEvent as ReactPointerEvent, SetStateAction } from 'react';\nimport { createContext, forwardRef, useContext, useEffect, useRef } from 'react';\n\nimport { useComposedRefs } from '../utils/use-composed-refs';\n\nexport interface PlayerContextValue {\n store: UnknownStore;\n media: Media | null;\n setMedia: Dispatch<SetStateAction<Media | null>>;\n container: MediaContainer | null;\n setContainer: Dispatch<SetStateAction<HTMLElement | null>>;\n}\n\nconst PlayerContext = createContext<PlayerContextValue | null>(null);\nconst EMPTY_UNSUBSCRIBE = () => {};\nconst EMPTY_STORE = {\n state: {} as UnknownState,\n subscribe: () => EMPTY_UNSUBSCRIBE,\n} as Pick<UnknownStore, 'state' | 'subscribe'>;\n\nexport function PlayerContextProvider({\n value,\n children,\n}: {\n value: PlayerContextValue;\n children: ReactNode;\n}): ReactNode {\n return <PlayerContext.Provider value={value}>{children}</PlayerContext.Provider>;\n}\n\n/** Access the full player context value. Throws if used outside a Player Provider. */\nexport function usePlayerContext(): PlayerContextValue {\n const ctx = useContext(PlayerContext);\n if (!ctx) throw new Error('usePlayerContext must be used within a Player Provider');\n return ctx;\n}\n\n/**\n * Access the player store from within a Player Provider.\n *\n * @label Without Selector\n */\nexport function usePlayer(): UnknownStore;\n/**\n * Select a value from the player store. Re-renders when the selected value changes.\n *\n * @label With Selector\n * @param selector - Derives a value from the player store state.\n */\nexport function usePlayer<R>(selector: (state: UnknownState) => R): R;\nexport function usePlayer<R>(selector?: (state: UnknownState) => R) {\n const { store } = usePlayerContext();\n return useStore(store, selector as any);\n}\n\n/**\n * Access player state when available, but return `undefined` outside Provider.\n *\n * This is useful for components that can operate without player context\n * (e.g. they accept fully explicit props as a fallback).\n */\n/** @label Without Selector */\nexport function useOptionalPlayer(): UnknownStore | undefined;\n/** @label With Selector */\nexport function useOptionalPlayer<R>(selector: (state: UnknownState) => R): R | undefined;\nexport function useOptionalPlayer<R>(selector?: (state: UnknownState) => R) {\n const ctx = useContext(PlayerContext);\n const store = (ctx?.store ?? (EMPTY_STORE as unknown as UnknownStore)) as UnknownStore;\n const value = useStore(store, (ctx ? selector : undefined) as any);\n return ctx ? value : undefined;\n}\n\n/** Access the media element from within a Player Provider. */\nexport function useMedia(): Media | null {\n const { media } = usePlayerContext();\n return media;\n}\n\n/** Access the container element from within a Player Provider. */\nexport function useContainer(): MediaContainer | null {\n const { container } = usePlayerContext();\n return container;\n}\n\n/** Access the media attach setter for connecting a media element to the player. */\nexport function useMediaAttach(): Dispatch<SetStateAction<Media | null>> | undefined {\n const ctx = useContext(PlayerContext);\n return ctx?.setMedia;\n}\n\n/** Access the container attach setter for connecting a container element to the player. */\nexport function useContainerAttach(): Dispatch<SetStateAction<HTMLElement | null>> | undefined {\n const ctx = useContext(PlayerContext);\n return ctx?.setContainer;\n}\n\nexport interface ContainerProps extends HTMLAttributes<HTMLDivElement> {\n children?: ReactNode;\n}\n\nexport const Container = forwardRef<HTMLDivElement, ContainerProps>(function Container(\n { children, tabIndex = 0, ...props },\n ref\n) {\n const setContainer = useContainerAttach();\n const internalRef = useRef<HTMLDivElement>(null);\n const composedRef = useComposedRefs(ref, internalRef);\n\n useEffect(() => {\n setContainer?.(internalRef.current);\n return () => setContainer?.(null);\n }, [setContainer]);\n\n const handlePointerUp = (event: ReactPointerEvent<HTMLDivElement>) => {\n props.onPointerUp?.(event);\n const el = internalRef.current;\n if (!el) return;\n // If nothing inside has focus, grab it so keyboard events reach hotkey listeners.\n if (!el.contains(document.activeElement) || document.activeElement === document.body) {\n el.focus({ preventScroll: true });\n }\n };\n\n return (\n <div ref={composedRef} tabIndex={tabIndex} {...props} onPointerUp={handlePointerUp}>\n {children}\n </div>\n );\n});\n\nexport namespace Container {\n export type Props = ContainerProps;\n}\n"],"mappings":";;;;;;AAkBA,MAAM,gBAAgB,cAAyC,KAAK;AACpE,MAAM,0BAA0B;AAChC,MAAM,cAAc;CAClB,OAAO,EAAE;CACT,iBAAiB;CAClB;AAED,SAAgB,sBAAsB,EACpC,OACA,YAIY;AACZ,QAAO,oBAAC,cAAc,UAAf;EAA+B;EAAQ;EAAkC,CAAA;;;AAIlF,SAAgB,mBAAuC;CACrD,MAAM,MAAM,WAAW,cAAc;AACrC,KAAI,CAAC,IAAK,OAAM,IAAI,MAAM,yDAAyD;AACnF,QAAO;;AAgBT,SAAgB,UAAa,UAAuC;CAClE,MAAM,EAAE,UAAU,kBAAkB;AACpC,QAAO,SAAS,OAAO,SAAgB;;AAazC,SAAgB,kBAAqB,UAAuC;CAC1E,MAAM,MAAM,WAAW,cAAc;CAErC,MAAM,QAAQ,SADC,KAAK,SAAU,aACC,MAAM,WAAW,KAAA,EAAkB;AAClE,QAAO,MAAM,QAAQ,KAAA;;;AAIvB,SAAgB,WAAyB;CACvC,MAAM,EAAE,UAAU,kBAAkB;AACpC,QAAO;;;AAIT,SAAgB,eAAsC;CACpD,MAAM,EAAE,cAAc,kBAAkB;AACxC,QAAO;;;AAIT,SAAgB,iBAAqE;AAEnF,QADY,WAAW,cAAc,EACzB;;;AAId,SAAgB,qBAA+E;AAE7F,QADY,WAAW,cAAc,EACzB;;AAOd,MAAa,YAAY,WAA2C,SAAS,UAC3E,EAAE,UAAU,WAAW,GAAG,GAAG,SAC7B,KACA;CACA,MAAM,eAAe,oBAAoB;CACzC,MAAM,cAAc,OAAuB,KAAK;CAChD,MAAM,cAAc,gBAAgB,KAAK,YAAY;AAErD,iBAAgB;AACd,iBAAe,YAAY,QAAQ;AACnC,eAAa,eAAe,KAAK;IAChC,CAAC,aAAa,CAAC;CAElB,MAAM,mBAAmB,UAA6C;AACpE,QAAM,cAAc,MAAM;EAC1B,MAAM,KAAK,YAAY;AACvB,MAAI,CAAC,GAAI;AAET,MAAI,CAAC,GAAG,SAAS,SAAS,cAAc,IAAI,SAAS,kBAAkB,SAAS,KAC9E,IAAG,MAAM,EAAE,eAAe,MAAM,CAAC;;AAIrC,QACE,oBAAC,OAAD;EAAK,KAAK;EAAuB;EAAU,GAAI;EAAO,aAAa;EAChE;EACG,CAAA;EAER"}
1
+ {"version":3,"file":"context.js","names":[],"sources":["../../../src/player/context.tsx"],"sourcesContent":["'use client';\n\nimport type { Media } from '@videojs/core';\nimport type { MediaContainer } from '@videojs/core/dom';\nimport type { UnknownState, UnknownStore } from '@videojs/store';\nimport { useStore } from '@videojs/store/react';\nimport type { Dispatch, HTMLAttributes, ReactNode, PointerEvent as ReactPointerEvent, SetStateAction } from 'react';\nimport { createContext, forwardRef, useContext, useEffect, useRef } from 'react';\n\nimport { useComposedRefs } from '../utils/use-composed-refs';\n\nexport interface PlayerContextValue {\n store: UnknownStore;\n media: Media | null;\n setMedia: Dispatch<SetStateAction<Media | null>>;\n container: MediaContainer | null;\n setContainer: Dispatch<SetStateAction<HTMLElement | null>>;\n}\n\nconst PlayerContext = createContext<PlayerContextValue | null>(null);\nconst EMPTY_UNSUBSCRIBE = () => {};\nconst EMPTY_STORE = {\n state: {} as UnknownState,\n subscribe: () => EMPTY_UNSUBSCRIBE,\n} as Pick<UnknownStore, 'state' | 'subscribe'>;\n\nexport function PlayerContextProvider({\n value,\n children,\n}: {\n value: PlayerContextValue;\n children: ReactNode;\n}): ReactNode {\n return <PlayerContext.Provider value={value}>{children}</PlayerContext.Provider>;\n}\n\n/** Access the full player context value. Throws if used outside a Player Provider. */\nexport function usePlayerContext(): PlayerContextValue {\n const ctx = useContext(PlayerContext);\n if (!ctx) throw new Error('usePlayerContext must be used within a Player Provider');\n return ctx;\n}\n\n/**\n * Access the player store from within a Player Provider.\n *\n * @label Without Selector\n */\nexport function usePlayer(): UnknownStore;\n/**\n * Select a value from the player store. Re-renders when the selected value changes.\n *\n * @label With Selector\n * @param selector - Derives a value from the player store state.\n */\nexport function usePlayer<R>(selector: (state: UnknownState) => R): R;\nexport function usePlayer<R>(selector?: (state: UnknownState) => R) {\n const { store } = usePlayerContext();\n return useStore(store, selector as any);\n}\n\n/**\n * Access player state when available, but return `undefined` outside Provider.\n *\n * This is useful for components that can operate without player context\n * (e.g. they accept fully explicit props as a fallback).\n */\n/** @label Without Selector */\nexport function useOptionalPlayer(): UnknownStore | undefined;\n/** @label With Selector */\nexport function useOptionalPlayer<R>(selector: (state: UnknownState) => R): R | undefined;\nexport function useOptionalPlayer<R>(selector?: (state: UnknownState) => R) {\n const ctx = useContext(PlayerContext);\n const store = (ctx?.store ?? (EMPTY_STORE as unknown as UnknownStore)) as UnknownStore;\n const value = useStore(store, (ctx ? selector : undefined) as any);\n return ctx ? value : undefined;\n}\n\n/** Access the media element from within a Player Provider. */\nexport function useMedia(): Media | null {\n const { media } = usePlayerContext();\n return media;\n}\n\n/** Access the container element from within a Player Provider. */\nexport function useContainer(): MediaContainer | null {\n const { container } = usePlayerContext();\n return container;\n}\n\n/** Access the media attach setter for connecting a media element to the player. */\nexport function useMediaAttach(): Dispatch<SetStateAction<Media | null>> | undefined {\n const ctx = useContext(PlayerContext);\n return ctx?.setMedia;\n}\n\n/** Access the container attach setter for connecting a container element to the player. */\nexport function useContainerAttach(): Dispatch<SetStateAction<HTMLElement | null>> | undefined {\n const ctx = useContext(PlayerContext);\n return ctx?.setContainer;\n}\n\nexport interface ContainerProps extends HTMLAttributes<HTMLDivElement> {\n children?: ReactNode;\n}\n\nexport const Container = forwardRef<HTMLDivElement, ContainerProps>(function Container(\n { children, tabIndex = 0, ...props },\n ref\n) {\n const setContainer = useContainerAttach();\n const internalRef = useRef<HTMLDivElement>(null);\n const composedRef = useComposedRefs(ref, internalRef);\n\n useEffect(() => {\n setContainer?.(internalRef.current);\n return () => setContainer?.(null);\n }, [setContainer]);\n\n const handlePointerUp = (event: ReactPointerEvent<HTMLDivElement>) => {\n props.onPointerUp?.(event);\n const el = internalRef.current;\n if (!el) return;\n // If nothing inside has focus, grab it so keyboard events reach hotkey listeners.\n if (!el.contains(document.activeElement) || document.activeElement === document.body) {\n el.focus({ preventScroll: true });\n }\n };\n\n return (\n <div ref={composedRef} tabIndex={tabIndex} {...props} onPointerUp={handlePointerUp}>\n {children}\n </div>\n );\n});\n\nexport namespace Container {\n export type Props = ContainerProps;\n}\n"],"mappings":";;;;;;AAmBA,MAAM,gBAAgB,cAAyC,KAAK;AACpE,MAAM,0BAA0B;AAChC,MAAM,cAAc;CAClB,OAAO,EAAE;CACT,iBAAiB;CAClB;AAED,SAAgB,sBAAsB,EACpC,OACA,YAIY;AACZ,QAAO,oBAAC,cAAc,UAAf;EAA+B;EAAQ;EAAkC,CAAA;;;AAIlF,SAAgB,mBAAuC;CACrD,MAAM,MAAM,WAAW,cAAc;AACrC,KAAI,CAAC,IAAK,OAAM,IAAI,MAAM,yDAAyD;AACnF,QAAO;;AAgBT,SAAgB,UAAa,UAAuC;CAClE,MAAM,EAAE,UAAU,kBAAkB;AACpC,QAAO,SAAS,OAAO,SAAgB;;AAazC,SAAgB,kBAAqB,UAAuC;CAC1E,MAAM,MAAM,WAAW,cAAc;CAErC,MAAM,QAAQ,SADC,KAAK,SAAU,aACC,MAAM,WAAW,KAAA,EAAkB;AAClE,QAAO,MAAM,QAAQ,KAAA;;;AAIvB,SAAgB,WAAyB;CACvC,MAAM,EAAE,UAAU,kBAAkB;AACpC,QAAO;;;AAIT,SAAgB,eAAsC;CACpD,MAAM,EAAE,cAAc,kBAAkB;AACxC,QAAO;;;AAIT,SAAgB,iBAAqE;AAEnF,QADY,WAAW,cAAc,EACzB;;;AAId,SAAgB,qBAA+E;AAE7F,QADY,WAAW,cAAc,EACzB;;AAOd,MAAa,YAAY,WAA2C,SAAS,UAC3E,EAAE,UAAU,WAAW,GAAG,GAAG,SAC7B,KACA;CACA,MAAM,eAAe,oBAAoB;CACzC,MAAM,cAAc,OAAuB,KAAK;CAChD,MAAM,cAAc,gBAAgB,KAAK,YAAY;AAErD,iBAAgB;AACd,iBAAe,YAAY,QAAQ;AACnC,eAAa,eAAe,KAAK;IAChC,CAAC,aAAa,CAAC;CAElB,MAAM,mBAAmB,UAA6C;AACpE,QAAM,cAAc,MAAM;EAC1B,MAAM,KAAK,YAAY;AACvB,MAAI,CAAC,GAAI;AAET,MAAI,CAAC,GAAG,SAAS,SAAS,cAAc,IAAI,SAAS,kBAAkB,SAAS,KAC9E,IAAG,MAAM,EAAE,eAAe,MAAM,CAAC;;AAIrC,QACE,oBAAC,OAAD;EAAK,KAAK;EAAuB;EAAU,GAAI;EAAO,aAAa;EAChE;EACG,CAAA;EAER"}
@@ -3,11 +3,11 @@ import { useLatestRef } from "../../utils/use-latest-ref.js";
3
3
  import { useDestroy } from "../../utils/use-destroy.js";
4
4
  import { AlertDialogContextProvider } from "./context.js";
5
5
  import { useSafeId } from "../../utils/use-safe-id.js";
6
- import { AlertDialogCore, AlertDialogDataAttrs } from "@videojs/core";
7
6
  import { createAlertDialog, createTransition } from "@videojs/core/dom";
8
7
  import { useSnapshot } from "@videojs/store/react";
9
8
  import { useEffect, useState } from "react";
10
9
  import { jsx } from "react/jsx-runtime";
10
+ import { AlertDialogCore, AlertDialogDataAttrs } from "@videojs/core";
11
11
  //#region src/ui/alert-dialog/alert-dialog-root.tsx
12
12
  function AlertDialogRoot({ open: controlledOpen, defaultOpen = AlertDialogCore.defaultProps.defaultOpen, onOpenChange: onOpenChangeProp, onOpenChangeComplete: onOpenChangeCompleteProp, children }) {
13
13
  const [core] = useState(() => new AlertDialogCore());
@@ -2,9 +2,9 @@
2
2
  import { usePlayer } from "../../player/context.js";
3
3
  import { useDestroy } from "../../utils/use-destroy.js";
4
4
  import { renderElement } from "../../utils/use-render.js";
5
- import { BufferingIndicatorCore, BufferingIndicatorDataAttrs } from "@videojs/core";
6
5
  import { selectPlayback } from "@videojs/core/dom";
7
6
  import { forwardRef, useState, useSyncExternalStore } from "react";
7
+ import { BufferingIndicatorCore, BufferingIndicatorDataAttrs } from "@videojs/core";
8
8
  //#region src/ui/buffering-indicator/buffering-indicator.tsx
9
9
  /**
10
10
  * Displays a buffering indicator when media is waiting for data.
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { createMediaButton } from "../create-media-button.js";
3
- import { CaptionsButtonCore, CaptionsButtonDataAttrs } from "@videojs/core";
4
3
  import { selectTextTrack } from "@videojs/core/dom";
4
+ import { CaptionsButtonCore, CaptionsButtonDataAttrs } from "@videojs/core";
5
5
  //#region src/ui/captions-button/captions-button.tsx
6
6
  /** A button that toggles captions. */
7
7
  const CaptionsButton = createMediaButton({
@@ -2,10 +2,10 @@
2
2
  import { usePlayer } from "../../player/context.js";
3
3
  import { renderElement } from "../../utils/use-render.js";
4
4
  import { ControlsContextProvider } from "./context.js";
5
- import { ControlsCore, ControlsDataAttrs } from "@videojs/core";
6
5
  import { selectControls } from "@videojs/core/dom";
7
6
  import { forwardRef, useState } from "react";
8
7
  import { jsx } from "react/jsx-runtime";
8
+ import { ControlsCore, ControlsDataAttrs } from "@videojs/core";
9
9
  //#region src/ui/controls/controls-root.tsx
10
10
  /** Root container for player controls state and rendered control content. */
11
11
  const ControlsRoot = forwardRef(function ControlsRoot(componentProps, forwardedRef) {
@@ -5,11 +5,11 @@ import { useDestroy } from "../../utils/use-destroy.js";
5
5
  import { AlertDialogContextProvider } from "../alert-dialog/context.js";
6
6
  import { useSafeId } from "../../utils/use-safe-id.js";
7
7
  import { ErrorDialogContextProvider } from "./context.js";
8
- import { AlertDialogDataAttrs, ErrorDialogCore } from "@videojs/core";
9
8
  import { createAlertDialog, createTransition, selectError } from "@videojs/core/dom";
10
9
  import { useSnapshot } from "@videojs/store/react";
11
10
  import { useEffect, useRef, useState } from "react";
12
11
  import { jsx } from "react/jsx-runtime";
12
+ import { AlertDialogDataAttrs, ErrorDialogCore } from "@videojs/core";
13
13
  //#region src/ui/error-dialog/error-dialog-root.tsx
14
14
  function ErrorDialogRoot({ children }) {
15
15
  const [core] = useState(() => new ErrorDialogCore());
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { createMediaButton } from "../create-media-button.js";
3
- import { FullscreenButtonCore, FullscreenButtonDataAttrs } from "@videojs/core";
4
3
  import { selectFullscreen } from "@videojs/core/dom";
4
+ import { FullscreenButtonCore, FullscreenButtonDataAttrs } from "@videojs/core";
5
5
  //#region src/ui/fullscreen-button/fullscreen-button.tsx
6
6
  /** A button that toggles fullscreen. */
7
7
  const FullscreenButton = createMediaButton({
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { createMediaButton } from "../create-media-button.js";
3
- import { MuteButtonCore, MuteButtonDataAttrs } from "@videojs/core";
4
3
  import { selectVolume } from "@videojs/core/dom";
4
+ import { MuteButtonCore, MuteButtonDataAttrs } from "@videojs/core";
5
5
  //#region src/ui/mute-button/mute-button.tsx
6
6
  /** A button that toggles mute state. */
7
7
  const MuteButton = createMediaButton({
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { createMediaButton } from "../create-media-button.js";
3
- import { PiPButtonCore, PiPButtonDataAttrs } from "@videojs/core";
4
3
  import { selectPiP } from "@videojs/core/dom";
4
+ import { PiPButtonCore, PiPButtonDataAttrs } from "@videojs/core";
5
5
  //#region src/ui/pip-button/pip-button.tsx
6
6
  /** A button that toggles picture-in-picture. */
7
7
  const PiPButton = createMediaButton({
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { createMediaButton } from "../create-media-button.js";
3
- import { PlayButtonCore, PlayButtonDataAttrs } from "@videojs/core";
4
3
  import { selectPlayback } from "@videojs/core/dom";
4
+ import { PlayButtonCore, PlayButtonDataAttrs } from "@videojs/core";
5
5
  //#region src/ui/play-button/play-button.tsx
6
6
  /**
7
7
  * A button that toggles playback.
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { createMediaButton } from "../create-media-button.js";
3
- import { PlaybackRateButtonCore, PlaybackRateButtonDataAttrs } from "@videojs/core";
4
3
  import { selectPlaybackRate } from "@videojs/core/dom";
4
+ import { PlaybackRateButtonCore, PlaybackRateButtonDataAttrs } from "@videojs/core";
5
5
  //#region src/ui/playback-rate-button/playback-rate-button.tsx
6
6
  /**
7
7
  * A button that cycles through playback rates.
@@ -3,11 +3,11 @@ import { useLatestRef } from "../../utils/use-latest-ref.js";
3
3
  import { useDestroy } from "../../utils/use-destroy.js";
4
4
  import { useSafeId } from "../../utils/use-safe-id.js";
5
5
  import { PopoverContextProvider } from "./context.js";
6
- import { PopoverCore, PopoverDataAttrs } from "@videojs/core";
7
6
  import { createPopover, createTransition } from "@videojs/core/dom";
8
7
  import { useSnapshot } from "@videojs/store/react";
9
8
  import { useEffect, useState } from "react";
10
9
  import { jsx } from "react/jsx-runtime";
10
+ import { PopoverCore, PopoverDataAttrs } from "@videojs/core";
11
11
  //#region src/ui/popover/popover-root.tsx
12
12
  function PopoverRoot({ open: controlledOpen, defaultOpen = PopoverCore.defaultProps.defaultOpen, onOpenChange: onOpenChangeProp, onOpenChangeComplete: onOpenChangeCompleteProp, openOnHover = PopoverCore.defaultProps.openOnHover, delay = PopoverCore.defaultProps.delay, closeDelay = PopoverCore.defaultProps.closeDelay, children, ...coreProps }) {
13
13
  const [core] = useState(() => new PopoverCore(coreProps));
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import { usePlayer } from "../../player/context.js";
3
3
  import { renderElement } from "../../utils/use-render.js";
4
- import { PosterCore, PosterDataAttrs } from "@videojs/core";
5
4
  import { selectPlayback } from "@videojs/core/dom";
6
5
  import { forwardRef, useState } from "react";
6
+ import { PosterCore, PosterDataAttrs } from "@videojs/core";
7
7
  //#region src/ui/poster/poster.tsx
8
8
  /**
9
9
  * Displays the video poster image. Shows before playback starts, hides after.
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { createMediaButton } from "../create-media-button.js";
3
- import { SeekButtonCore, SeekButtonDataAttrs } from "@videojs/core";
4
3
  import { selectTime } from "@videojs/core/dom";
4
+ import { SeekButtonCore, SeekButtonDataAttrs } from "@videojs/core";
5
5
  //#region src/ui/seek-button/seek-button.tsx
6
6
  /**
7
7
  * A button that seeks forward or backward by a configurable number of seconds.
@@ -2,10 +2,10 @@
2
2
  import { renderElement } from "../../utils/use-render.js";
3
3
  import { useSlider } from "../hooks/use-slider.js";
4
4
  import { SliderProvider } from "./context.js";
5
- import { SliderCore, SliderDataAttrs } from "@videojs/core";
6
5
  import { getSliderCSSVars } from "@videojs/core/dom";
7
6
  import { forwardRef, useState } from "react";
8
7
  import { jsx } from "react/jsx-runtime";
8
+ import { SliderCore, SliderDataAttrs } from "@videojs/core";
9
9
  //#region src/ui/slider/slider-root.tsx
10
10
  const SliderRoot = forwardRef(function SliderRoot(componentProps, forwardedRef) {
11
11
  const { render, className, style, label, min, max, step, largeStep, orientation, disabled, thumbAlignment, value = 0, onValueChange, onValueCommit, onDragStart, onDragEnd, ...elementProps } = componentProps;
@@ -2,10 +2,10 @@
2
2
  import { useOptionalPlayer } from "../../player/context.js";
3
3
  import { useDestroy } from "../../utils/use-destroy.js";
4
4
  import { renderElement } from "../../utils/use-render.js";
5
- import { ThumbnailCore, ThumbnailDataAttrs, mapCuesToThumbnails } from "@videojs/core";
6
5
  import { createThumbnail, selectTextTrack } from "@videojs/core/dom";
7
6
  import { forwardRef, useMemo, useRef, useState } from "react";
8
7
  import { jsx } from "react/jsx-runtime";
8
+ import { ThumbnailCore, ThumbnailDataAttrs, mapCuesToThumbnails } from "@videojs/core";
9
9
  //#region src/ui/thumbnail/thumbnail.tsx
10
10
  const Thumbnail = forwardRef(function Thumbnail(componentProps, forwardedRef) {
11
11
  const { render, className, style, time = 0, thumbnails: externalThumbnails, crossOrigin, loading, fetchPriority, ...elementProps } = componentProps;
@@ -1,10 +1,10 @@
1
1
  "use client";
2
2
  import { usePlayer } from "../../player/context.js";
3
3
  import { renderElement } from "../../utils/use-render.js";
4
- import { TimeCore, TimeDataAttrs } from "@videojs/core";
5
4
  import { selectTime } from "@videojs/core/dom";
6
5
  import { forwardRef, useState } from "react";
7
6
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
7
+ import { TimeCore, TimeDataAttrs } from "@videojs/core";
8
8
  //#region src/ui/time/time-value.tsx
9
9
  /**
10
10
  * Displays a formatted time value (current, duration, or remaining).
@@ -4,10 +4,10 @@ import { useLatestRef } from "../../utils/use-latest-ref.js";
4
4
  import { renderElement } from "../../utils/use-render.js";
5
5
  import { useSlider } from "../hooks/use-slider.js";
6
6
  import { SliderProvider } from "../slider/context.js";
7
- import { TimeSliderCore, TimeSliderDataAttrs } from "@videojs/core";
8
7
  import { getTimeSliderCSSVars, selectBuffer, selectTime } from "@videojs/core/dom";
9
8
  import { forwardRef, useState } from "react";
10
9
  import { jsx } from "react/jsx-runtime";
10
+ import { TimeSliderCore, TimeSliderDataAttrs } from "@videojs/core";
11
11
  import { formatTime } from "@videojs/utils/time";
12
12
  //#region src/ui/time-slider/time-slider-root.tsx
13
13
  const noopSeek = () => Promise.resolve(0);
@@ -2,9 +2,9 @@
2
2
  import { useComposedRefs } from "../../utils/use-composed-refs.js";
3
3
  import { renderElement } from "../../utils/use-render.js";
4
4
  import { useTooltipContext } from "./context.js";
5
- import { TooltipCSSVars } from "@videojs/core";
6
5
  import { getAnchorPositionStyle, getPopupPositionRect, resolveOffsets } from "@videojs/core/dom";
7
6
  import { forwardRef, useCallback, useLayoutEffect, useMemo, useRef, useState } from "react";
7
+ import { TooltipCSSVars } from "@videojs/core";
8
8
  import { supportsAnchorPositioning } from "@videojs/utils/dom";
9
9
  //#region src/ui/tooltip/tooltip-popup.tsx
10
10
  const POPUP_RESET = {
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import { TooltipGroupContextProvider } from "./group-context.js";
3
- import { TooltipGroupCore } from "@videojs/core";
4
3
  import { useState } from "react";
5
4
  import { jsx } from "react/jsx-runtime";
5
+ import { TooltipGroupCore } from "@videojs/core";
6
6
  //#region src/ui/tooltip/tooltip-provider.tsx
7
7
  function TooltipProvider({ delay, closeDelay, timeout, children }) {
8
8
  const [group] = useState(() => new TooltipGroupCore({
@@ -4,11 +4,11 @@ import { useDestroy } from "../../utils/use-destroy.js";
4
4
  import { useSafeId } from "../../utils/use-safe-id.js";
5
5
  import { TooltipContextProvider } from "./context.js";
6
6
  import { useTooltipGroup } from "./group-context.js";
7
- import { TooltipCore, TooltipDataAttrs } from "@videojs/core";
8
7
  import { createTooltip, createTransition } from "@videojs/core/dom";
9
8
  import { useSnapshot } from "@videojs/store/react";
10
9
  import { useEffect, useState } from "react";
11
10
  import { jsx } from "react/jsx-runtime";
11
+ import { TooltipCore, TooltipDataAttrs } from "@videojs/core";
12
12
  //#region src/ui/tooltip/tooltip-root.tsx
13
13
  function TooltipRoot({ open: controlledOpen, defaultOpen = TooltipCore.defaultProps.defaultOpen, onOpenChange: onOpenChangeProp, onOpenChangeComplete: onOpenChangeCompleteProp, delay = TooltipCore.defaultProps.delay, closeDelay = TooltipCore.defaultProps.closeDelay, disableHoverablePopup = TooltipCore.defaultProps.disableHoverablePopup, disabled = TooltipCore.defaultProps.disabled, children, ...coreProps }) {
14
14
  const [core] = useState(() => new TooltipCore(coreProps));
@@ -4,10 +4,10 @@ import { useLatestRef } from "../../utils/use-latest-ref.js";
4
4
  import { renderElement } from "../../utils/use-render.js";
5
5
  import { useSlider } from "../hooks/use-slider.js";
6
6
  import { SliderProvider } from "../slider/context.js";
7
- import { VolumeSliderCore, VolumeSliderDataAttrs } from "@videojs/core";
8
7
  import { createWheelStep, getSliderCSSVars, selectVolume } from "@videojs/core/dom";
9
8
  import { forwardRef, useCallback, useRef, useState } from "react";
10
9
  import { jsx } from "react/jsx-runtime";
10
+ import { VolumeSliderCore, VolumeSliderDataAttrs } from "@videojs/core";
11
11
  import { listen } from "@videojs/utils/dom";
12
12
  //#region src/ui/volume-slider/volume-slider-root.tsx
13
13
  const noopVolume = {
@@ -1 +1 @@
1
- {"version":3,"file":"media-props.js","names":[],"sources":["../../../src/utils/media-props.ts"],"sourcesContent":["import type { MediaApi } from '@videojs/core/dom';\n\ntype AnyClass = abstract new (...args: any[]) => any;\n\nfunction getSettableProps(DelegateClass: AnyClass): Set<string> {\n const props = new Set<string>();\n for (let proto = DelegateClass.prototype; proto && proto !== Object.prototype; proto = Object.getPrototypeOf(proto)) {\n for (const key of Object.getOwnPropertyNames(proto)) {\n const desc = Object.getOwnPropertyDescriptor(proto, key);\n if (desc?.set) props.add(key);\n }\n }\n return props;\n}\n\nexport function mediaProps(media: MediaApi, DelegateClass: AnyClass, props: Record<string, any>) {\n const delegateKeys = getSettableProps(DelegateClass);\n const rest: Record<string, any> = {};\n\n for (const key of Object.keys(props)) {\n if (delegateKeys.has(key)) {\n const value = props[key];\n if ((media as any)[key] !== value) {\n (media as any)[key] = value;\n }\n } else {\n rest[key] = props[key];\n }\n }\n\n return rest;\n}\n"],"mappings":";AAIA,SAAS,iBAAiB,eAAsC;CAC9D,MAAM,wBAAQ,IAAI,KAAa;AAC/B,MAAK,IAAI,QAAQ,cAAc,WAAW,SAAS,UAAU,OAAO,WAAW,QAAQ,OAAO,eAAe,MAAM,CACjH,MAAK,MAAM,OAAO,OAAO,oBAAoB,MAAM,CAEjD,KADa,OAAO,yBAAyB,OAAO,IAAI,EAC9C,IAAK,OAAM,IAAI,IAAI;AAGjC,QAAO;;AAGT,SAAgB,WAAW,OAAiB,eAAyB,OAA4B;CAC/F,MAAM,eAAe,iBAAiB,cAAc;CACpD,MAAM,OAA4B,EAAE;AAEpC,MAAK,MAAM,OAAO,OAAO,KAAK,MAAM,CAClC,KAAI,aAAa,IAAI,IAAI,EAAE;EACzB,MAAM,QAAQ,MAAM;AACpB,MAAK,MAAc,SAAS,MACzB,OAAc,OAAO;OAGxB,MAAK,OAAO,MAAM;AAItB,QAAO"}
1
+ {"version":3,"file":"media-props.js","names":[],"sources":["../../../src/utils/media-props.ts"],"sourcesContent":["import type { Media } from '@videojs/core';\n\ntype AnyClass = abstract new (...args: any[]) => any;\n\nfunction getSettableProps(DelegateClass: AnyClass): Set<string> {\n const props = new Set<string>();\n for (let proto = DelegateClass.prototype; proto && proto !== Object.prototype; proto = Object.getPrototypeOf(proto)) {\n for (const key of Object.getOwnPropertyNames(proto)) {\n const desc = Object.getOwnPropertyDescriptor(proto, key);\n if (desc?.set) props.add(key);\n }\n }\n return props;\n}\n\nexport function mediaProps(media: Media, DelegateClass: AnyClass, props: Record<string, any>) {\n const delegateKeys = getSettableProps(DelegateClass);\n const rest: Record<string, any> = {};\n\n for (const key of Object.keys(props)) {\n if (delegateKeys.has(key)) {\n const value = props[key];\n if ((media as any)[key] !== value) {\n (media as any)[key] = value;\n }\n } else {\n rest[key] = props[key];\n }\n }\n\n return rest;\n}\n"],"mappings":";AAIA,SAAS,iBAAiB,eAAsC;CAC9D,MAAM,wBAAQ,IAAI,KAAa;AAC/B,MAAK,IAAI,QAAQ,cAAc,WAAW,SAAS,UAAU,OAAO,WAAW,QAAQ,OAAO,eAAe,MAAM,CACjH,MAAK,MAAM,OAAO,OAAO,oBAAoB,MAAM,CAEjD,KADa,OAAO,yBAAyB,OAAO,IAAI,EAC9C,IAAK,OAAM,IAAI,IAAI;AAGjC,QAAO;;AAGT,SAAgB,WAAW,OAAc,eAAyB,OAA4B;CAC5F,MAAM,eAAe,iBAAiB,cAAc;CACpD,MAAM,OAA4B,EAAE;AAEpC,MAAK,MAAM,OAAO,OAAO,KAAK,MAAM,CAClC,KAAI,aAAa,IAAI,IAAI,EAAE;EACzB,MAAM,QAAQ,MAAM;AACpB,MAAK,MAAc,SAAS,MACzB,OAAc,OAAO;OAGxB,MAAK,OAAO,MAAM;AAItB,QAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"use-media-instance.js","names":[],"sources":["../../../src/utils/use-media-instance.ts"],"sourcesContent":["'use client';\n\nimport type { Media } from '@videojs/core/dom';\nimport { useState } from 'react';\n\nimport { useMediaAttach } from '../player/context';\nimport { useDestroy } from './use-destroy';\n\n/**\n * Create and manage a media instance lifecycle within a player context.\n *\n * Instantiates the media class once, attaches it to the player on mount,\n * and safely detaches on unmount using a functional updater to avoid race\n * conditions when swapping media components (e.g. DashVideo → HlsVideo).\n */\nexport function useMediaInstance<Instance extends Media & { destroy(): void }>(\n MediaClass: new () => Instance\n): Instance {\n const [instance] = useState(() => new MediaClass());\n const setMedia = useMediaAttach();\n\n useDestroy(\n instance,\n () => setMedia?.(instance),\n () => setMedia?.((prev) => (prev === instance ? null : prev))\n );\n\n return instance;\n}\n"],"mappings":";;;;;;;;;;;;AAeA,SAAgB,iBACd,YACU;CACV,MAAM,CAAC,YAAY,eAAe,IAAI,YAAY,CAAC;CACnD,MAAM,WAAW,gBAAgB;AAEjC,YACE,gBACM,WAAW,SAAS,QACpB,YAAY,SAAU,SAAS,WAAW,OAAO,KAAM,CAC9D;AAED,QAAO"}
1
+ {"version":3,"file":"use-media-instance.js","names":[],"sources":["../../../src/utils/use-media-instance.ts"],"sourcesContent":["'use client';\n\nimport type { Media } from '@videojs/core';\nimport { useState } from 'react';\n\nimport { useMediaAttach } from '../player/context';\nimport { useDestroy } from './use-destroy';\n\n/**\n * Create and manage a media instance lifecycle within a player context.\n *\n * Instantiates the media class once, attaches it to the player on mount,\n * and safely detaches on unmount using a functional updater to avoid race\n * conditions when swapping media components (e.g. DashVideo → HlsVideo).\n */\nexport function useMediaInstance<Instance extends Media & { destroy(): void }>(\n MediaClass: new () => Instance\n): Instance {\n const [instance] = useState(() => new MediaClass());\n const setMedia = useMediaAttach();\n\n useDestroy(\n instance,\n () => setMedia?.(instance),\n () => setMedia?.((prev) => (prev === instance ? null : prev))\n );\n\n return instance;\n}\n"],"mappings":";;;;;;;;;;;;AAeA,SAAgB,iBACd,YACU;CACV,MAAM,CAAC,YAAY,eAAe,IAAI,YAAY,CAAC;CACnD,MAAM,WAAW,gBAAgB;AAEjC,YACE,gBACM,WAAW,SAAS,QACpB,YAAY,SAAU,SAAS,WAAW,OAAO,KAAM,CAC9D;AAED,QAAO"}
@@ -49,8 +49,7 @@ import { useDestroy } from "./utils/use-destroy.js";
49
49
  import { useLatestRef } from "./utils/use-latest-ref.js";
50
50
  import { useMediaInstance } from "./utils/use-media-instance.js";
51
51
  import { renderElement } from "./utils/use-render.js";
52
- import { DelegateMixin } from "@videojs/core";
53
52
  import { Comparator, Selector, createSelector, shallowEqual } from "@videojs/store";
54
53
  import { useSelector, useStore } from "@videojs/store/react";
55
54
  export * from "@videojs/core/dom";
56
- export { index_parts_d_exports as AlertDialog, type AlertDialogContextValue, BufferingIndicator, type BufferingIndicatorProps, CaptionsButton, type CaptionsButtonProps, type Comparator, Container, type ContainerProps, index_parts_d_exports$1 as Controls, type ControlsGroupProps, type ControlsRootProps, type CreatePlayerConfig, type CreatePlayerResult, DelegateMixin, index_parts_d_exports$2 as ErrorDialog, type ErrorDialogContextValue, FullscreenButton, type FullscreenButtonProps, type HTMLProps, MediaGesture, type MediaGestureProps, MediaHotkey, type MediaHotkeyProps, MuteButton, type MuteButtonProps, PiPButton, type PiPButtonProps, PlayButton, type PlayButtonProps, PlaybackRateButton, type PlaybackRateButtonProps, type PlayerContextValue, index_parts_d_exports$3 as Popover, type PopoverContextValue, Poster, type PosterProps, type ProviderProps, type RenderFunction, type RenderProp, SeekButton, type SeekButtonProps, type Selector, index_parts_d_exports$4 as Slider, type SliderBufferProps, type SliderFillProps, type SliderRootProps, type SliderThumbProps, type SliderThumbnailProps, type SliderTrackProps, type SliderValueProps, Thumbnail, type ThumbnailProps, index_parts_d_exports$5 as Time, index_parts_d_exports$6 as TimeSlider, index_parts_d_exports$7 as Tooltip, type TooltipContextValue, type UIComponentProps, type UseDoubleTapGestureOptions, type UseHotkeyOptions, type UseTapGestureOptions, index_parts_d_exports$8 as VolumeSlider, attachMediaElement, composeRefs, createPlayer, createSelector, mediaProps, mergeProps, renderElement, shallowEqual, useAlertDialogContext, useAriaKeyShortcuts, useButton, useComposedRefs, useContainer, useContainerAttach, useDestroy, useDoubleTapGesture, useErrorDialogContext, useHotkey, useLatestRef, useMedia, useMediaAttach, useMediaInstance, useOptionalPlayer, usePlayer, usePlayerContext, usePopoverContext, useSelector, useSlider, useStore, useTapGesture, useTooltipContext };
55
+ export { index_parts_d_exports as AlertDialog, type AlertDialogContextValue, BufferingIndicator, type BufferingIndicatorProps, CaptionsButton, type CaptionsButtonProps, type Comparator, Container, type ContainerProps, index_parts_d_exports$1 as Controls, type ControlsGroupProps, type ControlsRootProps, type CreatePlayerConfig, type CreatePlayerResult, index_parts_d_exports$2 as ErrorDialog, type ErrorDialogContextValue, FullscreenButton, type FullscreenButtonProps, type HTMLProps, MediaGesture, type MediaGestureProps, MediaHotkey, type MediaHotkeyProps, MuteButton, type MuteButtonProps, PiPButton, type PiPButtonProps, PlayButton, type PlayButtonProps, PlaybackRateButton, type PlaybackRateButtonProps, type PlayerContextValue, index_parts_d_exports$3 as Popover, type PopoverContextValue, Poster, type PosterProps, type ProviderProps, type RenderFunction, type RenderProp, SeekButton, type SeekButtonProps, type Selector, index_parts_d_exports$4 as Slider, type SliderBufferProps, type SliderFillProps, type SliderRootProps, type SliderThumbProps, type SliderThumbnailProps, type SliderTrackProps, type SliderValueProps, Thumbnail, type ThumbnailProps, index_parts_d_exports$5 as Time, index_parts_d_exports$6 as TimeSlider, index_parts_d_exports$7 as Tooltip, type TooltipContextValue, type UIComponentProps, type UseDoubleTapGestureOptions, type UseHotkeyOptions, type UseTapGestureOptions, index_parts_d_exports$8 as VolumeSlider, attachMediaElement, composeRefs, createPlayer, createSelector, mediaProps, mergeProps, renderElement, shallowEqual, useAlertDialogContext, useAriaKeyShortcuts, useButton, useComposedRefs, useContainer, useContainerAttach, useDestroy, useDoubleTapGesture, useErrorDialogContext, useHotkey, useLatestRef, useMedia, useMediaAttach, useMediaInstance, useOptionalPlayer, usePlayer, usePlayerContext, usePopoverContext, useSelector, useSlider, useStore, useTapGesture, useTooltipContext };
package/dist/dev/index.js CHANGED
@@ -40,8 +40,7 @@ import { index_parts_exports as index_parts_exports$8 } from "./ui/volume-slider
40
40
  import { attachMediaElement } from "./utils/attach-media-element.js";
41
41
  import { mediaProps } from "./utils/media-props.js";
42
42
  import { useMediaInstance } from "./utils/use-media-instance.js";
43
- import { DelegateMixin } from "@videojs/core";
44
43
  import { createSelector, shallowEqual } from "@videojs/store";
45
44
  import { useSelector, useStore } from "@videojs/store/react";
46
45
  export * from "@videojs/core/dom";
47
- export { index_parts_exports as AlertDialog, BufferingIndicator, CaptionsButton, Container, index_parts_exports$1 as Controls, DelegateMixin, index_parts_exports$2 as ErrorDialog, FullscreenButton, MediaGesture, MediaHotkey, MuteButton, PiPButton, PlayButton, PlaybackRateButton, index_parts_exports$3 as Popover, Poster, SeekButton, index_parts_exports$4 as Slider, Thumbnail, index_parts_exports$5 as Time, index_parts_exports$6 as TimeSlider, index_parts_exports$7 as Tooltip, index_parts_exports$8 as VolumeSlider, attachMediaElement, composeRefs, createPlayer, createSelector, mediaProps, mergeProps, renderElement, shallowEqual, useAlertDialogContext, useAriaKeyShortcuts, useButton, useComposedRefs, useContainer, useContainerAttach, useDestroy, useDoubleTapGesture, useErrorDialogContext, useHotkey, useLatestRef, useMedia, useMediaAttach, useMediaInstance, useOptionalPlayer, usePlayer, usePlayerContext, usePopoverContext, useSelector, useSlider, useStore, useTapGesture, useTooltipContext };
46
+ export { index_parts_exports as AlertDialog, BufferingIndicator, CaptionsButton, Container, index_parts_exports$1 as Controls, index_parts_exports$2 as ErrorDialog, FullscreenButton, MediaGesture, MediaHotkey, MuteButton, PiPButton, PlayButton, PlaybackRateButton, index_parts_exports$3 as Popover, Poster, SeekButton, index_parts_exports$4 as Slider, Thumbnail, index_parts_exports$5 as Time, index_parts_exports$6 as TimeSlider, index_parts_exports$7 as Tooltip, index_parts_exports$8 as VolumeSlider, attachMediaElement, composeRefs, createPlayer, createSelector, mediaProps, mergeProps, renderElement, shallowEqual, useAlertDialogContext, useAriaKeyShortcuts, useButton, useComposedRefs, useContainer, useContainerAttach, useDestroy, useDoubleTapGesture, useErrorDialogContext, useHotkey, useLatestRef, useMedia, useMediaAttach, useMediaInstance, useOptionalPlayer, usePlayer, usePlayerContext, usePopoverContext, useSelector, useSlider, useStore, useTapGesture, useTooltipContext };
@@ -1,13 +1,13 @@
1
- import { InferDelegateProps } from "@videojs/core";
2
1
  import * as react from "react";
3
2
  import { PropsWithChildren, VideoHTMLAttributes } from "react";
4
- import { DashMediaDelegate } from "@videojs/core/dom/media/dash";
3
+ import { DashMedia } from "@videojs/core/dom/media/dash";
4
+ import { InferClassProps } from "@videojs/utils/types";
5
5
 
6
6
  //#region src/media/dash-video/index.d.ts
7
- type DashVideoProps = PropsWithChildren<VideoHTMLAttributes<HTMLVideoElement>> & InferDelegateProps<typeof DashMediaDelegate>;
7
+ type DashVideoProps = PropsWithChildren<VideoHTMLAttributes<HTMLVideoElement>> & InferClassProps<typeof DashMedia>;
8
8
  declare const DashVideo: react.ForwardRefExoticComponent<VideoHTMLAttributes<HTMLVideoElement> & {
9
9
  children?: react.ReactNode | undefined;
10
- } & Partial<Pick<DashMediaDelegate, "src">> & react.RefAttributes<HTMLVideoElement>>;
10
+ } & Partial<Pick<DashMedia, "src" | "currentTime" | "volume" | "muted" | "playbackRate">> & react.RefAttributes<HTMLVideoElement>>;
11
11
  declare namespace DashVideo {
12
12
  type Props = DashVideoProps;
13
13
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../../../src/media/dash-video/index.tsx"],"mappings":";;;;;;KAWY,cAAA,GAAiB,iBAAA,CAAkB,mBAAA,CAAoB,gBAAA,KACjE,kBAAA,QAA0B,iBAAA;AAAA,cAEf,SAAA,QAAS,yBAAA,CAAA,mBAAA,CAAA,gBAAA;aAAA,KAAA,CAAA,SAAA;AAAA;kBAYL,SAAA;EAAA,KACH,KAAA,GAAQ,cAAA;AAAA"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../../../src/media/dash-video/index.tsx"],"mappings":";;;;;;KAWY,cAAA,GAAiB,iBAAA,CAAkB,mBAAA,CAAoB,gBAAA,KACjE,eAAA,QAAuB,SAAA;AAAA,cAEZ,SAAA,QAAS,yBAAA,CAAA,mBAAA,CAAA,gBAAA;aAAA,KAAA,CAAA,SAAA;AAAA;kBAYL,SAAA;EAAA,KACH,KAAA,GAAQ,cAAA;AAAA"}
@@ -5,13 +5,13 @@ import { mediaProps } from "../../utils/media-props.js";
5
5
  import { useMediaInstance } from "../../utils/use-media-instance.js";
6
6
  import { forwardRef } from "react";
7
7
  import { jsx } from "react/jsx-runtime";
8
- import { DashMedia, DashMediaDelegate } from "@videojs/core/dom/media/dash";
8
+ import { DashMedia } from "@videojs/core/dom/media/dash";
9
9
  //#region src/media/dash-video/index.tsx
10
10
  const DashVideo = forwardRef(function DashVideo({ children, ...props }, ref) {
11
11
  const mediaApi = useMediaInstance(DashMedia);
12
12
  return /* @__PURE__ */ jsx("video", {
13
13
  ref: useComposedRefs(attachMediaElement(mediaApi), ref),
14
- ...mediaProps(mediaApi, DashMediaDelegate, props),
14
+ ...mediaProps(mediaApi, DashMedia, props),
15
15
  children
16
16
  });
17
17
  });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../src/media/dash-video/index.tsx"],"sourcesContent":["'use client';\n\nimport type { InferDelegateProps } from '@videojs/core';\nimport { DashMedia, DashMediaDelegate } from '@videojs/core/dom/media/dash';\nimport type { PropsWithChildren, VideoHTMLAttributes } from 'react';\nimport { forwardRef } from 'react';\nimport { attachMediaElement } from '../../utils/attach-media-element';\nimport { mediaProps } from '../../utils/media-props';\nimport { useComposedRefs } from '../../utils/use-composed-refs';\nimport { useMediaInstance } from '../../utils/use-media-instance';\n\nexport type DashVideoProps = PropsWithChildren<VideoHTMLAttributes<HTMLVideoElement>> &\n InferDelegateProps<typeof DashMediaDelegate>;\n\nexport const DashVideo = forwardRef<HTMLVideoElement, DashVideoProps>(function DashVideo({ children, ...props }, ref) {\n const mediaApi = useMediaInstance(DashMedia);\n\n const composedRef = useComposedRefs(attachMediaElement(mediaApi), ref);\n\n return (\n <video ref={composedRef} {...mediaProps(mediaApi, DashMediaDelegate, props)}>\n {children}\n </video>\n );\n});\n\nexport namespace DashVideo {\n export type Props = DashVideoProps;\n}\n"],"mappings":";;;;;;;;;AAcA,MAAa,YAAY,WAA6C,SAAS,UAAU,EAAE,UAAU,GAAG,SAAS,KAAK;CACpH,MAAM,WAAW,iBAAiB,UAAU;AAI5C,QACE,oBAAC,SAAD;EAAO,KAHW,gBAAgB,mBAAmB,SAAS,EAAE,IAAI;EAG3C,GAAI,WAAW,UAAU,mBAAmB,MAAM;EACxE;EACK,CAAA;EAEV"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../src/media/dash-video/index.tsx"],"sourcesContent":["'use client';\n\nimport { DashMedia } from '@videojs/core/dom/media/dash';\nimport type { InferClassProps } from '@videojs/utils/types';\nimport type { PropsWithChildren, VideoHTMLAttributes } from 'react';\nimport { forwardRef } from 'react';\nimport { attachMediaElement } from '../../utils/attach-media-element';\nimport { mediaProps } from '../../utils/media-props';\nimport { useComposedRefs } from '../../utils/use-composed-refs';\nimport { useMediaInstance } from '../../utils/use-media-instance';\n\nexport type DashVideoProps = PropsWithChildren<VideoHTMLAttributes<HTMLVideoElement>> &\n InferClassProps<typeof DashMedia>;\n\nexport const DashVideo = forwardRef<HTMLVideoElement, DashVideoProps>(function DashVideo({ children, ...props }, ref) {\n const mediaApi = useMediaInstance(DashMedia);\n\n const composedRef = useComposedRefs(attachMediaElement(mediaApi), ref);\n\n return (\n <video ref={composedRef} {...mediaProps(mediaApi, DashMedia, props)}>\n {children}\n </video>\n );\n});\n\nexport namespace DashVideo {\n export type Props = DashVideoProps;\n}\n"],"mappings":";;;;;;;;;AAcA,MAAa,YAAY,WAA6C,SAAS,UAAU,EAAE,UAAU,GAAG,SAAS,KAAK;CACpH,MAAM,WAAW,iBAAiB,UAAU;AAI5C,QACE,oBAAC,SAAD;EAAO,KAHW,gBAAgB,mBAAmB,SAAS,EAAE,IAAI;EAG3C,GAAI,WAAW,UAAU,WAAW,MAAM;EAChE;EACK,CAAA;EAEV"}