cloudinary-video-player 2.6.0 → 2.6.1-edge.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.
- package/README.md +14 -16
- package/dist/adaptive-streaming.js +36927 -0
- package/dist/adaptive-streaming.min.js +3 -0
- package/dist/adaptive-streaming.min.js.LICENSE.txt +3 -0
- package/dist/chapters.js +1 -1
- package/dist/chapters.min.js +1 -1
- package/dist/cld-video-player.css +200 -11
- package/dist/cld-video-player.js +37548 -79684
- package/dist/cld-video-player.light.js +197 -662
- package/dist/cld-video-player.light.min.js +4 -3
- package/dist/cld-video-player.min.css +1 -1
- package/dist/cld-video-player.min.js +1 -1
- package/dist/cld-video-player.min.js.LICENSE.txt +16 -14
- package/dist/colors.js +86 -0
- package/dist/colors.min.js +2 -0
- package/dist/dash.js +62 -2
- package/dist/dash.min.js +1 -1
- package/dist/debug.js +140 -90
- package/dist/debug.min.js +1 -1
- package/dist/ima.js +66 -3
- package/dist/ima.min.js +1 -1
- package/dist/interaction-areas.js +87 -4
- package/dist/interaction-areas.min.js +1 -1
- package/dist/playlist.js +9 -9
- package/dist/playlist.min.js +1 -1
- package/dist/recommendations-overlay.js +7 -7
- package/dist/recommendations-overlay.min.js +1 -1
- package/dist/shoppable.js +7 -7
- package/dist/shoppable.min.js +1 -1
- package/dist/srt-text-tracks.js +208 -0
- package/dist/srt-text-tracks.min.js +2 -0
- package/dist/visual-search.js +4 -4
- package/dist/visual-search.min.js +1 -1
- package/lib/adaptive-streaming.js +3 -0
- package/lib/adaptive-streaming.js.LICENSE.txt +3 -0
- package/lib/all.js +1 -1
- package/lib/all.js.LICENSE.txt +18 -12
- package/lib/chapters.js +1 -1
- package/lib/cld-video-player.js +1 -1
- package/lib/cld-video-player.js.LICENSE.txt +16 -14
- package/lib/cld-video-player.min.css +2 -2
- package/lib/colors.js +2 -0
- package/lib/dash.js +1 -1
- package/lib/debug.js +1 -1
- package/lib/ima.js +1 -1
- package/lib/interaction-areas.js +1 -1
- package/lib/player.js +1 -1
- package/lib/player.js.LICENSE.txt +16 -14
- package/lib/playlist.js +1 -1
- package/lib/recommendations-overlay.js +1 -1
- package/lib/shoppable.js +1 -1
- package/lib/srt-text-tracks.js +2 -0
- package/lib/videoPlayer.js +1 -1
- package/lib/videoPlayer.js.LICENSE.txt +16 -14
- package/lib/visual-search.js +1 -1
- package/package.json +10 -23
- package/dist/chapters.light.js +0 -233
- package/dist/chapters.light.min.js +0 -2
- package/dist/cld-video-player.light.css +0 -2428
- package/dist/cld-video-player.light.min.css +0 -2
- package/dist/cld-video-player.light.min.js.LICENSE.txt +0 -21
- package/dist/dash.light.js +0 -70036
- package/dist/dash.light.min.js +0 -3
- package/dist/dash.light.min.js.LICENSE.txt +0 -1842
- package/dist/debug.light.js +0 -383
- package/dist/debug.light.min.js +0 -2
- package/dist/ima.light.js +0 -7110
- package/dist/ima.light.min.js +0 -2
- package/dist/interaction-areas.light.js +0 -646
- package/dist/interaction-areas.light.min.js +0 -2
- package/dist/node_modules_lodash_throttle_js.light.js +0 -449
- package/dist/playlist.light.js +0 -1788
- package/dist/playlist.light.min.js +0 -2
- package/dist/recommendations-overlay.light.js +0 -464
- package/dist/recommendations-overlay.light.min.js +0 -2
- package/dist/shoppable.light.js +0 -853
- package/dist/shoppable.light.min.js +0 -2
- package/dist/visual-search.light.js +0 -317
- package/dist/visual-search.light.min.js +0 -2
- package/lib/light/chapters.js +0 -2
- package/lib/light/cld-video-player.light.min.css +0 -21
- package/lib/light/dash.js +0 -3
- package/lib/light/dash.js.LICENSE.txt +0 -1842
- package/lib/light/debug.js +0 -2
- package/lib/light/ima.js +0 -2
- package/lib/light/index.js +0 -3
- package/lib/light/index.js.LICENSE.txt +0 -21
- package/lib/light/interaction-areas.js +0 -2
- package/lib/light/playlist.js +0 -2
- package/lib/light/recommendations-overlay.js +0 -2
- package/lib/light/shoppable.js +0 -2
- package/lib/light/visual-search.js +0 -2
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
console.warn('[Cloudinary] The "light" video-player is deprecated and will be removed in a future release. The main player is now light by default. Please use that instead.');
|
|
1
2
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
2
3
|
if(typeof exports === 'object' && typeof module === 'object')
|
|
3
4
|
module.exports = factory();
|
|
@@ -356,12 +357,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
356
357
|
cloudinaryAnalytics: true,
|
|
357
358
|
allowUsageReport: true,
|
|
358
359
|
playedEventPercents: [25, 50, 75, 100],
|
|
360
|
+
adaptiveStreaming: {
|
|
361
|
+
strategy: 'balanced'
|
|
362
|
+
},
|
|
359
363
|
html5: {
|
|
360
364
|
handlePartialData: false,
|
|
361
|
-
nativeTextTracks: false
|
|
362
|
-
vhs: {
|
|
363
|
-
overrideNative: (video_js__WEBPACK_IMPORTED_MODULE_0___default())?.browser ? !(video_js__WEBPACK_IMPORTED_MODULE_0___default().browser).IS_IOS && !(video_js__WEBPACK_IMPORTED_MODULE_0___default().browser).IS_SAFARI : true
|
|
364
|
-
}
|
|
365
|
+
nativeTextTracks: false
|
|
365
366
|
},
|
|
366
367
|
disableSeekWhileScrubbingOnMobile: true
|
|
367
368
|
});
|
|
@@ -808,6 +809,35 @@ const player = async (elem, initOptions, ready) => {
|
|
|
808
809
|
|
|
809
810
|
/***/ }),
|
|
810
811
|
|
|
812
|
+
/***/ "./plugins/adaptive-streaming/index.js":
|
|
813
|
+
/*!*********************************************!*\
|
|
814
|
+
!*** ./plugins/adaptive-streaming/index.js ***!
|
|
815
|
+
\*********************************************/
|
|
816
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
817
|
+
|
|
818
|
+
"use strict";
|
|
819
|
+
__webpack_require__.r(__webpack_exports__);
|
|
820
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
821
|
+
/* harmony export */ "default": () => (/* binding */ lazyAdaptiveStreamingPlugin)
|
|
822
|
+
/* harmony export */ });
|
|
823
|
+
async function lazyAdaptiveStreamingPlugin(options) {
|
|
824
|
+
const player = this;
|
|
825
|
+
try {
|
|
826
|
+
if (options.isDash) {
|
|
827
|
+
await __webpack_require__.e(/*! import() | dash */ "dash").then(__webpack_require__.bind(__webpack_require__, /*! videojs-contrib-dash */ "../node_modules/videojs-contrib-dash/dist/videojs-dash.es.js"));
|
|
828
|
+
}
|
|
829
|
+
await __webpack_require__.e(/*! import() | adaptive-streaming */ "adaptive-streaming").then(__webpack_require__.bind(__webpack_require__, /*! ./adaptive-streaming */ "./plugins/adaptive-streaming/adaptive-streaming.js"));
|
|
830
|
+
const {
|
|
831
|
+
default: abrPlugin
|
|
832
|
+
} = await __webpack_require__.e(/*! import() | adaptive-streaming */ "adaptive-streaming").then(__webpack_require__.bind(__webpack_require__, /*! ./adaptive-streaming */ "./plugins/adaptive-streaming/adaptive-streaming.js"));
|
|
833
|
+
abrPlugin(player, options);
|
|
834
|
+
} catch (error) {
|
|
835
|
+
console.error('Failed to load plugin:', error);
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
/***/ }),
|
|
840
|
+
|
|
811
841
|
/***/ "./plugins/ai-highlights-graph/index.js":
|
|
812
842
|
/*!**********************************************!*\
|
|
813
843
|
!*** ./plugins/ai-highlights-graph/index.js ***!
|
|
@@ -1422,7 +1452,7 @@ class CloudinaryAnalytics {
|
|
|
1422
1452
|
}, {
|
|
1423
1453
|
...(lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_0___default()(this.analyticsOptions) ? this.analyticsOptions : {}),
|
|
1424
1454
|
videoPlayerType: 'cloudinary video player',
|
|
1425
|
-
videoPlayerVersion: "2.6.
|
|
1455
|
+
videoPlayerVersion: "2.6.1-edge.1"
|
|
1426
1456
|
});
|
|
1427
1457
|
} else if (this.currentVideoMetadata.cloudName !== metadata.cloudName || this.currentVideoMetadata.publicId !== metadata.publicId) {
|
|
1428
1458
|
this.cloudinaryAnalytics.stopManualTracking();
|
|
@@ -1779,9 +1809,20 @@ class CloudinaryContext {
|
|
|
1779
1809
|
unsetRecommendations();
|
|
1780
1810
|
}
|
|
1781
1811
|
_source = src;
|
|
1782
|
-
const
|
|
1783
|
-
|
|
1784
|
-
|
|
1812
|
+
const isDash = options.sourceTypes && options.sourceTypes.some(s => s.includes('dash')) || typeof source === 'string' && source.endsWith('.mpd');
|
|
1813
|
+
const isHls = options.sourceTypes && options.sourceTypes.some(s => s.includes('hls')) || typeof source === 'string' && source.endsWith('.m3u8');
|
|
1814
|
+
const isAdaptiveStreamingRequired = isDash || isHls;
|
|
1815
|
+
if (isAdaptiveStreamingRequired && !_this.player.adaptiveStreamingLoaded) {
|
|
1816
|
+
__webpack_require__.e(/*! import() | adaptive-streaming */ "adaptive-streaming").then(__webpack_require__.bind(__webpack_require__, /*! ../adaptive-streaming */ "./plugins/adaptive-streaming/index.js")).then(() => {
|
|
1817
|
+
_this.player.adaptiveStreaming({
|
|
1818
|
+
...options.adaptiveStreaming,
|
|
1819
|
+
isDash,
|
|
1820
|
+
debug: options.debug
|
|
1821
|
+
}).then(() => {
|
|
1822
|
+
refresh();
|
|
1823
|
+
});
|
|
1824
|
+
}).catch(err => {
|
|
1825
|
+
console.error('Failed to load adaptive streaming plugin:', err);
|
|
1785
1826
|
refresh();
|
|
1786
1827
|
});
|
|
1787
1828
|
} else if (!options.skipRefresh) {
|
|
@@ -1805,8 +1846,8 @@ class CloudinaryContext {
|
|
|
1805
1846
|
options.sourceTransformation = options.sourceTransformation || _this.sourceTransformation();
|
|
1806
1847
|
options.sourceTypes = options.sourceTypes || _this.sourceTypes();
|
|
1807
1848
|
options.poster = options.poster || posterOptionsForCurrent();
|
|
1808
|
-
options.queryParams = Object.assign(options.queryParams || {}, options.
|
|
1809
|
-
_s: `vp-${"2.6.
|
|
1849
|
+
options.queryParams = Object.assign(options.queryParams || {}, options.allowUsageReport ? {
|
|
1850
|
+
_s: `vp-${"2.6.1-edge.1"}`
|
|
1810
1851
|
} : {});
|
|
1811
1852
|
if (options.sourceTypes.indexOf('audio') > -1) {
|
|
1812
1853
|
builtSrc = new _models_audio_source_audio_source__WEBPACK_IMPORTED_MODULE_7__["default"](publicId, options);
|
|
@@ -2370,11 +2411,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2370
2411
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2371
2412
|
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
2372
2413
|
/* harmony export */ });
|
|
2373
|
-
/* harmony import */ var
|
|
2374
|
-
/* harmony import */ var
|
|
2375
|
-
/* harmony import */ var
|
|
2376
|
-
/* harmony import */ var
|
|
2377
|
-
/* harmony import */ var
|
|
2414
|
+
/* harmony import */ var utils_querystring__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! utils/querystring */ "./utils/querystring.js");
|
|
2415
|
+
/* harmony import */ var lodash_castArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash/castArray */ "../node_modules/lodash/castArray.js");
|
|
2416
|
+
/* harmony import */ var lodash_castArray__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_castArray__WEBPACK_IMPORTED_MODULE_1__);
|
|
2417
|
+
/* harmony import */ var utils_consts__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! utils/consts */ "./utils/consts.js");
|
|
2418
|
+
/* harmony import */ var video_player_const__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! video-player.const */ "./video-player.const.js");
|
|
2378
2419
|
/* harmony import */ var _video_source_const__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./video-source.const */ "./plugins/cloudinary/models/video-source/video-source.const.js");
|
|
2379
2420
|
/* harmony import */ var _video_source_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./video-source.utils */ "./plugins/cloudinary/models/video-source/video-source.utils.js");
|
|
2380
2421
|
/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../common */ "./plugins/cloudinary/common.js");
|
|
@@ -2408,105 +2449,67 @@ class VideoSource extends _base_source__WEBPACK_IMPORTED_MODULE_7__["default"] {
|
|
|
2408
2449
|
publicId
|
|
2409
2450
|
}, _video_source_const__WEBPACK_IMPORTED_MODULE_4__.DEFAULT_POSTER_PARAMS);
|
|
2410
2451
|
}
|
|
2411
|
-
const {
|
|
2412
|
-
poster,
|
|
2413
|
-
sourceTypes,
|
|
2414
|
-
sourceTransformation,
|
|
2415
|
-
info,
|
|
2416
|
-
recommendations,
|
|
2417
|
-
textTracks,
|
|
2418
|
-
withCredentials,
|
|
2419
|
-
interactionAreas,
|
|
2420
|
-
chapters,
|
|
2421
|
-
visualSearch
|
|
2422
|
-
} = (0,utils_slicing__WEBPACK_IMPORTED_MODULE_0__.sliceAndUnsetProperties)(options, 'poster', 'sourceTypes', 'sourceTransformation', 'info', 'recommendations', 'textTracks', 'withCredentials', 'interactionAreas', 'chapters', 'visualSearch');
|
|
2423
2452
|
super(publicId, options);
|
|
2424
|
-
this.
|
|
2425
|
-
this._recommendations = null;
|
|
2426
|
-
this._textTracks = null;
|
|
2427
|
-
this._poster = null;
|
|
2428
|
-
this._info = null;
|
|
2429
|
-
this._sourceTransformation = null;
|
|
2430
|
-
this._interactionAreas = null;
|
|
2431
|
-
this._chapters = null;
|
|
2432
|
-
this._visualSearch = null;
|
|
2433
|
-
this._type = utils_consts__WEBPACK_IMPORTED_MODULE_3__.SOURCE_TYPE.VIDEO;
|
|
2453
|
+
this._type = utils_consts__WEBPACK_IMPORTED_MODULE_2__.SOURCE_TYPE.VIDEO;
|
|
2434
2454
|
this.isRawUrl = _isRawUrl;
|
|
2435
2455
|
this.isLiveStream = options.type === 'live';
|
|
2436
|
-
this.
|
|
2437
|
-
this.withCredentials = !!withCredentials;
|
|
2456
|
+
this.withCredentials = !!options.withCredentials;
|
|
2438
2457
|
this.getInitOptions = () => initOptions;
|
|
2439
|
-
|
|
2440
|
-
|
|
2458
|
+
|
|
2459
|
+
// Get properties that need simple getter/setter methods (exclude special cases)
|
|
2460
|
+
const EXCLUDED_PROPERTIES = ['poster',
|
|
2461
|
+
// Has complex logic
|
|
2462
|
+
'withCredentials',
|
|
2463
|
+
// Direct property
|
|
2464
|
+
'publicId',
|
|
2465
|
+
// BaseSource method
|
|
2466
|
+
'cloudinaryConfig',
|
|
2467
|
+
// BaseSource method
|
|
2468
|
+
'transformation',
|
|
2469
|
+
// BaseSource method
|
|
2470
|
+
'queryParams' // BaseSource method
|
|
2471
|
+
];
|
|
2472
|
+
const SIMPLE_PROPERTIES = video_player_const__WEBPACK_IMPORTED_MODULE_3__.SOURCE_PARAMS.filter(param => !EXCLUDED_PROPERTIES.includes(param));
|
|
2473
|
+
|
|
2474
|
+
// Create simple getter/setter methods
|
|
2475
|
+
this._createGetterSetters(SIMPLE_PROPERTIES);
|
|
2476
|
+
|
|
2477
|
+
// Set initial values from options
|
|
2478
|
+
SIMPLE_PROPERTIES.forEach(prop => {
|
|
2479
|
+
if (options[prop] !== undefined) {
|
|
2480
|
+
this[prop](options[prop]);
|
|
2481
|
+
}
|
|
2441
2482
|
});
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
this.
|
|
2445
|
-
this.interactionAreas(interactionAreas);
|
|
2446
|
-
this.chapters(chapters);
|
|
2447
|
-
this.visualSearch(visualSearch);
|
|
2448
|
-
this.recommendations(recommendations);
|
|
2449
|
-
this.textTracks(textTracks);
|
|
2483
|
+
|
|
2484
|
+
// Initialize poster
|
|
2485
|
+
this.poster(options.poster);
|
|
2450
2486
|
this.objectId = generateId();
|
|
2451
2487
|
}
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
}
|
|
2473
|
-
info(info) {
|
|
2474
|
-
if (!info) {
|
|
2475
|
-
return this._info;
|
|
2476
|
-
}
|
|
2477
|
-
this._info = info;
|
|
2478
|
-
return this;
|
|
2479
|
-
}
|
|
2480
|
-
interactionAreas(interactionAreas) {
|
|
2481
|
-
if (!interactionAreas) {
|
|
2482
|
-
return this._interactionAreas;
|
|
2483
|
-
}
|
|
2484
|
-
this._interactionAreas = interactionAreas;
|
|
2485
|
-
return this;
|
|
2486
|
-
}
|
|
2487
|
-
chapters(chapters) {
|
|
2488
|
-
if (!chapters) {
|
|
2489
|
-
return this._chapters;
|
|
2490
|
-
}
|
|
2491
|
-
this._chapters = chapters;
|
|
2492
|
-
return this;
|
|
2493
|
-
}
|
|
2494
|
-
visualSearch(visualSearch) {
|
|
2495
|
-
if (!visualSearch) {
|
|
2496
|
-
return this._visualSearch;
|
|
2497
|
-
}
|
|
2498
|
-
this._visualSearch = visualSearch;
|
|
2499
|
-
return this;
|
|
2500
|
-
}
|
|
2501
|
-
sourceTransformation(trans) {
|
|
2502
|
-
if (!trans) {
|
|
2503
|
-
return this._sourceTransformation;
|
|
2504
|
-
}
|
|
2505
|
-
this._sourceTransformation = trans;
|
|
2506
|
-
return this;
|
|
2488
|
+
|
|
2489
|
+
// Helper method to create simple getter/setter methods
|
|
2490
|
+
_createGetterSetters(properties) {
|
|
2491
|
+
properties.forEach(prop => {
|
|
2492
|
+
const privateKey = `_${prop}`;
|
|
2493
|
+
this[prop] = function (value) {
|
|
2494
|
+
if (value === undefined) {
|
|
2495
|
+
// Provide sensible defaults for specific properties
|
|
2496
|
+
if (prop === 'sourceTypes' && this[privateKey] === undefined) {
|
|
2497
|
+
return ['auto'];
|
|
2498
|
+
}
|
|
2499
|
+
if (prop === 'sourceTransformation' && this[privateKey] === undefined) {
|
|
2500
|
+
return {};
|
|
2501
|
+
}
|
|
2502
|
+
return this[privateKey];
|
|
2503
|
+
}
|
|
2504
|
+
this[privateKey] = value;
|
|
2505
|
+
return this;
|
|
2506
|
+
};
|
|
2507
|
+
});
|
|
2507
2508
|
}
|
|
2508
2509
|
poster(publicId) {
|
|
2509
|
-
let options =
|
|
2510
|
+
let options = {
|
|
2511
|
+
type: this.getInitOptions().type
|
|
2512
|
+
};
|
|
2510
2513
|
if (!publicId) {
|
|
2511
2514
|
return this._poster;
|
|
2512
2515
|
}
|
|
@@ -2549,7 +2552,7 @@ class VideoSource extends _base_source__WEBPACK_IMPORTED_MODULE_7__["default"] {
|
|
|
2549
2552
|
const isAdaptive = _video_source_const__WEBPACK_IMPORTED_MODULE_4__.ADAPTIVE_SOURCETYPES.includes(format);
|
|
2550
2553
|
const opts = {};
|
|
2551
2554
|
if (srcTransformation) {
|
|
2552
|
-
opts.transformation =
|
|
2555
|
+
opts.transformation = lodash_castArray__WEBPACK_IMPORTED_MODULE_1___default()(srcTransformation);
|
|
2553
2556
|
}
|
|
2554
2557
|
Object.assign(opts, {
|
|
2555
2558
|
resource_type: 'video',
|
|
@@ -2558,7 +2561,7 @@ class VideoSource extends _base_source__WEBPACK_IMPORTED_MODULE_7__["default"] {
|
|
|
2558
2561
|
const [type, codecTrans] = (0,_video_source_utils__WEBPACK_IMPORTED_MODULE_5__.formatToMimeTypeAndTransformation)(sourceType);
|
|
2559
2562
|
|
|
2560
2563
|
// If user's transformation include video_codec then don't add another video codec to transformation
|
|
2561
|
-
if (codecTrans && !((0,_video_source_utils__WEBPACK_IMPORTED_MODULE_5__.hasCodec)(opts.transformation) || (0,_video_source_utils__WEBPACK_IMPORTED_MODULE_5__.hasCodec)(this.
|
|
2564
|
+
if (codecTrans && !((0,_video_source_utils__WEBPACK_IMPORTED_MODULE_5__.hasCodec)(opts.transformation) || (0,_video_source_utils__WEBPACK_IMPORTED_MODULE_5__.hasCodec)(this.raw_transformation()))) {
|
|
2562
2565
|
opts.transformation = (0,_common__WEBPACK_IMPORTED_MODULE_6__.mergeTransformations)(opts.transformation, codecTrans);
|
|
2563
2566
|
}
|
|
2564
2567
|
if (opts.format === 'auto') {
|
|
@@ -2576,7 +2579,7 @@ class VideoSource extends _base_source__WEBPACK_IMPORTED_MODULE_7__["default"] {
|
|
|
2576
2579
|
});
|
|
2577
2580
|
}
|
|
2578
2581
|
}
|
|
2579
|
-
const queryString = this.queryParams() ? (0,
|
|
2582
|
+
const queryString = this.queryParams() ? (0,utils_querystring__WEBPACK_IMPORTED_MODULE_0__.objectToQuerystring)(this.queryParams()) : '';
|
|
2580
2583
|
const src = this.config().url(this.publicId(), opts);
|
|
2581
2584
|
// if src is a url that already contains query params then replace '?' with '&'
|
|
2582
2585
|
const params = src.indexOf('?') > -1 ? queryString.replace('?', '&') : queryString;
|
|
@@ -2606,9 +2609,6 @@ class VideoSource extends _base_source__WEBPACK_IMPORTED_MODULE_7__["default"] {
|
|
|
2606
2609
|
withCredentials: this.withCredentials
|
|
2607
2610
|
};
|
|
2608
2611
|
}
|
|
2609
|
-
getInteractionAreas() {
|
|
2610
|
-
return this._interactionAreas;
|
|
2611
|
-
}
|
|
2612
2612
|
}
|
|
2613
2613
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (VideoSource);
|
|
2614
2614
|
|
|
@@ -2684,270 +2684,21 @@ const hasCodec = transformations => {
|
|
|
2684
2684
|
"use strict";
|
|
2685
2685
|
__webpack_require__.r(__webpack_exports__);
|
|
2686
2686
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2687
|
-
/* harmony export */ "default": () => (/*
|
|
2688
|
-
/* harmony export */ getDefaultPlayerColor: () => (/* binding */ getDefaultPlayerColor)
|
|
2687
|
+
/* harmony export */ "default": () => (/* binding */ lazyColorsPlugin)
|
|
2689
2688
|
/* harmony export */ });
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
}
|
|
2702
|
-
|
|
2703
|
-
.PLAYER-CLASS-PREFIX .vjs-time-tooltip,
|
|
2704
|
-
.PLAYER-CLASS-PREFIX .vjs-mouse-display:after,
|
|
2705
|
-
.PLAYER-CLASS-PREFIX .vjs-play-progress:after {
|
|
2706
|
-
color: --text-color;
|
|
2707
|
-
background-color: --base-color;
|
|
2708
|
-
}
|
|
2709
|
-
|
|
2710
|
-
.PLAYER-CLASS-PREFIX .vjs-load-progress {
|
|
2711
|
-
background: rgba(--text-color, 0.3);
|
|
2712
|
-
}
|
|
2713
|
-
|
|
2714
|
-
.PLAYER-CLASS-PREFIX .vjs-volume-level {
|
|
2715
|
-
background: --text-color;
|
|
2716
|
-
}
|
|
2717
|
-
|
|
2718
|
-
.PLAYER-CLASS-PREFIX .vjs-play-progress {
|
|
2719
|
-
background: --accent-color;
|
|
2720
|
-
}
|
|
2721
|
-
|
|
2722
|
-
.PLAYER-CLASS-PREFIX .vjs-volume-vertical {
|
|
2723
|
-
background-color: rgba(--base-color, 0.7);
|
|
2724
|
-
}
|
|
2725
|
-
|
|
2726
|
-
.PLAYER-CLASS-PREFIX .vjs-volume-panel-horizontal .vjs-control:before {
|
|
2727
|
-
border-color: transparent transparent rgba(--accent-color, 0.4) transparent;
|
|
2728
|
-
}
|
|
2729
|
-
|
|
2730
|
-
.PLAYER-CLASS-PREFIX .vjs-volume-panel-horizontal .vjs-volume-level:before {
|
|
2731
|
-
border-color: transparent transparent --accent-color transparent;
|
|
2732
|
-
}
|
|
2733
|
-
|
|
2734
|
-
.PLAYER-CLASS-PREFIX .vjs-progress-control:before {
|
|
2735
|
-
color: --base-color;
|
|
2736
|
-
}
|
|
2737
|
-
|
|
2738
|
-
.PLAYER-CLASS-PREFIX .vjs-highlights-graph-display {
|
|
2739
|
-
color: rgba(--text-color, 0.3);
|
|
2740
|
-
}
|
|
2741
|
-
|
|
2742
|
-
.PLAYER-CLASS-PREFIX .vjs-recommendations-overlay {
|
|
2743
|
-
color: --text-color;
|
|
2744
|
-
background-color: rgba(--base-color, 0.4);
|
|
2745
|
-
}
|
|
2746
|
-
|
|
2747
|
-
.PLAYER-CLASS-PREFIX .vjs-recommendations-overlay .vjs-recommendations-overlay-item {
|
|
2748
|
-
box-shadow: 0 0.5em 1.2em 0px --base-color;
|
|
2749
|
-
color: --text-color;
|
|
2750
|
-
border: 1px solid --text-color !important;
|
|
2751
|
-
position: relative;
|
|
2752
|
-
}
|
|
2753
|
-
|
|
2754
|
-
.PLAYER-CLASS-PREFIX .vjs-recommendations-overlay .vjs-recommendations-overlay-item:active,
|
|
2755
|
-
.PLAYER-CLASS-PREFIX .vjs-recommendations-overlay .vjs-recommendations-overlay-item:hover {
|
|
2756
|
-
border: 1px solid --accent-color !important;
|
|
2757
|
-
}
|
|
2758
|
-
|
|
2759
|
-
.PLAYER-CLASS-PREFIX .vjs-menu-content .vjs-menu-item:active,
|
|
2760
|
-
.PLAYER-CLASS-PREFIX .vjs-menu-content .vjs-menu-item:focus,
|
|
2761
|
-
.PLAYER-CLASS-PREFIX .vjs-menu-content .vjs-menu-item:hover {
|
|
2762
|
-
color: --text-color;
|
|
2763
|
-
background-color: rgba(--text-color, 0.2);
|
|
2764
|
-
}
|
|
2765
|
-
|
|
2766
|
-
.PLAYER-CLASS-PREFIX.vjs-ad-playing .vjs-progress-control .vjs-play-progress {
|
|
2767
|
-
background: --base-color;
|
|
2768
|
-
}
|
|
2769
|
-
|
|
2770
|
-
.PLAYER-CLASS-PREFIX.cld-plw-layout {
|
|
2771
|
-
background-color: --base-color;
|
|
2772
|
-
}
|
|
2773
|
-
|
|
2774
|
-
.PLAYER-CLASS-PREFIX .cld-plw-item-info-wrap {
|
|
2775
|
-
color: --text-color;
|
|
2776
|
-
}
|
|
2777
|
-
|
|
2778
|
-
.PLAYER-CLASS-PREFIX .cld-video-player-floater-close polygon {
|
|
2779
|
-
fill: --base-color;
|
|
2780
|
-
}
|
|
2781
|
-
|
|
2782
|
-
.PLAYER-CLASS-PREFIX .cld-spbl-product-hotspot:after {
|
|
2783
|
-
background: --base-color;
|
|
2784
|
-
box-shadow: 0 0 0 4px --accent-color, 0 0 0 8px rgba(--text-color, 0.24);
|
|
2785
|
-
}
|
|
2786
|
-
|
|
2787
|
-
.PLAYER-CLASS-PREFIX .cld-spbl-product-tooltip {
|
|
2788
|
-
color: --base-color;
|
|
2789
|
-
background: --text-color;
|
|
2790
|
-
}
|
|
2791
|
-
|
|
2792
|
-
.PLAYER-CLASS-PREFIX .base-color-semi-bg {
|
|
2793
|
-
background: rgba(--base-color, 0.7);
|
|
2794
|
-
}
|
|
2795
|
-
|
|
2796
|
-
.PLAYER-CLASS-PREFIX .text-color-semi-bg {
|
|
2797
|
-
background: rgba(--text-color, 0.7);
|
|
2798
|
-
}
|
|
2799
|
-
|
|
2800
|
-
.PLAYER-CLASS-PREFIX .text-color-text {
|
|
2801
|
-
color: --text-color;
|
|
2802
|
-
}
|
|
2803
|
-
|
|
2804
|
-
.PLAYER-CLASS-PREFIX .base-color-text {
|
|
2805
|
-
color: --base-color;
|
|
2806
|
-
}
|
|
2807
|
-
|
|
2808
|
-
.PLAYER-CLASS-PREFIX .accent-color-text {
|
|
2809
|
-
color: --accent-color;
|
|
2810
|
-
}
|
|
2811
|
-
`;
|
|
2812
|
-
const darkOnlyColors = `
|
|
2813
|
-
.PLAYER-CLASS-PREFIX.cld-video-player-skin-dark .base-color-bg,
|
|
2814
|
-
.PLAYER-CLASS-PREFIX.cld-video-player-skin-dark .vjs-control-bar,
|
|
2815
|
-
.PLAYER-CLASS-PREFIX.cld-video-player-skin-dark .vjs-big-play-button,
|
|
2816
|
-
.PLAYER-CLASS-PREFIX.cld-video-player-skin-dark .vjs-menu-button .vjs-menu-content {
|
|
2817
|
-
background-color: rgba(--base-color, 0.6);
|
|
2818
|
-
}
|
|
2819
|
-
|
|
2820
|
-
.PLAYER-CLASS-PREFIX .vjs-recommendations-overlay .vjs-recommendations-overlay-item.vjs-recommendations-overlay-item-primary .vjs-recommendations-overlay-item-primary-content {
|
|
2821
|
-
background-color: rgba(--base-color, 0.6);
|
|
2822
|
-
}
|
|
2823
|
-
|
|
2824
|
-
.PLAYER-CLASS-PREFIX .vjs-recommendations-overlay .vjs-recommendations-overlay-item.vjs-recommendations-overlay-item-secondary div {
|
|
2825
|
-
background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent 80%);
|
|
2826
|
-
}
|
|
2827
|
-
|
|
2828
|
-
.PLAYER-CLASS-PREFIX .vjs-upcoming-video {
|
|
2829
|
-
border: 1px solid rgba(--text-color, 0.5);
|
|
2830
|
-
}
|
|
2831
|
-
|
|
2832
|
-
.PLAYER-CLASS-PREFIX .vjs-upcoming-video .vjs-upcoming-video-bar {
|
|
2833
|
-
background-color: rgba(--base-color, 0.6);
|
|
2834
|
-
}
|
|
2835
|
-
|
|
2836
|
-
.PLAYER-CLASS-PREFIX .vjs-context-menu-ui .vjs-menu-content {
|
|
2837
|
-
background-color: rgba(--base-color, 0.6);
|
|
2838
|
-
}
|
|
2839
|
-
`;
|
|
2840
|
-
const lightOnlyColors = `
|
|
2841
|
-
.PLAYER-CLASS-PREFIX.cld-video-player-skin-light .base-color-bg,
|
|
2842
|
-
.PLAYER-CLASS-PREFIX.cld-video-player-skin-light .vjs-control-bar,
|
|
2843
|
-
.PLAYER-CLASS-PREFIX.cld-video-player-skin-light .vjs-big-play-button,
|
|
2844
|
-
.PLAYER-CLASS-PREFIX.cld-video-player-skin-light .vjs-menu-button .vjs-menu-content {
|
|
2845
|
-
background-color: rgba(--base-color, 0.8);
|
|
2846
|
-
}
|
|
2847
|
-
|
|
2848
|
-
.PLAYER-CLASS-PREFIX .vjs-recommendations-overlay .vjs-recommendations-overlay-item.vjs-recommendations-overlay-item-primary .vjs-recommendations-overlay-item-primary-content {
|
|
2849
|
-
background-color: --base-color;
|
|
2850
|
-
}
|
|
2851
|
-
|
|
2852
|
-
.PLAYER-CLASS-PREFIX .vjs-recommendations-overlay .vjs-recommendations-overlay-item.vjs-recommendations-overlay-item-primary:active .vjs-recommendations-overlay-item-primary-content,
|
|
2853
|
-
.PLAYER-CLASS-PREFIX .vjs-recommendations-overlay .vjs-recommendations-overlay-item.vjs-recommendations-overlay-item-primary:hover .vjs-recommendations-overlay-item-primary-content {
|
|
2854
|
-
color: --base-color;
|
|
2855
|
-
background-color: rgba(--accent-color, 0.8);
|
|
2856
|
-
}
|
|
2857
|
-
|
|
2858
|
-
.PLAYER-CLASS-PREFIX .vjs-recommendations-overlay .vjs-recommendations-overlay-item.vjs-recommendations-overlay-item-secondary:active div,
|
|
2859
|
-
.PLAYER-CLASS-PREFIX .vjs-recommendations-overlay .vjs-recommendations-overlay-item.vjs-recommendations-overlay-item-secondary:hover div {
|
|
2860
|
-
color: --base-color;
|
|
2861
|
-
background-color: rgba(--accent-color, 0.8);
|
|
2862
|
-
}
|
|
2863
|
-
|
|
2864
|
-
.PLAYER-CLASS-PREFIX .vjs-recommendations-overlay .vjs-recommendations-overlay-item.vjs-recommendations-overlay-item-secondary div {
|
|
2865
|
-
background: --base-color;
|
|
2866
|
-
}
|
|
2867
|
-
|
|
2868
|
-
.PLAYER-CLASS-PREFIX .vjs-upcoming-video {
|
|
2869
|
-
border: 1px solid --text-color;
|
|
2870
|
-
}
|
|
2871
|
-
|
|
2872
|
-
.PLAYER-CLASS-PREFIX .vjs-upcoming-video .vjs-upcoming-video-bar {
|
|
2873
|
-
background-color: --base-color;
|
|
2874
|
-
}
|
|
2875
|
-
|
|
2876
|
-
.PLAYER-CLASS-PREFIX .vjs-context-menu-ui .vjs-menu-content {
|
|
2877
|
-
background-color: --base-color;
|
|
2878
|
-
}
|
|
2879
|
-
|
|
2880
|
-
.PLAYER-CLASS-PREFIX .cld-plw-item-info-wrap {
|
|
2881
|
-
color: --text-color;
|
|
2882
|
-
}
|
|
2883
|
-
|
|
2884
|
-
@media only screen and (max-width: 768px) {
|
|
2885
|
-
.PLAYER-CLASS-PREFIX.cld-plw-vertical .cld-plw-item-info-wrap {
|
|
2886
|
-
color: --accent-color;
|
|
2887
|
-
}
|
|
2888
|
-
}
|
|
2889
|
-
`;
|
|
2890
|
-
const defaults = {
|
|
2891
|
-
colorsDark: {
|
|
2892
|
-
'base': '#000000',
|
|
2893
|
-
'accent': '#0D9AFF',
|
|
2894
|
-
'text': '#FFFFFF'
|
|
2895
|
-
},
|
|
2896
|
-
colorsLight: {
|
|
2897
|
-
'base': '#FFFFFF',
|
|
2898
|
-
'accent': '#0D9AFF',
|
|
2899
|
-
'text': '#000000'
|
|
2900
|
-
}
|
|
2901
|
-
};
|
|
2902
|
-
const getDefaultPlayerColor = options => {
|
|
2903
|
-
return (0,_video_player_utils__WEBPACK_IMPORTED_MODULE_1__.isLight)(options) ? defaults.colorsLight : defaults.colorsDark;
|
|
2904
|
-
};
|
|
2905
|
-
class Colors {
|
|
2906
|
-
constructor(player) {
|
|
2907
|
-
let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
2908
|
-
this.player = player;
|
|
2909
|
-
const skinDefaults = getDefaultPlayerColor(this.player.options_);
|
|
2910
|
-
opts.colors = Object.assign({}, skinDefaults, opts.colors);
|
|
2911
|
-
this.init = () => {
|
|
2912
|
-
injectCSS(parseStyles(playerColors));
|
|
2913
|
-
if (this.player.options_.skin === 'light') {
|
|
2914
|
-
injectCSS(parseStyles(lightOnlyColors));
|
|
2915
|
-
} else {
|
|
2916
|
-
injectCSS(parseStyles(darkOnlyColors));
|
|
2917
|
-
}
|
|
2918
|
-
};
|
|
2919
|
-
const injectCSS = css => {
|
|
2920
|
-
const style = document.createElement('style');
|
|
2921
|
-
style.innerHTML = css;
|
|
2922
|
-
this.player.el_.appendChild(style);
|
|
2923
|
-
};
|
|
2924
|
-
const hexToRgb = hex => {
|
|
2925
|
-
// Expand shorthand form (e.g. "03F") to full form (e.g. "0033FF")
|
|
2926
|
-
const shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
|
|
2927
|
-
hex = hex.replace(shorthandRegex, function (m, r, g, b) {
|
|
2928
|
-
return r + r + g + g + b + b;
|
|
2929
|
-
});
|
|
2930
|
-
|
|
2931
|
-
// '#0080C0' to '0, 128, 192'
|
|
2932
|
-
const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
|
2933
|
-
return result ? parseInt(result[1], 16) + ', ' + parseInt(result[2], 16) + ', ' + parseInt(result[3], 16) : null;
|
|
2934
|
-
};
|
|
2935
|
-
const parseStyles = styles => {
|
|
2936
|
-
const parsed = styles
|
|
2937
|
-
// wrapper class
|
|
2938
|
-
.replace(/PLAYER\-CLASS\-PREFIX/g, (0,utils_css_prefix__WEBPACK_IMPORTED_MODULE_0__.playerClassPrefix)(this.player))
|
|
2939
|
-
// rgba first
|
|
2940
|
-
.replace(/rgba\(\-\-base\-color/g, 'rgba(' + hexToRgb(opts.colors.base)).replace(/rgba\(\-\-accent\-color/g, 'rgba(' + hexToRgb(opts.colors.accent)).replace(/rgba\(\-\-text\-color/g, 'rgba(' + hexToRgb(opts.colors.text))
|
|
2941
|
-
// solid colors
|
|
2942
|
-
.replace(/\-\-base\-color/g, opts.colors.base).replace(/\-\-accent\-color/g, opts.colors.accent).replace(/\-\-text\-color/g, opts.colors.text);
|
|
2943
|
-
return parsed;
|
|
2944
|
-
};
|
|
2689
|
+
async function lazyColorsPlugin(options) {
|
|
2690
|
+
const player = this;
|
|
2691
|
+
try {
|
|
2692
|
+
const {
|
|
2693
|
+
default: colorsPlugin
|
|
2694
|
+
} = await Promise.all(/*! import() | colors */[__webpack_require__.e("styles"), __webpack_require__.e("colors")]).then(__webpack_require__.bind(__webpack_require__, /*! ./colors */ "./plugins/colors/colors.js"));
|
|
2695
|
+
const colors = colorsPlugin(player, options);
|
|
2696
|
+
player.cloudinary.colors = colors;
|
|
2697
|
+
return colors;
|
|
2698
|
+
} catch (error) {
|
|
2699
|
+
console.error('Failed to load colors plugin:', error);
|
|
2945
2700
|
}
|
|
2946
2701
|
}
|
|
2947
|
-
/* harmony default export */ function __WEBPACK_DEFAULT_EXPORT__() {
|
|
2948
|
-
let opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
2949
|
-
new Colors(this, opts).init();
|
|
2950
|
-
}
|
|
2951
2702
|
|
|
2952
2703
|
/***/ }),
|
|
2953
2704
|
|
|
@@ -3073,7 +2824,7 @@ const contextMenuContent = player => {
|
|
|
3073
2824
|
const isFullscreen = player.isFullscreen();
|
|
3074
2825
|
const aboutMenuItem = {
|
|
3075
2826
|
class: 'player-version',
|
|
3076
|
-
label: 'Cloudinary Player v' + "2.6.
|
|
2827
|
+
label: 'Cloudinary Player v' + "2.6.1-edge.1"
|
|
3077
2828
|
};
|
|
3078
2829
|
if (!player.controls()) {
|
|
3079
2830
|
return [aboutMenuItem];
|
|
@@ -3633,19 +3384,20 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
3633
3384
|
/* harmony import */ var _autoplay_on_scroll__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./autoplay-on-scroll */ "./plugins/autoplay-on-scroll/index.js");
|
|
3634
3385
|
/* harmony import */ var _cloudinary__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./cloudinary */ "./plugins/cloudinary/index.js");
|
|
3635
3386
|
/* harmony import */ var _cloudinary_analytics__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./cloudinary-analytics */ "./plugins/cloudinary-analytics/index.js");
|
|
3636
|
-
/* harmony import */ var
|
|
3637
|
-
/* harmony import */ var
|
|
3638
|
-
/* harmony import */ var
|
|
3639
|
-
/* harmony import */ var
|
|
3640
|
-
/* harmony import */ var
|
|
3641
|
-
/* harmony import */ var
|
|
3642
|
-
/* harmony import */ var
|
|
3643
|
-
/* harmony import */ var
|
|
3644
|
-
/* harmony import */ var
|
|
3645
|
-
/* harmony import */ var
|
|
3646
|
-
/* harmony import */ var
|
|
3647
|
-
/* harmony import */ var
|
|
3387
|
+
/* harmony import */ var _context_menu__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./context-menu */ "./plugins/context-menu/index.js");
|
|
3388
|
+
/* harmony import */ var _floating_player__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./floating-player */ "./plugins/floating-player/index.js");
|
|
3389
|
+
/* harmony import */ var _paced_transcript__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./paced-transcript */ "./plugins/paced-transcript/index.js");
|
|
3390
|
+
/* harmony import */ var _styled_text_tracks__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./styled-text-tracks */ "./plugins/styled-text-tracks/index.js");
|
|
3391
|
+
/* harmony import */ var _vtt_thumbnails__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./vtt-thumbnails */ "./plugins/vtt-thumbnails/index.js");
|
|
3392
|
+
/* harmony import */ var _chapters__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./chapters */ "./plugins/chapters/index.js");
|
|
3393
|
+
/* harmony import */ var _colors__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./colors */ "./plugins/colors/index.js");
|
|
3394
|
+
/* harmony import */ var _ima__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./ima */ "./plugins/ima/index.js");
|
|
3395
|
+
/* harmony import */ var _interaction_areas__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./interaction-areas */ "./plugins/interaction-areas/index.js");
|
|
3396
|
+
/* harmony import */ var _playlist__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./playlist */ "./plugins/playlist/index.js");
|
|
3397
|
+
/* harmony import */ var _shoppable_plugin__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./shoppable-plugin */ "./plugins/shoppable-plugin/index.js");
|
|
3398
|
+
/* harmony import */ var _srt_text_tracks__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./srt-text-tracks */ "./plugins/srt-text-tracks/index.js");
|
|
3648
3399
|
/* harmony import */ var _visual_search__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./visual-search */ "./plugins/visual-search/index.js");
|
|
3400
|
+
/* harmony import */ var _adaptive_streaming__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./adaptive-streaming */ "./plugins/adaptive-streaming/index.js");
|
|
3649
3401
|
|
|
3650
3402
|
|
|
3651
3403
|
|
|
@@ -3658,9 +3410,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
3658
3410
|
|
|
3659
3411
|
|
|
3660
3412
|
|
|
3413
|
+
// Lazy loaded plugins
|
|
3414
|
+
|
|
3661
3415
|
|
|
3662
3416
|
|
|
3663
|
-
// Lazy loaded plugins
|
|
3664
3417
|
|
|
3665
3418
|
|
|
3666
3419
|
|
|
@@ -3673,20 +3426,21 @@ const plugins = {
|
|
|
3673
3426
|
autoplayOnScroll: _autoplay_on_scroll__WEBPACK_IMPORTED_MODULE_3__["default"],
|
|
3674
3427
|
cloudinary: _cloudinary__WEBPACK_IMPORTED_MODULE_4__["default"],
|
|
3675
3428
|
cloudinaryAnalytics: _cloudinary_analytics__WEBPACK_IMPORTED_MODULE_5__["default"],
|
|
3676
|
-
|
|
3677
|
-
|
|
3678
|
-
|
|
3679
|
-
|
|
3680
|
-
vttThumbnails:
|
|
3429
|
+
contextMenu: _context_menu__WEBPACK_IMPORTED_MODULE_6__["default"],
|
|
3430
|
+
floatingPlayer: _floating_player__WEBPACK_IMPORTED_MODULE_7__["default"],
|
|
3431
|
+
pacedTranscript: _paced_transcript__WEBPACK_IMPORTED_MODULE_8__["default"],
|
|
3432
|
+
styledTextTracks: _styled_text_tracks__WEBPACK_IMPORTED_MODULE_9__["default"],
|
|
3433
|
+
vttThumbnails: _vtt_thumbnails__WEBPACK_IMPORTED_MODULE_10__["default"],
|
|
3681
3434
|
// Lazy loaded plugins
|
|
3682
|
-
chapters:
|
|
3683
|
-
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
|
|
3687
|
-
|
|
3688
|
-
interactionAreas:
|
|
3689
|
-
visualSearch: _visual_search__WEBPACK_IMPORTED_MODULE_18__["default"]
|
|
3435
|
+
chapters: _chapters__WEBPACK_IMPORTED_MODULE_11__["default"],
|
|
3436
|
+
colors: _colors__WEBPACK_IMPORTED_MODULE_12__["default"],
|
|
3437
|
+
imaPlugin: _ima__WEBPACK_IMPORTED_MODULE_13__["default"],
|
|
3438
|
+
playlist: _playlist__WEBPACK_IMPORTED_MODULE_15__["default"],
|
|
3439
|
+
shoppable: _shoppable_plugin__WEBPACK_IMPORTED_MODULE_16__["default"],
|
|
3440
|
+
srtTextTracks: _srt_text_tracks__WEBPACK_IMPORTED_MODULE_17__["default"],
|
|
3441
|
+
interactionAreas: _interaction_areas__WEBPACK_IMPORTED_MODULE_14__["default"],
|
|
3442
|
+
visualSearch: _visual_search__WEBPACK_IMPORTED_MODULE_18__["default"],
|
|
3443
|
+
adaptiveStreaming: _adaptive_streaming__WEBPACK_IMPORTED_MODULE_19__["default"]
|
|
3690
3444
|
};
|
|
3691
3445
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (plugins);
|
|
3692
3446
|
|
|
@@ -3911,86 +3665,22 @@ async function lazyShoppablePlugin(player, options) {
|
|
|
3911
3665
|
"use strict";
|
|
3912
3666
|
__webpack_require__.r(__webpack_exports__);
|
|
3913
3667
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3914
|
-
/* harmony export */ "default": () => (/* binding */
|
|
3668
|
+
/* harmony export */ "default": () => (/* binding */ lazySrtTextTracksPlugin)
|
|
3915
3669
|
/* harmony export */ });
|
|
3916
|
-
|
|
3917
|
-
|
|
3918
|
-
async function srtTextTracksPlugin(config) {
|
|
3670
|
+
async function lazySrtTextTracksPlugin(config) {
|
|
3919
3671
|
const player = this;
|
|
3920
3672
|
try {
|
|
3921
|
-
|
|
3673
|
+
const {
|
|
3674
|
+
default: srtTextTracks
|
|
3675
|
+
} = await __webpack_require__.e(/*! import() | srt-text-tracks */ "srt-text-tracks").then(__webpack_require__.bind(__webpack_require__, /*! ./srt-text-tracks */ "./plugins/srt-text-tracks/srt-text-tracks.js"));
|
|
3676
|
+
player.ready(() => srtTextTracks(config, player));
|
|
3922
3677
|
} catch (error) {
|
|
3923
|
-
console.error('Failed to load plugin:', error);
|
|
3678
|
+
console.error('Failed to load srt-text-tracks plugin:', error);
|
|
3924
3679
|
}
|
|
3925
3680
|
}
|
|
3926
3681
|
|
|
3927
3682
|
/***/ }),
|
|
3928
3683
|
|
|
3929
|
-
/***/ "./plugins/srt-text-tracks/srt-text-tracks.js":
|
|
3930
|
-
/*!****************************************************!*\
|
|
3931
|
-
!*** ./plugins/srt-text-tracks/srt-text-tracks.js ***!
|
|
3932
|
-
\****************************************************/
|
|
3933
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
3934
|
-
|
|
3935
|
-
"use strict";
|
|
3936
|
-
__webpack_require__.r(__webpack_exports__);
|
|
3937
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
3938
|
-
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
3939
|
-
/* harmony export */ });
|
|
3940
|
-
/* harmony import */ var srt_parser_2__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! srt-parser-2 */ "../node_modules/srt-parser-2/dist/index.js");
|
|
3941
|
-
|
|
3942
|
-
function srtTextTracks(config, player) {
|
|
3943
|
-
// Load the SRT file and convert it to WebVTT
|
|
3944
|
-
const initSRT = async () => {
|
|
3945
|
-
let srtResponse;
|
|
3946
|
-
if (config.src) {
|
|
3947
|
-
try {
|
|
3948
|
-
srtResponse = await fetch(config.src);
|
|
3949
|
-
if (!srtResponse.ok) {
|
|
3950
|
-
throw new Error(`Failed fetching from ${config.src} with status code ${srtResponse.status}`);
|
|
3951
|
-
}
|
|
3952
|
-
} catch (error) {
|
|
3953
|
-
console.error(error);
|
|
3954
|
-
}
|
|
3955
|
-
}
|
|
3956
|
-
if (!srtResponse.ok) return;
|
|
3957
|
-
const srtData = await srtResponse.text();
|
|
3958
|
-
const webvttCues = srt2webvtt(srtData); // Get the array of cues
|
|
3959
|
-
|
|
3960
|
-
const srtTrack = player.addRemoteTextTrack({
|
|
3961
|
-
kind: config.kind || 'subtitles',
|
|
3962
|
-
label: config.label || 'Subtitles',
|
|
3963
|
-
srclang: config.srclang,
|
|
3964
|
-
default: config.default,
|
|
3965
|
-
mode: config.default ? 'showing' : 'disabled'
|
|
3966
|
-
});
|
|
3967
|
-
|
|
3968
|
-
// Add the WebVTT data to the track
|
|
3969
|
-
webvttCues.forEach(cue => {
|
|
3970
|
-
if (cue) {
|
|
3971
|
-
srtTrack.track.addCue(new VTTCue(cue.startTime, cue.endTime, cue.text));
|
|
3972
|
-
}
|
|
3973
|
-
});
|
|
3974
|
-
};
|
|
3975
|
-
player.one('loadedmetadata', () => {
|
|
3976
|
-
initSRT();
|
|
3977
|
-
});
|
|
3978
|
-
}
|
|
3979
|
-
|
|
3980
|
-
// SRT parser
|
|
3981
|
-
const srt2webvtt = data => {
|
|
3982
|
-
const SRTParser = new srt_parser_2__WEBPACK_IMPORTED_MODULE_0__["default"]();
|
|
3983
|
-
const cues = SRTParser.fromSrt(data);
|
|
3984
|
-
return cues.map(cue => ({
|
|
3985
|
-
startTime: cue.startSeconds,
|
|
3986
|
-
endTime: cue.endSeconds,
|
|
3987
|
-
text: cue.text
|
|
3988
|
-
}));
|
|
3989
|
-
};
|
|
3990
|
-
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (srtTextTracks);
|
|
3991
|
-
|
|
3992
|
-
/***/ }),
|
|
3993
|
-
|
|
3994
3684
|
/***/ "./plugins/styled-text-tracks/index.js":
|
|
3995
3685
|
/*!*********************************************!*\
|
|
3996
3686
|
!*** ./plugins/styled-text-tracks/index.js ***!
|
|
@@ -4916,7 +4606,6 @@ const filterDefaultsAndNulls = obj => Object.entries(obj).reduce((filtered, _ref
|
|
|
4916
4606
|
const getCloudinaryOptions = function () {
|
|
4917
4607
|
let cloudinaryOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
4918
4608
|
return {
|
|
4919
|
-
sourceTypes: cloudinaryOptions.sourceTypes,
|
|
4920
4609
|
autoShowRecommendations: cloudinaryOptions.autoShowRecommendations,
|
|
4921
4610
|
fontFace: cloudinaryOptions.fontFace,
|
|
4922
4611
|
posterOptions: hasConfig(cloudinaryOptions.posterOptions),
|
|
@@ -4942,9 +4631,13 @@ const getTranscriptOptions = function () {
|
|
|
4942
4631
|
const getSourceOptions = function () {
|
|
4943
4632
|
let sourceOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
4944
4633
|
return {
|
|
4634
|
+
sourceTypes: sourceOptions.sourceTypes,
|
|
4945
4635
|
chapters: sourceOptions.chapters && (sourceOptions.chapters.url ? 'url' : 'inline-chapters'),
|
|
4946
4636
|
visualSearch: hasConfig(sourceOptions.visualSearch),
|
|
4947
4637
|
recommendations: sourceOptions.recommendations && sourceOptions.recommendations.length,
|
|
4638
|
+
...(sourceOptions.adaptiveStreaming ? {
|
|
4639
|
+
abrStrategy: sourceOptions?.adaptiveStreaming?.strategy
|
|
4640
|
+
} : {}),
|
|
4948
4641
|
shoppable: hasConfig(sourceOptions.shoppable),
|
|
4949
4642
|
shoppableProductsLength: sourceOptions.shoppable && sourceOptions.shoppable.products && sourceOptions.shoppable.products.length,
|
|
4950
4643
|
...(sourceOptions.info ? {
|
|
@@ -5394,15 +5087,20 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5394
5087
|
/* harmony export */ ADS_IN_PLAYLIST: () => (/* binding */ ADS_IN_PLAYLIST),
|
|
5395
5088
|
/* harmony export */ AUTO_PLAY_MODE: () => (/* binding */ AUTO_PLAY_MODE),
|
|
5396
5089
|
/* harmony export */ CLOUDINARY_CONFIG_PARAM: () => (/* binding */ CLOUDINARY_CONFIG_PARAM),
|
|
5397
|
-
/* harmony export */ CLOUDINARY_PARAMS: () => (/* binding */ CLOUDINARY_PARAMS),
|
|
5398
5090
|
/* harmony export */ FLOATING_TO: () => (/* binding */ FLOATING_TO),
|
|
5399
5091
|
/* harmony export */ FLUID_CLASS_NAME: () => (/* binding */ FLUID_CLASS_NAME),
|
|
5400
5092
|
/* harmony export */ PLAYER_PARAMS: () => (/* binding */ PLAYER_PARAMS),
|
|
5401
|
-
/* harmony export */ PRELOAD: () => (/* binding */ PRELOAD)
|
|
5093
|
+
/* harmony export */ PRELOAD: () => (/* binding */ PRELOAD),
|
|
5094
|
+
/* harmony export */ SOURCE_PARAMS: () => (/* binding */ SOURCE_PARAMS)
|
|
5402
5095
|
/* harmony export */ });
|
|
5403
|
-
|
|
5404
|
-
const
|
|
5405
|
-
|
|
5096
|
+
// Parameters that can be passed to source configuration (inherited by source method)
|
|
5097
|
+
const SOURCE_PARAMS = ['adaptiveStreaming', 'allowUsageReport', 'autoShowRecommendations', 'chapters', 'cloudinaryConfig', 'info', 'interactionAreas', 'poster', 'posterOptions', 'publicId', 'queryParams', 'raw_transformation', 'recommendations', 'shoppable', 'source', 'sourceTransformation', 'sourceTypes', 'textTracks', 'transformation', 'type', 'visualSearch', 'withCredentials'];
|
|
5098
|
+
|
|
5099
|
+
// All parameters that can be passed to player constructor
|
|
5100
|
+
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', 'qualitySelector', 'seekThumbnails', 'showJumpControls']);
|
|
5101
|
+
|
|
5102
|
+
// We support both camelCase and snake_case for cloudinary SDK params
|
|
5103
|
+
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'];
|
|
5406
5104
|
const FLUID_CLASS_NAME = 'cld-fluid';
|
|
5407
5105
|
const AUTO_PLAY_MODE = {
|
|
5408
5106
|
ALWAYS: 'always',
|
|
@@ -5488,9 +5186,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
5488
5186
|
|
|
5489
5187
|
|
|
5490
5188
|
|
|
5491
|
-
// #if (!process.env.WEBPACK_BUILD_LIGHT)
|
|
5492
|
-
// import qualitySelector from './components/qualitySelector/qualitySelector.js';
|
|
5493
|
-
// #endif
|
|
5494
5189
|
|
|
5495
5190
|
const INTERNAL_ANALYTICS_URL = 'https://analytics-api-s.cloudinary.com';
|
|
5496
5191
|
const RETRY_DEFAULT_TIMEOUT = 5 * 1000;
|
|
@@ -5568,11 +5263,8 @@ class VideoPlayer extends _utils__WEBPACK_IMPORTED_MODULE_9__["default"].mixin(_
|
|
|
5568
5263
|
const analyticsData = (0,_utils_get_analytics_player_options__WEBPACK_IMPORTED_MODULE_18__.getAnalyticsFromPlayerOptions)(options);
|
|
5569
5264
|
const analyticsParams = new URLSearchParams(analyticsData).toString();
|
|
5570
5265
|
const baseParams = new URLSearchParams({
|
|
5571
|
-
vpVersion: "2.6.
|
|
5266
|
+
vpVersion: "2.6.1-edge.1",
|
|
5572
5267
|
vpInstanceId: this.getVPInstanceId(),
|
|
5573
|
-
// #if (process.env.WEBPACK_BUILD_LIGHT)
|
|
5574
|
-
vpLightBuild: true,
|
|
5575
|
-
// #endif
|
|
5576
5268
|
cloudName: options.cloudinary.cloudinaryConfig.cloud_name,
|
|
5577
5269
|
...internalAnalyticsMetadata
|
|
5578
5270
|
}).toString();
|
|
@@ -5631,9 +5323,7 @@ class VideoPlayer extends _utils__WEBPACK_IMPORTED_MODULE_9__["default"].mixin(_
|
|
|
5631
5323
|
});
|
|
5632
5324
|
}
|
|
5633
5325
|
_initPlugins() {
|
|
5634
|
-
|
|
5635
|
-
// this._initIma();
|
|
5636
|
-
// #endif
|
|
5326
|
+
this._initIma();
|
|
5637
5327
|
this._initAutoplay();
|
|
5638
5328
|
this._initContextMenu();
|
|
5639
5329
|
this._initPerSrcBehaviors();
|
|
@@ -5791,28 +5481,12 @@ class VideoPlayer extends _utils__WEBPACK_IMPORTED_MODULE_9__["default"].mixin(_
|
|
|
5791
5481
|
});
|
|
5792
5482
|
}
|
|
5793
5483
|
_initColors() {
|
|
5794
|
-
|
|
5795
|
-
|
|
5796
|
-
|
|
5797
|
-
|
|
5798
|
-
|
|
5799
|
-
|
|
5800
|
-
// _initQualitySelector() {
|
|
5801
|
-
// if (this.videojs.controlBar && this.playerOptions.qualitySelector !== false) {
|
|
5802
|
-
// this.videojs.httpSourceSelector({ default: 'auto' });
|
|
5803
|
-
//
|
|
5804
|
-
// this.videojs.on(PLAYER_EVENT.LOADED_METADATA, () => {
|
|
5805
|
-
// qualitySelector.init(this.videojs);
|
|
5806
|
-
// });
|
|
5807
|
-
//
|
|
5808
|
-
// // Show only if more than one option available
|
|
5809
|
-
// this.videojs.on(PLAYER_EVENT.LOADED_DATA, () => {
|
|
5810
|
-
// qualitySelector.setVisibility(this.videojs);
|
|
5811
|
-
// });
|
|
5812
|
-
// }
|
|
5813
|
-
// }
|
|
5814
|
-
// #endif
|
|
5815
|
-
|
|
5484
|
+
if (this.playerOptions.colors) {
|
|
5485
|
+
this.videojs.colors({
|
|
5486
|
+
colors: this.playerOptions.colors
|
|
5487
|
+
});
|
|
5488
|
+
}
|
|
5489
|
+
}
|
|
5816
5490
|
_initTextTracks() {
|
|
5817
5491
|
this.videojs.on(_utils_consts__WEBPACK_IMPORTED_MODULE_17__.PLAYER_EVENT.CLD_SOURCE_CHANGED, (e, _ref5) => {
|
|
5818
5492
|
let {
|
|
@@ -5933,9 +5607,11 @@ class VideoPlayer extends _utils__WEBPACK_IMPORTED_MODULE_9__["default"].mixin(_
|
|
|
5933
5607
|
this._setExtendedEvents();
|
|
5934
5608
|
|
|
5935
5609
|
// Load first video (mainly to support video tag 'source' and 'public-id' attributes)
|
|
5936
|
-
|
|
5610
|
+
// Source parameters are set to playerOptions.cloudinary
|
|
5611
|
+
const source = this.playerOptions.cloudinary.source || this.playerOptions.cloudinary.publicId;
|
|
5937
5612
|
if (source) {
|
|
5938
|
-
|
|
5613
|
+
const sourceOptions = Object.assign({}, this.playerOptions.cloudinary);
|
|
5614
|
+
this.source(source, sourceOptions);
|
|
5939
5615
|
}
|
|
5940
5616
|
}
|
|
5941
5617
|
_onSourceChange(e, _ref6) {
|
|
@@ -5948,9 +5624,6 @@ class VideoPlayer extends _utils__WEBPACK_IMPORTED_MODULE_9__["default"].mixin(_
|
|
|
5948
5624
|
sourceOptions
|
|
5949
5625
|
})
|
|
5950
5626
|
});
|
|
5951
|
-
// #if (!process.env.WEBPACK_BUILD_LIGHT)
|
|
5952
|
-
// this._initQualitySelector();
|
|
5953
|
-
// #endif
|
|
5954
5627
|
this.isLiveStream = source.resourceConfig().type === 'live';
|
|
5955
5628
|
}
|
|
5956
5629
|
_setExtendedEvents() {
|
|
@@ -6003,6 +5676,7 @@ class VideoPlayer extends _utils__WEBPACK_IMPORTED_MODULE_9__["default"].mixin(_
|
|
|
6003
5676
|
return;
|
|
6004
5677
|
}
|
|
6005
5678
|
if (this.playerOptions.debug) {
|
|
5679
|
+
options.debug = true;
|
|
6006
5680
|
(0,_validators_validators_functions__WEBPACK_IMPORTED_MODULE_16__.isValidSourceConfig)(options).then(valid => {
|
|
6007
5681
|
if (!valid) {
|
|
6008
5682
|
this.videojs.error('invalid source configuration');
|
|
@@ -6012,15 +5686,16 @@ class VideoPlayer extends _utils__WEBPACK_IMPORTED_MODULE_9__["default"].mixin(_
|
|
|
6012
5686
|
if (publicId instanceof _plugins_cloudinary_models_video_source_video_source__WEBPACK_IMPORTED_MODULE_13__["default"]) {
|
|
6013
5687
|
return this.videojs.cloudinary.source(publicId, options);
|
|
6014
5688
|
}
|
|
5689
|
+
|
|
5690
|
+
// Inherit source parameters from player options (source options take precedence)
|
|
5691
|
+
const inherited = lodash_pick__WEBPACK_IMPORTED_MODULE_3___default()(this.playerOptions, _video_player_const__WEBPACK_IMPORTED_MODULE_15__.SOURCE_PARAMS);
|
|
5692
|
+
options = {
|
|
5693
|
+
...inherited,
|
|
5694
|
+
...options
|
|
5695
|
+
};
|
|
6015
5696
|
if (options.shoppable && this.videojs.shoppable) {
|
|
6016
5697
|
this.videojs.shoppable(this.videojs, options);
|
|
6017
5698
|
}
|
|
6018
|
-
if (this.playerOptions.allowUsageReport) {
|
|
6019
|
-
options.usageReport = true;
|
|
6020
|
-
}
|
|
6021
|
-
if (this.playerOptions.withCredentials) {
|
|
6022
|
-
options.withCredentials = true;
|
|
6023
|
-
}
|
|
6024
5699
|
this._resetReloadVideo();
|
|
6025
5700
|
this._resetReTryVideoState();
|
|
6026
5701
|
const maxTries = this.videojs.options_.maxTries || 3;
|
|
@@ -6305,7 +5980,7 @@ const extractOptions = (elem, options) => {
|
|
|
6305
5980
|
const playerOptions = _utils__WEBPACK_IMPORTED_MODULE_1__["default"].sliceAndUnsetProperties(options, ..._video_player_const__WEBPACK_IMPORTED_MODULE_3__.PLAYER_PARAMS);
|
|
6306
5981
|
|
|
6307
5982
|
// Cloudinary plugin specific options
|
|
6308
|
-
playerOptions.cloudinary = _utils__WEBPACK_IMPORTED_MODULE_1__["default"].sliceAndUnsetProperties(playerOptions, ..._video_player_const__WEBPACK_IMPORTED_MODULE_3__.
|
|
5983
|
+
playerOptions.cloudinary = _utils__WEBPACK_IMPORTED_MODULE_1__["default"].sliceAndUnsetProperties(playerOptions, ..._video_player_const__WEBPACK_IMPORTED_MODULE_3__.SOURCE_PARAMS);
|
|
6309
5984
|
|
|
6310
5985
|
// Allow explicitly passing options to videojs using the `videojs` namespace, in order
|
|
6311
5986
|
// to avoid param name conflicts:
|
|
@@ -49121,146 +48796,6 @@ function isString(value) {
|
|
|
49121
48796
|
|
|
49122
48797
|
|
|
49123
48798
|
|
|
49124
|
-
/***/ }),
|
|
49125
|
-
|
|
49126
|
-
/***/ "../node_modules/srt-parser-2/dist/index.js":
|
|
49127
|
-
/*!**************************************************!*\
|
|
49128
|
-
!*** ../node_modules/srt-parser-2/dist/index.js ***!
|
|
49129
|
-
\**************************************************/
|
|
49130
|
-
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
49131
|
-
|
|
49132
|
-
"use strict";
|
|
49133
|
-
__webpack_require__.r(__webpack_exports__);
|
|
49134
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
49135
|
-
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
49136
|
-
/* harmony export */ });
|
|
49137
|
-
class Parser {
|
|
49138
|
-
seperator = ",";
|
|
49139
|
-
timestampToSeconds(srtTimestamp) {
|
|
49140
|
-
const [rest, millisecondsString] = srtTimestamp.split(",");
|
|
49141
|
-
const milliseconds = parseInt(millisecondsString);
|
|
49142
|
-
const [hours, minutes, seconds] = rest.split(":").map((x) => parseInt(x));
|
|
49143
|
-
const result = milliseconds * 0.001 + seconds + 60 * minutes + 3600 * hours;
|
|
49144
|
-
// fix odd JS roundings, e.g. timestamp '00:01:20,460' result is 80.46000000000001
|
|
49145
|
-
return Math.round(result * 1000) / 1000;
|
|
49146
|
-
}
|
|
49147
|
-
;
|
|
49148
|
-
correctFormat(time) {
|
|
49149
|
-
// Fix the format if the format is wrong
|
|
49150
|
-
// 00:00:28.9670 Become 00:00:28,967
|
|
49151
|
-
// 00:00:28.967 Become 00:00:28,967
|
|
49152
|
-
// 00:00:28.96 Become 00:00:28,960
|
|
49153
|
-
// 00:00:28.9 Become 00:00:28,900
|
|
49154
|
-
// 00:00:28,96 Become 00:00:28,960
|
|
49155
|
-
// 00:00:28,9 Become 00:00:28,900
|
|
49156
|
-
// 00:00:28,0 Become 00:00:28,000
|
|
49157
|
-
// 00:00:28,01 Become 00:00:28,010
|
|
49158
|
-
// 0:00:10,500 Become 00:00:10,500
|
|
49159
|
-
let str = time.replace(".", ",");
|
|
49160
|
-
var hour = null;
|
|
49161
|
-
var minute = null;
|
|
49162
|
-
var second = null;
|
|
49163
|
-
var millisecond = null;
|
|
49164
|
-
// Handle millisecond
|
|
49165
|
-
var [front, ms] = str.split(",");
|
|
49166
|
-
millisecond = this.fixed_str_digit(3, ms);
|
|
49167
|
-
// Handle hour
|
|
49168
|
-
var [a_hour, a_minute, a_second] = front.split(":");
|
|
49169
|
-
hour = this.fixed_str_digit(2, a_hour, false);
|
|
49170
|
-
minute = this.fixed_str_digit(2, a_minute, false);
|
|
49171
|
-
second = this.fixed_str_digit(2, a_second, false);
|
|
49172
|
-
return `${hour}:${minute}:${second},${millisecond}`;
|
|
49173
|
-
}
|
|
49174
|
-
/*
|
|
49175
|
-
// make sure string is 'how_many_digit' long
|
|
49176
|
-
// if str is shorter than how_many_digit, pad with 0
|
|
49177
|
-
// if str is longer than how_many_digit, slice from the beginning
|
|
49178
|
-
// Example:
|
|
49179
|
-
|
|
49180
|
-
Input: fixed_str_digit(3, '100')
|
|
49181
|
-
Output: 100
|
|
49182
|
-
Explain: unchanged, because "100" is 3 digit
|
|
49183
|
-
|
|
49184
|
-
Input: fixed_str_digit(3, '50')
|
|
49185
|
-
Output: 500
|
|
49186
|
-
Explain: pad end with 0
|
|
49187
|
-
|
|
49188
|
-
Input: fixed_str_digit(3, '50', false)
|
|
49189
|
-
Output: 050
|
|
49190
|
-
Explain: pad start with 0
|
|
49191
|
-
|
|
49192
|
-
Input: fixed_str_digit(3, '7771')
|
|
49193
|
-
Output: 777
|
|
49194
|
-
Explain: slice from beginning
|
|
49195
|
-
*/
|
|
49196
|
-
fixed_str_digit(how_many_digit, str, padEnd = true) {
|
|
49197
|
-
if (str.length == how_many_digit) {
|
|
49198
|
-
return str;
|
|
49199
|
-
}
|
|
49200
|
-
if (str.length > how_many_digit) {
|
|
49201
|
-
return str.slice(0, how_many_digit);
|
|
49202
|
-
}
|
|
49203
|
-
if (str.length < how_many_digit) {
|
|
49204
|
-
if (padEnd) {
|
|
49205
|
-
return str.padEnd(how_many_digit, "0");
|
|
49206
|
-
}
|
|
49207
|
-
else {
|
|
49208
|
-
return str.padStart(how_many_digit, "0");
|
|
49209
|
-
}
|
|
49210
|
-
}
|
|
49211
|
-
}
|
|
49212
|
-
tryComma(data) {
|
|
49213
|
-
data = data.replace(/\r/g, "");
|
|
49214
|
-
var regex = /(\d+)\n(\d{1,2}:\d{2}:\d{2},\d{1,3}) --> (\d{1,2}:\d{2}:\d{2},\d{1,3})/g;
|
|
49215
|
-
let data_array = data.split(regex);
|
|
49216
|
-
data_array.shift(); // remove first '' in array
|
|
49217
|
-
return data_array;
|
|
49218
|
-
}
|
|
49219
|
-
tryDot(data) {
|
|
49220
|
-
data = data.replace(/\r/g, "");
|
|
49221
|
-
var regex = /(\d+)\n(\d{1,2}:\d{2}:\d{2}\.\d{1,3}) --> (\d{1,2}:\d{2}:\d{2}\.\d{1,3})/g;
|
|
49222
|
-
let data_array = data.split(regex);
|
|
49223
|
-
data_array.shift(); // remove first '' in array
|
|
49224
|
-
this.seperator = ".";
|
|
49225
|
-
return data_array;
|
|
49226
|
-
}
|
|
49227
|
-
fromSrt(data) {
|
|
49228
|
-
var originalData = data;
|
|
49229
|
-
var data_array = this.tryComma(originalData);
|
|
49230
|
-
if (data_array.length == 0) {
|
|
49231
|
-
data_array = this.tryDot(originalData);
|
|
49232
|
-
}
|
|
49233
|
-
var items = [];
|
|
49234
|
-
for (var i = 0; i < data_array.length; i += 4) {
|
|
49235
|
-
const startTime = this.correctFormat(data_array[i + 1].trim());
|
|
49236
|
-
const endTime = this.correctFormat(data_array[i + 2].trim());
|
|
49237
|
-
var new_line = {
|
|
49238
|
-
id: data_array[i].trim(),
|
|
49239
|
-
startTime,
|
|
49240
|
-
startSeconds: this.timestampToSeconds(startTime),
|
|
49241
|
-
endTime,
|
|
49242
|
-
endSeconds: this.timestampToSeconds(endTime),
|
|
49243
|
-
text: data_array[i + 3].trim(),
|
|
49244
|
-
};
|
|
49245
|
-
items.push(new_line);
|
|
49246
|
-
}
|
|
49247
|
-
return items;
|
|
49248
|
-
}
|
|
49249
|
-
toSrt(data) {
|
|
49250
|
-
var res = "";
|
|
49251
|
-
const end_of_line = "\r\n";
|
|
49252
|
-
for (var i = 0; i < data.length; i++) {
|
|
49253
|
-
var s = data[i];
|
|
49254
|
-
res += s.id + end_of_line;
|
|
49255
|
-
res += s.startTime + " --> " + s.endTime + end_of_line;
|
|
49256
|
-
res += s.text.replace("\n", end_of_line) + end_of_line + end_of_line;
|
|
49257
|
-
}
|
|
49258
|
-
return res;
|
|
49259
|
-
}
|
|
49260
|
-
}
|
|
49261
|
-
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Parser);
|
|
49262
|
-
|
|
49263
|
-
|
|
49264
48799
|
/***/ }),
|
|
49265
48800
|
|
|
49266
48801
|
/***/ "../node_modules/uuid/dist/esm-browser/native.js":
|
|
@@ -49541,7 +49076,7 @@ function validate(uuid) {
|
|
|
49541
49076
|
/******/ // This function allow to reference async chunks
|
|
49542
49077
|
/******/ __webpack_require__.u = (chunkId) => {
|
|
49543
49078
|
/******/ // return url for filenames based on template
|
|
49544
|
-
/******/ return "" + chunkId + ".
|
|
49079
|
+
/******/ return "" + chunkId + ".js";
|
|
49545
49080
|
/******/ };
|
|
49546
49081
|
/******/ })();
|
|
49547
49082
|
/******/
|
|
@@ -49763,4 +49298,4 @@ function validate(uuid) {
|
|
|
49763
49298
|
/******/ })()
|
|
49764
49299
|
;
|
|
49765
49300
|
});
|
|
49766
|
-
//# sourceMappingURL=cld-video-player.
|
|
49301
|
+
//# sourceMappingURL=cld-video-player.js.map
|