cloudinary-video-player 3.1.2-edge.0 → 3.1.2-edge.2
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/adaptive-streaming.js +2 -2
- package/dist/adaptive-streaming.min.js +2 -2
- package/dist/chapters.js +9 -6
- package/dist/chapters.min.js +3 -3
- package/dist/cld-video-player.css +2 -2
- package/dist/cld-video-player.js +39 -12
- package/dist/cld-video-player.light.js +39 -12
- 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 +2 -2
- package/dist/colors.min.js +2 -2
- package/dist/dash.js +2 -2
- package/dist/dash.min.js +2 -2
- package/dist/debug.js +2 -2
- package/dist/debug.min.js +2 -2
- package/dist/ima.js +2 -2
- package/dist/ima.min.js +2 -2
- package/dist/interaction-areas.js +2 -2
- package/dist/interaction-areas.min.js +2 -2
- package/dist/node_modules_lodash_throttle_js.js +2 -2
- package/dist/playlist.js +2 -2
- package/dist/playlist.min.js +2 -2
- package/dist/recommendations-overlay.js +2 -2
- package/dist/recommendations-overlay.min.js +2 -2
- package/dist/schema.json +523 -0
- package/dist/shoppable.js +2 -2
- package/dist/shoppable.min.js +2 -2
- package/dist/srt-text-tracks.js +2 -2
- package/dist/srt-text-tracks.min.js +2 -2
- package/dist/visual-search.js +2 -2
- package/dist/visual-search.min.js +2 -2
- package/lib/all.js +1 -1
- package/lib/chapters.js +1 -1
- package/lib/cld-video-player.js +1 -1
- package/lib/player.js +1 -1
- package/lib/schema.json +523 -0
- package/lib/videoPlayer.js +1 -1
- package/package.json +1 -1
package/dist/schema.json
ADDED
|
@@ -0,0 +1,523 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$id": "cloudinary_video_player_schema",
|
|
3
|
+
"title": "Cloudinary Video Player Schema",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"properties": {
|
|
6
|
+
"loop": {
|
|
7
|
+
"type": "boolean",
|
|
8
|
+
"default": false
|
|
9
|
+
},
|
|
10
|
+
"controls": {
|
|
11
|
+
"type": "boolean",
|
|
12
|
+
"default": true
|
|
13
|
+
},
|
|
14
|
+
"autoplay": {
|
|
15
|
+
"type": "boolean",
|
|
16
|
+
"default": false
|
|
17
|
+
},
|
|
18
|
+
"autoplayMode": {
|
|
19
|
+
"type": "string",
|
|
20
|
+
"enum": ["always", "on-scroll", "never"],
|
|
21
|
+
"default": "never"
|
|
22
|
+
},
|
|
23
|
+
"bigPlayButton": {
|
|
24
|
+
"type": "boolean",
|
|
25
|
+
"default": true
|
|
26
|
+
},
|
|
27
|
+
"playbackRates": {
|
|
28
|
+
"type": "array",
|
|
29
|
+
"items": {
|
|
30
|
+
"type": "number"
|
|
31
|
+
},
|
|
32
|
+
"default": []
|
|
33
|
+
},
|
|
34
|
+
"showLogo": {
|
|
35
|
+
"type": "boolean",
|
|
36
|
+
"default": true
|
|
37
|
+
},
|
|
38
|
+
"logoImageUrl": {
|
|
39
|
+
"type": "string",
|
|
40
|
+
"default": "https://cloudinary.com/images/logo.png"
|
|
41
|
+
},
|
|
42
|
+
"logoOnclickUrl": {
|
|
43
|
+
"type": "string",
|
|
44
|
+
"default": "https://cloudinary.com"
|
|
45
|
+
},
|
|
46
|
+
"videoJS": {
|
|
47
|
+
"type": "object",
|
|
48
|
+
"default": {}
|
|
49
|
+
},
|
|
50
|
+
"maxTries": {
|
|
51
|
+
"type": "number",
|
|
52
|
+
"default": 3
|
|
53
|
+
},
|
|
54
|
+
"muted": {
|
|
55
|
+
"type": "boolean",
|
|
56
|
+
"default": false
|
|
57
|
+
},
|
|
58
|
+
"playsinline": {
|
|
59
|
+
"type": "boolean",
|
|
60
|
+
"default": false
|
|
61
|
+
},
|
|
62
|
+
"videoTimeout": {
|
|
63
|
+
"type": "number",
|
|
64
|
+
"default": 55000
|
|
65
|
+
},
|
|
66
|
+
"preload": {
|
|
67
|
+
"type": "string",
|
|
68
|
+
"enum": ["auto", "metadata", "none"],
|
|
69
|
+
"default": "auto"
|
|
70
|
+
},
|
|
71
|
+
"sourceTransformation": {
|
|
72
|
+
"type": "object",
|
|
73
|
+
"default": {}
|
|
74
|
+
},
|
|
75
|
+
"allowUsageReport": {
|
|
76
|
+
"type": "boolean",
|
|
77
|
+
"default": true
|
|
78
|
+
},
|
|
79
|
+
"debug": {
|
|
80
|
+
"type": "boolean",
|
|
81
|
+
"default": false
|
|
82
|
+
},
|
|
83
|
+
"queryParams": {
|
|
84
|
+
"type": "object",
|
|
85
|
+
"default": {}
|
|
86
|
+
},
|
|
87
|
+
"fluid": {
|
|
88
|
+
"type": "boolean",
|
|
89
|
+
"default": true
|
|
90
|
+
},
|
|
91
|
+
"withCredentials": {
|
|
92
|
+
"type": "boolean",
|
|
93
|
+
"default": false
|
|
94
|
+
},
|
|
95
|
+
"analytics": {
|
|
96
|
+
"type": "boolean",
|
|
97
|
+
"default": false
|
|
98
|
+
},
|
|
99
|
+
"cloudinaryAnalytics": {
|
|
100
|
+
"oneOf": [
|
|
101
|
+
{
|
|
102
|
+
"type": "boolean",
|
|
103
|
+
"default": true
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"type": "object",
|
|
107
|
+
"properties": {
|
|
108
|
+
"customData1": { "type": "string" },
|
|
109
|
+
"customData2": { "type": "string" },
|
|
110
|
+
"customData3": { "type": "string" },
|
|
111
|
+
"customData4": { "type": "string" },
|
|
112
|
+
"customData5": { "type": "string" }
|
|
113
|
+
},
|
|
114
|
+
"additionalProperties": false
|
|
115
|
+
}
|
|
116
|
+
],
|
|
117
|
+
"default": true
|
|
118
|
+
},
|
|
119
|
+
"hideContextMenu": {
|
|
120
|
+
"type": "boolean",
|
|
121
|
+
"default": false
|
|
122
|
+
},
|
|
123
|
+
"playedEventPercents": {
|
|
124
|
+
"type": "array",
|
|
125
|
+
"items": {
|
|
126
|
+
"type": "number"
|
|
127
|
+
},
|
|
128
|
+
"default": [25, 50, 75, 100]
|
|
129
|
+
},
|
|
130
|
+
"showJumpControls": {
|
|
131
|
+
"type": "boolean",
|
|
132
|
+
"default": false
|
|
133
|
+
},
|
|
134
|
+
"chaptersButton": {
|
|
135
|
+
"type": "boolean",
|
|
136
|
+
"default": false
|
|
137
|
+
},
|
|
138
|
+
"pictureInPictureToggle": {
|
|
139
|
+
"type": "boolean",
|
|
140
|
+
"default": false
|
|
141
|
+
},
|
|
142
|
+
"seekThumbnails": {
|
|
143
|
+
"type": "boolean",
|
|
144
|
+
"default": true
|
|
145
|
+
},
|
|
146
|
+
"aiHighlightsGraph": {
|
|
147
|
+
"type": "boolean",
|
|
148
|
+
"default": false
|
|
149
|
+
},
|
|
150
|
+
"floatingWhenNotVisible": {
|
|
151
|
+
"type": "string",
|
|
152
|
+
"enum": ["left", "right", "none"],
|
|
153
|
+
"default": "none"
|
|
154
|
+
},
|
|
155
|
+
"playedEventTimes": {
|
|
156
|
+
"type": "array",
|
|
157
|
+
"items": {
|
|
158
|
+
"type": "number"
|
|
159
|
+
},
|
|
160
|
+
"default": []
|
|
161
|
+
},
|
|
162
|
+
"playlistWidget": {
|
|
163
|
+
"type": "object",
|
|
164
|
+
"properties": {
|
|
165
|
+
"direction": {
|
|
166
|
+
"type": "string",
|
|
167
|
+
"default": "horizontal"
|
|
168
|
+
},
|
|
169
|
+
"total": {
|
|
170
|
+
"type": "number",
|
|
171
|
+
"default": 0
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
"default": {
|
|
175
|
+
"direction": "horizontal",
|
|
176
|
+
"total": 0
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
"colors": {
|
|
180
|
+
"type": "object",
|
|
181
|
+
"properties": {
|
|
182
|
+
"base": {
|
|
183
|
+
"type": "string",
|
|
184
|
+
"default": "#000000"
|
|
185
|
+
},
|
|
186
|
+
"accent": {
|
|
187
|
+
"type": "string",
|
|
188
|
+
"default": "#FF620C"
|
|
189
|
+
},
|
|
190
|
+
"text": {
|
|
191
|
+
"type": "string",
|
|
192
|
+
"default": "#FFFFFF"
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
"default": {
|
|
196
|
+
"base": "#000000",
|
|
197
|
+
"accent": "#FF620C",
|
|
198
|
+
"text": "#FFFFFF"
|
|
199
|
+
}
|
|
200
|
+
},
|
|
201
|
+
"ads": {
|
|
202
|
+
"type": "object",
|
|
203
|
+
"properties": {
|
|
204
|
+
"adTagUrl": {
|
|
205
|
+
"type": "string",
|
|
206
|
+
"default": ""
|
|
207
|
+
},
|
|
208
|
+
"showCountdown": {
|
|
209
|
+
"type": "boolean",
|
|
210
|
+
"default": true
|
|
211
|
+
},
|
|
212
|
+
"adLabel": {
|
|
213
|
+
"type": "string",
|
|
214
|
+
"default": "Advertisement"
|
|
215
|
+
},
|
|
216
|
+
"locale": {
|
|
217
|
+
"type": "string",
|
|
218
|
+
"default": "en"
|
|
219
|
+
},
|
|
220
|
+
"prerollTimeout": {
|
|
221
|
+
"type": "number",
|
|
222
|
+
"default": 5000
|
|
223
|
+
},
|
|
224
|
+
"postrollTimeout": {
|
|
225
|
+
"type": "number",
|
|
226
|
+
"default": 5000
|
|
227
|
+
},
|
|
228
|
+
"adsInPlaylist": {
|
|
229
|
+
"type": "string",
|
|
230
|
+
"enum": ["first-video", "every-video"],
|
|
231
|
+
"default": "first-video"
|
|
232
|
+
}
|
|
233
|
+
},
|
|
234
|
+
"default": {
|
|
235
|
+
"adTagUrl": "",
|
|
236
|
+
"showCountdown": true,
|
|
237
|
+
"adLabel": "Advertisement",
|
|
238
|
+
"locale": "en",
|
|
239
|
+
"prerollTimeout": 5000,
|
|
240
|
+
"postrollTimeout": 5000,
|
|
241
|
+
"adsInPlaylist": "first-video"
|
|
242
|
+
}
|
|
243
|
+
},
|
|
244
|
+
"autoShowRecommendations": {
|
|
245
|
+
"type": "boolean",
|
|
246
|
+
"default": false
|
|
247
|
+
},
|
|
248
|
+
"fontFace": {
|
|
249
|
+
"type": "string",
|
|
250
|
+
"default": "Fira Sans"
|
|
251
|
+
},
|
|
252
|
+
"posterOptions": {
|
|
253
|
+
"type": "object",
|
|
254
|
+
"properties": {
|
|
255
|
+
"transformation": {
|
|
256
|
+
"type": "object",
|
|
257
|
+
"default": {}
|
|
258
|
+
}
|
|
259
|
+
},
|
|
260
|
+
"default": {
|
|
261
|
+
"transformation": {
|
|
262
|
+
"start_offset": 0
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
},
|
|
266
|
+
"sourceTypes": {
|
|
267
|
+
"type": "array",
|
|
268
|
+
"items": {
|
|
269
|
+
"type": "string"
|
|
270
|
+
},
|
|
271
|
+
"default": ["auto"]
|
|
272
|
+
},
|
|
273
|
+
"transformation": {
|
|
274
|
+
"oneOf": [
|
|
275
|
+
{
|
|
276
|
+
"type": "string",
|
|
277
|
+
"default": ""
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
"type": "array",
|
|
281
|
+
"default": []
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
"type": "object",
|
|
285
|
+
"default": {}
|
|
286
|
+
}
|
|
287
|
+
],
|
|
288
|
+
"default": []
|
|
289
|
+
},
|
|
290
|
+
"shoppable": {
|
|
291
|
+
"type": "object",
|
|
292
|
+
"default": {}
|
|
293
|
+
},
|
|
294
|
+
"chapters": {
|
|
295
|
+
"oneOf": [
|
|
296
|
+
{
|
|
297
|
+
"type": "string"
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
"type": "object"
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
"type": "boolean"
|
|
304
|
+
}
|
|
305
|
+
],
|
|
306
|
+
"default": false
|
|
307
|
+
},
|
|
308
|
+
"visualSearch": {
|
|
309
|
+
"type": "boolean",
|
|
310
|
+
"default": false
|
|
311
|
+
},
|
|
312
|
+
"interactionAreas": {
|
|
313
|
+
"type": "object",
|
|
314
|
+
"properties": {
|
|
315
|
+
"enable": {
|
|
316
|
+
"type": "boolean",
|
|
317
|
+
"default": false
|
|
318
|
+
},
|
|
319
|
+
"template": {
|
|
320
|
+
"type": "string",
|
|
321
|
+
"enum": ["portrait", "landscape", "all", "center"],
|
|
322
|
+
"default": "portrait"
|
|
323
|
+
},
|
|
324
|
+
"vttUrl": {
|
|
325
|
+
"type": "string",
|
|
326
|
+
"default": ""
|
|
327
|
+
},
|
|
328
|
+
"theme": {
|
|
329
|
+
"type": "object",
|
|
330
|
+
"properties": {
|
|
331
|
+
"template": {
|
|
332
|
+
"type": "string",
|
|
333
|
+
"enum": ["pulsing", "shadowed"],
|
|
334
|
+
"default": "pulsing"
|
|
335
|
+
}
|
|
336
|
+
},
|
|
337
|
+
"default": {
|
|
338
|
+
"template": "pulsing"
|
|
339
|
+
}
|
|
340
|
+
},
|
|
341
|
+
"layout": {
|
|
342
|
+
"type": "object",
|
|
343
|
+
"properties": {
|
|
344
|
+
"enable": {
|
|
345
|
+
"type": "boolean",
|
|
346
|
+
"default": false
|
|
347
|
+
},
|
|
348
|
+
"showAgain": {
|
|
349
|
+
"type": "boolean",
|
|
350
|
+
"default": false
|
|
351
|
+
}
|
|
352
|
+
},
|
|
353
|
+
"default": {
|
|
354
|
+
"enable": false,
|
|
355
|
+
"showAgain": false
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
},
|
|
359
|
+
"default": {
|
|
360
|
+
"enable": false,
|
|
361
|
+
"template": "portrait",
|
|
362
|
+
"vttUrl": "",
|
|
363
|
+
"theme": {
|
|
364
|
+
"template": "pulsing"
|
|
365
|
+
},
|
|
366
|
+
"layout": {
|
|
367
|
+
"enable": false,
|
|
368
|
+
"showAgain": false
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
},
|
|
372
|
+
"textTracks": {
|
|
373
|
+
"type": "object",
|
|
374
|
+
"properties": {
|
|
375
|
+
"options": {
|
|
376
|
+
"type": "object",
|
|
377
|
+
"properties": {
|
|
378
|
+
"theme": {
|
|
379
|
+
"type": "string",
|
|
380
|
+
"default": "default"
|
|
381
|
+
},
|
|
382
|
+
"fontFace": {
|
|
383
|
+
"type": "string",
|
|
384
|
+
"default": "Fira Sans"
|
|
385
|
+
},
|
|
386
|
+
"fontSize": {
|
|
387
|
+
"type": "string",
|
|
388
|
+
"default": "medium"
|
|
389
|
+
},
|
|
390
|
+
"gravity": {
|
|
391
|
+
"type": "string",
|
|
392
|
+
"default": "bottom"
|
|
393
|
+
},
|
|
394
|
+
"box": {
|
|
395
|
+
"type": "object",
|
|
396
|
+
"default": {}
|
|
397
|
+
},
|
|
398
|
+
"style": {
|
|
399
|
+
"type": "object",
|
|
400
|
+
"default": {}
|
|
401
|
+
},
|
|
402
|
+
"wordHighlightStyle": {
|
|
403
|
+
"type": "object",
|
|
404
|
+
"default": {}
|
|
405
|
+
}
|
|
406
|
+
},
|
|
407
|
+
"default": {
|
|
408
|
+
"theme": "default",
|
|
409
|
+
"fontFace": "Fira Sans",
|
|
410
|
+
"fontSize": "medium",
|
|
411
|
+
"gravity": "bottom",
|
|
412
|
+
"box": {},
|
|
413
|
+
"style": {},
|
|
414
|
+
"wordHighlightStyle": {}
|
|
415
|
+
}
|
|
416
|
+
},
|
|
417
|
+
"captions": {
|
|
418
|
+
"type": "object",
|
|
419
|
+
"properties": {
|
|
420
|
+
"label": {
|
|
421
|
+
"type": "string",
|
|
422
|
+
"default": "English"
|
|
423
|
+
},
|
|
424
|
+
"language": {
|
|
425
|
+
"type": "string",
|
|
426
|
+
"default": "en"
|
|
427
|
+
},
|
|
428
|
+
"default": {
|
|
429
|
+
"type": "boolean",
|
|
430
|
+
"default": true
|
|
431
|
+
},
|
|
432
|
+
"url": {
|
|
433
|
+
"type": "string",
|
|
434
|
+
"default": ""
|
|
435
|
+
},
|
|
436
|
+
"maxWords": {
|
|
437
|
+
"type": "number",
|
|
438
|
+
"default": 0
|
|
439
|
+
},
|
|
440
|
+
"wordHighlight": {
|
|
441
|
+
"type": "boolean",
|
|
442
|
+
"default": true
|
|
443
|
+
},
|
|
444
|
+
"timeOffset": {
|
|
445
|
+
"type": "number",
|
|
446
|
+
"default": 0
|
|
447
|
+
}
|
|
448
|
+
},
|
|
449
|
+
"default": {
|
|
450
|
+
"label": "English",
|
|
451
|
+
"language": "en",
|
|
452
|
+
"default": true,
|
|
453
|
+
"url": "",
|
|
454
|
+
"maxWords": 0,
|
|
455
|
+
"wordHighlight": true,
|
|
456
|
+
"timeOffset": 0
|
|
457
|
+
}
|
|
458
|
+
},
|
|
459
|
+
"subtitles": {
|
|
460
|
+
"type": "array",
|
|
461
|
+
"items": {
|
|
462
|
+
"type": "object",
|
|
463
|
+
"properties": {
|
|
464
|
+
"label": {
|
|
465
|
+
"type": "string",
|
|
466
|
+
"default": ""
|
|
467
|
+
},
|
|
468
|
+
"language": {
|
|
469
|
+
"type": "string",
|
|
470
|
+
"default": ""
|
|
471
|
+
},
|
|
472
|
+
"default": {
|
|
473
|
+
"type": "boolean",
|
|
474
|
+
"default": true
|
|
475
|
+
},
|
|
476
|
+
"url": {
|
|
477
|
+
"type": "string",
|
|
478
|
+
"default": ""
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
},
|
|
482
|
+
"default": [
|
|
483
|
+
{
|
|
484
|
+
"label": "English",
|
|
485
|
+
"default": true,
|
|
486
|
+
"language": "en"
|
|
487
|
+
}
|
|
488
|
+
]
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
},
|
|
492
|
+
"title": {
|
|
493
|
+
"oneOf": [
|
|
494
|
+
{
|
|
495
|
+
"type": "string",
|
|
496
|
+
"default": ""
|
|
497
|
+
},
|
|
498
|
+
{
|
|
499
|
+
"type": "boolean",
|
|
500
|
+
"default": false
|
|
501
|
+
}
|
|
502
|
+
]
|
|
503
|
+
},
|
|
504
|
+
"description": {
|
|
505
|
+
"oneOf": [
|
|
506
|
+
{
|
|
507
|
+
"type": "string",
|
|
508
|
+
"default": ""
|
|
509
|
+
},
|
|
510
|
+
{
|
|
511
|
+
"type": "boolean",
|
|
512
|
+
"default": false
|
|
513
|
+
}
|
|
514
|
+
]
|
|
515
|
+
},
|
|
516
|
+
"adaptiveStreaming": {
|
|
517
|
+
"type": "string",
|
|
518
|
+
"enum": ["fastStart", "balanced", "highQuality"],
|
|
519
|
+
"default": "balanced"
|
|
520
|
+
}
|
|
521
|
+
},
|
|
522
|
+
"additionalProperties": true
|
|
523
|
+
}
|
package/dist/shoppable.js
CHANGED
package/dist/shoppable.min.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Cloudinary Video Player v3.1.2-edge.
|
|
3
|
-
* Built on 2025-07-
|
|
2
|
+
* Cloudinary Video Player v3.1.2-edge.2
|
|
3
|
+
* Built on 2025-07-29T06:41:04.249Z
|
|
4
4
|
* https://github.com/cloudinary/cloudinary-video-player
|
|
5
5
|
*/
|
|
6
6
|
(self.cloudinaryVideoPlayerChunkLoading=self.cloudinaryVideoPlayerChunkLoading||[]).push([[525],{9987:(t,e,s)=>{"use strict";s.d(e,{default:()=>Z});var o=s(6673),a=s.n(o);const i=function(t){const[e,s,o]=t.split(":").reverse();let a=null;return isNaN(e)||(a=60*(+o||0)*60+60*(+s||0)+ +e),a};var r=s(9339);const n={location:"right",toggleIcon:"",width:"20%",startState:"openOnPlay",autoClose:2,transformation:{quality:"auto",width:"auto",fetch_format:"auto",crop:"scale"},products:[],showPostPlayOverlay:!1},l="goto",c="seek",p="overlay",d="shoppable-panel-visible",h="shoppable-panel-hidden",u="shoppable-products-overlay",m="cld-spbl-panel",g="cld-spbl-toggle",_="cld-spbl-toggle-icon",y="cld-spbl-bar-inner",f="animate",v="cld-spbl-item",b="cld-spbl-img";var C=s(1104);const E=a().dom||a(),T=a().getComponent("Component");class N extends T{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(t,e),this.options_=e,this.player_=t,this.player_.on(C.f.SHOW_PRODUCTS_OVERLAY,this.renderProducts),this.dispose=()=>{this.layout_.dispose()}}renderProducts=()=>{this.player_.removeClass(d),this.player_.addClass(h),this.player_.addClass(u),this.layout_.innerHTML="";const t=this.player_.currentTime();this.options_.products.filter((e=>e.hotspots&&e.hotspots.some((e=>i(e.time)===t)))).forEach((e=>{const s=(0,r.I)(e.hotspots,(e=>i(e.time)===t)),o=E.createEl("div",{className:"cld-spbl-product-hotspot-name"},{},e.productName),a=E.createEl("div",{className:"cld-spbl-product-tooltip cld-spbl-product-tooltip-"+s.tooltipPosition},{},o),n=E.createEl("a",{className:"cld-spbl-product-hotspot accent-color-text",href:s.clickUrl,target:"_blank"},{style:"left:"+s.x+"; top:"+s.y+";"},a);this.layout_.appendChild(n)})),this.player_.one(C.f.SEEKING,this.clearLayout),this.player_.one(C.f.PLAY,this.clearLayout)};clearLayout=()=>{this.layout_.innerHTML="",this.player_.removeClass(u)};createEl(){const t=this.player_.currentDimensions();return this.layout_=E.createEl("div",{className:"cld-spbl-products-overlay",style:`padding-top: ${t.height/t.width*100}%;`}),this.layout_}}a().registerComponent("ShoppableProductsOverlay",N);const P=N,L=a().dom||a(),x=a().getComponent("ClickableComponent");class w extends x{constructor(t,e){super(t,e),this.options_=e}handleClick(t){t.preventDefault(),t.stopPropagation(),this.options_.clickHandler()}createEl(){let t={},e={};this.options_.toggleIcon?(t={className:`${_} cld-spbl-toggle-custom-icon vjs-icon-close`},e={style:`background-image: url(${this.options_.toggleIcon})`}):t={className:`${_} vjs-icon-cart`};const s=L.createEl("span",t,e),o=super.createEl("a",{className:`${g} base-color-bg`});return o.appendChild(s),this.player_.on(C.f.PRODUCT_BAR_MIN,(()=>{setTimeout((()=>{s.classList.add(f),setTimeout((()=>{s.classList.remove(f)}),1e3)}),500)})),o}}a().registerComponent("shoppablePanelToggle",w);const k=w,I=a().dom||a(),A=a().getComponent("Component");class H extends A{constructor(t,e){super(t,e),this.player_=t,this.player().addClass("cld-shoppable-panel"),this.player().addClass(h),this.contentWrpEl_=I.createEl("div",{className:"cld-spbl-bar"}),this.contentBannerEl_=I.createEl("div",{className:"cld-spbl-banner-msg base-color-text"},{},this.options_.bannerMsg||"Shop the Video"),this.contentWrpEl_.appendChild(this.contentBannerEl_);const s=new P(this.player_,this.options_);this.contentWrpEl_.appendChild(s.el_),this.contentEl_=I.createEl("div",{className:y}),this.contentWrpEl_.appendChild(this.contentEl_),this.player().el().appendChild(this.contentWrpEl_),this.addChild(new k(this.player_,{toggleIcon:this.options_.toggleIcon,clickHandler:()=>{this.togglePanel()}})),this.addChild("ShoppablePanel",this.options_),this.dispose=()=>{this.removeLayout(),super.dispose()},this.togglePanel=t=>{!0===t?(this.player().removeClass(h),this.player().addClass(d)):!1===t?(this.player().removeClass(d),this.player().addClass(h)):(this.player().toggleClass(h),this.player().toggleClass(d));let e=this.player().hasClass(d)?"productBarMax":"productBarMin";this.player().trigger(e)},"open"===this.options_.startState&&this.togglePanel(!0),this.player_.on(C.f.PLAY,(()=>{this.player_.currentTime()<.01&&("openOnPlay"===this.options_.startState&&this.togglePanel(!0,this.options_.autoClose),this.options_.autoClose&&-1!==this.options_.startState.indexOf("open")&&setTimeout((()=>{this.contentEl_.matches(":hover")?this.contentEl_.addEventListener("mouseleave",(()=>{this.togglePanel(!1)}),{once:!0}):this.togglePanel(!1)}),1e3*this.options_.autoClose))}))}createEl(){return super.createEl("div")}}a().registerComponent("shoppableBarLayout",H);const M=H;var S=s(2858),$=s.n(S),O=s(4650);const D=a().getComponent("ClickableComponent"),W=a().dom||a(),j={width:132};class B extends D{constructor(t,e){super(t,e),this.options_=e,this.isDragged=!1}handleClick(t){t.preventDefault(),t.stopPropagation(),this.el_.matches(`.dragged .${v}`)||this.options_.clickHandler(t),this.isDragged=!1}getTitle(){return this.options_.conf.title}createEl(){const t=super.createEl("a",{className:`${v} base-color-bg accent-color-text`,href:"#"});t.setAttribute("data-product-id",this.options_.conf.productId||""),t.setAttribute("data-product-name",this.options_.conf.productName||""),this.options_.conf.onHover&&R(t,this.options_.conf.onHover,this.options_.item.cloudinaryConfig()),this.options_.conf.onClick&&z(t,this.options_.conf.onClick);const e=super.createEl("img",{className:b},{src:this.options_.item.url(j)});if(t.appendChild(e),this.getTitle()){const e=W.createEl("div",{className:"cld-spbl-item-info base-color-semi-bg text-color-text"}),s=W.createEl("span",{className:"cld-spbl-item-title"},{},this.getTitle());e.appendChild(s),t.appendChild(e)}return t}}const R=(t,e,s)=>{if(t.setAttribute("data-hover-action",e.action),e.action===p){const s=W.createEl("span",{className:"cld-spbl-overlay-text base-color-text"},{},e.args),o=W.createEl("span",{className:"cld-spbl-overlay text-color-semi-bg base-color-text"},{title:e.args},s);t.appendChild(o)}else{const o=new O.A(e.args.publicId,{cloudinaryConfig:s,transformation:e.args.transformation}),a=W.createEl("img",{className:`${b} cld-spbl-hover-img`},{src:o.url(j)});t.appendChild(a)}},z=(t,e)=>{t.setAttribute("data-click-action",e.action),t.setAttribute("data-pause",e.pause),e.action===c?t.setAttribute("data-seek",e.args.time):e.action===l&&t.setAttribute("data-goto-url",e.args.url)};a().registerComponent("shoppablePanelItem",B);const U=B,V=a().getComponent("Component");class X extends V{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(t,e),this.options=e;const s=()=>{this.render()};t.on(C.f.SHOPPABLE_ITEM_CHANGED,s),this.render(),this.dispose=()=>{super.dispose(),t.off(C.f.SHOPPABLE_ITEM_CHANGED,s)}}createEl(){const t=super.createEl();return[m,"base-color-bg"].map((e=>t.classList.add(e))),t}removeAll(){const t=this.children();for(let e=t.length-1;e>=0;--e)this.removeChild(t[e])}getItems(){const t=this.player_.cloudinary.cloudinaryConfig();return this.options.products.map((e=>{e.onHover&&"object"==typeof e.onHover.args&&(e.onHover.args.transformation=Object.assign({},this.options.transformation,e.onHover.args.transformation));const s={productId:e.productId,productName:e.productName,title:e.title,onHover:e.onHover,onClick:e.onClick,startTime:e.startTime,endTime:e.endTime};return{imageSrc:new O.A(e.publicId,{cloudinaryConfig:t,transformation:Object.assign({},this.options.transformation,e.transformation)}),conf:s}}))}scrollToActiveItem(){const t=this.el_.getElementsByClassName("active");if(t.length>0){const e=t[0].offsetTop-12;"scrollBehavior"in document.documentElement.style?this.el_.scrollTo({top:e,behavior:"smooth"}):this.el_.scrollTop=e}}render(){this.removeAll();const t=this.getItems(),e=$()((()=>this.scrollToActiveItem()),1e3);t.forEach(((t,s)=>{const o=new U(this.player(),{item:t.imageSrc,conf:t.conf,next:1===s,current:0===s,clickHandler:t=>{let e=t.currentTarget||t.target,s=this.player_.ended()?"productClickPost":"productClick";if(this.player_.trigger(s,{productId:e.dataset.productId,productName:e.dataset.productName}),e.dataset.clickAction===l)window.open(e.dataset.gotoUrl,"_blank");else if(e.dataset.clickAction===c){const t=i(e.dataset.seek);null!==t&&(this.player_.addClass("vjs-has-started"),this.player_.postModal&&this.player_.postModal.close(),this.player_.currentTime(t),this.player_.removeClass(d),this.player_.addClass(h),this.player_.addClass(u),this.player_.one("seeked",(()=>this.player_.trigger("showProductsOverlay"))))}"false"!==e.dataset.pause&&(this.player_.pause(),i(e.dataset.pause)&&setTimeout((()=>{this.player_.play()}),1e3*i(e.dataset.pause)))}});o.on("mouseover",(t=>{let e=t.currentTarget||t.target,s=this.player_.ended()?"productHoverPost":"productHover";this.player_.trigger(s,{productId:e.dataset.productId,productName:e.dataset.productName})})),void 0!==t.conf.startTime&&void 0!==t.conf.endTime&&this.player_.on(C.f.TIME_UPDATE,(()=>{const s=this.player_.currentTime();s>=t.conf.startTime&&s<t.conf.endTime?(o.el_.classList.add("active"),e()):o.el_.classList.contains("active")&&o.el_.classList.remove("active")})),this.addChild(o)}))}}a().registerComponent("shoppablePanel",X);const G=X,Y=a().dom||a();const q=class{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.options_={...e,postPlay:!0},this.player_=t,this.render(),this.handleDragToScroll(),this.dispose=()=>{this.layout_.dispose()}}handleDragToScroll(){const t=this.player_.postModal.el_.querySelector(`.${m}`);let e=!1,s=0,o=0;t.addEventListener("mousedown",(a=>{e=!0,s=a.pageX-t.offsetLeft,o=t.scrollLeft})),document.addEventListener("mouseup",(o=>{e=!1,setTimeout((()=>{t.classList.remove("dragged")}),300);const a=o.pageX-t.offsetLeft-s;Math.abs(a)>5&&o.preventDefault()})),document.addEventListener("mousemove",(a=>{if(!e)return;a.preventDefault();const i=a.pageX-t.offsetLeft-s;t.scrollLeft=o-i,Math.abs(i)>5&&!t.classList.contains("dragged")&&t.classList.add("dragged")}))}render(){this.player_.postModal=null;const t=Y.createEl("div",{className:"cld-spbl-post-play"}),e=new G(this.player_,this.options_),s=Y.createEl("div",{className:"cld-spbl-post-title base-color-text"},{},this.options_.bannerMsg||"Shop the Video"),o=this.player_.cloudinary.currentPoster();o.transformation([o.transformation().toOptions?o.transformation().toOptions():{},{effect:"blur:3000"}]);const a=Y.createEl("div",{className:"cld-spbl-post-play-bg",style:`background-image: url("${o.url()}")`}),i=Y.createEl("button",{className:"cld-spbl-replay-btn base-color-bg vjs-icon-replay",onclick:()=>{this.player_.trigger("replay"),this.player_.postModal.close(),this.player_.play()}},{},"Replay");t.appendChild(a),t.appendChild(s),t.appendChild(e.el()),t.appendChild(i),this.player_.postModal=this.player_.createModal(t,{name:"postModal",uncloseable:!0}),this.player_.addClass("cld-spbl-post-modal"),this.player_.postModal.on("beforemodalclose",(()=>{this.player_.removeClass("cld-spbl-post-modal")}))}};const Z=class{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.options_=a().obj.merge(n,e),this.player_=t,this.options_.showPostPlayOverlay&&this.player_.on(C.f.ENDED,(()=>{this.player_.addChild(new q(this.player_,this.options_))}));const s=this.options_.width;this._injectCSS(`\n .${y} {\n transform: translateX(${s});\n }\n .${d} .vjs-control-bar {\n width: calc(100% - ${s});\n }\n .${g} {\n right: ${s};\n }\n .${m}{\n width: ${s};\n }\n `),this._setListeners()}_setListeners(){const t=this._resizeHandler.bind(this);this.player_.on(C.f.RESIZE,t),window.addEventListener("resize",t),this.dispose=()=>{this.player_.off(C.f.RESIZE,t),window.removeEventListener("resize",t),this.layout_.dispose()}}_injectCSS(t){const e=document.createElement("style");e.innerHTML=t,this.player_.el_.appendChild(e)}_resizeHandler(){const t=[["sm",0,80],["md",81,110],["lg",111,170]],e=parseFloat(this.options_.width)/100*this.player_.el_.clientWidth;let s=!1;if(e){for(const[o,a,i]of t)e>a&&e<=i&&(this.layout_.contentWrpEl_.setAttribute("size",o),s=o);s||this.layout_.contentWrpEl_.removeAttribute("size")}}init(){this.render()}render(){this.layout_=new M(this.player_,this.options_)}}},8812:(t,e,s)=>{var o=s(2140),a=/^\s+/;t.exports=function(t){return t?t.slice(0,o(t)+1).replace(a,""):t}},2140:t=>{var e=/\s/;t.exports=function(t){for(var s=t.length;s--&&e.test(t.charAt(s)););return s}},6177:(t,e,s)=>{var o=s(8953),a=s(3664),i=s(5378),r=Math.max,n=Math.min;t.exports=function(t,e,s){var l,c,p,d,h,u,m=0,g=!1,_=!1,y=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function f(e){var s=l,o=c;return l=c=void 0,m=e,d=t.apply(o,s)}function v(t){var s=t-u;return void 0===u||s>=e||s<0||_&&t-m>=p}function b(){var t=a();if(v(t))return C(t);h=setTimeout(b,function(t){var s=e-(t-u);return _?n(s,p-(t-m)):s}(t))}function C(t){return h=void 0,y&&l?f(t):(l=c=void 0,d)}function E(){var t=a(),s=v(t);if(l=arguments,c=this,u=t,s){if(void 0===h)return function(t){return m=t,h=setTimeout(b,e),g?f(t):d}(u);if(_)return clearTimeout(h),h=setTimeout(b,e),f(u)}return void 0===h&&(h=setTimeout(b,e)),d}return e=i(e)||0,o(s)&&(g=!!s.leading,p=(_="maxWait"in s)?r(i(s.maxWait)||0,e):p,y="trailing"in s?!!s.trailing:y),E.cancel=function(){void 0!==h&&clearTimeout(h),m=0,l=u=c=h=void 0},E.flush=function(){return void 0===h?d:C(a())},E}},3664:(t,e,s)=>{var o=s(1433);t.exports=function(){return o.Date.now()}},2858:(t,e,s)=>{var o=s(6177),a=s(8953);t.exports=function(t,e,s){var i=!0,r=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return a(s)&&(i="leading"in s?!!s.leading:i,r="trailing"in s?!!s.trailing:r),o(t,e,{leading:i,maxWait:e,trailing:r})}},5378:(t,e,s)=>{var o=s(8812),a=s(8953),i=s(5414),r=/^[-+]0x[0-9a-f]+$/i,n=/^0b[01]+$/i,l=/^0o[0-7]+$/i,c=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(i(t))return NaN;if(a(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=a(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=o(t);var s=n.test(t);return s||l.test(t)?c(t.slice(2),s?2:8):r.test(t)?NaN:+t}}}]);
|
package/dist/srt-text-tracks.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Cloudinary Video Player v3.1.2-edge.
|
|
3
|
-
* Built on 2025-07-
|
|
2
|
+
* Cloudinary Video Player v3.1.2-edge.2
|
|
3
|
+
* Built on 2025-07-29T06:41:04.249Z
|
|
4
4
|
* https://github.com/cloudinary/cloudinary-video-player
|
|
5
5
|
*/
|
|
6
6
|
"use strict";(self.cloudinaryVideoPlayerChunkLoading=self.cloudinaryVideoPlayerChunkLoading||[]).push([[6],{3565:(t,e,r)=>{r.d(e,{default:()=>d});const i=class{seperator=",";timestampToSeconds(t){const[e,r]=t.split(","),i=parseInt(r),[s,d,a]=e.split(":").map((t=>parseInt(t))),n=.001*i+a+60*d+3600*s;return Math.round(1e3*n)/1e3}correctFormat(t){let e=t.replace(".",",");var r,[i,s]=e.split(",");r=this.fixed_str_digit(3,s);var[d,a,n]=i.split(":");return`${this.fixed_str_digit(2,d,!1)}:${this.fixed_str_digit(2,a,!1)}:${this.fixed_str_digit(2,n,!1)},${r}`}fixed_str_digit(t,e,r=!0){return e.length==t?e:e.length>t?e.slice(0,t):e.length<t?r?e.padEnd(t,"0"):e.padStart(t,"0"):void 0}tryComma(t){let e=(t=t.replace(/\r/g,"")).split(/(\d+)\n(\d{1,2}:\d{2}:\d{2},\d{1,3}) --> (\d{1,2}:\d{2}:\d{2},\d{1,3})/g);return e.shift(),e}tryDot(t){let e=(t=t.replace(/\r/g,"")).split(/(\d+)\n(\d{1,2}:\d{2}:\d{2}\.\d{1,3}) --> (\d{1,2}:\d{2}:\d{2}\.\d{1,3})/g);return e.shift(),this.seperator=".",e}fromSrt(t){var e=t,r=this.tryComma(e);0==r.length&&(r=this.tryDot(e));for(var i=[],s=0;s<r.length;s+=4){const t=this.correctFormat(r[s+1].trim()),e=this.correctFormat(r[s+2].trim());var d={id:r[s].trim(),startTime:t,startSeconds:this.timestampToSeconds(t),endTime:e,endSeconds:this.timestampToSeconds(e),text:r[s+3].trim()};i.push(d)}return i}toSrt(t){var e="";const r="\r\n";for(var i=0;i<t.length;i++){var s=t[i];e+=s.id+r,e+=s.startTime+" --\x3e "+s.endTime+r,e+=s.text.replace("\n",r)+r+r}return e}};const s=t=>(new i).fromSrt(t).map((t=>({startTime:t.startSeconds,endTime:t.endSeconds,text:t.text}))),d=function(t,e){e.one("loadedmetadata",(()=>{(async()=>{let r;if(t.src)try{if(r=await fetch(t.src),!r.ok)throw new Error(`Failed fetching from ${t.src} with status code ${r.status}`)}catch(t){console.error(t)}if(!r.ok)return;const i=await r.text(),d=s(i),a=e.addRemoteTextTrack({kind:t.kind||"subtitles",label:t.label||"Subtitles",srclang:t.srclang,default:t.default,mode:t.default?"showing":"disabled"});d.forEach((t=>{t&&a.track.addCue(new VTTCue(t.startTime,t.endTime,t.text))}))})()}))}}}]);
|
package/dist/visual-search.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Cloudinary Video Player v3.1.2-edge.
|
|
3
|
-
* Built on 2025-07-
|
|
2
|
+
* Cloudinary Video Player v3.1.2-edge.2
|
|
3
|
+
* Built on 2025-07-29T06:41:04.249Z
|
|
4
4
|
* https://github.com/cloudinary/cloudinary-video-player
|
|
5
5
|
*/
|
|
6
6
|
"use strict";(self.cloudinaryVideoPlayerChunkLoading=self.cloudinaryVideoPlayerChunkLoading||[]).push([[728],{9148:(e,a,s)=>{s.d(a,{default:()=>l});var t=s(6673),r=s.n(t);const l=(e,a)=>{a.addClass("vjs-visual-search");let s=!1;const t=(e=>{const a=()=>{e.$$(".vjs-visual-search-marker").forEach((e=>e.remove())),e.$$(".vjs-visual-search-results-wrapper").forEach((e=>e.remove())),e.removeClass("vjs-visual-search-results-active")};return{displayResults:s=>{a();const t=e.duration(),l=e.controlBar.progressControl.seekBar,n=r().dom.createEl("div",{className:"vjs-visual-search-results-wrapper",role:"presentation"});s.forEach((a=>{const{start_time:s,end_time:l}=a,c=s/t*100,o=(l-s)/t*100,i=`${Math.floor(s/60)}:${Math.floor(s%60).toString().padStart(2,"0")}`,d=r().dom.createEl("div",{className:"vjs-control vjs-visual-search-marker",style:`left: ${c}%; width: ${o}%`,tabIndex:0,role:"button",title:`Search result at ${i}`,ariaLabel:`Search result at ${i}`});n.appendChild(d),d.addEventListener("click",(()=>{e.currentTime(s)})),d.addEventListener("keydown",(a=>{"Enter"!==a.key&&" "!==a.key||(a.preventDefault(),e.currentTime(s))}))})),l.el().appendChild(n),s.length>0&&e.addClass("vjs-visual-search-results-active")},clearMarkers:a}})(a),l=async e=>{const s=a.$(".vjs-visual-search-button");s.classList.add("vjs-waiting");try{const s=a.cloudinary.source(),r=s.publicId(),l=Object.assign({},s.transformation());l.flags=l.flags||[],l.flags.push(`getinfo:search_b64_${btoa(e)}`);const n=s.config().url(`${r}`,{transformation:l}),c=await fetch(n,{method:"GET",headers:{"Content-Type":"application/json"}});if(!c.ok)throw new Error(`Search request failed with status: ${c.status}`);const o=await c.json();t.displayResults(o.timestamps),o&&!a.hasStarted()&&a.play().then((()=>a.pause()))}catch(e){console.error("Error performing visual search:",e)}finally{s.classList.remove("vjs-waiting")}},n=()=>{s=!1,t.clearMarkers(),a.$(".vjs-visual-search-wrapper")?.remove()},c=()=>{n();const e=a.$(".vjs-title-bar");e&&e.classList.remove("vjs-hidden");const c=r().dom.createEl("div",{className:"vjs-visual-search-wrapper"}),o=()=>{s&&(s=!1,c.classList.remove("vjs-visual-search-active"),d.input.value="",d.input.tabIndex=-1,d.closeButton.tabIndex=-1,t.clearMarkers())},i=(e=>{const a=r().dom.createEl("button",{className:"vjs-control vjs-button vjs-visual-search-button",title:"Search video content",ariaLabel:"Search video content"}),s=r().dom.createEl("span",{className:"vjs-icon-search"});a.appendChild(s);const t=r().dom.createEl("span",{className:"vjs-loading-spinner"});return a.appendChild(t),a.addEventListener("click",e),a})((()=>{if(s){const e=d.input.value.trim();e&&l(e)}else s=!0,c.classList.add("vjs-visual-search-active"),d.input.tabIndex=0,d.closeButton.tabIndex=0,d.input.focus()})),d=((e,a)=>{const s=r().dom.createEl("form",{className:"vjs-visual-search-form"}),t=r().dom.createEl("input",{className:"vjs-visual-search-input",type:"text",ariaLabel:"Search input",tabIndex:-1}),l=r().dom.createEl("button",{className:"vjs-control vjs-button vjs-visual-search-close",type:"button",title:"Close search",ariaLabel:"Close search",tabIndex:-1}),n=r().dom.createEl("span",{className:"vjs-icon-close"});return l.appendChild(n),s.appendChild(t),s.appendChild(l),s.addEventListener("submit",(a=>{a.preventDefault();const s=t.value.trim();s&&e(s)})),l.addEventListener("click",(e=>{e.preventDefault(),a&&a()})),{element:s,input:t,closeButton:l}})(l,o);c.appendChild(i),c.appendChild(d.element),e.prepend(c),a.on("keydown",(e=>{"Escape"===e.key&&s&&o()}))};c(),a.visualSearch={createSearchUI:c,clearUI:n}}}}]);
|