cloudinary-video-player 3.12.1 → 3.12.2-edge.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/134.min.js +8 -0
- package/dist/309.min.js +6 -0
- package/dist/adaptive-streaming.js +9 -9
- package/dist/adaptive-streaming.min.js +2 -2
- package/dist/chapters.js +4 -4
- package/dist/chapters.min.js +3 -3
- package/dist/cld-player-core.js +37 -0
- package/dist/cld-player-core.min.js +6 -0
- package/dist/cld-video-player-lazy.js +494 -0
- package/dist/cld-video-player-lazy.min.js +6 -0
- package/dist/cld-video-player.css +2 -2
- package/dist/cld-video-player.js +366 -332
- package/dist/cld-video-player.light.js +366 -332
- package/dist/cld-video-player.light.min.js +4 -4
- package/dist/cld-video-player.min.css +2 -2
- package/dist/cld-video-player.min.js +4 -4
- package/dist/colors.js +4 -4
- package/dist/colors.min.js +2 -2
- package/dist/dash.js +6 -6
- package/dist/dash.min.js +2 -2
- package/dist/debug.js +8 -8
- package/dist/debug.min.js +3 -3
- package/dist/ima.js +9 -9
- package/dist/ima.min.js +2 -2
- package/dist/interaction-areas.js +11 -11
- package/dist/interaction-areas.min.js +2 -2
- package/dist/node_modules_lodash_throttle_js.js +8 -8
- package/dist/playlist.js +31 -31
- package/dist/playlist.min.js +3 -3
- package/dist/recommendations-overlay.js +10 -10
- package/dist/recommendations-overlay.min.js +2 -2
- package/dist/schema.json +19 -0
- package/dist/share.js +5 -5
- package/dist/share.min.js +3 -3
- package/dist/shoppable.js +12 -12
- package/dist/shoppable.min.js +2 -2
- package/dist/utils_fetch-config_js.js +81 -0
- package/dist/video-player_js.js +3111 -0
- package/dist/visual-search.js +7 -7
- package/dist/visual-search.min.js +2 -2
- package/lib/_commonjsHelpers.js +7 -0
- package/lib/_videojs-proxy.js +30294 -0
- package/lib/abr-strategies.js +31 -0
- package/lib/adaptive-streaming.js +468 -2
- package/lib/all.js +25 -2
- package/lib/chapters.js +205 -1
- package/lib/cld-video-player.min.css +5 -22
- package/lib/colors.js +59 -1
- package/lib/{schema.json → config/configSchema.json} +19 -0
- package/lib/dash.js +69943 -2
- package/lib/debug.js +322 -1
- package/lib/document.js +770 -0
- package/lib/download-button.js +48 -0
- package/lib/fetch-config.js +93 -0
- package/lib/ima.js +6851 -1
- package/lib/index.js +27 -0
- package/lib/interaction-areas.const.js +24 -0
- package/lib/interaction-areas.service.js +469 -0
- package/lib/lazy.js +20 -0
- package/lib/noop.js +33 -0
- package/lib/player-api.js +469 -0
- package/lib/player.js +7 -2
- package/lib/playlist-panel.js +602 -0
- package/lib/playlist.js +637 -1
- package/lib/querystring.js +81 -0
- package/lib/recommendations-overlay.js +320 -1
- package/lib/share.js +129 -1
- package/lib/shoppable-post-widget.js +572 -0
- package/lib/shoppable-widget.js +77 -0
- package/lib/throttle.js +318 -0
- package/lib/toNumber.js +134 -0
- package/lib/validators-functions.js +485 -0
- package/lib/video-player.js +16241 -0
- package/lib/videoPlayer.js +7 -2
- package/lib/videojs-contrib-hlsjs.js +37638 -0
- package/lib/visual-search.js +235 -1
- package/package.json +31 -15
- package/lib/adaptive-streaming.js.LICENSE.txt +0 -3
- package/lib/all.js.LICENSE.txt +0 -25
- package/lib/cld-video-player.js +0 -2
- package/lib/cld-video-player.js.LICENSE.txt +0 -21
- package/lib/dash.js.LICENSE.txt +0 -1842
- package/lib/interaction-areas.js +0 -1
- package/lib/player.js.LICENSE.txt +0 -21
- package/lib/shoppable.js +0 -1
- package/lib/videoPlayer.js.LICENSE.txt +0 -21
|
@@ -0,0 +1,485 @@
|
|
|
1
|
+
import { c as commonjsGlobal, g as getDefaultExportFromCjs } from './_commonjsHelpers.js';
|
|
2
|
+
|
|
3
|
+
/** Detect free variable `global` from Node.js. */
|
|
4
|
+
|
|
5
|
+
var _freeGlobal;
|
|
6
|
+
var hasRequired_freeGlobal;
|
|
7
|
+
|
|
8
|
+
function require_freeGlobal () {
|
|
9
|
+
if (hasRequired_freeGlobal) return _freeGlobal;
|
|
10
|
+
hasRequired_freeGlobal = 1;
|
|
11
|
+
var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
|
12
|
+
|
|
13
|
+
_freeGlobal = freeGlobal;
|
|
14
|
+
return _freeGlobal;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
var _root;
|
|
18
|
+
var hasRequired_root;
|
|
19
|
+
|
|
20
|
+
function require_root () {
|
|
21
|
+
if (hasRequired_root) return _root;
|
|
22
|
+
hasRequired_root = 1;
|
|
23
|
+
var freeGlobal = require_freeGlobal();
|
|
24
|
+
|
|
25
|
+
/** Detect free variable `self`. */
|
|
26
|
+
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
|
27
|
+
|
|
28
|
+
/** Used as a reference to the global object. */
|
|
29
|
+
var root = freeGlobal || freeSelf || Function('return this')();
|
|
30
|
+
|
|
31
|
+
_root = root;
|
|
32
|
+
return _root;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
var _Symbol;
|
|
36
|
+
var hasRequired_Symbol;
|
|
37
|
+
|
|
38
|
+
function require_Symbol () {
|
|
39
|
+
if (hasRequired_Symbol) return _Symbol;
|
|
40
|
+
hasRequired_Symbol = 1;
|
|
41
|
+
var root = require_root();
|
|
42
|
+
|
|
43
|
+
/** Built-in value references. */
|
|
44
|
+
var Symbol = root.Symbol;
|
|
45
|
+
|
|
46
|
+
_Symbol = Symbol;
|
|
47
|
+
return _Symbol;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
var _getRawTag;
|
|
51
|
+
var hasRequired_getRawTag;
|
|
52
|
+
|
|
53
|
+
function require_getRawTag () {
|
|
54
|
+
if (hasRequired_getRawTag) return _getRawTag;
|
|
55
|
+
hasRequired_getRawTag = 1;
|
|
56
|
+
var Symbol = require_Symbol();
|
|
57
|
+
|
|
58
|
+
/** Used for built-in method references. */
|
|
59
|
+
var objectProto = Object.prototype;
|
|
60
|
+
|
|
61
|
+
/** Used to check objects for own properties. */
|
|
62
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Used to resolve the
|
|
66
|
+
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
67
|
+
* of values.
|
|
68
|
+
*/
|
|
69
|
+
var nativeObjectToString = objectProto.toString;
|
|
70
|
+
|
|
71
|
+
/** Built-in value references. */
|
|
72
|
+
var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
|
|
76
|
+
*
|
|
77
|
+
* @private
|
|
78
|
+
* @param {*} value The value to query.
|
|
79
|
+
* @returns {string} Returns the raw `toStringTag`.
|
|
80
|
+
*/
|
|
81
|
+
function getRawTag(value) {
|
|
82
|
+
var isOwn = hasOwnProperty.call(value, symToStringTag),
|
|
83
|
+
tag = value[symToStringTag];
|
|
84
|
+
|
|
85
|
+
try {
|
|
86
|
+
value[symToStringTag] = undefined;
|
|
87
|
+
var unmasked = true;
|
|
88
|
+
} catch (e) {}
|
|
89
|
+
|
|
90
|
+
var result = nativeObjectToString.call(value);
|
|
91
|
+
if (unmasked) {
|
|
92
|
+
if (isOwn) {
|
|
93
|
+
value[symToStringTag] = tag;
|
|
94
|
+
} else {
|
|
95
|
+
delete value[symToStringTag];
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return result;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
_getRawTag = getRawTag;
|
|
102
|
+
return _getRawTag;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/** Used for built-in method references. */
|
|
106
|
+
|
|
107
|
+
var _objectToString;
|
|
108
|
+
var hasRequired_objectToString;
|
|
109
|
+
|
|
110
|
+
function require_objectToString () {
|
|
111
|
+
if (hasRequired_objectToString) return _objectToString;
|
|
112
|
+
hasRequired_objectToString = 1;
|
|
113
|
+
var objectProto = Object.prototype;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Used to resolve the
|
|
117
|
+
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
118
|
+
* of values.
|
|
119
|
+
*/
|
|
120
|
+
var nativeObjectToString = objectProto.toString;
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Converts `value` to a string using `Object.prototype.toString`.
|
|
124
|
+
*
|
|
125
|
+
* @private
|
|
126
|
+
* @param {*} value The value to convert.
|
|
127
|
+
* @returns {string} Returns the converted string.
|
|
128
|
+
*/
|
|
129
|
+
function objectToString(value) {
|
|
130
|
+
return nativeObjectToString.call(value);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
_objectToString = objectToString;
|
|
134
|
+
return _objectToString;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
var _baseGetTag;
|
|
138
|
+
var hasRequired_baseGetTag;
|
|
139
|
+
|
|
140
|
+
function require_baseGetTag () {
|
|
141
|
+
if (hasRequired_baseGetTag) return _baseGetTag;
|
|
142
|
+
hasRequired_baseGetTag = 1;
|
|
143
|
+
var Symbol = require_Symbol(),
|
|
144
|
+
getRawTag = require_getRawTag(),
|
|
145
|
+
objectToString = require_objectToString();
|
|
146
|
+
|
|
147
|
+
/** `Object#toString` result references. */
|
|
148
|
+
var nullTag = '[object Null]',
|
|
149
|
+
undefinedTag = '[object Undefined]';
|
|
150
|
+
|
|
151
|
+
/** Built-in value references. */
|
|
152
|
+
var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* The base implementation of `getTag` without fallbacks for buggy environments.
|
|
156
|
+
*
|
|
157
|
+
* @private
|
|
158
|
+
* @param {*} value The value to query.
|
|
159
|
+
* @returns {string} Returns the `toStringTag`.
|
|
160
|
+
*/
|
|
161
|
+
function baseGetTag(value) {
|
|
162
|
+
if (value == null) {
|
|
163
|
+
return value === undefined ? undefinedTag : nullTag;
|
|
164
|
+
}
|
|
165
|
+
return (symToStringTag && symToStringTag in Object(value))
|
|
166
|
+
? getRawTag(value)
|
|
167
|
+
: objectToString(value);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
_baseGetTag = baseGetTag;
|
|
171
|
+
return _baseGetTag;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Checks if `value` is the
|
|
176
|
+
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
|
|
177
|
+
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
|
178
|
+
*
|
|
179
|
+
* @static
|
|
180
|
+
* @memberOf _
|
|
181
|
+
* @since 0.1.0
|
|
182
|
+
* @category Lang
|
|
183
|
+
* @param {*} value The value to check.
|
|
184
|
+
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
|
|
185
|
+
* @example
|
|
186
|
+
*
|
|
187
|
+
* _.isObject({});
|
|
188
|
+
* // => true
|
|
189
|
+
*
|
|
190
|
+
* _.isObject([1, 2, 3]);
|
|
191
|
+
* // => true
|
|
192
|
+
*
|
|
193
|
+
* _.isObject(_.noop);
|
|
194
|
+
* // => true
|
|
195
|
+
*
|
|
196
|
+
* _.isObject(null);
|
|
197
|
+
* // => false
|
|
198
|
+
*/
|
|
199
|
+
|
|
200
|
+
var isObject_1;
|
|
201
|
+
var hasRequiredIsObject;
|
|
202
|
+
|
|
203
|
+
function requireIsObject () {
|
|
204
|
+
if (hasRequiredIsObject) return isObject_1;
|
|
205
|
+
hasRequiredIsObject = 1;
|
|
206
|
+
function isObject(value) {
|
|
207
|
+
var type = typeof value;
|
|
208
|
+
return value != null && (type == 'object' || type == 'function');
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
isObject_1 = isObject;
|
|
212
|
+
return isObject_1;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
var isFunction_1;
|
|
216
|
+
var hasRequiredIsFunction;
|
|
217
|
+
|
|
218
|
+
function requireIsFunction () {
|
|
219
|
+
if (hasRequiredIsFunction) return isFunction_1;
|
|
220
|
+
hasRequiredIsFunction = 1;
|
|
221
|
+
var baseGetTag = require_baseGetTag(),
|
|
222
|
+
isObject = requireIsObject();
|
|
223
|
+
|
|
224
|
+
/** `Object#toString` result references. */
|
|
225
|
+
var asyncTag = '[object AsyncFunction]',
|
|
226
|
+
funcTag = '[object Function]',
|
|
227
|
+
genTag = '[object GeneratorFunction]',
|
|
228
|
+
proxyTag = '[object Proxy]';
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* Checks if `value` is classified as a `Function` object.
|
|
232
|
+
*
|
|
233
|
+
* @static
|
|
234
|
+
* @memberOf _
|
|
235
|
+
* @since 0.1.0
|
|
236
|
+
* @category Lang
|
|
237
|
+
* @param {*} value The value to check.
|
|
238
|
+
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
|
|
239
|
+
* @example
|
|
240
|
+
*
|
|
241
|
+
* _.isFunction(_);
|
|
242
|
+
* // => true
|
|
243
|
+
*
|
|
244
|
+
* _.isFunction(/abc/);
|
|
245
|
+
* // => false
|
|
246
|
+
*/
|
|
247
|
+
function isFunction(value) {
|
|
248
|
+
if (!isObject(value)) {
|
|
249
|
+
return false;
|
|
250
|
+
}
|
|
251
|
+
// The use of `Object#toString` avoids issues with the `typeof` operator
|
|
252
|
+
// in Safari 9 which returns 'object' for typed arrays and other constructors.
|
|
253
|
+
var tag = baseGetTag(value);
|
|
254
|
+
return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
isFunction_1 = isFunction;
|
|
258
|
+
return isFunction_1;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* Checks if `value` is object-like. A value is object-like if it's not `null`
|
|
263
|
+
* and has a `typeof` result of "object".
|
|
264
|
+
*
|
|
265
|
+
* @static
|
|
266
|
+
* @memberOf _
|
|
267
|
+
* @since 4.0.0
|
|
268
|
+
* @category Lang
|
|
269
|
+
* @param {*} value The value to check.
|
|
270
|
+
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
|
|
271
|
+
* @example
|
|
272
|
+
*
|
|
273
|
+
* _.isObjectLike({});
|
|
274
|
+
* // => true
|
|
275
|
+
*
|
|
276
|
+
* _.isObjectLike([1, 2, 3]);
|
|
277
|
+
* // => true
|
|
278
|
+
*
|
|
279
|
+
* _.isObjectLike(_.noop);
|
|
280
|
+
* // => false
|
|
281
|
+
*
|
|
282
|
+
* _.isObjectLike(null);
|
|
283
|
+
* // => false
|
|
284
|
+
*/
|
|
285
|
+
|
|
286
|
+
var isObjectLike_1;
|
|
287
|
+
var hasRequiredIsObjectLike;
|
|
288
|
+
|
|
289
|
+
function requireIsObjectLike () {
|
|
290
|
+
if (hasRequiredIsObjectLike) return isObjectLike_1;
|
|
291
|
+
hasRequiredIsObjectLike = 1;
|
|
292
|
+
function isObjectLike(value) {
|
|
293
|
+
return value != null && typeof value == 'object';
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
isObjectLike_1 = isObjectLike;
|
|
297
|
+
return isObjectLike_1;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
* Checks if `value` is classified as an `Array` object.
|
|
302
|
+
*
|
|
303
|
+
* @static
|
|
304
|
+
* @memberOf _
|
|
305
|
+
* @since 0.1.0
|
|
306
|
+
* @category Lang
|
|
307
|
+
* @param {*} value The value to check.
|
|
308
|
+
* @returns {boolean} Returns `true` if `value` is an array, else `false`.
|
|
309
|
+
* @example
|
|
310
|
+
*
|
|
311
|
+
* _.isArray([1, 2, 3]);
|
|
312
|
+
* // => true
|
|
313
|
+
*
|
|
314
|
+
* _.isArray(document.body.children);
|
|
315
|
+
* // => false
|
|
316
|
+
*
|
|
317
|
+
* _.isArray('abc');
|
|
318
|
+
* // => false
|
|
319
|
+
*
|
|
320
|
+
* _.isArray(_.noop);
|
|
321
|
+
* // => false
|
|
322
|
+
*/
|
|
323
|
+
|
|
324
|
+
var isArray_1;
|
|
325
|
+
var hasRequiredIsArray;
|
|
326
|
+
|
|
327
|
+
function requireIsArray () {
|
|
328
|
+
if (hasRequiredIsArray) return isArray_1;
|
|
329
|
+
hasRequiredIsArray = 1;
|
|
330
|
+
var isArray = Array.isArray;
|
|
331
|
+
|
|
332
|
+
isArray_1 = isArray;
|
|
333
|
+
return isArray_1;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
var isFunctionExports = requireIsFunction();
|
|
337
|
+
var isFunction = /*@__PURE__*/getDefaultExportFromCjs(isFunctionExports);
|
|
338
|
+
|
|
339
|
+
var isObjectExports = requireIsObject();
|
|
340
|
+
var isObject = /*@__PURE__*/getDefaultExportFromCjs(isObjectExports);
|
|
341
|
+
|
|
342
|
+
var isString_1;
|
|
343
|
+
var hasRequiredIsString;
|
|
344
|
+
|
|
345
|
+
function requireIsString () {
|
|
346
|
+
if (hasRequiredIsString) return isString_1;
|
|
347
|
+
hasRequiredIsString = 1;
|
|
348
|
+
var baseGetTag = require_baseGetTag(),
|
|
349
|
+
isArray = requireIsArray(),
|
|
350
|
+
isObjectLike = requireIsObjectLike();
|
|
351
|
+
|
|
352
|
+
/** `Object#toString` result references. */
|
|
353
|
+
var stringTag = '[object String]';
|
|
354
|
+
|
|
355
|
+
/**
|
|
356
|
+
* Checks if `value` is classified as a `String` primitive or object.
|
|
357
|
+
*
|
|
358
|
+
* @static
|
|
359
|
+
* @since 0.1.0
|
|
360
|
+
* @memberOf _
|
|
361
|
+
* @category Lang
|
|
362
|
+
* @param {*} value The value to check.
|
|
363
|
+
* @returns {boolean} Returns `true` if `value` is a string, else `false`.
|
|
364
|
+
* @example
|
|
365
|
+
*
|
|
366
|
+
* _.isString('abc');
|
|
367
|
+
* // => true
|
|
368
|
+
*
|
|
369
|
+
* _.isString(1);
|
|
370
|
+
* // => false
|
|
371
|
+
*/
|
|
372
|
+
function isString(value) {
|
|
373
|
+
return typeof value == 'string' ||
|
|
374
|
+
(!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
isString_1 = isString;
|
|
378
|
+
return isString_1;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
var isStringExports = requireIsString();
|
|
382
|
+
var isString = /*@__PURE__*/getDefaultExportFromCjs(isStringExports);
|
|
383
|
+
|
|
384
|
+
// Parameters that can be passed to source configuration (inherited by source method)
|
|
385
|
+
const SOURCE_PARAMS = ['adaptiveStreaming', 'allowUsageReport', 'aspectRatio', 'autoShowRecommendations', 'breakpoints', 'chapters', 'cropMode', 'cropPadColor', 'cloudinaryConfig', 'description', 'download', 'hdr', 'info', 'interactionAreas', 'maxDpr', 'poster', 'posterOptions', 'publicId', 'rawTransformation', 'recommendations', 'resourceType', 'shoppable', 'source', 'sourceTransformation', 'sourceTypes', 'textTracks', 'title', 'transformation', 'type', 'visualSearch', 'withCredentials', 'videoSources'];
|
|
386
|
+
|
|
387
|
+
// All parameters that can be passed to player constructor
|
|
388
|
+
const PLAYER_PARAMS = SOURCE_PARAMS.concat(['_internalAnalyticsMetadata', 'ads', 'aiHighlightsGraph', 'analytics', 'autoplayMode', 'chaptersButton', 'cloudinaryAnalytics', 'colors', 'debug', 'fetchErrorUsingGet', 'floatingWhenNotVisible', 'fluid', 'fontFace', 'hideContextMenu', 'ima', 'pictureInPictureToggle', 'playedEventPercents', 'playedEventTimes', 'playlistWidget', 'profile', 'qualitySelector', 'queryParams', 'seekThumbnails', 'showJumpControls', 'videoConfig', 'schedule']);
|
|
389
|
+
|
|
390
|
+
// We support both camelCase and snake_case for cloudinary SDK params
|
|
391
|
+
const CLOUDINARY_CONFIG_PARAM = ['api_secret', 'auth_token', 'cdn_subdomain', 'cloud_name', 'cname', 'private_cdn', 'secure', 'secure_cdn_subdomain', 'secure_distribution', 'shorten', 'sign_url', 'url_suffix', 'use_root_path'];
|
|
392
|
+
const FLUID_CLASS_NAME = 'cld-fluid';
|
|
393
|
+
const AUTO_PLAY_MODE = {
|
|
394
|
+
ALWAYS: 'always',
|
|
395
|
+
ON_SCROLL: 'on-scroll',
|
|
396
|
+
NEVER: 'never'
|
|
397
|
+
};
|
|
398
|
+
const FLOATING_TO = {
|
|
399
|
+
LEFT: 'left',
|
|
400
|
+
RIGHT: 'right',
|
|
401
|
+
NONE: 'none'
|
|
402
|
+
};
|
|
403
|
+
const ADS_IN_PLAYLIST = {
|
|
404
|
+
FIRST_VIDEO: 'first-video',
|
|
405
|
+
EVERY_VIDEO: 'every-video'
|
|
406
|
+
};
|
|
407
|
+
const PRELOAD = {
|
|
408
|
+
AUTO: 'auto'};
|
|
409
|
+
const CROP_MODE = {
|
|
410
|
+
FILL: 'fill',
|
|
411
|
+
PAD: 'pad',
|
|
412
|
+
SMART: 'smart'
|
|
413
|
+
};
|
|
414
|
+
|
|
415
|
+
const getValidatorItem = validator => isFunction(validator) ? validator() : validator;
|
|
416
|
+
|
|
417
|
+
/**
|
|
418
|
+
* check if a value is valid or not
|
|
419
|
+
* @param {object | function} validator - a config object
|
|
420
|
+
* @param {any} value
|
|
421
|
+
* @param {key} string
|
|
422
|
+
* @returns boolean - using the validators to check if the value is a valid value or not
|
|
423
|
+
*/
|
|
424
|
+
const isValueValid = (validator, value, configPropertyName) => {
|
|
425
|
+
const validatorItem = getValidatorItem(validator);
|
|
426
|
+
const isValid = validatorItem.value(value);
|
|
427
|
+
if (!isValid) {
|
|
428
|
+
console.error(`cloudinary video player: ${validatorItem.message(configPropertyName)}`);
|
|
429
|
+
}
|
|
430
|
+
return isValid;
|
|
431
|
+
};
|
|
432
|
+
|
|
433
|
+
/**
|
|
434
|
+
* check if a configuration object is valid or not
|
|
435
|
+
* @param {object} config - a config object
|
|
436
|
+
* @param {object} validators
|
|
437
|
+
* @returns boolean - true is the configuration object is valid and false if it is not
|
|
438
|
+
*/
|
|
439
|
+
const isValidConfig = (config, validators) => {
|
|
440
|
+
if (isObject(validators)) {
|
|
441
|
+
for (let key in config) {
|
|
442
|
+
if (Object.prototype.hasOwnProperty.call(validators, key)) {
|
|
443
|
+
const configValue = config[key];
|
|
444
|
+
const validatorValue = validators[key];
|
|
445
|
+
const isConfigObject = isObject(configValue);
|
|
446
|
+
if (isConfigObject && !isValidConfig(configValue, validatorValue)) {
|
|
447
|
+
return false;
|
|
448
|
+
} else if (!isConfigObject && !isValueValid(validatorValue, configValue, key)) {
|
|
449
|
+
return false;
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
return true;
|
|
455
|
+
};
|
|
456
|
+
|
|
457
|
+
/**
|
|
458
|
+
* check if a configuration object is valid or not
|
|
459
|
+
* @param {object} config - a config object
|
|
460
|
+
* @returns boolean - true is the configuration object is valid and false if it is not
|
|
461
|
+
*/
|
|
462
|
+
const isValidPlayerConfig = async config => {
|
|
463
|
+
return import(/* webpackChunkName: "debug" */'./debug.js').then(function (n) { return n.v; }).then(_ref => {
|
|
464
|
+
let {
|
|
465
|
+
playerValidators
|
|
466
|
+
} = _ref;
|
|
467
|
+
return isValidConfig(config, playerValidators);
|
|
468
|
+
});
|
|
469
|
+
};
|
|
470
|
+
|
|
471
|
+
/**
|
|
472
|
+
* check if a configuration object is valid or not
|
|
473
|
+
* @param {object} config - a config object
|
|
474
|
+
* @returns boolean - true is the configuration object is valid and false if it is not
|
|
475
|
+
*/
|
|
476
|
+
const isValidSourceConfig = config => {
|
|
477
|
+
return import(/* webpackChunkName: "debug" */'./debug.js').then(function (n) { return n.v; }).then(_ref2 => {
|
|
478
|
+
let {
|
|
479
|
+
sourceValidators
|
|
480
|
+
} = _ref2;
|
|
481
|
+
return isValidConfig(config, sourceValidators);
|
|
482
|
+
});
|
|
483
|
+
};
|
|
484
|
+
|
|
485
|
+
export { AUTO_PLAY_MODE as A, CROP_MODE as C, FLOATING_TO as F, PRELOAD as P, SOURCE_PARAMS as S, require_root as a, requireIsFunction as b, require_baseGetTag as c, requireIsObjectLike as d, require_freeGlobal as e, requireIsArray as f, require_Symbol as g, isString as h, isObject as i, isFunction as j, PLAYER_PARAMS as k, CLOUDINARY_CONFIG_PARAM as l, FLUID_CLASS_NAME as m, isValidPlayerConfig as n, isValidSourceConfig as o, getValidatorItem as p, isValueValid as q, requireIsObject as r, ADS_IN_PLAYLIST as s };
|