@hanifhan1f/vidstack-react 1.12.33 → 1.12.35

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 (188) hide show
  1. package/dev/chunks/{vidstack-3rdEWplD.js → vidstack-B-DU-_xu.js} +55 -3
  2. package/dev/chunks/{vidstack-CniPzPQc.js → vidstack-C3VHrHPf.js} +155 -15
  3. package/dev/chunks/{vidstack-BOPSNTgH.js → vidstack-CjLj3q5w.js} +5 -57
  4. package/dev/chunks/{vidstack-BNwnoM-l.js → vidstack-DpWioszb.js} +1 -1
  5. package/dev/chunks/{vidstack-S_S6XDnL.js → vidstack-t48GJbb5.js} +1 -1
  6. package/dev/player/vidstack-default-components.js +4 -4
  7. package/dev/player/vidstack-default-layout.js +4 -4
  8. package/dev/player/vidstack-plyr-layout.js +3 -3
  9. package/dev/vidstack.js +5 -5
  10. package/package.json +1 -1
  11. package/player/layouts/default.d.ts +9 -1
  12. package/prod/chunks/{vidstack-BlPINAXN.js → vidstack-BI5-IK9v.js} +55 -3
  13. package/prod/chunks/{vidstack-CbejzCJs.js → vidstack-BgAMJr1Y.js} +155 -15
  14. package/prod/chunks/{vidstack-Bh7M8kL6.js → vidstack-DKWmxvB4.js} +5 -57
  15. package/prod/chunks/{vidstack-DhSvljmQ.js → vidstack-NR84X5HE.js} +1 -1
  16. package/prod/chunks/{vidstack-BS445j5D.js → vidstack-jSJ0Meez.js} +1 -1
  17. package/prod/player/vidstack-default-components.js +4 -4
  18. package/prod/player/vidstack-default-layout.js +4 -4
  19. package/prod/player/vidstack-plyr-layout.js +3 -3
  20. package/prod/vidstack.js +5 -5
  21. package/{dev/chunks/vidstack-DTow20pt.js → server/chunks/vidstack-CSX6ausI.js} +55 -3
  22. package/server/chunks/{vidstack-CoGzBr_V.js → vidstack-CePUWLrW.js} +5 -57
  23. package/{dev/chunks/vidstack-CvWDiSTs.js → server/chunks/vidstack-D7sOBYbw.js} +1 -1
  24. package/server/chunks/{vidstack-VGPw_CQP.js → vidstack-DqUb8JgU.js} +1 -1
  25. package/server/chunks/{vidstack-i9a2TQLO.js → vidstack-Dvh6BtYs.js} +155 -15
  26. package/server/player/vidstack-default-components.js +4 -4
  27. package/server/player/vidstack-default-layout.js +4 -4
  28. package/server/player/vidstack-plyr-layout.js +3 -3
  29. package/server/vidstack.js +5 -5
  30. package/dev/chunks/vidstack-B-FM4-oZ.js +0 -668
  31. package/dev/chunks/vidstack-B92UncBI.js +0 -61
  32. package/dev/chunks/vidstack-BDiAEW1N.js +0 -11691
  33. package/dev/chunks/vidstack-BPymmnxm.js +0 -551
  34. package/dev/chunks/vidstack-BSZY6sbC.js +0 -180
  35. package/dev/chunks/vidstack-BSpAxhO6.js +0 -643
  36. package/dev/chunks/vidstack-BVVxkUlq.js +0 -288
  37. package/dev/chunks/vidstack-BXgKy_7V.js +0 -11693
  38. package/dev/chunks/vidstack-BalWqr4j.js +0 -1422
  39. package/dev/chunks/vidstack-Bfi_jCvb.js +0 -476
  40. package/dev/chunks/vidstack-BoLZuw80.js +0 -34
  41. package/dev/chunks/vidstack-BrqDQG-r.js +0 -643
  42. package/dev/chunks/vidstack-C3QPOZNd.js +0 -476
  43. package/dev/chunks/vidstack-C7BwfK5c.js +0 -1537
  44. package/dev/chunks/vidstack-CEUjDh4x.js +0 -34
  45. package/dev/chunks/vidstack-CFOPpDTy.js +0 -476
  46. package/dev/chunks/vidstack-CFZ0rYJz.js +0 -34
  47. package/dev/chunks/vidstack-CKsUl4ll.js +0 -1384
  48. package/dev/chunks/vidstack-CM82l-7o.js +0 -551
  49. package/dev/chunks/vidstack-CQSHFVu7.js +0 -401
  50. package/dev/chunks/vidstack-CXrXBlpD.js +0 -11692
  51. package/dev/chunks/vidstack-CevuS08D.js +0 -1504
  52. package/dev/chunks/vidstack-CkRXb9Ia.js +0 -1537
  53. package/dev/chunks/vidstack-CqNX679o.js +0 -669
  54. package/dev/chunks/vidstack-Csfg08VS.js +0 -551
  55. package/dev/chunks/vidstack-CzU-uC5f.js +0 -189
  56. package/dev/chunks/vidstack-D2Bi2Td9.js +0 -1537
  57. package/dev/chunks/vidstack-D3ZXOE4d.js +0 -643
  58. package/dev/chunks/vidstack-D6_9yy0x.js +0 -643
  59. package/dev/chunks/vidstack-DJQOTrl6.js +0 -180
  60. package/dev/chunks/vidstack-DNbKNc4R.js +0 -288
  61. package/dev/chunks/vidstack-DOtIyh4c.js +0 -288
  62. package/dev/chunks/vidstack-DY2iivhG.js +0 -84
  63. package/dev/chunks/vidstack-DjqYvkVp.js +0 -84
  64. package/dev/chunks/vidstack-Dov8gjdq.js +0 -401
  65. package/dev/chunks/vidstack-DqaqkU4T.js +0 -9
  66. package/dev/chunks/vidstack-DwdhbP5c.js +0 -189
  67. package/dev/chunks/vidstack-DweQYzVw.js +0 -180
  68. package/dev/chunks/vidstack-FuCbl228.js +0 -226
  69. package/dev/chunks/vidstack-H9OdEKUQ.js +0 -375
  70. package/dev/chunks/vidstack-KntYDWMe.js +0 -668
  71. package/dev/chunks/vidstack-L5mw2iPb.js +0 -375
  72. package/dev/chunks/vidstack-NCBSBZE-.js +0 -61
  73. package/dev/chunks/vidstack-PREbBNMG.js +0 -125
  74. package/dev/chunks/vidstack-UWMPvwsa.js +0 -1537
  75. package/dev/chunks/vidstack-f6WXkmfP.js +0 -375
  76. package/dev/chunks/vidstack-gqKBE4xH.js +0 -376
  77. package/dev/chunks/vidstack-iRuTLfhk.js +0 -61
  78. package/dev/chunks/vidstack-lYFZKRUc.js +0 -401
  79. package/dev/chunks/vidstack-oOGofWSl.js +0 -668
  80. package/dev/chunks/vidstack-vh0BKYWJ.js +0 -84
  81. package/prod/chunks/vidstack-0Foyib2F.js +0 -34
  82. package/prod/chunks/vidstack-58ZavMvv.js +0 -159
  83. package/prod/chunks/vidstack-B0SSIHIv.js +0 -1537
  84. package/prod/chunks/vidstack-B9nEslvl.js +0 -11197
  85. package/prod/chunks/vidstack-BCBskRpc.js +0 -664
  86. package/prod/chunks/vidstack-BOObgZd8.js +0 -504
  87. package/prod/chunks/vidstack-BZVrgeRF.js +0 -9
  88. package/prod/chunks/vidstack-B_9VGrZQ.js +0 -504
  89. package/prod/chunks/vidstack-B_wD853-.js +0 -386
  90. package/prod/chunks/vidstack-BbPEqH3g.js +0 -11196
  91. package/prod/chunks/vidstack-Bm2UemPE.js +0 -470
  92. package/prod/chunks/vidstack-Bp_hAwzI.js +0 -61
  93. package/prod/chunks/vidstack-C4tNkfXj.js +0 -470
  94. package/prod/chunks/vidstack-C4tuISYG.js +0 -1504
  95. package/prod/chunks/vidstack-C5Rzkyfp.js +0 -375
  96. package/prod/chunks/vidstack-CKapDFwB.js +0 -376
  97. package/prod/chunks/vidstack-CNJwYQRW.js +0 -84
  98. package/prod/chunks/vidstack-CQll06Hv.js +0 -34
  99. package/prod/chunks/vidstack-CVzVtf1j.js +0 -61
  100. package/prod/chunks/vidstack-CYK75vJF.js +0 -1382
  101. package/prod/chunks/vidstack-CZNlvfmV.js +0 -288
  102. package/prod/chunks/vidstack-CiQEyk_l.js +0 -189
  103. package/prod/chunks/vidstack-CiTWSpv_.js +0 -34
  104. package/prod/chunks/vidstack-CikQpsuo.js +0 -1537
  105. package/prod/chunks/vidstack-CtxjO6HG.js +0 -84
  106. package/prod/chunks/vidstack-CzjHdPIT.js +0 -375
  107. package/prod/chunks/vidstack-D0XCUWbp.js +0 -159
  108. package/prod/chunks/vidstack-D3cSYtez.js +0 -663
  109. package/prod/chunks/vidstack-D91K36KQ.js +0 -206
  110. package/prod/chunks/vidstack-DJThTSEm.js +0 -125
  111. package/prod/chunks/vidstack-DTyDOhwS.js +0 -504
  112. package/prod/chunks/vidstack-DVMwXUgY.js +0 -189
  113. package/prod/chunks/vidstack-DXSNXDnS.js +0 -1384
  114. package/prod/chunks/vidstack-D_Sd7838.js +0 -663
  115. package/prod/chunks/vidstack-D_ijTIbV.js +0 -11198
  116. package/prod/chunks/vidstack-DdiGCJVp.js +0 -504
  117. package/prod/chunks/vidstack-DgGDsAKh.js +0 -375
  118. package/prod/chunks/vidstack-DgsBXr1J.js +0 -84
  119. package/prod/chunks/vidstack-DhC5F6c8.js +0 -470
  120. package/prod/chunks/vidstack-Djmla_FM.js +0 -545
  121. package/prod/chunks/vidstack-DpQw1Y33.js +0 -663
  122. package/prod/chunks/vidstack-DrEorv9m.js +0 -189
  123. package/prod/chunks/vidstack-Ma9rwtR0.js +0 -386
  124. package/prod/chunks/vidstack-VTpvHAdU.js +0 -1537
  125. package/prod/chunks/vidstack-dbLRgf2L.js +0 -159
  126. package/prod/chunks/vidstack-ehqxnvc9.js +0 -1537
  127. package/prod/chunks/vidstack-jIPoNqhj.js +0 -545
  128. package/prod/chunks/vidstack-lc8NHly9.js +0 -288
  129. package/prod/chunks/vidstack-rHvQ8f6c.js +0 -288
  130. package/prod/chunks/vidstack-rKV98aQH.js +0 -545
  131. package/prod/chunks/vidstack-uA7h-Bsq.js +0 -386
  132. package/prod/chunks/vidstack-xo_SmgiV.js +0 -84
  133. package/prod/chunks/vidstack-xvxeRtaN.js +0 -61
  134. package/server/chunks/vidstack--ufi23Q6.js +0 -1537
  135. package/server/chunks/vidstack-B3AXUfgF.js +0 -189
  136. package/server/chunks/vidstack-B4rJ1ZKK.js +0 -376
  137. package/server/chunks/vidstack-BJCx78pm.js +0 -386
  138. package/server/chunks/vidstack-BTdEfKqV.js +0 -84
  139. package/server/chunks/vidstack-BV_VpWlJ.js +0 -1537
  140. package/server/chunks/vidstack-BtitkRvR.js +0 -11198
  141. package/server/chunks/vidstack-BtqWstSj.js +0 -375
  142. package/server/chunks/vidstack-BweZhuNd.js +0 -1537
  143. package/server/chunks/vidstack-ByG5MvLs.js +0 -545
  144. package/server/chunks/vidstack-C-HdFsZi.js +0 -84
  145. package/server/chunks/vidstack-C0xOpWYR.js +0 -470
  146. package/server/chunks/vidstack-C481iXqe.js +0 -386
  147. package/server/chunks/vidstack-C4iWXMC-.js +0 -545
  148. package/server/chunks/vidstack-C5zFBMwg.js +0 -386
  149. package/server/chunks/vidstack-CEh38XpD.js +0 -288
  150. package/server/chunks/vidstack-CSiPajWY.js +0 -470
  151. package/server/chunks/vidstack-CbNRZgUA.js +0 -11197
  152. package/server/chunks/vidstack-CgXa6YO3.js +0 -61
  153. package/server/chunks/vidstack-CkMAeO-e.js +0 -34
  154. package/server/chunks/vidstack-Cm0qnRvu.js +0 -11196
  155. package/server/chunks/vidstack-Ct1NFlBa.js +0 -1537
  156. package/server/chunks/vidstack-CyFwkPiu.js +0 -470
  157. package/server/chunks/vidstack-D4t_SZbb.js +0 -1416
  158. package/server/chunks/vidstack-D7D9kiW6.js +0 -34
  159. package/server/chunks/vidstack-DH6N0AoF.js +0 -375
  160. package/server/chunks/vidstack-DJJmNib6.js +0 -504
  161. package/server/chunks/vidstack-DKr7br9D.js +0 -34
  162. package/server/chunks/vidstack-DM-5dPT-.js +0 -663
  163. package/server/chunks/vidstack-DOIUveQF.js +0 -504
  164. package/server/chunks/vidstack-DTn72IA8.js +0 -1504
  165. package/server/chunks/vidstack-DWfS9vAY.js +0 -84
  166. package/server/chunks/vidstack-DWt5LAKE.js +0 -375
  167. package/server/chunks/vidstack-DY51lx0R.js +0 -189
  168. package/server/chunks/vidstack-DbNoKLjz.js +0 -664
  169. package/server/chunks/vidstack-Dbs_rXUT.js +0 -663
  170. package/server/chunks/vidstack-DeS67_gx.js +0 -9
  171. package/server/chunks/vidstack-DiHlnSws.js +0 -1384
  172. package/server/chunks/vidstack-DnoqxmOs.js +0 -125
  173. package/server/chunks/vidstack-DsZKgA8y.js +0 -663
  174. package/server/chunks/vidstack-DtQSvsQr.js +0 -189
  175. package/server/chunks/vidstack-E7eUOyFt.js +0 -288
  176. package/server/chunks/vidstack-JkJEYEQM.js +0 -159
  177. package/server/chunks/vidstack-KhtuR229.js +0 -504
  178. package/server/chunks/vidstack-NXcLNXxO.js +0 -84
  179. package/server/chunks/vidstack-OKdxH1xx.js +0 -189
  180. package/server/chunks/vidstack-SkX-mSrw.js +0 -206
  181. package/server/chunks/vidstack-X1Hex9PH.js +0 -84
  182. package/server/chunks/vidstack-iVN8uBAv.js +0 -288
  183. package/server/chunks/vidstack-jlaBqZq5.js +0 -61
  184. package/server/chunks/vidstack-m8aA99tE.js +0 -159
  185. package/server/chunks/vidstack-rUHVQoo3.js +0 -61
  186. package/server/chunks/vidstack-rWs25cS9.js +0 -159
  187. package/server/chunks/vidstack-uyCXITen.js +0 -504
  188. package/server/chunks/vidstack-yf18YVAb.js +0 -545
