@ilo-org/react 0.1.2 → 0.2.1

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 (74) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/lib/cjs/{DailyMotion-4f88e10b.js → DailyMotion-2aa7f048.js} +4 -5
  3. package/lib/cjs/{Facebook-d993b91c.js → Facebook-87e24af8.js} +4 -5
  4. package/lib/cjs/{FilePlayer-8272a6ea.js → FilePlayer-e1216cc8.js} +4 -5
  5. package/lib/cjs/{Kaltura-fbd2c46f.js → Kaltura-a673a8e9.js} +4 -5
  6. package/lib/cjs/{Mixcloud-2b4ffb85.js → Mixcloud-f9575c31.js} +4 -5
  7. package/lib/cjs/{Preview-8238ea6e.js → Preview-468c3a7f.js} +2 -2
  8. package/lib/cjs/{SoundCloud-356fd92d.js → SoundCloud-7c59f293.js} +4 -5
  9. package/lib/cjs/{Streamable-407ca855.js → Streamable-83e516e5.js} +4 -5
  10. package/lib/cjs/{Twitch-ca00faaf.js → Twitch-fdfa1c77.js} +4 -5
  11. package/lib/cjs/VideoPlayer-9ce35136.js +2059 -0
  12. package/lib/cjs/{Vidyard-9d037503.js → Vidyard-096bba3c.js} +4 -5
  13. package/lib/cjs/{Vimeo-6898bfd9.js → Vimeo-2cb7476f.js} +4 -5
  14. package/lib/cjs/{Wistia-ed77bf25.js → Wistia-5e830ac8.js} +4 -5
  15. package/lib/cjs/{YouTube-909bd761.js → YouTube-25a1d9a0.js} +4 -5
  16. package/lib/cjs/components/Footer/Footer.js +23 -0
  17. package/lib/cjs/components/Footer/index.js +18 -0
  18. package/lib/cjs/components/LocalNav/LocalNav.js +102 -0
  19. package/lib/cjs/components/LocalNav/index.js +14 -0
  20. package/lib/cjs/components/Video/Video.js +2 -4
  21. package/lib/cjs/components/Video/VideoPlayer.js +10 -1445
  22. package/lib/cjs/components/Video/index.js +1 -3
  23. package/lib/cjs/components/index.js +6 -4
  24. package/lib/cjs/index.js +5 -3
  25. package/lib/esm/{DailyMotion-9a7aeab5.js → DailyMotion-66b6eff2.js} +1 -2
  26. package/lib/esm/{Facebook-eb35da52.js → Facebook-dbd1003d.js} +1 -2
  27. package/lib/esm/{FilePlayer-22314795.js → FilePlayer-617ed2ce.js} +1 -2
  28. package/lib/esm/{Kaltura-b97bb455.js → Kaltura-bbcec33d.js} +1 -2
  29. package/lib/esm/{Mixcloud-41d6dc0b.js → Mixcloud-a681ec69.js} +1 -2
  30. package/lib/esm/{Preview-6d2a6792.js → Preview-407cc648.js} +1 -1
  31. package/lib/esm/{SoundCloud-0fac2e7a.js → SoundCloud-16e78ee5.js} +1 -2
  32. package/lib/esm/{Streamable-46f19a16.js → Streamable-ecb225c1.js} +1 -2
  33. package/lib/esm/{Twitch-1be39438.js → Twitch-8d1b6769.js} +1 -2
  34. package/lib/esm/VideoPlayer-62e0ce79.js +2054 -0
  35. package/lib/esm/{Vidyard-6185c490.js → Vidyard-57e2834a.js} +1 -2
  36. package/lib/esm/{Vimeo-a807e7e1.js → Vimeo-faa058a2.js} +1 -2
  37. package/lib/esm/{Wistia-eef03ce2.js → Wistia-24fb5120.js} +1 -2
  38. package/lib/esm/{YouTube-e030042e.js → YouTube-01b3e51f.js} +1 -2
  39. package/lib/esm/components/Footer/Footer.js +21 -0
  40. package/lib/esm/components/Footer/index.js +12 -0
  41. package/lib/esm/components/LocalNav/LocalNav.js +100 -0
  42. package/lib/esm/components/LocalNav/index.js +8 -0
  43. package/lib/esm/components/Video/Video.js +1 -3
  44. package/lib/esm/components/Video/VideoPlayer.js +9 -1448
  45. package/lib/esm/components/Video/index.js +1 -3
  46. package/lib/esm/components/index.js +4 -4
  47. package/lib/esm/index.js +3 -3
  48. package/lib/types/react/src/components/ContextMenu/ContextMenu.props.d.ts +1 -2
  49. package/lib/types/react/src/components/Footer/Footer.d.ts +4 -0
  50. package/lib/types/react/src/components/Footer/Footer.props.d.ts +70 -0
  51. package/lib/types/react/src/components/Footer/index.d.ts +1 -0
  52. package/lib/types/react/src/components/LinkList/LinkList.props.d.ts +2 -3
  53. package/lib/types/react/src/components/LocalNav/LocalNav.d.ts +4 -0
  54. package/lib/types/react/src/components/LocalNav/LocalNav.props.d.ts +50 -0
  55. package/lib/types/react/src/components/LocalNav/index.d.ts +1 -0
  56. package/lib/types/react/src/components/index.d.ts +2 -0
  57. package/lib/types/react/src/types/index.d.ts +1 -0
  58. package/package.json +4 -4
  59. package/src/components/ContextMenu/ContextMenu.props.ts +1 -1
  60. package/src/components/Footer/Footer.args.ts +105 -0
  61. package/src/components/Footer/Footer.props.ts +84 -0
  62. package/src/components/Footer/Footer.tsx +107 -0
  63. package/src/components/Footer/index.ts +1 -0
  64. package/src/components/LinkList/LinkList.props.ts +2 -2
  65. package/src/components/LocalNav/LocalNav.args.ts +64 -0
  66. package/src/components/LocalNav/LocalNav.props.ts +60 -0
  67. package/src/components/LocalNav/LocalNav.tsx +175 -0
  68. package/src/components/LocalNav/index.ts +1 -0
  69. package/src/components/index.ts +2 -0
  70. package/src/types/index.ts +1 -0
  71. package/lib/cjs/_commonjsHelpers-9f9f50a8.js +0 -39
  72. package/lib/cjs/patterns-975adf3c.js +0 -579
  73. package/lib/esm/_commonjsHelpers-849bcf65.js +0 -35
  74. package/lib/esm/patterns-53247c1d.js +0 -575
