@hanifhan1f/vidstack-react 1.12.34 → 1.12.36

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