@react-scrollytelling/video 0.1.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js DELETED
@@ -1,719 +0,0 @@
1
- import J, { useRef as ke, useEffect as vr, useState as pr, useCallback as ne, useImperativeHandle as yr } from "react";
2
- import { useRafThrottle as gr } from "@react-scrollytelling/core";
3
- var ae = { exports: {} }, V = {};
4
- /**
5
- * @license React
6
- * react-jsx-runtime.production.min.js
7
- *
8
- * Copyright (c) Facebook, Inc. and its affiliates.
9
- *
10
- * This source code is licensed under the MIT license found in the
11
- * LICENSE file in the root directory of this source tree.
12
- */
13
- var je;
14
- function hr() {
15
- if (je)
16
- return V;
17
- je = 1;
18
- var S = J, g = Symbol.for("react.element"), C = Symbol.for("react.fragment"), b = Object.prototype.hasOwnProperty, m = S.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, T = { key: !0, ref: !0, __self: !0, __source: !0 };
19
- function O(h, s, w) {
20
- var c, R = {}, E = null, k = null;
21
- w !== void 0 && (E = "" + w), s.key !== void 0 && (E = "" + s.key), s.ref !== void 0 && (k = s.ref);
22
- for (c in s)
23
- b.call(s, c) && !T.hasOwnProperty(c) && (R[c] = s[c]);
24
- if (h && h.defaultProps)
25
- for (c in s = h.defaultProps, s)
26
- R[c] === void 0 && (R[c] = s[c]);
27
- return { $$typeof: g, type: h, key: E, ref: k, props: R, _owner: m.current };
28
- }
29
- return V.Fragment = C, V.jsx = O, V.jsxs = O, V;
30
- }
31
- var L = {};
32
- /**
33
- * @license React
34
- * react-jsx-runtime.development.js
35
- *
36
- * Copyright (c) Facebook, Inc. and its affiliates.
37
- *
38
- * This source code is licensed under the MIT license found in the
39
- * LICENSE file in the root directory of this source tree.
40
- */
41
- var xe;
42
- function Rr() {
43
- return xe || (xe = 1, process.env.NODE_ENV !== "production" && function() {
44
- var S = J, g = Symbol.for("react.element"), C = Symbol.for("react.portal"), b = Symbol.for("react.fragment"), m = Symbol.for("react.strict_mode"), T = Symbol.for("react.profiler"), O = Symbol.for("react.provider"), h = Symbol.for("react.context"), s = Symbol.for("react.forward_ref"), w = Symbol.for("react.suspense"), c = Symbol.for("react.suspense_list"), R = Symbol.for("react.memo"), E = Symbol.for("react.lazy"), k = Symbol.for("react.offscreen"), M = Symbol.iterator, K = "@@iterator";
45
- function I(e) {
46
- if (e === null || typeof e != "object")
47
- return null;
48
- var r = M && e[M] || e[K];
49
- return typeof r == "function" ? r : null;
50
- }
51
- var P = S.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
52
- function d(e) {
53
- {
54
- for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
55
- t[n - 1] = arguments[n];
56
- De("error", e, t);
57
- }
58
- }
59
- function De(e, r, t) {
60
- {
61
- var n = P.ReactDebugCurrentFrame, i = n.getStackAddendum();
62
- i !== "" && (r += "%s", t = t.concat([i]));
63
- var u = t.map(function(o) {
64
- return String(o);
65
- });
66
- u.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, u);
67
- }
68
- }
69
- var Fe = !1, Ae = !1, Ie = !1, $e = !1, We = !1, oe;
70
- oe = Symbol.for("react.module.reference");
71
- function Ye(e) {
72
- return !!(typeof e == "string" || typeof e == "function" || e === b || e === T || We || e === m || e === w || e === c || $e || e === k || Fe || Ae || Ie || typeof e == "object" && e !== null && (e.$$typeof === E || e.$$typeof === R || e.$$typeof === O || e.$$typeof === h || e.$$typeof === s || // This needs to include all possible module reference object
73
- // types supported by any Flight configuration anywhere since
74
- // we don't know which Flight build this will end up being used
75
- // with.
76
- e.$$typeof === oe || e.getModuleId !== void 0));
77
- }
78
- function Ve(e, r, t) {
79
- var n = e.displayName;
80
- if (n)
81
- return n;
82
- var i = r.displayName || r.name || "";
83
- return i !== "" ? t + "(" + i + ")" : t;
84
- }
85
- function ie(e) {
86
- return e.displayName || "Context";
87
- }
88
- function _(e) {
89
- if (e == null)
90
- return null;
91
- if (typeof e.tag == "number" && d("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
92
- return e.displayName || e.name || null;
93
- if (typeof e == "string")
94
- return e;
95
- switch (e) {
96
- case b:
97
- return "Fragment";
98
- case C:
99
- return "Portal";
100
- case T:
101
- return "Profiler";
102
- case m:
103
- return "StrictMode";
104
- case w:
105
- return "Suspense";
106
- case c:
107
- return "SuspenseList";
108
- }
109
- if (typeof e == "object")
110
- switch (e.$$typeof) {
111
- case h:
112
- var r = e;
113
- return ie(r) + ".Consumer";
114
- case O:
115
- var t = e;
116
- return ie(t._context) + ".Provider";
117
- case s:
118
- return Ve(e, e.render, "ForwardRef");
119
- case R:
120
- var n = e.displayName || null;
121
- return n !== null ? n : _(e.type) || "Memo";
122
- case E: {
123
- var i = e, u = i._payload, o = i._init;
124
- try {
125
- return _(o(u));
126
- } catch (a) {
127
- return null;
128
- }
129
- }
130
- }
131
- return null;
132
- }
133
- var j = Object.assign, $ = 0, ue, se, le, fe, ce, de, ve;
134
- function pe() {
135
- }
136
- pe.__reactDisabledLog = !0;
137
- function Le() {
138
- {
139
- if ($ === 0) {
140
- ue = console.log, se = console.info, le = console.warn, fe = console.error, ce = console.group, de = console.groupCollapsed, ve = console.groupEnd;
141
- var e = {
142
- configurable: !0,
143
- enumerable: !0,
144
- value: pe,
145
- writable: !0
146
- };
147
- Object.defineProperties(console, {
148
- info: e,
149
- log: e,
150
- warn: e,
151
- error: e,
152
- group: e,
153
- groupCollapsed: e,
154
- groupEnd: e
155
- });
156
- }
157
- $++;
158
- }
159
- }
160
- function Me() {
161
- {
162
- if ($--, $ === 0) {
163
- var e = {
164
- configurable: !0,
165
- enumerable: !0,
166
- writable: !0
167
- };
168
- Object.defineProperties(console, {
169
- log: j({}, e, {
170
- value: ue
171
- }),
172
- info: j({}, e, {
173
- value: se
174
- }),
175
- warn: j({}, e, {
176
- value: le
177
- }),
178
- error: j({}, e, {
179
- value: fe
180
- }),
181
- group: j({}, e, {
182
- value: ce
183
- }),
184
- groupCollapsed: j({}, e, {
185
- value: de
186
- }),
187
- groupEnd: j({}, e, {
188
- value: ve
189
- })
190
- });
191
- }
192
- $ < 0 && d("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
193
- }
194
- }
195
- var G = P.ReactCurrentDispatcher, z;
196
- function U(e, r, t) {
197
- {
198
- if (z === void 0)
199
- try {
200
- throw Error();
201
- } catch (i) {
202
- var n = i.stack.trim().match(/\n( *(at )?)/);
203
- z = n && n[1] || "";
204
- }
205
- return `
206
- ` + z + e;
207
- }
208
- }
209
- var H = !1, N;
210
- {
211
- var Ue = typeof WeakMap == "function" ? WeakMap : Map;
212
- N = new Ue();
213
- }
214
- function ye(e, r) {
215
- if (!e || H)
216
- return "";
217
- {
218
- var t = N.get(e);
219
- if (t !== void 0)
220
- return t;
221
- }
222
- var n;
223
- H = !0;
224
- var i = Error.prepareStackTrace;
225
- Error.prepareStackTrace = void 0;
226
- var u;
227
- u = G.current, G.current = null, Le();
228
- try {
229
- if (r) {
230
- var o = function() {
231
- throw Error();
232
- };
233
- if (Object.defineProperty(o.prototype, "props", {
234
- set: function() {
235
- throw Error();
236
- }
237
- }), typeof Reflect == "object" && Reflect.construct) {
238
- try {
239
- Reflect.construct(o, []);
240
- } catch (p) {
241
- n = p;
242
- }
243
- Reflect.construct(e, [], o);
244
- } else {
245
- try {
246
- o.call();
247
- } catch (p) {
248
- n = p;
249
- }
250
- e.call(o.prototype);
251
- }
252
- } else {
253
- try {
254
- throw Error();
255
- } catch (p) {
256
- n = p;
257
- }
258
- e();
259
- }
260
- } catch (p) {
261
- if (p && n && typeof p.stack == "string") {
262
- for (var a = p.stack.split(`
263
- `), v = n.stack.split(`
264
- `), l = a.length - 1, f = v.length - 1; l >= 1 && f >= 0 && a[l] !== v[f]; )
265
- f--;
266
- for (; l >= 1 && f >= 0; l--, f--)
267
- if (a[l] !== v[f]) {
268
- if (l !== 1 || f !== 1)
269
- do
270
- if (l--, f--, f < 0 || a[l] !== v[f]) {
271
- var y = `
272
- ` + a[l].replace(" at new ", " at ");
273
- return e.displayName && y.includes("<anonymous>") && (y = y.replace("<anonymous>", e.displayName)), typeof e == "function" && N.set(e, y), y;
274
- }
275
- while (l >= 1 && f >= 0);
276
- break;
277
- }
278
- }
279
- } finally {
280
- H = !1, G.current = u, Me(), Error.prepareStackTrace = i;
281
- }
282
- var F = e ? e.displayName || e.name : "", x = F ? U(F) : "";
283
- return typeof e == "function" && N.set(e, x), x;
284
- }
285
- function Ne(e, r, t) {
286
- return ye(e, !1);
287
- }
288
- function qe(e) {
289
- var r = e.prototype;
290
- return !!(r && r.isReactComponent);
291
- }
292
- function q(e, r, t) {
293
- if (e == null)
294
- return "";
295
- if (typeof e == "function")
296
- return ye(e, qe(e));
297
- if (typeof e == "string")
298
- return U(e);
299
- switch (e) {
300
- case w:
301
- return U("Suspense");
302
- case c:
303
- return U("SuspenseList");
304
- }
305
- if (typeof e == "object")
306
- switch (e.$$typeof) {
307
- case s:
308
- return Ne(e.render);
309
- case R:
310
- return q(e.type, r, t);
311
- case E: {
312
- var n = e, i = n._payload, u = n._init;
313
- try {
314
- return q(u(i), r, t);
315
- } catch (o) {
316
- }
317
- }
318
- }
319
- return "";
320
- }
321
- var W = Object.prototype.hasOwnProperty, ge = {}, he = P.ReactDebugCurrentFrame;
322
- function B(e) {
323
- if (e) {
324
- var r = e._owner, t = q(e.type, e._source, r ? r.type : null);
325
- he.setExtraStackFrame(t);
326
- } else
327
- he.setExtraStackFrame(null);
328
- }
329
- function Be(e, r, t, n, i) {
330
- {
331
- var u = Function.call.bind(W);
332
- for (var o in e)
333
- if (u(e, o)) {
334
- var a = void 0;
335
- try {
336
- if (typeof e[o] != "function") {
337
- var v = Error((n || "React class") + ": " + t + " type `" + o + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[o] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
338
- throw v.name = "Invariant Violation", v;
339
- }
340
- a = e[o](r, o, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
341
- } catch (l) {
342
- a = l;
343
- }
344
- a && !(a instanceof Error) && (B(i), d("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", n || "React class", t, o, typeof a), B(null)), a instanceof Error && !(a.message in ge) && (ge[a.message] = !0, B(i), d("Failed %s type: %s", t, a.message), B(null));
345
- }
346
- }
347
- }
348
- var Je = Array.isArray;
349
- function X(e) {
350
- return Je(e);
351
- }
352
- function Ke(e) {
353
- {
354
- var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
355
- return t;
356
- }
357
- }
358
- function Ge(e) {
359
- try {
360
- return Re(e), !1;
361
- } catch (r) {
362
- return !0;
363
- }
364
- }
365
- function Re(e) {
366
- return "" + e;
367
- }
368
- function be(e) {
369
- if (Ge(e))
370
- return d("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Ke(e)), Re(e);
371
- }
372
- var Y = P.ReactCurrentOwner, ze = {
373
- key: !0,
374
- ref: !0,
375
- __self: !0,
376
- __source: !0
377
- }, me, Ee, Z;
378
- Z = {};
379
- function He(e) {
380
- if (W.call(e, "ref")) {
381
- var r = Object.getOwnPropertyDescriptor(e, "ref").get;
382
- if (r && r.isReactWarning)
383
- return !1;
384
- }
385
- return e.ref !== void 0;
386
- }
387
- function Xe(e) {
388
- if (W.call(e, "key")) {
389
- var r = Object.getOwnPropertyDescriptor(e, "key").get;
390
- if (r && r.isReactWarning)
391
- return !1;
392
- }
393
- return e.key !== void 0;
394
- }
395
- function Ze(e, r) {
396
- if (typeof e.ref == "string" && Y.current && r && Y.current.stateNode !== r) {
397
- var t = _(Y.current.type);
398
- Z[t] || (d('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', _(Y.current.type), e.ref), Z[t] = !0);
399
- }
400
- }
401
- function Qe(e, r) {
402
- {
403
- var t = function() {
404
- me || (me = !0, d("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
405
- };
406
- t.isReactWarning = !0, Object.defineProperty(e, "key", {
407
- get: t,
408
- configurable: !0
409
- });
410
- }
411
- }
412
- function er(e, r) {
413
- {
414
- var t = function() {
415
- Ee || (Ee = !0, d("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
416
- };
417
- t.isReactWarning = !0, Object.defineProperty(e, "ref", {
418
- get: t,
419
- configurable: !0
420
- });
421
- }
422
- }
423
- var rr = function(e, r, t, n, i, u, o) {
424
- var a = {
425
- // This tag allows us to uniquely identify this as a React Element
426
- $$typeof: g,
427
- // Built-in properties that belong on the element
428
- type: e,
429
- key: r,
430
- ref: t,
431
- props: o,
432
- // Record the component responsible for creating this element.
433
- _owner: u
434
- };
435
- return a._store = {}, Object.defineProperty(a._store, "validated", {
436
- configurable: !1,
437
- enumerable: !1,
438
- writable: !0,
439
- value: !1
440
- }), Object.defineProperty(a, "_self", {
441
- configurable: !1,
442
- enumerable: !1,
443
- writable: !1,
444
- value: n
445
- }), Object.defineProperty(a, "_source", {
446
- configurable: !1,
447
- enumerable: !1,
448
- writable: !1,
449
- value: i
450
- }), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
451
- };
452
- function tr(e, r, t, n, i) {
453
- {
454
- var u, o = {}, a = null, v = null;
455
- t !== void 0 && (be(t), a = "" + t), Xe(r) && (be(r.key), a = "" + r.key), He(r) && (v = r.ref, Ze(r, i));
456
- for (u in r)
457
- W.call(r, u) && !ze.hasOwnProperty(u) && (o[u] = r[u]);
458
- if (e && e.defaultProps) {
459
- var l = e.defaultProps;
460
- for (u in l)
461
- o[u] === void 0 && (o[u] = l[u]);
462
- }
463
- if (a || v) {
464
- var f = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
465
- a && Qe(o, f), v && er(o, f);
466
- }
467
- return rr(e, a, v, i, n, Y.current, o);
468
- }
469
- }
470
- var Q = P.ReactCurrentOwner, _e = P.ReactDebugCurrentFrame;
471
- function D(e) {
472
- if (e) {
473
- var r = e._owner, t = q(e.type, e._source, r ? r.type : null);
474
- _e.setExtraStackFrame(t);
475
- } else
476
- _e.setExtraStackFrame(null);
477
- }
478
- var ee;
479
- ee = !1;
480
- function re(e) {
481
- return typeof e == "object" && e !== null && e.$$typeof === g;
482
- }
483
- function Te() {
484
- {
485
- if (Q.current) {
486
- var e = _(Q.current.type);
487
- if (e)
488
- return `
489
-
490
- Check the render method of \`` + e + "`.";
491
- }
492
- return "";
493
- }
494
- }
495
- function nr(e) {
496
- return "";
497
- }
498
- var Oe = {};
499
- function ar(e) {
500
- {
501
- var r = Te();
502
- if (!r) {
503
- var t = typeof e == "string" ? e : e.displayName || e.name;
504
- t && (r = `
505
-
506
- Check the top-level render call using <` + t + ">.");
507
- }
508
- return r;
509
- }
510
- }
511
- function Pe(e, r) {
512
- {
513
- if (!e._store || e._store.validated || e.key != null)
514
- return;
515
- e._store.validated = !0;
516
- var t = ar(r);
517
- if (Oe[t])
518
- return;
519
- Oe[t] = !0;
520
- var n = "";
521
- e && e._owner && e._owner !== Q.current && (n = " It was passed a child from " + _(e._owner.type) + "."), D(e), d('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), D(null);
522
- }
523
- }
524
- function Se(e, r) {
525
- {
526
- if (typeof e != "object")
527
- return;
528
- if (X(e))
529
- for (var t = 0; t < e.length; t++) {
530
- var n = e[t];
531
- re(n) && Pe(n, r);
532
- }
533
- else if (re(e))
534
- e._store && (e._store.validated = !0);
535
- else if (e) {
536
- var i = I(e);
537
- if (typeof i == "function" && i !== e.entries)
538
- for (var u = i.call(e), o; !(o = u.next()).done; )
539
- re(o.value) && Pe(o.value, r);
540
- }
541
- }
542
- }
543
- function or(e) {
544
- {
545
- var r = e.type;
546
- if (r == null || typeof r == "string")
547
- return;
548
- var t;
549
- if (typeof r == "function")
550
- t = r.propTypes;
551
- else if (typeof r == "object" && (r.$$typeof === s || // Note: Memo only checks outer props here.
552
- // Inner props are checked in the reconciler.
553
- r.$$typeof === R))
554
- t = r.propTypes;
555
- else
556
- return;
557
- if (t) {
558
- var n = _(r);
559
- Be(t, e.props, "prop", n, e);
560
- } else if (r.PropTypes !== void 0 && !ee) {
561
- ee = !0;
562
- var i = _(r);
563
- d("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", i || "Unknown");
564
- }
565
- typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && d("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
566
- }
567
- }
568
- function ir(e) {
569
- {
570
- for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
571
- var n = r[t];
572
- if (n !== "children" && n !== "key") {
573
- D(e), d("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), D(null);
574
- break;
575
- }
576
- }
577
- e.ref !== null && (D(e), d("Invalid attribute `ref` supplied to `React.Fragment`."), D(null));
578
- }
579
- }
580
- var we = {};
581
- function Ce(e, r, t, n, i, u) {
582
- {
583
- var o = Ye(e);
584
- if (!o) {
585
- var a = "";
586
- (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (a += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
587
- var v = nr();
588
- v ? a += v : a += Te();
589
- var l;
590
- e === null ? l = "null" : X(e) ? l = "array" : e !== void 0 && e.$$typeof === g ? (l = "<" + (_(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : l = typeof e, d("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", l, a);
591
- }
592
- var f = tr(e, r, t, i, u);
593
- if (f == null)
594
- return f;
595
- if (o) {
596
- var y = r.children;
597
- if (y !== void 0)
598
- if (n)
599
- if (X(y)) {
600
- for (var F = 0; F < y.length; F++)
601
- Se(y[F], e);
602
- Object.freeze && Object.freeze(y);
603
- } else
604
- d("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
605
- else
606
- Se(y, e);
607
- }
608
- if (W.call(r, "key")) {
609
- var x = _(e), p = Object.keys(r).filter(function(dr) {
610
- return dr !== "key";
611
- }), te = p.length > 0 ? "{key: someKey, " + p.join(": ..., ") + ": ...}" : "{key: someKey}";
612
- if (!we[x + te]) {
613
- var cr = p.length > 0 ? "{" + p.join(": ..., ") + ": ...}" : "{}";
614
- d(`A props object containing a "key" prop is being spread into JSX:
615
- let props = %s;
616
- <%s {...props} />
617
- React keys must be passed directly to JSX without using spread:
618
- let props = %s;
619
- <%s key={someKey} {...props} />`, te, x, cr, x), we[x + te] = !0;
620
- }
621
- }
622
- return e === b ? ir(f) : or(f), f;
623
- }
624
- }
625
- function ur(e, r, t) {
626
- return Ce(e, r, t, !0);
627
- }
628
- function sr(e, r, t) {
629
- return Ce(e, r, t, !1);
630
- }
631
- var lr = sr, fr = ur;
632
- L.Fragment = b, L.jsx = lr, L.jsxs = fr;
633
- }()), L;
634
- }
635
- process.env.NODE_ENV === "production" ? ae.exports = hr() : ae.exports = Rr();
636
- var A = ae.exports;
637
- const _r = ({
638
- src: S,
639
- srcWebm: g,
640
- width: C,
641
- height: b,
642
- thumbnail: m,
643
- ratio: T = 0,
644
- className: O,
645
- loadingOverlay: h
646
- }) => {
647
- const s = ke(null);
648
- return vr(() => {
649
- s.current && s.current.setRatio(T);
650
- }, [T]), /* @__PURE__ */ A.jsx(
651
- br,
652
- {
653
- ref: s,
654
- width: C,
655
- height: b,
656
- src: S,
657
- srcWebm: g,
658
- className: O,
659
- thumbnail: m,
660
- loadingOverlay: h
661
- }
662
- );
663
- }, br = J.memo(
664
- J.forwardRef(
665
- ({ src: S, srcWebm: g, width: C, height: b, thumbnail: m, className: T, loadingOverlay: O }, h) => {
666
- const s = ke(null), [w, c] = pr(!0), R = ne((K) => {
667
- const I = s.current;
668
- if (!I)
669
- return;
670
- const P = I.duration;
671
- isNaN(P) || requestAnimationFrame(() => {
672
- I.currentTime = Math.round(K * P * 100) / 100;
673
- });
674
- }, []), E = gr(R);
675
- yr(
676
- h,
677
- () => ({
678
- setRatio: E
679
- }),
680
- [E]
681
- );
682
- const k = ne(() => {
683
- c(!0);
684
- }, []), M = ne(() => {
685
- c(!1);
686
- }, []);
687
- return /* @__PURE__ */ A.jsxs("div", { style: { position: "relative", width: "100%", height: "100%" }, children: [
688
- /* @__PURE__ */ A.jsxs(
689
- "video",
690
- {
691
- ref: s,
692
- width: C,
693
- height: b,
694
- className: T,
695
- muted: !0,
696
- disablePictureInPicture: !0,
697
- disableRemotePlayback: !0,
698
- playsInline: !0,
699
- controls: !1,
700
- preload: "auto",
701
- onWaiting: k,
702
- onCanPlay: M,
703
- poster: m,
704
- children: [
705
- g && /* @__PURE__ */ A.jsx("source", { src: m ? g : `${g}#t=0.1`, type: "video/webm" }),
706
- /* @__PURE__ */ A.jsx("source", { src: m ? S : `${S}#t=0.1`, type: "video/mp4" })
707
- ]
708
- }
709
- ),
710
- /* @__PURE__ */ A.jsx("div", { style: { position: "absolute", inset: 0 }, children: w && O })
711
- ] });
712
- }
713
- )
714
- );
715
- export {
716
- _r as Video,
717
- br as VideoWithImperativeHandle
718
- };
719
- //# sourceMappingURL=index.es.js.map