@@ -0,0 +1,2059 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var require$$0 = require('react');
5
+ var index = require('./index-1b6434f0.js');
6
+ var ReactDOM = require('react-dom');
7
+ var classNames = require('classnames');
8
+ var hooks_useGlobalSettings = require('./hooks/useGlobalSettings.js');
9
+ var utils_hoursMinutesSeconds = require('./utils/hoursMinutesSeconds.js');
10
+ var screenfull = require('screenfull');
11
+
12
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
13
+
14
+ function getDefaultExportFromCjs (x) {
15
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
16
+ }
17
+
18
+ function getAugmentedNamespace(n) {
19
+ if (n.__esModule) return n;
20
+ var f = n.default;
21
+ if (typeof f == "function") {
22
+ var a = function a () {
23
+ if (this instanceof a) {
24
+ var args = [null];
25
+ args.push.apply(args, arguments);
26
+ var Ctor = Function.bind.apply(f, args);
27
+ return new Ctor();
28
+ }
29
+ return f.apply(this, arguments);
30
+ };
31
+ a.prototype = f.prototype;
32
+ } else a = {};
33
+ Object.defineProperty(a, '__esModule', {value: true});
34
+ Object.keys(n).forEach(function (k) {
35
+ var d = Object.getOwnPropertyDescriptor(n, k);
36
+ Object.defineProperty(a, k, d.get ? d : {
37
+ enumerable: true,
38
+ get: function () {
39
+ return n[k];
40
+ }
41
+ });
42
+ });
43
+ return a;
44
+ }
45
+
46
+ var lazy = {};
47
+
48
+ var players = {};
49
+
50
+ var utils = {};
51
+
52
+ var loadScript = function load (src, opts, cb) {
53
+ var head = document.head || document.getElementsByTagName('head')[0];
54
+ var script = document.createElement('script');
55
+
56
+ if (typeof opts === 'function') {
57
+ cb = opts;
58
+ opts = {};
59
+ }
60
+
61
+ opts = opts || {};
62
+ cb = cb || function() {};
63
+
64
+ script.type = opts.type || 'text/javascript';
65
+ script.charset = opts.charset || 'utf8';
66
+ script.async = 'async' in opts ? !!opts.async : true;
67
+ script.src = src;
68
+
69
+ if (opts.attrs) {
70
+ setAttributes(script, opts.attrs);
71
+ }
72
+
73
+ if (opts.text) {
74
+ script.text = '' + opts.text;
75
+ }
76
+
77
+ var onend = 'onload' in script ? stdOnEnd : ieOnEnd;
78
+ onend(script, cb);
79
+
80
+ // some good legacy browsers (firefox) fail the 'in' detection above
81
+ // so as a fallback we always set onload
82
+ // old IE will ignore this and new IE will set onload
83
+ if (!script.onload) {
84
+ stdOnEnd(script, cb);
85
+ }
86
+
87
+ head.appendChild(script);
88
+ };
89
+
90
+ function setAttributes(script, attrs) {
91
+ for (var attr in attrs) {
92
+ script.setAttribute(attr, attrs[attr]);
93
+ }
94
+ }
95
+
96
+ function stdOnEnd (script, cb) {
97
+ script.onload = function () {
98
+ this.onerror = this.onload = null;
99
+ cb(null, script);
100
+ };
101
+ script.onerror = function () {
102
+ // this.onload = null here is necessary
103
+ // because even IE9 works not like others
104
+ this.onerror = this.onload = null;
105
+ cb(new Error('Failed to load ' + this.src), script);
106
+ };
107
+ }
108
+
109
+ function ieOnEnd (script, cb) {
110
+ script.onreadystatechange = function () {
111
+ if (this.readyState != 'complete' && this.readyState != 'loaded') return
112
+ this.onreadystatechange = null;
113
+ cb(null, script); // there is no way to catch loading errors in IE8
114
+ };
115
+ }
116
+
117
+ var isMergeableObject = function isMergeableObject(value) {
118
+ return isNonNullObject(value)
119
+ && !isSpecial(value)
120
+ };
121
+
122
+ function isNonNullObject(value) {
123
+ return !!value && typeof value === 'object'
124
+ }
125
+
126
+ function isSpecial(value) {
127
+ var stringValue = Object.prototype.toString.call(value);
128
+
129
+ return stringValue === '[object RegExp]'
130
+ || stringValue === '[object Date]'
131
+ || isReactElement(value)
132
+ }
133
+
134
+ // see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25
135
+ var canUseSymbol = typeof Symbol === 'function' && Symbol.for;
136
+ var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 0xeac7;
137
+
138
+ function isReactElement(value) {
139
+ return value.$$typeof === REACT_ELEMENT_TYPE
140
+ }
141
+
142
+ function emptyTarget(val) {
143
+ return Array.isArray(val) ? [] : {}
144
+ }
145
+
146
+ function cloneUnlessOtherwiseSpecified(value, options) {
147
+ return (options.clone !== false && options.isMergeableObject(value))
148
+ ? deepmerge(emptyTarget(value), value, options)
149
+ : value
150
+ }
151
+
152
+ function defaultArrayMerge(target, source, options) {
153
+ return target.concat(source).map(function(element) {
154
+ return cloneUnlessOtherwiseSpecified(element, options)
155
+ })
156
+ }
157
+
158
+ function getMergeFunction(key, options) {
159
+ if (!options.customMerge) {
160
+ return deepmerge
161
+ }
162
+ var customMerge = options.customMerge(key);
163
+ return typeof customMerge === 'function' ? customMerge : deepmerge
164
+ }
165
+
166
+ function getEnumerableOwnPropertySymbols(target) {
167
+ return Object.getOwnPropertySymbols
168
+ ? Object.getOwnPropertySymbols(target).filter(function(symbol) {
169
+ return Object.propertyIsEnumerable.call(target, symbol)
170
+ })
171
+ : []
172
+ }
173
+
174
+ function getKeys(target) {
175
+ return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target))
176
+ }
177
+
178
+ function propertyIsOnObject(object, property) {
179
+ try {
180
+ return property in object
181
+ } catch(_) {
182
+ return false
183
+ }
184
+ }
185
+
186
+ // Protects from prototype poisoning and unexpected merging up the prototype chain.
187
+ function propertyIsUnsafe(target, key) {
188
+ return propertyIsOnObject(target, key) // Properties are safe to merge if they don't exist in the target yet,
189
+ && !(Object.hasOwnProperty.call(target, key) // unsafe if they exist up the prototype chain,
190
+ && Object.propertyIsEnumerable.call(target, key)) // and also unsafe if they're nonenumerable.
191
+ }
192
+
193
+ function mergeObject(target, source, options) {
194
+ var destination = {};
195
+ if (options.isMergeableObject(target)) {
196
+ getKeys(target).forEach(function(key) {
197
+ destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
198
+ });
199
+ }
200
+ getKeys(source).forEach(function(key) {
201
+ if (propertyIsUnsafe(target, key)) {
202
+ return
203
+ }
204
+
205
+ if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {
206
+ destination[key] = getMergeFunction(key, options)(target[key], source[key], options);
207
+ } else {
208
+ destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
209
+ }
210
+ });
211
+ return destination
212
+ }
213
+
214
+ function deepmerge(target, source, options) {
215
+ options = options || {};
216
+ options.arrayMerge = options.arrayMerge || defaultArrayMerge;
217
+ options.isMergeableObject = options.isMergeableObject || isMergeableObject;
218
+ // cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge()
219
+ // implementations can use it. The caller may not replace it.
220
+ options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;
221
+
222
+ var sourceIsArray = Array.isArray(source);
223
+ var targetIsArray = Array.isArray(target);
224
+ var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
225
+
226
+ if (!sourceAndTargetTypesMatch) {
227
+ return cloneUnlessOtherwiseSpecified(source, options)
228
+ } else if (sourceIsArray) {
229
+ return options.arrayMerge(target, source, options)
230
+ } else {
231
+ return mergeObject(target, source, options)
232
+ }
233
+ }
234
+
235
+ deepmerge.all = function deepmergeAll(array, options) {
236
+ if (!Array.isArray(array)) {
237
+ throw new Error('first argument should be an array')
238
+ }
239
+
240
+ return array.reduce(function(prev, next) {
241
+ return deepmerge(prev, next, options)
242
+ }, {})
243
+ };
244
+
245
+ var deepmerge_1 = deepmerge;
246
+
247
+ var cjs = deepmerge_1;
248
+
249
+ Object.defineProperty(utils, "__esModule", {
250
+ value: true
251
+ });
252
+ utils.parseStartTime = parseStartTime;
253
+ utils.parseEndTime = parseEndTime;
254
+ utils.randomString = randomString;
255
+ utils.queryString = queryString;
256
+ utils.getSDK = getSDK;
257
+ utils.getConfig = getConfig;
258
+ utils.omit = omit;
259
+ utils.callPlayer = callPlayer;
260
+ utils.isMediaStream = isMediaStream;
261
+ utils.isBlobUrl = isBlobUrl;
262
+ utils.supportsWebKitPresentationMode = supportsWebKitPresentationMode;
263
+
264
+ var _loadScript = _interopRequireDefault$2(loadScript);
265
+
266
+ var _deepmerge$1 = _interopRequireDefault$2(cjs);
267
+
268
+ function _interopRequireDefault$2(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
269
+
270
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray$2(arr, i) || _nonIterableRest(); }
271
+
272
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
273
+
274
+ function _unsupportedIterableToArray$2(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$2(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$2(o, minLen); }
275
+
276
+ function _arrayLikeToArray$2(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
277
+
278
+ function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
279
+
280
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
281
+
282
+ var MATCH_START_QUERY = /[?&#](?:start|t)=([0-9hms]+)/;
283
+ var MATCH_END_QUERY = /[?&#]end=([0-9hms]+)/;
284
+ var MATCH_START_STAMP = /(\d+)(h|m|s)/g;
285
+ var MATCH_NUMERIC = /^\d+$/; // Parse YouTube URL for a start time param, ie ?t=1h14m30s
286
+ // and return the start time in seconds
287
+
288
+ function parseTimeParam(url, pattern) {
289
+ if (url instanceof Array) {
290
+ return undefined;
291
+ }
292
+
293
+ var match = url.match(pattern);
294
+
295
+ if (match) {
296
+ var stamp = match[1];
297
+
298
+ if (stamp.match(MATCH_START_STAMP)) {
299
+ return parseTimeString(stamp);
300
+ }
301
+
302
+ if (MATCH_NUMERIC.test(stamp)) {
303
+ return parseInt(stamp);
304
+ }
305
+ }
306
+
307
+ return undefined;
308
+ }
309
+
310
+ function parseTimeString(stamp) {
311
+ var seconds = 0;
312
+ var array = MATCH_START_STAMP.exec(stamp);
313
+
314
+ while (array !== null) {
315
+ var _array = array,
316
+ _array2 = _slicedToArray(_array, 3),
317
+ count = _array2[1],
318
+ period = _array2[2];
319
+
320
+ if (period === 'h') seconds += parseInt(count, 10) * 60 * 60;
321
+ if (period === 'm') seconds += parseInt(count, 10) * 60;
322
+ if (period === 's') seconds += parseInt(count, 10);
323
+ array = MATCH_START_STAMP.exec(stamp);
324
+ }
325
+
326
+ return seconds;
327
+ }
328
+
329
+ function parseStartTime(url) {
330
+ return parseTimeParam(url, MATCH_START_QUERY);
331
+ }
332
+
333
+ function parseEndTime(url) {
334
+ return parseTimeParam(url, MATCH_END_QUERY);
335
+ } // http://stackoverflow.com/a/38622545
336
+
337
+
338
+ function randomString() {
339
+ return Math.random().toString(36).substr(2, 5);
340
+ }
341
+
342
+ function queryString(object) {
343
+ return Object.keys(object).map(function (key) {
344
+ return "".concat(key, "=").concat(object[key]);
345
+ }).join('&');
346
+ }
347
+
348
+ function getGlobal(key) {
349
+ if (window[key]) {
350
+ return window[key];
351
+ }
352
+
353
+ if (window.exports && window.exports[key]) {
354
+ return window.exports[key];
355
+ }
356
+
357
+ if (window.module && window.module.exports && window.module.exports[key]) {
358
+ return window.module.exports[key];
359
+ }
360
+
361
+ return null;
362
+ } // Util function to load an external SDK
363
+ // or return the SDK if it is already loaded
364
+
365
+
366
+ var requests = {};
367
+
368
+ function getSDK(url, sdkGlobal) {
369
+ var sdkReady = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
370
+ var isLoaded = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : function () {
371
+ return true;
372
+ };
373
+ var fetchScript = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : _loadScript["default"];
374
+ var existingGlobal = getGlobal(sdkGlobal);
375
+
376
+ if (existingGlobal && isLoaded(existingGlobal)) {
377
+ return Promise.resolve(existingGlobal);
378
+ }
379
+
380
+ return new Promise(function (resolve, reject) {
381
+ // If we are already loading the SDK, add the resolve and reject
382
+ // functions to the existing array of requests
383
+ if (requests[url]) {
384
+ requests[url].push({
385
+ resolve: resolve,
386
+ reject: reject
387
+ });
388
+ return;
389
+ }
390
+
391
+ requests[url] = [{
392
+ resolve: resolve,
393
+ reject: reject
394
+ }];
395
+
396
+ var onLoaded = function onLoaded(sdk) {
397
+ // When loaded, resolve all pending request promises
398
+ requests[url].forEach(function (request) {
399
+ return request.resolve(sdk);
400
+ });
401
+ };
402
+
403
+ if (sdkReady) {
404
+ var previousOnReady = window[sdkReady];
405
+
406
+ window[sdkReady] = function () {
407
+ if (previousOnReady) previousOnReady();
408
+ onLoaded(getGlobal(sdkGlobal));
409
+ };
410
+ }
411
+
412
+ fetchScript(url, function (err) {
413
+ if (err) {
414
+ // Loading the SDK failed – reject all requests and
415
+ // reset the array of requests for this SDK
416
+ requests[url].forEach(function (request) {
417
+ return request.reject(err);
418
+ });
419
+ requests[url] = null;
420
+ } else if (!sdkReady) {
421
+ onLoaded(getGlobal(sdkGlobal));
422
+ }
423
+ });
424
+ });
425
+ }
426
+
427
+ function getConfig(props, defaultProps) {
428
+ return (0, _deepmerge$1["default"])(defaultProps.config, props.config);
429
+ }
430
+
431
+ function omit(object) {
432
+ var _ref;
433
+
434
+ for (var _len = arguments.length, arrays = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
435
+ arrays[_key - 1] = arguments[_key];
436
+ }
437
+
438
+ var omitKeys = (_ref = []).concat.apply(_ref, arrays);
439
+
440
+ var output = {};
441
+ var keys = Object.keys(object);
442
+
443
+ for (var _i2 = 0, _keys = keys; _i2 < _keys.length; _i2++) {
444
+ var key = _keys[_i2];
445
+
446
+ if (omitKeys.indexOf(key) === -1) {
447
+ output[key] = object[key];
448
+ }
449
+ }
450
+
451
+ return output;
452
+ }
453
+
454
+ function callPlayer(method) {
455
+ var _this$player;
456
+
457
+ // Util method for calling a method on this.player
458
+ // but guard against errors and console.warn instead
459
+ if (!this.player || !this.player[method]) {
460
+ var message = "ReactPlayer: ".concat(this.constructor.displayName, " player could not call %c").concat(method, "%c \u2013 ");
461
+
462
+ if (!this.player) {
463
+ message += 'The player was not available';
464
+ } else if (!this.player[method]) {
465
+ message += 'The method was not available';
466
+ }
467
+
468
+ console.warn(message, 'font-weight: bold', '');
469
+ return null;
470
+ }
471
+
472
+ for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
473
+ args[_key2 - 1] = arguments[_key2];
474
+ }
475
+
476
+ return (_this$player = this.player)[method].apply(_this$player, args);
477
+ }
478
+
479
+ function isMediaStream(url) {
480
+ return typeof window !== 'undefined' && typeof window.MediaStream !== 'undefined' && url instanceof window.MediaStream;
481
+ }
482
+
483
+ function isBlobUrl(url) {
484
+ return /^blob:/.test(url);
485
+ }
486
+
487
+ function supportsWebKitPresentationMode() {
488
+ var video = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document.createElement('video');
489
+ // Check if Safari supports PiP, and is not on mobile (other than iPad)
490
+ // iPhone safari appears to "support" PiP through the check, however PiP does not function
491
+ var notMobile = /iPhone|iPod/.test(navigator.userAgent) === false;
492
+ return video.webkitSupportsPresentationMode && typeof video.webkitSetPresentationMode === 'function' && notMobile;
493
+ }
494
+
495
+ var patterns = {};
496
+
497
+ Object.defineProperty(patterns, "__esModule", {
498
+ value: true
499
+ });
500
+ patterns.canPlay = patterns.FLV_EXTENSIONS = patterns.DASH_EXTENSIONS = patterns.HLS_EXTENSIONS = patterns.VIDEO_EXTENSIONS = patterns.AUDIO_EXTENSIONS = patterns.MATCH_URL_KALTURA = patterns.MATCH_URL_VIDYARD = patterns.MATCH_URL_MIXCLOUD = patterns.MATCH_URL_DAILYMOTION = patterns.MATCH_URL_TWITCH_CHANNEL = patterns.MATCH_URL_TWITCH_VIDEO = patterns.MATCH_URL_WISTIA = patterns.MATCH_URL_STREAMABLE = patterns.MATCH_URL_FACEBOOK_WATCH = patterns.MATCH_URL_FACEBOOK = patterns.MATCH_URL_VIMEO = patterns.MATCH_URL_SOUNDCLOUD = patterns.MATCH_URL_YOUTUBE = void 0;
501
+
502
+ var _utils$1 = utils;
503
+
504
+ function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray$1(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
505
+
506
+ function _unsupportedIterableToArray$1(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$1(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$1(o, minLen); }
507
+
508
+ function _arrayLikeToArray$1(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
509
+
510
+ var MATCH_URL_YOUTUBE = /(?:youtu\.be\/|youtube(?:-nocookie)?\.com\/(?:embed\/|v\/|watch\/|watch\?v=|watch\?.+&v=|shorts\/))((\w|-){11})|youtube\.com\/playlist\?list=|youtube\.com\/user\//;
511
+ patterns.MATCH_URL_YOUTUBE = MATCH_URL_YOUTUBE;
512
+ var MATCH_URL_SOUNDCLOUD = /(?:soundcloud\.com|snd\.sc)\/[^.]+$/;
513
+ patterns.MATCH_URL_SOUNDCLOUD = MATCH_URL_SOUNDCLOUD;
514
+ var MATCH_URL_VIMEO = /vimeo\.com\/(?!progressive_redirect).+/;
515
+ patterns.MATCH_URL_VIMEO = MATCH_URL_VIMEO;
516
+ var MATCH_URL_FACEBOOK = /^https?:\/\/(www\.)?facebook\.com.*\/(video(s)?|watch|story)(\.php?|\/).+$/;
517
+ patterns.MATCH_URL_FACEBOOK = MATCH_URL_FACEBOOK;
518
+ var MATCH_URL_FACEBOOK_WATCH = /^https?:\/\/fb\.watch\/.+$/;
519
+ patterns.MATCH_URL_FACEBOOK_WATCH = MATCH_URL_FACEBOOK_WATCH;
520
+ var MATCH_URL_STREAMABLE = /streamable\.com\/([a-z0-9]+)$/;
521
+ patterns.MATCH_URL_STREAMABLE = MATCH_URL_STREAMABLE;
522
+ var MATCH_URL_WISTIA = /(?:wistia\.(?:com|net)|wi\.st)\/(?:medias|embed)\/(?:iframe\/)?(.*)$/;
523
+ patterns.MATCH_URL_WISTIA = MATCH_URL_WISTIA;
524
+ var MATCH_URL_TWITCH_VIDEO = /(?:www\.|go\.)?twitch\.tv\/videos\/(\d+)($|\?)/;
525
+ patterns.MATCH_URL_TWITCH_VIDEO = MATCH_URL_TWITCH_VIDEO;
526
+ var MATCH_URL_TWITCH_CHANNEL = /(?:www\.|go\.)?twitch\.tv\/([a-zA-Z0-9_]+)($|\?)/;
527
+ patterns.MATCH_URL_TWITCH_CHANNEL = MATCH_URL_TWITCH_CHANNEL;
528
+ var MATCH_URL_DAILYMOTION = /^(?:(?:https?):)?(?:\/\/)?(?:www\.)?(?:(?:dailymotion\.com(?:\/embed)?\/video)|dai\.ly)\/([a-zA-Z0-9]+)(?:_[\w_-]+)?$/;
529
+ patterns.MATCH_URL_DAILYMOTION = MATCH_URL_DAILYMOTION;
530
+ var MATCH_URL_MIXCLOUD = /mixcloud\.com\/([^/]+\/[^/]+)/;
531
+ patterns.MATCH_URL_MIXCLOUD = MATCH_URL_MIXCLOUD;
532
+ var MATCH_URL_VIDYARD = /vidyard.com\/(?:watch\/)?([a-zA-Z0-9-_]+)/;
533
+ patterns.MATCH_URL_VIDYARD = MATCH_URL_VIDYARD;
534
+ var MATCH_URL_KALTURA = /^https?:\/\/[a-zA-Z]+\.kaltura.(com|org)\/p\/([0-9]+)\/sp\/([0-9]+)00\/embedIframeJs\/uiconf_id\/([0-9]+)\/partner_id\/([0-9]+)(.*)entry_id.([a-zA-Z0-9-_].*)$/;
535
+ patterns.MATCH_URL_KALTURA = MATCH_URL_KALTURA;
536
+ var AUDIO_EXTENSIONS = /\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx)($|\?)/i;
537
+ patterns.AUDIO_EXTENSIONS = AUDIO_EXTENSIONS;
538
+ var VIDEO_EXTENSIONS = /\.(mp4|og[gv]|webm|mov|m4v)(#t=[,\d+]+)?($|\?)/i;
539
+ patterns.VIDEO_EXTENSIONS = VIDEO_EXTENSIONS;
540
+ var HLS_EXTENSIONS = /\.(m3u8)($|\?)/i;
541
+ patterns.HLS_EXTENSIONS = HLS_EXTENSIONS;
542
+ var DASH_EXTENSIONS = /\.(mpd)($|\?)/i;
543
+ patterns.DASH_EXTENSIONS = DASH_EXTENSIONS;
544
+ var FLV_EXTENSIONS = /\.(flv)($|\?)/i;
545
+ patterns.FLV_EXTENSIONS = FLV_EXTENSIONS;
546
+
547
+ var canPlayFile = function canPlayFile(url) {
548
+ if (url instanceof Array) {
549
+ var _iterator = _createForOfIteratorHelper(url),
550
+ _step;
551
+
552
+ try {
553
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
554
+ var item = _step.value;
555
+
556
+ if (typeof item === 'string' && canPlayFile(item)) {
557
+ return true;
558
+ }
559
+
560
+ if (canPlayFile(item.src)) {
561
+ return true;
562
+ }
563
+ }
564
+ } catch (err) {
565
+ _iterator.e(err);
566
+ } finally {
567
+ _iterator.f();
568
+ }
569
+
570
+ return false;
571
+ }
572
+
573
+ if ((0, _utils$1.isMediaStream)(url) || (0, _utils$1.isBlobUrl)(url)) {
574
+ return true;
575
+ }
576
+
577
+ return AUDIO_EXTENSIONS.test(url) || VIDEO_EXTENSIONS.test(url) || HLS_EXTENSIONS.test(url) || DASH_EXTENSIONS.test(url) || FLV_EXTENSIONS.test(url);
578
+ };
579
+
580
+ var canPlay = {
581
+ youtube: function youtube(url) {
582
+ if (url instanceof Array) {
583
+ return url.every(function (item) {
584
+ return MATCH_URL_YOUTUBE.test(item);
585
+ });
586
+ }
587
+
588
+ return MATCH_URL_YOUTUBE.test(url);
589
+ },
590
+ soundcloud: function soundcloud(url) {
591
+ return MATCH_URL_SOUNDCLOUD.test(url) && !AUDIO_EXTENSIONS.test(url);
592
+ },
593
+ vimeo: function vimeo(url) {
594
+ return MATCH_URL_VIMEO.test(url) && !VIDEO_EXTENSIONS.test(url) && !HLS_EXTENSIONS.test(url);
595
+ },
596
+ facebook: function facebook(url) {
597
+ return MATCH_URL_FACEBOOK.test(url) || MATCH_URL_FACEBOOK_WATCH.test(url);
598
+ },
599
+ streamable: function streamable(url) {
600
+ return MATCH_URL_STREAMABLE.test(url);
601
+ },
602
+ wistia: function wistia(url) {
603
+ return MATCH_URL_WISTIA.test(url);
604
+ },
605
+ twitch: function twitch(url) {
606
+ return MATCH_URL_TWITCH_VIDEO.test(url) || MATCH_URL_TWITCH_CHANNEL.test(url);
607
+ },
608
+ dailymotion: function dailymotion(url) {
609
+ return MATCH_URL_DAILYMOTION.test(url);
610
+ },
611
+ mixcloud: function mixcloud(url) {
612
+ return MATCH_URL_MIXCLOUD.test(url);
613
+ },
614
+ vidyard: function vidyard(url) {
615
+ return MATCH_URL_VIDYARD.test(url);
616
+ },
617
+ kaltura: function kaltura(url) {
618
+ return MATCH_URL_KALTURA.test(url);
619
+ },
620
+ file: canPlayFile
621
+ };
622
+ patterns.canPlay = canPlay;
623
+
624
+ (function (exports) {
625
+
626
+ Object.defineProperty(exports, "__esModule", {
627
+ value: true
628
+ });
629
+ exports["default"] = void 0;
630
+
631
+ var _react = require$$0;
632
+
633
+ var _utils = utils;
634
+
635
+ var _patterns = patterns;
636
+
637
+ var _default = [{
638
+ key: 'youtube',
639
+ name: 'YouTube',
640
+ canPlay: _patterns.canPlay.youtube,
641
+ lazyPlayer: /*#__PURE__*/(0, _react.lazy)(function () {
642
+ return Promise.resolve().then(function () { return require(
643
+ /* webpackChunkName: 'reactPlayerYouTube' */
644
+ './YouTube-25a1d9a0.js'); }).then(function (n) { return n.YouTube; });
645
+ })
646
+ }, {
647
+ key: 'soundcloud',
648
+ name: 'SoundCloud',
649
+ canPlay: _patterns.canPlay.soundcloud,
650
+ lazyPlayer: /*#__PURE__*/(0, _react.lazy)(function () {
651
+ return Promise.resolve().then(function () { return require(
652
+ /* webpackChunkName: 'reactPlayerSoundCloud' */
653
+ './SoundCloud-7c59f293.js'); }).then(function (n) { return n.SoundCloud; });
654
+ })
655
+ }, {
656
+ key: 'vimeo',
657
+ name: 'Vimeo',
658
+ canPlay: _patterns.canPlay.vimeo,
659
+ lazyPlayer: /*#__PURE__*/(0, _react.lazy)(function () {
660
+ return Promise.resolve().then(function () { return require(
661
+ /* webpackChunkName: 'reactPlayerVimeo' */
662
+ './Vimeo-2cb7476f.js'); }).then(function (n) { return n.Vimeo; });
663
+ })
664
+ }, {
665
+ key: 'facebook',
666
+ name: 'Facebook',
667
+ canPlay: _patterns.canPlay.facebook,
668
+ lazyPlayer: /*#__PURE__*/(0, _react.lazy)(function () {
669
+ return Promise.resolve().then(function () { return require(
670
+ /* webpackChunkName: 'reactPlayerFacebook' */
671
+ './Facebook-87e24af8.js'); }).then(function (n) { return n.Facebook; });
672
+ })
673
+ }, {
674
+ key: 'streamable',
675
+ name: 'Streamable',
676
+ canPlay: _patterns.canPlay.streamable,
677
+ lazyPlayer: /*#__PURE__*/(0, _react.lazy)(function () {
678
+ return Promise.resolve().then(function () { return require(
679
+ /* webpackChunkName: 'reactPlayerStreamable' */
680
+ './Streamable-83e516e5.js'); }).then(function (n) { return n.Streamable; });
681
+ })
682
+ }, {
683
+ key: 'wistia',
684
+ name: 'Wistia',
685
+ canPlay: _patterns.canPlay.wistia,
686
+ lazyPlayer: /*#__PURE__*/(0, _react.lazy)(function () {
687
+ return Promise.resolve().then(function () { return require(
688
+ /* webpackChunkName: 'reactPlayerWistia' */
689
+ './Wistia-5e830ac8.js'); }).then(function (n) { return n.Wistia; });
690
+ })
691
+ }, {
692
+ key: 'twitch',
693
+ name: 'Twitch',
694
+ canPlay: _patterns.canPlay.twitch,
695
+ lazyPlayer: /*#__PURE__*/(0, _react.lazy)(function () {
696
+ return Promise.resolve().then(function () { return require(
697
+ /* webpackChunkName: 'reactPlayerTwitch' */
698
+ './Twitch-fdfa1c77.js'); }).then(function (n) { return n.Twitch; });
699
+ })
700
+ }, {
701
+ key: 'dailymotion',
702
+ name: 'DailyMotion',
703
+ canPlay: _patterns.canPlay.dailymotion,
704
+ lazyPlayer: /*#__PURE__*/(0, _react.lazy)(function () {
705
+ return Promise.resolve().then(function () { return require(
706
+ /* webpackChunkName: 'reactPlayerDailyMotion' */
707
+ './DailyMotion-2aa7f048.js'); }).then(function (n) { return n.DailyMotion; });
708
+ })
709
+ }, {
710
+ key: 'mixcloud',
711
+ name: 'Mixcloud',
712
+ canPlay: _patterns.canPlay.mixcloud,
713
+ lazyPlayer: /*#__PURE__*/(0, _react.lazy)(function () {
714
+ return Promise.resolve().then(function () { return require(
715
+ /* webpackChunkName: 'reactPlayerMixcloud' */
716
+ './Mixcloud-f9575c31.js'); }).then(function (n) { return n.Mixcloud; });
717
+ })
718
+ }, {
719
+ key: 'vidyard',
720
+ name: 'Vidyard',
721
+ canPlay: _patterns.canPlay.vidyard,
722
+ lazyPlayer: /*#__PURE__*/(0, _react.lazy)(function () {
723
+ return Promise.resolve().then(function () { return require(
724
+ /* webpackChunkName: 'reactPlayerVidyard' */
725
+ './Vidyard-096bba3c.js'); }).then(function (n) { return n.Vidyard; });
726
+ })
727
+ }, {
728
+ key: 'kaltura',
729
+ name: 'Kaltura',
730
+ canPlay: _patterns.canPlay.kaltura,
731
+ lazyPlayer: /*#__PURE__*/(0, _react.lazy)(function () {
732
+ return Promise.resolve().then(function () { return require(
733
+ /* webpackChunkName: 'reactPlayerKaltura' */
734
+ './Kaltura-a673a8e9.js'); }).then(function (n) { return n.Kaltura; });
735
+ })
736
+ }, {
737
+ key: 'file',
738
+ name: 'FilePlayer',
739
+ canPlay: _patterns.canPlay.file,
740
+ canEnablePIP: function canEnablePIP(url) {
741
+ return _patterns.canPlay.file(url) && (document.pictureInPictureEnabled || (0, _utils.supportsWebKitPresentationMode)()) && !_patterns.AUDIO_EXTENSIONS.test(url);
742
+ },
743
+ lazyPlayer: /*#__PURE__*/(0, _react.lazy)(function () {
744
+ return Promise.resolve().then(function () { return require(
745
+ /* webpackChunkName: 'reactPlayerFilePlayer' */
746
+ './FilePlayer-e1216cc8.js'); }).then(function (n) { return n.FilePlayer; });
747
+ })
748
+ }];
749
+ exports["default"] = _default;
750
+ } (players));
751
+
752
+ var ReactPlayer$1 = {};
753
+
754
+ var safeIsNaN = Number.isNaN ||
755
+ function ponyfill(value) {
756
+ return typeof value === 'number' && value !== value;
757
+ };
758
+ function isEqual(first, second) {
759
+ if (first === second) {
760
+ return true;
761
+ }
762
+ if (safeIsNaN(first) && safeIsNaN(second)) {
763
+ return true;
764
+ }
765
+ return false;
766
+ }
767
+ function areInputsEqual(newInputs, lastInputs) {
768
+ if (newInputs.length !== lastInputs.length) {
769
+ return false;
770
+ }
771
+ for (var i = 0; i < newInputs.length; i++) {
772
+ if (!isEqual(newInputs[i], lastInputs[i])) {
773
+ return false;
774
+ }
775
+ }
776
+ return true;
777
+ }
778
+
779
+ function memoizeOne(resultFn, isEqual) {
780
+ if (isEqual === void 0) { isEqual = areInputsEqual; }
781
+ var lastThis;
782
+ var lastArgs = [];
783
+ var lastResult;
784
+ var calledOnce = false;
785
+ function memoized() {
786
+ var newArgs = [];
787
+ for (var _i = 0; _i < arguments.length; _i++) {
788
+ newArgs[_i] = arguments[_i];
789
+ }
790
+ if (calledOnce && lastThis === this && isEqual(newArgs, lastArgs)) {
791
+ return lastResult;
792
+ }
793
+ lastResult = resultFn.apply(this, newArgs);
794
+ calledOnce = true;
795
+ lastThis = this;
796
+ lastArgs = newArgs;
797
+ return lastResult;
798
+ }
799
+ return memoized;
800
+ }
801
+
802
+ var memoizeOne_esm = /*#__PURE__*/Object.freeze({
803
+ __proto__: null,
804
+ default: memoizeOne
805
+ });
806
+
807
+ var require$$2 = /*@__PURE__*/getAugmentedNamespace(memoizeOne_esm);
808
+
809
+ /* global Map:readonly, Set:readonly, ArrayBuffer:readonly */
810
+
811
+ var hasElementType = typeof Element !== 'undefined';
812
+ var hasMap = typeof Map === 'function';
813
+ var hasSet = typeof Set === 'function';
814
+ var hasArrayBuffer = typeof ArrayBuffer === 'function' && !!ArrayBuffer.isView;
815
+
816
+ // Note: We **don't** need `envHasBigInt64Array` in fde es6/index.js
817
+
818
+ function equal(a, b) {
819
+ // START: fast-deep-equal es6/index.js 3.1.1
820
+ if (a === b) return true;
821
+
822
+ if (a && b && typeof a == 'object' && typeof b == 'object') {
823
+ if (a.constructor !== b.constructor) return false;
824
+
825
+ var length, i, keys;
826
+ if (Array.isArray(a)) {
827
+ length = a.length;
828
+ if (length != b.length) return false;
829
+ for (i = length; i-- !== 0;)
830
+ if (!equal(a[i], b[i])) return false;
831
+ return true;
832
+ }
833
+
834
+ // START: Modifications:
835
+ // 1. Extra `has<Type> &&` helpers in initial condition allow es6 code
836
+ // to co-exist with es5.
837
+ // 2. Replace `for of` with es5 compliant iteration using `for`.
838
+ // Basically, take:
839
+ //
840
+ // ```js
841
+ // for (i of a.entries())
842
+ // if (!b.has(i[0])) return false;
843
+ // ```
844
+ //
845
+ // ... and convert to:
846
+ //
847
+ // ```js
848
+ // it = a.entries();
849
+ // while (!(i = it.next()).done)
850
+ // if (!b.has(i.value[0])) return false;
851
+ // ```
852
+ //
853
+ // **Note**: `i` access switches to `i.value`.
854
+ var it;
855
+ if (hasMap && (a instanceof Map) && (b instanceof Map)) {
856
+ if (a.size !== b.size) return false;
857
+ it = a.entries();
858
+ while (!(i = it.next()).done)
859
+ if (!b.has(i.value[0])) return false;
860
+ it = a.entries();
861
+ while (!(i = it.next()).done)
862
+ if (!equal(i.value[1], b.get(i.value[0]))) return false;
863
+ return true;
864
+ }
865
+
866
+ if (hasSet && (a instanceof Set) && (b instanceof Set)) {
867
+ if (a.size !== b.size) return false;
868
+ it = a.entries();
869
+ while (!(i = it.next()).done)
870
+ if (!b.has(i.value[0])) return false;
871
+ return true;
872
+ }
873
+ // END: Modifications
874
+
875
+ if (hasArrayBuffer && ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {
876
+ length = a.length;
877
+ if (length != b.length) return false;
878
+ for (i = length; i-- !== 0;)
879
+ if (a[i] !== b[i]) return false;
880
+ return true;
881
+ }
882
+
883
+ if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
884
+ if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
885
+ if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
886
+
887
+ keys = Object.keys(a);
888
+ length = keys.length;
889
+ if (length !== Object.keys(b).length) return false;
890
+
891
+ for (i = length; i-- !== 0;)
892
+ if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
893
+ // END: fast-deep-equal
894
+
895
+ // START: react-fast-compare
896
+ // custom handling for DOM elements
897
+ if (hasElementType && a instanceof Element) return false;
898
+
899
+ // custom handling for React/Preact
900
+ for (i = length; i-- !== 0;) {
901
+ if ((keys[i] === '_owner' || keys[i] === '__v' || keys[i] === '__o') && a.$$typeof) {
902
+ // React-specific: avoid traversing React elements' _owner
903
+ // Preact-specific: avoid traversing Preact elements' __v and __o
904
+ // __v = $_original / $_vnode
905
+ // __o = $_owner
906
+ // These properties contain circular references and are not needed when
907
+ // comparing the actual elements (and not their owners)
908
+ // .$$typeof and ._store on just reasonable markers of elements
909
+
910
+ continue;
911
+ }
912
+
913
+ // all other properties should be traversed as usual
914
+ if (!equal(a[keys[i]], b[keys[i]])) return false;
915
+ }
916
+ // END: react-fast-compare
917
+
918
+ // START: fast-deep-equal
919
+ return true;
920
+ }
921
+
922
+ return a !== a && b !== b;
923
+ }
924
+ // end fast-deep-equal
925
+
926
+ var reactFastCompare = function isEqual(a, b) {
927
+ try {
928
+ return equal(a, b);
929
+ } catch (error) {
930
+ if (((error.message || '').match(/stack|recursion/i))) {
931
+ // warn on circular references, don't crash
932
+ // browsers give this different errors name and messages:
933
+ // chrome/safari: "RangeError", "Maximum call stack size exceeded"
934
+ // firefox: "InternalError", too much recursion"
935
+ // edge: "Error", "Out of stack space"
936
+ console.warn('react-fast-compare cannot handle circular refs');
937
+ return false;
938
+ }
939
+ // some other error. we should definitely know about these
940
+ throw error;
941
+ }
942
+ };
943
+
944
+ var props = {};
945
+
946
+ Object.defineProperty(props, "__esModule", {
947
+ value: true
948
+ });
949
+ props.defaultProps = props.propTypes = void 0;
950
+
951
+ var _propTypes = _interopRequireDefault$1(index.propTypesExports);
952
+
953
+ function _interopRequireDefault$1(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
954
+
955
+ var string = _propTypes["default"].string,
956
+ bool = _propTypes["default"].bool,
957
+ number = _propTypes["default"].number,
958
+ array = _propTypes["default"].array,
959
+ oneOfType = _propTypes["default"].oneOfType,
960
+ shape = _propTypes["default"].shape,
961
+ object = _propTypes["default"].object,
962
+ func = _propTypes["default"].func,
963
+ node = _propTypes["default"].node;
964
+ var propTypes = {
965
+ url: oneOfType([string, array, object]),
966
+ playing: bool,
967
+ loop: bool,
968
+ controls: bool,
969
+ volume: number,
970
+ muted: bool,
971
+ playbackRate: number,
972
+ width: oneOfType([string, number]),
973
+ height: oneOfType([string, number]),
974
+ style: object,
975
+ progressInterval: number,
976
+ playsinline: bool,
977
+ pip: bool,
978
+ stopOnUnmount: bool,
979
+ light: oneOfType([bool, string]),
980
+ playIcon: node,
981
+ previewTabIndex: number,
982
+ fallback: node,
983
+ oEmbedUrl: string,
984
+ wrapper: oneOfType([string, func, shape({
985
+ render: func.isRequired
986
+ })]),
987
+ config: shape({
988
+ soundcloud: shape({
989
+ options: object
990
+ }),
991
+ youtube: shape({
992
+ playerVars: object,
993
+ embedOptions: object,
994
+ onUnstarted: func
995
+ }),
996
+ facebook: shape({
997
+ appId: string,
998
+ version: string,
999
+ playerId: string,
1000
+ attributes: object
1001
+ }),
1002
+ dailymotion: shape({
1003
+ params: object
1004
+ }),
1005
+ vimeo: shape({
1006
+ playerOptions: object,
1007
+ title: string
1008
+ }),
1009
+ file: shape({
1010
+ attributes: object,
1011
+ tracks: array,
1012
+ forceVideo: bool,
1013
+ forceAudio: bool,
1014
+ forceHLS: bool,
1015
+ forceDASH: bool,
1016
+ forceFLV: bool,
1017
+ hlsOptions: object,
1018
+ hlsVersion: string,
1019
+ dashVersion: string,
1020
+ flvVersion: string
1021
+ }),
1022
+ wistia: shape({
1023
+ options: object,
1024
+ playerId: string,
1025
+ customControls: array
1026
+ }),
1027
+ mixcloud: shape({
1028
+ options: object
1029
+ }),
1030
+ twitch: shape({
1031
+ options: object,
1032
+ playerId: string
1033
+ }),
1034
+ vidyard: shape({
1035
+ options: object
1036
+ })
1037
+ }),
1038
+ onReady: func,
1039
+ onStart: func,
1040
+ onPlay: func,
1041
+ onPause: func,
1042
+ onBuffer: func,
1043
+ onBufferEnd: func,
1044
+ onEnded: func,
1045
+ onError: func,
1046
+ onDuration: func,
1047
+ onSeek: func,
1048
+ onPlaybackRateChange: func,
1049
+ onProgress: func,
1050
+ onClickPreview: func,
1051
+ onEnablePIP: func,
1052
+ onDisablePIP: func
1053
+ };
1054
+ props.propTypes = propTypes;
1055
+
1056
+ var noop = function noop() {};
1057
+
1058
+ var defaultProps = {
1059
+ playing: false,
1060
+ loop: false,
1061
+ controls: false,
1062
+ volume: null,
1063
+ muted: false,
1064
+ playbackRate: 1,
1065
+ width: '640px',
1066
+ height: '360px',
1067
+ style: {},
1068
+ progressInterval: 1000,
1069
+ playsinline: false,
1070
+ pip: false,
1071
+ stopOnUnmount: true,
1072
+ light: false,
1073
+ fallback: null,
1074
+ wrapper: 'div',
1075
+ previewTabIndex: 0,
1076
+ oEmbedUrl: 'https://noembed.com/embed?url={url}',
1077
+ config: {
1078
+ soundcloud: {
1079
+ options: {
1080
+ visual: true,
1081
+ // Undocumented, but makes player fill container and look better
1082
+ buying: false,
1083
+ liking: false,
1084
+ download: false,
1085
+ sharing: false,
1086
+ show_comments: false,
1087
+ show_playcount: false
1088
+ }
1089
+ },
1090
+ youtube: {
1091
+ playerVars: {
1092
+ playsinline: 1,
1093
+ showinfo: 0,
1094
+ rel: 0,
1095
+ iv_load_policy: 3,
1096
+ modestbranding: 1
1097
+ },
1098
+ embedOptions: {},
1099
+ onUnstarted: noop
1100
+ },
1101
+ facebook: {
1102
+ appId: '1309697205772819',
1103
+ version: 'v3.3',
1104
+ playerId: null,
1105
+ attributes: {}
1106
+ },
1107
+ dailymotion: {
1108
+ params: {
1109
+ api: 1,
1110
+ 'endscreen-enable': false
1111
+ }
1112
+ },
1113
+ vimeo: {
1114
+ playerOptions: {
1115
+ autopause: false,
1116
+ byline: false,
1117
+ portrait: false,
1118
+ title: false
1119
+ },
1120
+ title: null
1121
+ },
1122
+ file: {
1123
+ attributes: {},
1124
+ tracks: [],
1125
+ forceVideo: false,
1126
+ forceAudio: false,
1127
+ forceHLS: false,
1128
+ forceDASH: false,
1129
+ forceFLV: false,
1130
+ hlsOptions: {},
1131
+ hlsVersion: '1.1.4',
1132
+ dashVersion: '3.1.3',
1133
+ flvVersion: '1.5.0'
1134
+ },
1135
+ wistia: {
1136
+ options: {},
1137
+ playerId: null,
1138
+ customControls: null
1139
+ },
1140
+ mixcloud: {
1141
+ options: {
1142
+ hide_cover: 1
1143
+ }
1144
+ },
1145
+ twitch: {
1146
+ options: {},
1147
+ playerId: null
1148
+ },
1149
+ vidyard: {
1150
+ options: {}
1151
+ }
1152
+ },
1153
+ onReady: noop,
1154
+ onStart: noop,
1155
+ onPlay: noop,
1156
+ onPause: noop,
1157
+ onBuffer: noop,
1158
+ onBufferEnd: noop,
1159
+ onEnded: noop,
1160
+ onError: noop,
1161
+ onDuration: noop,
1162
+ onSeek: noop,
1163
+ onPlaybackRateChange: noop,
1164
+ onProgress: noop,
1165
+ onClickPreview: noop,
1166
+ onEnablePIP: noop,
1167
+ onDisablePIP: noop
1168
+ };
1169
+ props.defaultProps = defaultProps;
1170
+
1171
+ var Player = {};
1172
+
1173
+ (function (exports) {
1174
+
1175
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
1176
+
1177
+ Object.defineProperty(exports, "__esModule", {
1178
+ value: true
1179
+ });
1180
+ exports["default"] = void 0;
1181
+
1182
+ var _react = _interopRequireWildcard(require$$0);
1183
+
1184
+ var _reactFastCompare = _interopRequireDefault(reactFastCompare);
1185
+
1186
+ var _props = props;
1187
+
1188
+ var _utils = utils;
1189
+
1190
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
1191
+
1192
+ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
1193
+
1194
+ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
1195
+
1196
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
1197
+
1198
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1199
+
1200
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
1201
+
1202
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
1203
+
1204
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
1205
+
1206
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
1207
+
1208
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
1209
+
1210
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
1211
+
1212
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
1213
+
1214
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
1215
+
1216
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
1217
+
1218
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
1219
+
1220
+ var SEEK_ON_PLAY_EXPIRY = 5000;
1221
+
1222
+ var Player = /*#__PURE__*/function (_Component) {
1223
+ _inherits(Player, _Component);
1224
+
1225
+ var _super = _createSuper(Player);
1226
+
1227
+ function Player() {
1228
+ var _this;
1229
+
1230
+ _classCallCheck(this, Player);
1231
+
1232
+ for (var _len = arguments.length, _args = new Array(_len), _key = 0; _key < _len; _key++) {
1233
+ _args[_key] = arguments[_key];
1234
+ }
1235
+
1236
+ _this = _super.call.apply(_super, [this].concat(_args));
1237
+
1238
+ _defineProperty(_assertThisInitialized(_this), "mounted", false);
1239
+
1240
+ _defineProperty(_assertThisInitialized(_this), "isReady", false);
1241
+
1242
+ _defineProperty(_assertThisInitialized(_this), "isPlaying", false);
1243
+
1244
+ _defineProperty(_assertThisInitialized(_this), "isLoading", true);
1245
+
1246
+ _defineProperty(_assertThisInitialized(_this), "loadOnReady", null);
1247
+
1248
+ _defineProperty(_assertThisInitialized(_this), "startOnPlay", true);
1249
+
1250
+ _defineProperty(_assertThisInitialized(_this), "seekOnPlay", null);
1251
+
1252
+ _defineProperty(_assertThisInitialized(_this), "onDurationCalled", false);
1253
+
1254
+ _defineProperty(_assertThisInitialized(_this), "handlePlayerMount", function (player) {
1255
+ if (_this.player) return; // Prevent loading twice in strict mode
1256
+
1257
+ _this.player = player;
1258
+
1259
+ _this.player.load(_this.props.url);
1260
+
1261
+ _this.progress();
1262
+ });
1263
+
1264
+ _defineProperty(_assertThisInitialized(_this), "getInternalPlayer", function (key) {
1265
+ if (!_this.player) return null;
1266
+ return _this.player[key];
1267
+ });
1268
+
1269
+ _defineProperty(_assertThisInitialized(_this), "progress", function () {
1270
+ if (_this.props.url && _this.player && _this.isReady) {
1271
+ var playedSeconds = _this.getCurrentTime() || 0;
1272
+
1273
+ var loadedSeconds = _this.getSecondsLoaded();
1274
+
1275
+ var duration = _this.getDuration();
1276
+
1277
+ if (duration) {
1278
+ var progress = {
1279
+ playedSeconds: playedSeconds,
1280
+ played: playedSeconds / duration
1281
+ };
1282
+
1283
+ if (loadedSeconds !== null) {
1284
+ progress.loadedSeconds = loadedSeconds;
1285
+ progress.loaded = loadedSeconds / duration;
1286
+ } // Only call onProgress if values have changed
1287
+
1288
+
1289
+ if (progress.playedSeconds !== _this.prevPlayed || progress.loadedSeconds !== _this.prevLoaded) {
1290
+ _this.props.onProgress(progress);
1291
+ }
1292
+
1293
+ _this.prevPlayed = progress.playedSeconds;
1294
+ _this.prevLoaded = progress.loadedSeconds;
1295
+ }
1296
+ }
1297
+
1298
+ _this.progressTimeout = setTimeout(_this.progress, _this.props.progressFrequency || _this.props.progressInterval);
1299
+ });
1300
+
1301
+ _defineProperty(_assertThisInitialized(_this), "handleReady", function () {
1302
+ if (!_this.mounted) return;
1303
+ _this.isReady = true;
1304
+ _this.isLoading = false;
1305
+ var _this$props = _this.props,
1306
+ onReady = _this$props.onReady,
1307
+ playing = _this$props.playing,
1308
+ volume = _this$props.volume,
1309
+ muted = _this$props.muted;
1310
+ onReady();
1311
+
1312
+ if (!muted && volume !== null) {
1313
+ _this.player.setVolume(volume);
1314
+ }
1315
+
1316
+ if (_this.loadOnReady) {
1317
+ _this.player.load(_this.loadOnReady, true);
1318
+
1319
+ _this.loadOnReady = null;
1320
+ } else if (playing) {
1321
+ _this.player.play();
1322
+ }
1323
+
1324
+ _this.handleDurationCheck();
1325
+ });
1326
+
1327
+ _defineProperty(_assertThisInitialized(_this), "handlePlay", function () {
1328
+ _this.isPlaying = true;
1329
+ _this.isLoading = false;
1330
+ var _this$props2 = _this.props,
1331
+ onStart = _this$props2.onStart,
1332
+ onPlay = _this$props2.onPlay,
1333
+ playbackRate = _this$props2.playbackRate;
1334
+
1335
+ if (_this.startOnPlay) {
1336
+ if (_this.player.setPlaybackRate && playbackRate !== 1) {
1337
+ _this.player.setPlaybackRate(playbackRate);
1338
+ }
1339
+
1340
+ onStart();
1341
+ _this.startOnPlay = false;
1342
+ }
1343
+
1344
+ onPlay();
1345
+
1346
+ if (_this.seekOnPlay) {
1347
+ _this.seekTo(_this.seekOnPlay);
1348
+
1349
+ _this.seekOnPlay = null;
1350
+ }
1351
+
1352
+ _this.handleDurationCheck();
1353
+ });
1354
+
1355
+ _defineProperty(_assertThisInitialized(_this), "handlePause", function (e) {
1356
+ _this.isPlaying = false;
1357
+
1358
+ if (!_this.isLoading) {
1359
+ _this.props.onPause(e);
1360
+ }
1361
+ });
1362
+
1363
+ _defineProperty(_assertThisInitialized(_this), "handleEnded", function () {
1364
+ var _this$props3 = _this.props,
1365
+ activePlayer = _this$props3.activePlayer,
1366
+ loop = _this$props3.loop,
1367
+ onEnded = _this$props3.onEnded;
1368
+
1369
+ if (activePlayer.loopOnEnded && loop) {
1370
+ _this.seekTo(0);
1371
+ }
1372
+
1373
+ if (!loop) {
1374
+ _this.isPlaying = false;
1375
+ onEnded();
1376
+ }
1377
+ });
1378
+
1379
+ _defineProperty(_assertThisInitialized(_this), "handleError", function () {
1380
+ var _this$props4;
1381
+
1382
+ _this.isLoading = false;
1383
+
1384
+ (_this$props4 = _this.props).onError.apply(_this$props4, arguments);
1385
+ });
1386
+
1387
+ _defineProperty(_assertThisInitialized(_this), "handleDurationCheck", function () {
1388
+ clearTimeout(_this.durationCheckTimeout);
1389
+
1390
+ var duration = _this.getDuration();
1391
+
1392
+ if (duration) {
1393
+ if (!_this.onDurationCalled) {
1394
+ _this.props.onDuration(duration);
1395
+
1396
+ _this.onDurationCalled = true;
1397
+ }
1398
+ } else {
1399
+ _this.durationCheckTimeout = setTimeout(_this.handleDurationCheck, 100);
1400
+ }
1401
+ });
1402
+
1403
+ _defineProperty(_assertThisInitialized(_this), "handleLoaded", function () {
1404
+ // Sometimes we know loading has stopped but onReady/onPlay are never called
1405
+ // so this provides a way for players to avoid getting stuck
1406
+ _this.isLoading = false;
1407
+ });
1408
+
1409
+ return _this;
1410
+ }
1411
+
1412
+ _createClass(Player, [{
1413
+ key: "componentDidMount",
1414
+ value: function componentDidMount() {
1415
+ this.mounted = true;
1416
+ }
1417
+ }, {
1418
+ key: "componentWillUnmount",
1419
+ value: function componentWillUnmount() {
1420
+ clearTimeout(this.progressTimeout);
1421
+ clearTimeout(this.durationCheckTimeout);
1422
+
1423
+ if (this.isReady && this.props.stopOnUnmount) {
1424
+ this.player.stop();
1425
+
1426
+ if (this.player.disablePIP) {
1427
+ this.player.disablePIP();
1428
+ }
1429
+ }
1430
+
1431
+ this.mounted = false;
1432
+ }
1433
+ }, {
1434
+ key: "componentDidUpdate",
1435
+ value: function componentDidUpdate(prevProps) {
1436
+ var _this2 = this;
1437
+
1438
+ // If there isn’t a player available, don’t do anything
1439
+ if (!this.player) {
1440
+ return;
1441
+ } // Invoke player methods based on changed props
1442
+
1443
+
1444
+ var _this$props5 = this.props,
1445
+ url = _this$props5.url,
1446
+ playing = _this$props5.playing,
1447
+ volume = _this$props5.volume,
1448
+ muted = _this$props5.muted,
1449
+ playbackRate = _this$props5.playbackRate,
1450
+ pip = _this$props5.pip,
1451
+ loop = _this$props5.loop,
1452
+ activePlayer = _this$props5.activePlayer,
1453
+ disableDeferredLoading = _this$props5.disableDeferredLoading;
1454
+
1455
+ if (!(0, _reactFastCompare["default"])(prevProps.url, url)) {
1456
+ if (this.isLoading && !activePlayer.forceLoad && !disableDeferredLoading && !(0, _utils.isMediaStream)(url)) {
1457
+ console.warn("ReactPlayer: the attempt to load ".concat(url, " is being deferred until the player has loaded"));
1458
+ this.loadOnReady = url;
1459
+ return;
1460
+ }
1461
+
1462
+ this.isLoading = true;
1463
+ this.startOnPlay = true;
1464
+ this.onDurationCalled = false;
1465
+ this.player.load(url, this.isReady);
1466
+ }
1467
+
1468
+ if (!prevProps.playing && playing && !this.isPlaying) {
1469
+ this.player.play();
1470
+ }
1471
+
1472
+ if (prevProps.playing && !playing && this.isPlaying) {
1473
+ this.player.pause();
1474
+ }
1475
+
1476
+ if (!prevProps.pip && pip && this.player.enablePIP) {
1477
+ this.player.enablePIP();
1478
+ }
1479
+
1480
+ if (prevProps.pip && !pip && this.player.disablePIP) {
1481
+ this.player.disablePIP();
1482
+ }
1483
+
1484
+ if (prevProps.volume !== volume && volume !== null) {
1485
+ this.player.setVolume(volume);
1486
+ }
1487
+
1488
+ if (prevProps.muted !== muted) {
1489
+ if (muted) {
1490
+ this.player.mute();
1491
+ } else {
1492
+ this.player.unmute();
1493
+
1494
+ if (volume !== null) {
1495
+ // Set volume next tick to fix a bug with DailyMotion
1496
+ setTimeout(function () {
1497
+ return _this2.player.setVolume(volume);
1498
+ });
1499
+ }
1500
+ }
1501
+ }
1502
+
1503
+ if (prevProps.playbackRate !== playbackRate && this.player.setPlaybackRate) {
1504
+ this.player.setPlaybackRate(playbackRate);
1505
+ }
1506
+
1507
+ if (prevProps.loop !== loop && this.player.setLoop) {
1508
+ this.player.setLoop(loop);
1509
+ }
1510
+ }
1511
+ }, {
1512
+ key: "getDuration",
1513
+ value: function getDuration() {
1514
+ if (!this.isReady) return null;
1515
+ return this.player.getDuration();
1516
+ }
1517
+ }, {
1518
+ key: "getCurrentTime",
1519
+ value: function getCurrentTime() {
1520
+ if (!this.isReady) return null;
1521
+ return this.player.getCurrentTime();
1522
+ }
1523
+ }, {
1524
+ key: "getSecondsLoaded",
1525
+ value: function getSecondsLoaded() {
1526
+ if (!this.isReady) return null;
1527
+ return this.player.getSecondsLoaded();
1528
+ }
1529
+ }, {
1530
+ key: "seekTo",
1531
+ value: function seekTo(amount, type) {
1532
+ var _this3 = this;
1533
+
1534
+ // When seeking before player is ready, store value and seek later
1535
+ if (!this.isReady) {
1536
+ if (amount !== 0) {
1537
+ this.seekOnPlay = amount;
1538
+ setTimeout(function () {
1539
+ _this3.seekOnPlay = null;
1540
+ }, SEEK_ON_PLAY_EXPIRY);
1541
+ }
1542
+
1543
+ return;
1544
+ }
1545
+
1546
+ var isFraction = !type ? amount > 0 && amount < 1 : type === 'fraction';
1547
+
1548
+ if (isFraction) {
1549
+ // Convert fraction to seconds based on duration
1550
+ var duration = this.player.getDuration();
1551
+
1552
+ if (!duration) {
1553
+ console.warn('ReactPlayer: could not seek using fraction – duration not yet available');
1554
+ return;
1555
+ }
1556
+
1557
+ this.player.seekTo(duration * amount);
1558
+ return;
1559
+ }
1560
+
1561
+ this.player.seekTo(amount);
1562
+ }
1563
+ }, {
1564
+ key: "render",
1565
+ value: function render() {
1566
+ var Player = this.props.activePlayer;
1567
+
1568
+ if (!Player) {
1569
+ return null;
1570
+ }
1571
+
1572
+ return /*#__PURE__*/_react["default"].createElement(Player, _extends({}, this.props, {
1573
+ onMount: this.handlePlayerMount,
1574
+ onReady: this.handleReady,
1575
+ onPlay: this.handlePlay,
1576
+ onPause: this.handlePause,
1577
+ onEnded: this.handleEnded,
1578
+ onLoaded: this.handleLoaded,
1579
+ onError: this.handleError
1580
+ }));
1581
+ }
1582
+ }]);
1583
+
1584
+ return Player;
1585
+ }(_react.Component);
1586
+
1587
+ exports["default"] = Player;
1588
+
1589
+ _defineProperty(Player, "displayName", 'Player');
1590
+
1591
+ _defineProperty(Player, "propTypes", _props.propTypes);
1592
+
1593
+ _defineProperty(Player, "defaultProps", _props.defaultProps);
1594
+ } (Player));
1595
+
1596
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
1597
+
1598
+ Object.defineProperty(ReactPlayer$1, "__esModule", {
1599
+ value: true
1600
+ });
1601
+ ReactPlayer$1.createReactPlayer = void 0;
1602
+
1603
+ var _react = _interopRequireWildcard(require$$0);
1604
+
1605
+ var _deepmerge = _interopRequireDefault(cjs);
1606
+
1607
+ var _memoizeOne = _interopRequireDefault(require$$2);
1608
+
1609
+ var _reactFastCompare = _interopRequireDefault(reactFastCompare);
1610
+
1611
+ var _props = props;
1612
+
1613
+ var _utils = utils;
1614
+
1615
+ var _Player3 = _interopRequireDefault(Player);
1616
+
1617
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
1618
+
1619
+ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
1620
+
1621
+ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
1622
+
1623
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
1624
+
1625
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
1626
+
1627
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
1628
+
1629
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
1630
+
1631
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
1632
+
1633
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
1634
+
1635
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); }
1636
+
1637
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
1638
+
1639
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
1640
+
1641
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1642
+
1643
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
1644
+
1645
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
1646
+
1647
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
1648
+
1649
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
1650
+
1651
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
1652
+
1653
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
1654
+
1655
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
1656
+
1657
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
1658
+
1659
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
1660
+
1661
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
1662
+
1663
+ var Preview = /*#__PURE__*/(0, _react.lazy)(function () {
1664
+ return Promise.resolve().then(function () { return require(
1665
+ /* webpackChunkName: 'reactPlayerPreview' */
1666
+ './Preview-468c3a7f.js'); }).then(function (n) { return n.Preview; });
1667
+ });
1668
+ var IS_BROWSER = typeof window !== 'undefined' && window.document;
1669
+ var IS_GLOBAL = typeof commonjsGlobal !== 'undefined' && commonjsGlobal.window && commonjsGlobal.window.document;
1670
+ var SUPPORTED_PROPS = Object.keys(_props.propTypes); // Return null when rendering on the server
1671
+ // as Suspense is not supported yet
1672
+
1673
+ var UniversalSuspense = IS_BROWSER || IS_GLOBAL ? _react.Suspense : function () {
1674
+ return null;
1675
+ };
1676
+ var customPlayers = [];
1677
+
1678
+ var createReactPlayer = function createReactPlayer(players, fallback) {
1679
+ var _class, _temp;
1680
+
1681
+ return _temp = _class = /*#__PURE__*/function (_Component) {
1682
+ _inherits(ReactPlayer, _Component);
1683
+
1684
+ var _super = _createSuper(ReactPlayer);
1685
+
1686
+ function ReactPlayer() {
1687
+ var _this;
1688
+
1689
+ _classCallCheck(this, ReactPlayer);
1690
+
1691
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1692
+ args[_key] = arguments[_key];
1693
+ }
1694
+
1695
+ _this = _super.call.apply(_super, [this].concat(args));
1696
+
1697
+ _defineProperty(_assertThisInitialized(_this), "state", {
1698
+ showPreview: !!_this.props.light
1699
+ });
1700
+
1701
+ _defineProperty(_assertThisInitialized(_this), "references", {
1702
+ wrapper: function wrapper(_wrapper) {
1703
+ _this.wrapper = _wrapper;
1704
+ },
1705
+ player: function player(_player) {
1706
+ _this.player = _player;
1707
+ }
1708
+ });
1709
+
1710
+ _defineProperty(_assertThisInitialized(_this), "handleClickPreview", function (e) {
1711
+ _this.setState({
1712
+ showPreview: false
1713
+ });
1714
+
1715
+ _this.props.onClickPreview(e);
1716
+ });
1717
+
1718
+ _defineProperty(_assertThisInitialized(_this), "showPreview", function () {
1719
+ _this.setState({
1720
+ showPreview: true
1721
+ });
1722
+ });
1723
+
1724
+ _defineProperty(_assertThisInitialized(_this), "getDuration", function () {
1725
+ if (!_this.player) return null;
1726
+ return _this.player.getDuration();
1727
+ });
1728
+
1729
+ _defineProperty(_assertThisInitialized(_this), "getCurrentTime", function () {
1730
+ if (!_this.player) return null;
1731
+ return _this.player.getCurrentTime();
1732
+ });
1733
+
1734
+ _defineProperty(_assertThisInitialized(_this), "getSecondsLoaded", function () {
1735
+ if (!_this.player) return null;
1736
+ return _this.player.getSecondsLoaded();
1737
+ });
1738
+
1739
+ _defineProperty(_assertThisInitialized(_this), "getInternalPlayer", function () {
1740
+ var key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'player';
1741
+ if (!_this.player) return null;
1742
+ return _this.player.getInternalPlayer(key);
1743
+ });
1744
+
1745
+ _defineProperty(_assertThisInitialized(_this), "seekTo", function (fraction, type) {
1746
+ if (!_this.player) return null;
1747
+
1748
+ _this.player.seekTo(fraction, type);
1749
+ });
1750
+
1751
+ _defineProperty(_assertThisInitialized(_this), "handleReady", function () {
1752
+ _this.props.onReady(_assertThisInitialized(_this));
1753
+ });
1754
+
1755
+ _defineProperty(_assertThisInitialized(_this), "getActivePlayer", (0, _memoizeOne["default"])(function (url) {
1756
+ for (var _i = 0, _arr = [].concat(customPlayers, _toConsumableArray(players)); _i < _arr.length; _i++) {
1757
+ var player = _arr[_i];
1758
+
1759
+ if (player.canPlay(url)) {
1760
+ return player;
1761
+ }
1762
+ }
1763
+
1764
+ if (fallback) {
1765
+ return fallback;
1766
+ }
1767
+
1768
+ return null;
1769
+ }));
1770
+
1771
+ _defineProperty(_assertThisInitialized(_this), "getConfig", (0, _memoizeOne["default"])(function (url, key) {
1772
+ var config = _this.props.config;
1773
+ return _deepmerge["default"].all([_props.defaultProps.config, _props.defaultProps.config[key] || {}, config, config[key] || {}]);
1774
+ }));
1775
+
1776
+ _defineProperty(_assertThisInitialized(_this), "getAttributes", (0, _memoizeOne["default"])(function (url) {
1777
+ return (0, _utils.omit)(_this.props, SUPPORTED_PROPS);
1778
+ }));
1779
+
1780
+ _defineProperty(_assertThisInitialized(_this), "renderActivePlayer", function (url) {
1781
+ if (!url) return null;
1782
+
1783
+ var player = _this.getActivePlayer(url);
1784
+
1785
+ if (!player) return null;
1786
+
1787
+ var config = _this.getConfig(url, player.key);
1788
+
1789
+ return /*#__PURE__*/_react["default"].createElement(_Player3["default"], _extends({}, _this.props, {
1790
+ key: player.key,
1791
+ ref: _this.references.player,
1792
+ config: config,
1793
+ activePlayer: player.lazyPlayer || player,
1794
+ onReady: _this.handleReady
1795
+ }));
1796
+ });
1797
+
1798
+ return _this;
1799
+ }
1800
+
1801
+ _createClass(ReactPlayer, [{
1802
+ key: "shouldComponentUpdate",
1803
+ value: function shouldComponentUpdate(nextProps, nextState) {
1804
+ return !(0, _reactFastCompare["default"])(this.props, nextProps) || !(0, _reactFastCompare["default"])(this.state, nextState);
1805
+ }
1806
+ }, {
1807
+ key: "componentDidUpdate",
1808
+ value: function componentDidUpdate(prevProps) {
1809
+ var light = this.props.light;
1810
+
1811
+ if (!prevProps.light && light) {
1812
+ this.setState({
1813
+ showPreview: true
1814
+ });
1815
+ }
1816
+
1817
+ if (prevProps.light && !light) {
1818
+ this.setState({
1819
+ showPreview: false
1820
+ });
1821
+ }
1822
+ }
1823
+ }, {
1824
+ key: "renderPreview",
1825
+ value: function renderPreview(url) {
1826
+ if (!url) return null;
1827
+ var _this$props = this.props,
1828
+ light = _this$props.light,
1829
+ playIcon = _this$props.playIcon,
1830
+ previewTabIndex = _this$props.previewTabIndex,
1831
+ oEmbedUrl = _this$props.oEmbedUrl;
1832
+ return /*#__PURE__*/_react["default"].createElement(Preview, {
1833
+ url: url,
1834
+ light: light,
1835
+ playIcon: playIcon,
1836
+ previewTabIndex: previewTabIndex,
1837
+ oEmbedUrl: oEmbedUrl,
1838
+ onClick: this.handleClickPreview
1839
+ });
1840
+ }
1841
+ }, {
1842
+ key: "render",
1843
+ value: function render() {
1844
+ var _this$props2 = this.props,
1845
+ url = _this$props2.url,
1846
+ style = _this$props2.style,
1847
+ width = _this$props2.width,
1848
+ height = _this$props2.height,
1849
+ fallback = _this$props2.fallback,
1850
+ Wrapper = _this$props2.wrapper;
1851
+ var showPreview = this.state.showPreview;
1852
+ var attributes = this.getAttributes(url);
1853
+ return /*#__PURE__*/_react["default"].createElement(Wrapper, _extends({
1854
+ ref: this.references.wrapper,
1855
+ style: _objectSpread(_objectSpread({}, style), {}, {
1856
+ width: width,
1857
+ height: height
1858
+ })
1859
+ }, attributes), /*#__PURE__*/_react["default"].createElement(UniversalSuspense, {
1860
+ fallback: fallback
1861
+ }, showPreview ? this.renderPreview(url) : this.renderActivePlayer(url)));
1862
+ }
1863
+ }]);
1864
+
1865
+ return ReactPlayer;
1866
+ }(_react.Component), _defineProperty(_class, "displayName", 'ReactPlayer'), _defineProperty(_class, "propTypes", _props.propTypes), _defineProperty(_class, "defaultProps", _props.defaultProps), _defineProperty(_class, "addCustomPlayer", function (player) {
1867
+ customPlayers.push(player);
1868
+ }), _defineProperty(_class, "removeCustomPlayers", function () {
1869
+ customPlayers.length = 0;
1870
+ }), _defineProperty(_class, "canPlay", function (url) {
1871
+ for (var _i2 = 0, _arr2 = [].concat(customPlayers, _toConsumableArray(players)); _i2 < _arr2.length; _i2++) {
1872
+ var _Player = _arr2[_i2];
1873
+
1874
+ if (_Player.canPlay(url)) {
1875
+ return true;
1876
+ }
1877
+ }
1878
+
1879
+ return false;
1880
+ }), _defineProperty(_class, "canEnablePIP", function (url) {
1881
+ for (var _i3 = 0, _arr3 = [].concat(customPlayers, _toConsumableArray(players)); _i3 < _arr3.length; _i3++) {
1882
+ var _Player2 = _arr3[_i3];
1883
+
1884
+ if (_Player2.canEnablePIP && _Player2.canEnablePIP(url)) {
1885
+ return true;
1886
+ }
1887
+ }
1888
+
1889
+ return false;
1890
+ }), _temp;
1891
+ };
1892
+
1893
+ ReactPlayer$1.createReactPlayer = createReactPlayer;
1894
+
1895
+ (function (exports) {
1896
+
1897
+ Object.defineProperty(exports, "__esModule", {
1898
+ value: true
1899
+ });
1900
+ exports["default"] = void 0;
1901
+
1902
+ var _players = _interopRequireDefault(players);
1903
+
1904
+ var _ReactPlayer = ReactPlayer$1;
1905
+
1906
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
1907
+
1908
+ // Fall back to FilePlayer if nothing else can play the URL
1909
+ var fallback = _players["default"][_players["default"].length - 1];
1910
+
1911
+ var _default = (0, _ReactPlayer.createReactPlayer)(_players["default"], fallback);
1912
+
1913
+ exports["default"] = _default;
1914
+ } (lazy));
1915
+
1916
+ var RP = /*@__PURE__*/getDefaultExportFromCjs(lazy);
1917
+
1918
+ const ReactPlayer = RP;
1919
+ const VideoPlayer = ({ controls, src, poster, youtube, tracks, }) => {
1920
+ var _a;
1921
+ const { prefix } = hooks_useGlobalSettings();
1922
+ const baseClass = `${prefix}--video`;
1923
+ const playerClasses = classNames("", {
1924
+ [`${baseClass}--player`]: true,
1925
+ [`youtube`]: youtube,
1926
+ });
1927
+ const controlsClasses = classNames("", {
1928
+ [`${baseClass}--controls`]: true,
1929
+ });
1930
+ /**
1931
+ * State hooks for our player controls
1932
+ */
1933
+ const [duration, setDuration] = require$$0.useState("0:00");
1934
+ const [playedtime, setPlayedtime] = require$$0.useState("0:00");
1935
+ const [buffer, setBuffer] = require$$0.useState(0);
1936
+ const [playing, setPlaying] = require$$0.useState(false);
1937
+ const [playhead, setPlayhead] = require$$0.useState(0);
1938
+ const [volume, setVolume] = require$$0.useState(0.8);
1939
+ const [muted, setMute] = require$$0.useState(false);
1940
+ const [showposter, showPoster] = require$$0.useState(true);
1941
+ const [showvolume, showVolume] = require$$0.useState(false);
1942
+ const [seeking, setSeeking] = require$$0.useState(false);
1943
+ /**
1944
+ * Ref for the video element
1945
+ */
1946
+ const videoElement = require$$0.createRef();
1947
+ /**
1948
+ * Ref for the video container
1949
+ */
1950
+ const videoContainer = require$$0.createRef();
1951
+ const youtubeparams = {
1952
+ controls: 0,
1953
+ modestbranding: 1,
1954
+ };
1955
+ const playerconfig = {
1956
+ file: {
1957
+ tracks: tracks || [],
1958
+ },
1959
+ youtube: youtube ? { playerVars: youtubeparams } : {},
1960
+ };
1961
+ /**
1962
+ * Fullscreen functionality
1963
+ */
1964
+ const toggleFullscreen = () => {
1965
+ /* This is a known issue with ReactPlayer */
1966
+ /* @ts-ignore */
1967
+ screenfull.request(ReactDOM.findDOMNode(videoContainer.current));
1968
+ };
1969
+ /**
1970
+ * Play/pause functionality
1971
+ */
1972
+ const togglePlay = () => {
1973
+ setPlaying(!playing);
1974
+ showPoster(false);
1975
+ };
1976
+ /**
1977
+ * Show volume slider
1978
+ */
1979
+ const showVolumeSlider = () => {
1980
+ showVolume(true);
1981
+ };
1982
+ /**
1983
+ * Hide volume slider
1984
+ */
1985
+ const hideVolumeSlider = () => {
1986
+ setTimeout(() => {
1987
+ showVolume(false);
1988
+ }, 2000);
1989
+ };
1990
+ /**
1991
+ * Mute/unmute
1992
+ */
1993
+ const toggleMute = () => {
1994
+ setMute(!muted);
1995
+ hideVolumeSlider();
1996
+ };
1997
+ /**
1998
+ * Volume change
1999
+ */
2000
+ const handleVolumeChange = (event) => {
2001
+ console.log("handleVolumeChange", event.target.value);
2002
+ setVolume(event.target.value * 0.1);
2003
+ };
2004
+ /**
2005
+ * Begin seek
2006
+ */
2007
+ const handleSeekMouseDown = () => {
2008
+ setSeeking(true);
2009
+ };
2010
+ /**
2011
+ * Seek
2012
+ */
2013
+ const handleSeekChange = (event) => {
2014
+ setPlayhead(parseFloat(event.target.value));
2015
+ };
2016
+ /**
2017
+ * End seek
2018
+ */
2019
+ const handleSeekMouseUp = (event) => {
2020
+ setSeeking(false);
2021
+ /* This is a known issue with ReactPlayer */
2022
+ /* @ts-ignore */
2023
+ videoElement.current.seekTo(parseFloat(event.target.value));
2024
+ };
2025
+ /**
2026
+ * handle display of progress
2027
+ */
2028
+ const handleProgress = (state) => {
2029
+ if (!seeking) {
2030
+ setPlayhead(state.played);
2031
+ setBuffer(state.loaded);
2032
+ setPlayedtime(utils_hoursMinutesSeconds(state.playedSeconds));
2033
+ }
2034
+ };
2035
+ /**
2036
+ * get the duration to display
2037
+ */
2038
+ const handleDuration = (duration) => {
2039
+ setDuration(utils_hoursMinutesSeconds(duration));
2040
+ };
2041
+ /**
2042
+ * on video end
2043
+ */
2044
+ const handleEnded = () => {
2045
+ setPlaying(false);
2046
+ setSeeking(false);
2047
+ };
2048
+ return (jsxRuntime.jsxs("div", Object.assign({ className: `${baseClass}--container`, ref: videoContainer }, { children: [jsxRuntime.jsx(ReactPlayer, { className: playerClasses, config: playerconfig, loop: false, muted: muted, playing: playing, ref: videoElement, url: src, width: "100%", height: "100%", progressInterval: 30, volume: volume, onProgress: handleProgress, onDuration: handleDuration, onEnded: handleEnded }), jsxRuntime.jsxs("picture", Object.assign({ className: `${baseClass}--poster ${showposter ? "show" : ""}` }, { children: [(poster === null || poster === void 0 ? void 0 : poster.url) &&
2049
+ poster.url
2050
+ .sort((a, b) => parseFloat(a.breakpoint) - parseFloat(b.breakpoint))
2051
+ .slice(1)
2052
+ .reverse()
2053
+ .map((item, index) => (jsxRuntime.jsx("source", { srcSet: item.src, media: `(min-width: ${item.breakpoint}px)` }, index))), jsxRuntime.jsx("img", { src: (_a = poster === null || poster === void 0 ? void 0 : poster.url[0]) === null || _a === void 0 ? void 0 : _a.src, alt: poster === null || poster === void 0 ? void 0 : poster.alt })] })), jsxRuntime.jsxs("div", Object.assign({ className: `${controlsClasses} ${showposter ? "notplayed" : ""}` }, { children: [jsxRuntime.jsx("label", Object.assign({ className: `${controlsClasses}--duration ${showposter ? "show" : ""}` }, { children: duration })), jsxRuntime.jsx("button", Object.assign({ className: `${controlsClasses}--${!playing ? "play" : "pause"}`, onClick: togglePlay }, { children: jsxRuntime.jsx("span", { children: !playing ? controls && controls.play : controls && controls.pause }) })), jsxRuntime.jsxs("div", Object.assign({ className: `${controlsClasses}--progress ${showposter ? "" : "show"}` }, { children: [jsxRuntime.jsx("input", { type: "range", min: 0, max: 0.999999, step: "any", value: playhead, onMouseDown: handleSeekMouseDown, onChange: handleSeekChange, onMouseUp: handleSeekMouseUp, className: `${controlsClasses}--progress-playhead` }), jsxRuntime.jsx("progress", { className: `${controlsClasses}--progress-current`, max: 1, value: playhead }), jsxRuntime.jsx("progress", { className: `${controlsClasses}--progress-loaded`, max: 1, value: buffer }), jsxRuntime.jsx("div", Object.assign({ className: `${controlsClasses}--progress-played-container` }, { children: jsxRuntime.jsx("label", Object.assign({ className: `${controlsClasses}--progress-played`, style: { ["--playhead"]: `${playhead * 100}%` } }, { children: playedtime })) }))] })), jsxRuntime.jsxs("div", Object.assign({ className: `${controlsClasses}--volume ${showposter ? "" : "show"}`, onMouseEnter: showVolumeSlider, onMouseLeave: hideVolumeSlider }, { children: [jsxRuntime.jsx("button", Object.assign({ className: `${controlsClasses}--showvolume ${muted ? "muted" : ""}`, onClick: toggleMute }, { children: jsxRuntime.jsx("span", { children: controls && controls.volume }) })), jsxRuntime.jsx("div", Object.assign({ className: `${controlsClasses}--setvolume-container` }, { children: jsxRuntime.jsx("input", { className: `${controlsClasses}--setvolume ${showvolume ? "show" : ""}`, type: "range", step: "0.5", defaultValue: volume, min: "1", max: "10", onChange: handleVolumeChange, onMouseLeave: hideVolumeSlider }) }))] })), jsxRuntime.jsx("button", Object.assign({ className: `${controlsClasses}--fullscreen ${showposter ? "" : "show"}`, onClick: toggleFullscreen }, { children: jsxRuntime.jsx("span", { children: controls && controls.fullscreen }) }))] }))] })));
2054
+ };
2055
+
2056
+ exports.VideoPlayer = VideoPlayer;
2057
+ exports.getDefaultExportFromCjs = getDefaultExportFromCjs;
2058
+ exports.patterns = patterns;
2059
+ exports.utils = utils;