@@ -1,668 +0,0 @@
1
- "use client"
2
-
3
- import * as React from 'react';
4
- import { useReactContext, createReactComponent, composeRefs, useSignal, noop, useStateContext, signal, effect, isString } from './vidstack-D_bWd66h.js';
5
- import { mediaContext, AirPlayButtonInstance, Primitive, PlayButtonInstance, CaptionButtonInstance, FullscreenButtonInstance, MuteButtonInstance, PIPButtonInstance, SeekButtonInstance, LiveButtonInstance, SliderValueInstance, SliderInstance, SliderPreviewInstance, useSliderState, VolumeSliderInstance, IS_SERVER, ThumbnailInstance, TimeSliderInstance, SliderChaptersInstance, SliderThumbnailInstance, SliderVideoInstance, mediaState, RadioGroupInstance, RadioInstance, MenuInstance, MenuButtonInstance, useMediaState, MenuItemsInstance, MenuItemInstance, GestureInstance, TimeInstance, isTrackCaptionKind } from './vidstack-CXrXBlpD.js';
6
- import { createPortal } from 'react-dom';
7
-
8
- function useMediaContext() {
9
- return useReactContext(mediaContext);
10
- }
11
-
12
- const AirPlayButtonBridge = createReactComponent(AirPlayButtonInstance, {
13
- domEventsRegex: /^onMedia/
14
- });
15
- const AirPlayButton = React.forwardRef(
16
- ({ children, ...props }, forwardRef) => {
17
- return /* @__PURE__ */ React.createElement(AirPlayButtonBridge, { ...props }, (props2) => /* @__PURE__ */ React.createElement(
18
- Primitive.button,
19
- {
20
- ...props2,
21
- ref: composeRefs(props2.ref, forwardRef)
22
- },
23
- children
24
- ));
25
- }
26
- );
27
- AirPlayButton.displayName = "AirPlayButton";
28
-
29
- const PlayButtonBridge = createReactComponent(PlayButtonInstance, {
30
- domEventsRegex: /^onMedia/
31
- });
32
- const PlayButton = React.forwardRef(
33
- ({ children, ...props }, forwardRef) => {
34
- return /* @__PURE__ */ React.createElement(PlayButtonBridge, { ...props }, (props2) => /* @__PURE__ */ React.createElement(
35
- Primitive.button,
36
- {
37
- ...props2,
38
- ref: composeRefs(props2.ref, forwardRef)
39
- },
40
- children
41
- ));
42
- }
43
- );
44
- PlayButton.displayName = "PlayButton";
45
-
46
- const CaptionButtonBridge = createReactComponent(CaptionButtonInstance, {
47
- domEventsRegex: /^onMedia/
48
- });
49
- const CaptionButton = React.forwardRef(
50
- ({ children, ...props }, forwardRef) => {
51
- return /* @__PURE__ */ React.createElement(CaptionButtonBridge, { ...props }, (props2) => /* @__PURE__ */ React.createElement(
52
- Primitive.button,
53
- {
54
- ...props2,
55
- ref: composeRefs(props2.ref, forwardRef)
56
- },
57
- children
58
- ));
59
- }
60
- );
61
- CaptionButton.displayName = "CaptionButton";
62
-
63
- const FullscreenButtonBridge = createReactComponent(FullscreenButtonInstance, {
64
- domEventsRegex: /^onMedia/
65
- });
66
- const FullscreenButton = React.forwardRef(
67
- ({ children, ...props }, forwardRef) => {
68
- return /* @__PURE__ */ React.createElement(FullscreenButtonBridge, { ...props }, (props2) => /* @__PURE__ */ React.createElement(
69
- Primitive.button,
70
- {
71
- ...props2,
72
- ref: composeRefs(props2.ref, forwardRef)
73
- },
74
- children
75
- ));
76
- }
77
- );
78
- FullscreenButton.displayName = "FullscreenButton";
79
-
80
- const MuteButtonBridge = createReactComponent(MuteButtonInstance, {
81
- domEventsRegex: /^onMedia/
82
- });
83
- const MuteButton = React.forwardRef(
84
- ({ children, ...props }, forwardRef) => {
85
- return /* @__PURE__ */ React.createElement(MuteButtonBridge, { ...props }, (props2) => /* @__PURE__ */ React.createElement(
86
- Primitive.button,
87
- {
88
- ...props2,
89
- ref: composeRefs(props2.ref, forwardRef)
90
- },
91
- children
92
- ));
93
- }
94
- );
95
- MuteButton.displayName = "MuteButton";
96
-
97
- const PIPButtonBridge = createReactComponent(PIPButtonInstance, {
98
- domEventsRegex: /^onMedia/
99
- });
100
- const PIPButton = React.forwardRef(
101
- ({ children, ...props }, forwardRef) => {
102
- return /* @__PURE__ */ React.createElement(PIPButtonBridge, { ...props }, (props2) => /* @__PURE__ */ React.createElement(
103
- Primitive.button,
104
- {
105
- ...props2,
106
- ref: composeRefs(props2.ref, forwardRef)
107
- },
108
- children
109
- ));
110
- }
111
- );
112
- PIPButton.displayName = "PIPButton";
113
-
114
- const SeekButtonBridge = createReactComponent(SeekButtonInstance, {
115
- domEventsRegex: /^onMedia/
116
- });
117
- const SeekButton = React.forwardRef(
118
- ({ children, ...props }, forwardRef) => {
119
- return /* @__PURE__ */ React.createElement(SeekButtonBridge, { ...props }, (props2) => /* @__PURE__ */ React.createElement(
120
- Primitive.button,
121
- {
122
- ...props2,
123
- ref: composeRefs(props2.ref, forwardRef)
124
- },
125
- children
126
- ));
127
- }
128
- );
129
- SeekButton.displayName = "SeekButton";
130
-
131
- const LiveButtonBridge = createReactComponent(LiveButtonInstance, {
132
- domEventsRegex: /^onMedia/
133
- });
134
- const LiveButton = React.forwardRef(
135
- ({ children, ...props }, forwardRef) => {
136
- return /* @__PURE__ */ React.createElement(LiveButtonBridge, { ...props }, (props2) => /* @__PURE__ */ React.createElement(
137
- Primitive.button,
138
- {
139
- ...props2,
140
- ref: composeRefs(props2.ref, forwardRef)
141
- },
142
- children
143
- ));
144
- }
145
- );
146
- LiveButton.displayName = "LiveButton";
147
-
148
- const sliderCallbacks = [
149
- "onDragStart",
150
- "onDragEnd",
151
- "onDragValueChange",
152
- "onValueChange",
153
- "onPointerValueChange"
154
- ];
155
-
156
- const SliderValueBridge = createReactComponent(SliderValueInstance);
157
-
158
- const SliderBridge = createReactComponent(SliderInstance, {
159
- events: sliderCallbacks
160
- });
161
- const Root$5 = React.forwardRef(({ children, ...props }, forwardRef) => {
162
- return /* @__PURE__ */ React.createElement(SliderBridge, { ...props, ref: forwardRef }, (props2) => /* @__PURE__ */ React.createElement(Primitive.div, { ...props2 }, children));
163
- });
164
- Root$5.displayName = "Slider";
165
- const Thumb = React.forwardRef((props, forwardRef) => /* @__PURE__ */ React.createElement(Primitive.div, { ...props, ref: forwardRef }));
166
- Thumb.displayName = "SliderThumb";
167
- const Track = React.forwardRef((props, forwardRef) => /* @__PURE__ */ React.createElement(Primitive.div, { ...props, ref: forwardRef }));
168
- Track.displayName = "SliderTrack";
169
- const TrackFill = React.forwardRef((props, forwardRef) => /* @__PURE__ */ React.createElement(Primitive.div, { ...props, ref: forwardRef }));
170
- TrackFill.displayName = "SliderTrackFill";
171
- const PreviewBridge = createReactComponent(SliderPreviewInstance);
172
- const Preview = React.forwardRef(
173
- ({ children, ...props }, forwardRef) => {
174
- return /* @__PURE__ */ React.createElement(PreviewBridge, { ...props }, (props2) => /* @__PURE__ */ React.createElement(
175
- Primitive.div,
176
- {
177
- ...props2,
178
- ref: composeRefs(props2.ref, forwardRef)
179
- },
180
- children
181
- ));
182
- }
183
- );
184
- Preview.displayName = "SliderPreview";
185
- const Value = React.forwardRef(({ children, ...props }, forwardRef) => {
186
- return /* @__PURE__ */ React.createElement(SliderValueBridge, { ...props }, (props2, instance) => {
187
- const $text = useSignal(() => instance.getValueText(), instance);
188
- return /* @__PURE__ */ React.createElement(Primitive.div, { ...props2, ref: forwardRef }, $text, children);
189
- });
190
- });
191
- Value.displayName = "SliderValue";
192
- const Steps = React.forwardRef(({ children, ...props }, forwardRef) => {
193
- const $min = useSliderState("min"), $max = useSliderState("max"), $step = useSliderState("step"), steps = ($max - $min) / $step;
194
- return /* @__PURE__ */ React.createElement(Primitive.div, { ...props, ref: forwardRef }, Array.from({ length: Math.floor(steps) + 1 }).map((_, step) => children(step)));
195
- });
196
- Steps.displayName = "SliderSteps";
197
-
198
- var slider = /*#__PURE__*/Object.freeze({
199
- __proto__: null,
200
- Preview: Preview,
201
- Root: Root$5,
202
- Steps: Steps,
203
- Thumb: Thumb,
204
- Track: Track,
205
- TrackFill: TrackFill,
206
- Value: Value
207
- });
208
-
209
- const VolumeSliderBridge = createReactComponent(VolumeSliderInstance, {
210
- events: sliderCallbacks,
211
- domEventsRegex: /^onMedia/
212
- });
213
- const Root$4 = React.forwardRef(
214
- ({ children, ...props }, forwardRef) => {
215
- return /* @__PURE__ */ React.createElement(VolumeSliderBridge, { ...props, ref: forwardRef }, (props2) => /* @__PURE__ */ React.createElement(Primitive.div, { ...props2 }, children));
216
- }
217
- );
218
- Root$4.displayName = "VolumeSlider";
219
-
220
- var volumeSlider = /*#__PURE__*/Object.freeze({
221
- __proto__: null,
222
- Preview: Preview,
223
- Root: Root$4,
224
- Steps: Steps,
225
- Thumb: Thumb,
226
- Track: Track,
227
- TrackFill: TrackFill,
228
- Value: Value
229
- });
230
-
231
- function createVTTCue(startTime = 0, endTime = 0, text = "") {
232
- if (IS_SERVER) {
233
- return {
234
- startTime,
235
- endTime,
236
- text,
237
- addEventListener: noop,
238
- removeEventListener: noop,
239
- dispatchEvent: noop
240
- };
241
- }
242
- return new window.VTTCue(startTime, endTime, text);
243
- }
244
- function appendParamsToURL(baseUrl, params) {
245
- const url = new URL(baseUrl);
246
- for (const key of Object.keys(params)) {
247
- url.searchParams.set(key, params[key] + "");
248
- }
249
- return url.toString();
250
- }
251
-
252
- const ThumbnailBridge = createReactComponent(ThumbnailInstance);
253
- const Root$3 = React.forwardRef(({ children, ...props }, forwardRef) => {
254
- return /* @__PURE__ */ React.createElement(ThumbnailBridge, { ...props }, (props2) => /* @__PURE__ */ React.createElement(
255
- Primitive.div,
256
- {
257
- ...props2,
258
- ref: composeRefs(props2.ref, forwardRef)
259
- },
260
- children
261
- ));
262
- });
263
- Root$3.displayName = "Thumbnail";
264
- const Img = React.forwardRef(({ children, ...props }, forwardRef) => {
265
- const { src, img, crossOrigin } = useStateContext(ThumbnailInstance.state), $src = useSignal(src), $crossOrigin = useSignal(crossOrigin);
266
- return /* @__PURE__ */ React.createElement(
267
- Primitive.img,
268
- {
269
- crossOrigin: $crossOrigin,
270
- ...props,
271
- src: $src || void 0,
272
- ref: composeRefs(img.set, forwardRef)
273
- },
274
- children
275
- );
276
- });
277
- Img.displayName = "ThumbnailImg";
278
-
279
- var thumbnail = /*#__PURE__*/Object.freeze({
280
- __proto__: null,
281
- Img: Img,
282
- Root: Root$3
283
- });
284
-
285
- const TimeSliderContext = React.createContext({
286
- $chapters: signal(null)
287
- });
288
- TimeSliderContext.displayName = "TimeSliderContext";
289
- const TimeSliderBridge = createReactComponent(TimeSliderInstance, {
290
- events: sliderCallbacks,
291
- domEventsRegex: /^onMedia/
292
- });
293
- const Root$2 = React.forwardRef(
294
- ({ children, ...props }, forwardRef) => {
295
- const $chapters = React.useMemo(() => signal(null), []);
296
- return /* @__PURE__ */ React.createElement(TimeSliderContext.Provider, { value: { $chapters } }, /* @__PURE__ */ React.createElement(TimeSliderBridge, { ...props, ref: forwardRef }, (props2) => /* @__PURE__ */ React.createElement(Primitive.div, { ...props2 }, children)));
297
- }
298
- );
299
- Root$2.displayName = "TimeSlider";
300
- const SliderChaptersBridge = createReactComponent(SliderChaptersInstance);
301
- const Chapters = React.forwardRef(
302
- ({ children, ...props }, forwardRef) => {
303
- return /* @__PURE__ */ React.createElement(SliderChaptersBridge, { ...props }, (props2, instance) => /* @__PURE__ */ React.createElement(
304
- Primitive.div,
305
- {
306
- ...props2,
307
- ref: composeRefs(props2.ref, forwardRef)
308
- },
309
- /* @__PURE__ */ React.createElement(ChapterTracks, { instance }, children)
310
- ));
311
- }
312
- );
313
- Chapters.displayName = "SliderChapters";
314
- function ChapterTracks({ instance, children }) {
315
- const $cues = useSignal(() => instance.cues, instance), refs = React.useRef([]), emptyCue = React.useRef(null), { $chapters } = React.useContext(TimeSliderContext);
316
- if (!emptyCue.current) {
317
- emptyCue.current = createVTTCue();
318
- }
319
- React.useEffect(() => {
320
- $chapters.set(instance);
321
- return () => void $chapters.set(null);
322
- }, [instance]);
323
- React.useEffect(() => {
324
- instance.setRefs(refs.current);
325
- }, [$cues]);
326
- return children($cues.length ? $cues : [emptyCue.current], (el) => {
327
- if (!el) {
328
- refs.current.length = 0;
329
- return;
330
- }
331
- refs.current.push(el);
332
- });
333
- }
334
- ChapterTracks.displayName = "SliderChapterTracks";
335
- const ChapterTitle = React.forwardRef(
336
- ({ children, ...props }, forwardRef) => {
337
- const { $chapters } = React.useContext(TimeSliderContext), [title, setTitle] = React.useState();
338
- React.useEffect(() => {
339
- return effect(() => {
340
- const chapters = $chapters(), cue = chapters?.activePointerCue || chapters?.activeCue;
341
- setTitle(cue?.text || "");
342
- });
343
- }, []);
344
- return /* @__PURE__ */ React.createElement(Primitive.div, { ...props, ref: forwardRef }, title, children);
345
- }
346
- );
347
- ChapterTitle.displayName = "SliderChapterTitle";
348
- const Progress = React.forwardRef((props, forwardRef) => /* @__PURE__ */ React.createElement(Primitive.div, { ...props, ref: forwardRef }));
349
- Progress.displayName = "SliderProgress";
350
- const SliderThumbnailBridge = createReactComponent(SliderThumbnailInstance);
351
- const ThumbnailRoot = React.forwardRef(
352
- ({ children, ...props }, forwardRef) => {
353
- return /* @__PURE__ */ React.createElement(SliderThumbnailBridge, { ...props }, (props2) => /* @__PURE__ */ React.createElement(Primitive.div, { ...props2, ref: composeRefs(props2.ref, forwardRef) }, children));
354
- }
355
- );
356
- ThumbnailRoot.displayName = "SliderThumbnail";
357
- const Thumbnail = {
358
- Root: ThumbnailRoot,
359
- Img: Img
360
- };
361
- const VideoBridge = createReactComponent(SliderVideoInstance, {
362
- events: ["onCanPlay", "onError"]
363
- });
364
- const Video = React.forwardRef(
365
- ({ children, ...props }, forwardRef) => {
366
- return /* @__PURE__ */ React.createElement(VideoBridge, { ...props }, (props2, instance) => /* @__PURE__ */ React.createElement(
367
- VideoProvider,
368
- {
369
- ...props2,
370
- instance,
371
- ref: composeRefs(props2.ref, forwardRef)
372
- },
373
- children
374
- ));
375
- }
376
- );
377
- Video.displayName = "SliderVideo";
378
- const VideoProvider = React.forwardRef(
379
- ({ instance, children, ...props }, forwardRef) => {
380
- const { canLoad } = useStateContext(mediaState), { src, video, crossOrigin } = instance.$state, $src = useSignal(src), $canLoad = useSignal(canLoad), $crossOrigin = useSignal(crossOrigin);
381
- return /* @__PURE__ */ React.createElement(
382
- Primitive.video,
383
- {
384
- style: { maxWidth: "unset" },
385
- ...props,
386
- src: $src || void 0,
387
- muted: true,
388
- playsInline: true,
389
- preload: $canLoad ? "auto" : "none",
390
- crossOrigin: $crossOrigin || void 0,
391
- ref: composeRefs(video.set, forwardRef)
392
- },
393
- children
394
- );
395
- }
396
- );
397
- VideoProvider.displayName = "SliderVideoProvider";
398
-
399
- var timeSlider = /*#__PURE__*/Object.freeze({
400
- __proto__: null,
401
- ChapterTitle: ChapterTitle,
402
- Chapters: Chapters,
403
- Preview: Preview,
404
- Progress: Progress,
405
- Root: Root$2,
406
- Steps: Steps,
407
- Thumb: Thumb,
408
- Thumbnail: Thumbnail,
409
- Track: Track,
410
- TrackFill: TrackFill,
411
- Value: Value,
412
- Video: Video
413
- });
414
-
415
- const RadioGroupBridge = createReactComponent(RadioGroupInstance, {
416
- events: ["onChange"]
417
- });
418
- const Root$1 = React.forwardRef(
419
- ({ children, ...props }, forwardRef) => {
420
- return /* @__PURE__ */ React.createElement(RadioGroupBridge, { ...props, ref: forwardRef }, (props2) => /* @__PURE__ */ React.createElement(Primitive.div, { ...props2 }, children));
421
- }
422
- );
423
- Root$1.displayName = "RadioGroup";
424
- const ItemBridge$1 = createReactComponent(RadioInstance, {
425
- events: ["onChange", "onSelect"]
426
- });
427
- const Item$1 = React.forwardRef(({ children, ...props }, forwardRef) => {
428
- return /* @__PURE__ */ React.createElement(ItemBridge$1, { ...props }, (props2) => /* @__PURE__ */ React.createElement(
429
- Primitive.div,
430
- {
431
- ...props2,
432
- ref: composeRefs(props2.ref, forwardRef)
433
- },
434
- children
435
- ));
436
- });
437
- Item$1.displayName = "RadioItem";
438
-
439
- var radioGroup = /*#__PURE__*/Object.freeze({
440
- __proto__: null,
441
- Item: Item$1,
442
- Root: Root$1
443
- });
444
-
445
- const MenuBridge = createReactComponent(MenuInstance, {
446
- events: ["onOpen", "onClose"],
447
- domEventsRegex: /^onMedia/
448
- });
449
- const Root = React.forwardRef(({ children, ...props }, forwardRef) => {
450
- return /* @__PURE__ */ React.createElement(MenuBridge, { ...props, ref: forwardRef }, (props2, instance) => /* @__PURE__ */ React.createElement(
451
- Primitive.div,
452
- {
453
- ...props2,
454
- style: { display: !instance.isSubmenu ? "contents" : void 0, ...props2.style }
455
- },
456
- children
457
- ));
458
- });
459
- Root.displayName = "Menu";
460
- const ButtonBridge = createReactComponent(MenuButtonInstance, {
461
- events: ["onSelect"]
462
- });
463
- const Button = React.forwardRef(
464
- ({ children, ...props }, forwardRef) => {
465
- return /* @__PURE__ */ React.createElement(ButtonBridge, { ...props }, (props2) => /* @__PURE__ */ React.createElement(
466
- Primitive.button,
467
- {
468
- ...props2,
469
- ref: composeRefs(props2.ref, forwardRef)
470
- },
471
- children
472
- ));
473
- }
474
- );
475
- Button.displayName = "MenuButton";
476
- const Portal = React.forwardRef(
477
- ({ container = null, disabled = false, children, ...props }, forwardRef) => {
478
- let fullscreen = useMediaState("fullscreen"), shouldPortal = disabled === "fullscreen" ? !fullscreen : !disabled;
479
- const target = React.useMemo(() => {
480
- if (IS_SERVER) return null;
481
- const node = isString(container) ? document.querySelector(container) : container;
482
- return node ?? document.body;
483
- }, [container]);
484
- return !target || !shouldPortal ? children : createPortal(
485
- /* @__PURE__ */ React.createElement(
486
- Primitive.div,
487
- {
488
- ...props,
489
- style: { display: "contents", ...props.style },
490
- ref: forwardRef
491
- },
492
- children
493
- ),
494
- target
495
- );
496
- }
497
- );
498
- Portal.displayName = "MenuPortal";
499
- const ItemsBridge = createReactComponent(MenuItemsInstance);
500
- const Items = React.forwardRef(({ children, ...props }, forwardRef) => {
501
- return /* @__PURE__ */ React.createElement(ItemsBridge, { ...props }, (props2) => /* @__PURE__ */ React.createElement(
502
- Primitive.div,
503
- {
504
- ...props2,
505
- ref: composeRefs(props2.ref, forwardRef)
506
- },
507
- children
508
- ));
509
- });
510
- Items.displayName = "MenuItems";
511
- const ItemBridge = createReactComponent(MenuItemInstance);
512
- const Item = React.forwardRef(({ children, ...props }, forwardRef) => {
513
- return /* @__PURE__ */ React.createElement(ItemBridge, { ...props }, (props2) => /* @__PURE__ */ React.createElement(
514
- Primitive.div,
515
- {
516
- ...props2,
517
- ref: composeRefs(props2.ref, forwardRef)
518
- },
519
- children
520
- ));
521
- });
522
- Item.displayName = "MenuItem";
523
-
524
- var menu = /*#__PURE__*/Object.freeze({
525
- __proto__: null,
526
- Button: Button,
527
- Content: Items,
528
- Item: Item,
529
- Items: Items,
530
- Portal: Portal,
531
- Radio: Item$1,
532
- RadioGroup: Root$1,
533
- Root: Root
534
- });
535
-
536
- const GestureBridge = createReactComponent(GestureInstance, {
537
- events: ["onWillTrigger", "onTrigger"]
538
- });
539
- const Gesture = React.forwardRef(
540
- ({ children, ...props }, forwardRef) => {
541
- return /* @__PURE__ */ React.createElement(GestureBridge, { ...props, ref: forwardRef }, (props2) => /* @__PURE__ */ React.createElement(Primitive.div, { ...props2 }, children));
542
- }
543
- );
544
- Gesture.displayName = "Gesture";
545
-
546
- const TimeBridge = createReactComponent(TimeInstance);
547
- const Time = React.forwardRef(({ children, ...props }, forwardRef) => {
548
- return /* @__PURE__ */ React.createElement(TimeBridge, { ...props }, (props2, instance) => /* @__PURE__ */ React.createElement(
549
- TimeText,
550
- {
551
- ...props2,
552
- instance,
553
- ref: composeRefs(props2.ref, forwardRef)
554
- },
555
- children
556
- ));
557
- });
558
- Time.displayName = "Time";
559
- const TimeText = React.forwardRef(
560
- ({ instance, children, ...props }, forwardRef) => {
561
- const { timeText } = instance.$state, $timeText = useSignal(timeText);
562
- return /* @__PURE__ */ React.createElement(Primitive.div, { ...props, ref: forwardRef }, $timeText, children);
563
- }
564
- );
565
- TimeText.displayName = "TimeText";
566
-
567
- function useMediaPlayer() {
568
- const context = useMediaContext();
569
- if (!context) {
570
- throw Error(
571
- "[vidstack] no media context was found - was this called outside of `<MediaPlayer>`?"
572
- );
573
- }
574
- return context?.player || null;
575
- }
576
-
577
- function useAudioOptions() {
578
- const media = useMediaContext(), { audioTracks, audioTrack } = media.$state, $audioTracks = useSignal(audioTracks);
579
- useSignal(audioTrack);
580
- return React.useMemo(() => {
581
- const options = $audioTracks.map((track) => ({
582
- track,
583
- label: track.label,
584
- value: getTrackValue$1(track),
585
- get selected() {
586
- return audioTrack() === track;
587
- },
588
- select(trigger) {
589
- const index = audioTracks().indexOf(track);
590
- if (index >= 0) media.remote.changeAudioTrack(index, trigger);
591
- }
592
- }));
593
- Object.defineProperty(options, "disabled", {
594
- get() {
595
- return options.length <= 1;
596
- }
597
- });
598
- Object.defineProperty(options, "selectedTrack", {
599
- get() {
600
- return audioTrack();
601
- }
602
- });
603
- Object.defineProperty(options, "selectedValue", {
604
- get() {
605
- const track = audioTrack();
606
- return track ? getTrackValue$1(track) : void 0;
607
- }
608
- });
609
- return options;
610
- }, [$audioTracks]);
611
- }
612
- function getTrackValue$1(track) {
613
- return track.label.toLowerCase();
614
- }
615
-
616
- function useCaptionOptions({ off = true } = {}) {
617
- const media = useMediaContext(), { textTracks, textTrack } = media.$state, $textTracks = useSignal(textTracks);
618
- useSignal(textTrack);
619
- return React.useMemo(() => {
620
- const captionTracks = $textTracks.filter(isTrackCaptionKind), options = captionTracks.map((track) => ({
621
- track,
622
- label: track.label,
623
- value: getTrackValue(track),
624
- get selected() {
625
- return textTrack() === track;
626
- },
627
- select(trigger) {
628
- const index = textTracks().indexOf(track);
629
- if (index >= 0) media.remote.changeTextTrackMode(index, "showing", trigger);
630
- }
631
- }));
632
- if (off) {
633
- options.unshift({
634
- track: null,
635
- label: isString(off) ? off : "Off",
636
- value: "off",
637
- get selected() {
638
- return !textTrack();
639
- },
640
- select(trigger) {
641
- media.remote.toggleCaptions(trigger);
642
- }
643
- });
644
- }
645
- Object.defineProperty(options, "disabled", {
646
- get() {
647
- return !captionTracks.length;
648
- }
649
- });
650
- Object.defineProperty(options, "selectedTrack", {
651
- get() {
652
- return textTrack();
653
- }
654
- });
655
- Object.defineProperty(options, "selectedValue", {
656
- get() {
657
- const track = textTrack();
658
- return track ? getTrackValue(track) : "off";
659
- }
660
- });
661
- return options;
662
- }, [$textTracks]);
663
- }
664
- function getTrackValue(track) {
665
- return track.id + ":" + track.kind + "-" + track.label.toLowerCase();
666
- }
667
-
668
- export { AirPlayButton, Button, CaptionButton, ChapterTitle, Chapters, FullscreenButton, Gesture, Img, Item$1 as Item, Items, LiveButton, MuteButton, PIPButton, PlayButton, Portal, Preview, Progress, Root$3 as Root, Root$2 as Root$1, Root as Root$2, Root$1 as Root$3, Root$4, Root$5, SeekButton, Steps, Thumb, Thumbnail, Time, Track, TrackFill, Value, appendParamsToURL, menu, radioGroup, slider, sliderCallbacks, thumbnail, timeSlider, useAudioOptions, useCaptionOptions, useMediaContext, useMediaPlayer, volumeSlider };