@gcorevideo/player 2.28.12 → 2.28.14
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/core.js +312 -180
- package/dist/index.css +223 -223
- package/dist/index.embed.js +322 -182
- package/dist/index.js +324 -184
- package/lib/build.d.ts.map +1 -1
- package/lib/build.js +1 -1
- package/lib/plugins/cmcd-config/CmcdConfig.d.ts.map +1 -1
- package/lib/plugins/cmcd-config/CmcdConfig.js +6 -2
- package/package.json +3 -3
- package/src/build.ts +1 -1
- package/src/plugins/cmcd-config/CmcdConfig.ts +7 -4
- package/tsconfig.tsbuildinfo +1 -1
- package/vitest.config.ts +1 -2
package/dist/core.js
CHANGED
|
@@ -2323,9 +2323,7 @@ if (typeof Object.assign != 'function') {
|
|
|
2323
2323
|
// Skip over if undefined or null
|
|
2324
2324
|
for (var nextKey in nextSource) {
|
|
2325
2325
|
// Avoid bugs when hasOwnProperty is shadowed
|
|
2326
|
-
if (Object.prototype.hasOwnProperty.call(nextSource, nextKey))
|
|
2327
|
-
to[nextKey] = nextSource[nextKey];
|
|
2328
|
-
}
|
|
2326
|
+
if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) to[nextKey] = nextSource[nextKey];
|
|
2329
2327
|
}
|
|
2330
2328
|
}
|
|
2331
2329
|
}
|
|
@@ -2341,18 +2339,14 @@ if (!Array.prototype.findIndex) {
|
|
|
2341
2339
|
Object.defineProperty(Array.prototype, 'findIndex', {
|
|
2342
2340
|
value: function value(predicate) {
|
|
2343
2341
|
// 1. Let O be ? ToObject(this value).
|
|
2344
|
-
if (this == null)
|
|
2345
|
-
throw new TypeError('"this" is null or not defined');
|
|
2346
|
-
}
|
|
2342
|
+
if (this == null) throw new TypeError('"this" is null or not defined');
|
|
2347
2343
|
var o = Object(this);
|
|
2348
2344
|
|
|
2349
2345
|
// 2. Let len be ? ToLength(? Get(O, "length")).
|
|
2350
2346
|
var len = o.length >>> 0;
|
|
2351
2347
|
|
|
2352
2348
|
// 3. If IsCallable(predicate) is false, throw a TypeError exception.
|
|
2353
|
-
if (typeof predicate !== 'function')
|
|
2354
|
-
throw new TypeError('predicate must be a function');
|
|
2355
|
-
}
|
|
2349
|
+
if (typeof predicate !== 'function') throw new TypeError('predicate must be a function');
|
|
2356
2350
|
|
|
2357
2351
|
// 4. If thisArg was supplied, let T be thisArg; else let T be undefined.
|
|
2358
2352
|
var thisArg = arguments[1];
|
|
@@ -2367,9 +2361,8 @@ if (!Array.prototype.findIndex) {
|
|
|
2367
2361
|
// c. Let testResult be ToBoolean(? Call(predicate, T, « kValue, k, O »)).
|
|
2368
2362
|
// d. If testResult is true, return k.
|
|
2369
2363
|
var kValue = o[k];
|
|
2370
|
-
if (predicate.call(thisArg, kValue, k, o))
|
|
2371
|
-
|
|
2372
|
-
}
|
|
2364
|
+
if (predicate.call(thisArg, kValue, k, o)) return k;
|
|
2365
|
+
|
|
2373
2366
|
// e. Increase k by 1.
|
|
2374
2367
|
k++;
|
|
2375
2368
|
}
|
|
@@ -2648,8 +2641,8 @@ var hasFlash = function hasFlash() {
|
|
|
2648
2641
|
}
|
|
2649
2642
|
};
|
|
2650
2643
|
var getBrowserInfo = function getBrowserInfo(ua) {
|
|
2651
|
-
var parts = ua.match(/\b(playstation 4|nx|opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || []
|
|
2652
|
-
|
|
2644
|
+
var parts = ua.match(/\b(playstation 4|nx|opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || [];
|
|
2645
|
+
var extra;
|
|
2653
2646
|
if (/trident/i.test(parts[1])) {
|
|
2654
2647
|
extra = /\brv[ :]+(\d+)/g.exec(ua) || [];
|
|
2655
2648
|
return {
|
|
@@ -2699,7 +2692,9 @@ var getBrowserData = function getBrowserData() {
|
|
|
2699
2692
|
if (browser.versionIdentifier) {
|
|
2700
2693
|
var versionRegExp = new RegExp(browser.versionIdentifier.toLowerCase());
|
|
2701
2694
|
var versionRegExpResult = versionRegExp.exec(userAgent);
|
|
2702
|
-
if (versionRegExpResult != null && versionRegExpResult[1])
|
|
2695
|
+
if (versionRegExpResult != null && versionRegExpResult[1]) {
|
|
2696
|
+
setBrowserVersion(versionRegExpResult[1], browserObject);
|
|
2697
|
+
}
|
|
2703
2698
|
} else {
|
|
2704
2699
|
setBrowserVersion(browserRegExpResult[1], browserObject);
|
|
2705
2700
|
}
|
|
@@ -2755,7 +2750,9 @@ var getOsData = function getOsData() {
|
|
|
2755
2750
|
} else if (os.versionIdentifier) {
|
|
2756
2751
|
var versionRegExp = new RegExp(os.versionIdentifier.toLowerCase());
|
|
2757
2752
|
var versionRegExpResult = versionRegExp.exec(userAgent);
|
|
2758
|
-
if (versionRegExpResult != null && versionRegExpResult[1])
|
|
2753
|
+
if (versionRegExpResult != null && versionRegExpResult[1]) {
|
|
2754
|
+
setOsVersion(versionRegExpResult[1], os.versionSeparator ? os.versionSeparator : '.', osObject);
|
|
2755
|
+
}
|
|
2759
2756
|
}
|
|
2760
2757
|
break;
|
|
2761
2758
|
}
|
|
@@ -2770,16 +2767,20 @@ var getOsData = function getOsData() {
|
|
|
2770
2767
|
|
|
2771
2768
|
// Set OS version
|
|
2772
2769
|
var setOsVersion = function setOsVersion(version, separator, osObject) {
|
|
2773
|
-
var finalSeparator = separator.substr(0, 1)
|
|
2770
|
+
var finalSeparator = separator.substr(0, 1) === '[' ? new RegExp(separator, 'g') : separator;
|
|
2774
2771
|
var splitVersion = version.split(finalSeparator, 2);
|
|
2775
|
-
if (separator
|
|
2772
|
+
if (separator !== '.') version = version.replace(new RegExp(separator, 'g'), '.');
|
|
2776
2773
|
osObject.fullVersion = version;
|
|
2777
2774
|
|
|
2778
2775
|
// Major version
|
|
2779
|
-
if (splitVersion && splitVersion[0])
|
|
2776
|
+
if (splitVersion && splitVersion[0]) {
|
|
2777
|
+
osObject.majorVersion = parseInt(splitVersion[0]);
|
|
2778
|
+
}
|
|
2780
2779
|
|
|
2781
2780
|
// Minor version
|
|
2782
|
-
if (splitVersion && splitVersion[1])
|
|
2781
|
+
if (splitVersion && splitVersion[1]) {
|
|
2782
|
+
osObject.minorVersion = parseInt(splitVersion[1]);
|
|
2783
|
+
}
|
|
2783
2784
|
};
|
|
2784
2785
|
|
|
2785
2786
|
// Set viewport size
|
|
@@ -2828,17 +2829,17 @@ Browser.hasLocalstorage = hasLocalstorage();
|
|
|
2828
2829
|
Browser.hasFlash = hasFlash();
|
|
2829
2830
|
|
|
2830
2831
|
/**
|
|
2831
|
-
* @deprecated
|
|
2832
|
-
* This parameter currently exists for retrocompatibility reasons.
|
|
2833
|
-
* Use Browser.data.name instead.
|
|
2834
|
-
*/
|
|
2832
|
+
* @deprecated
|
|
2833
|
+
* This parameter currently exists for retrocompatibility reasons.
|
|
2834
|
+
* Use Browser.data.name instead.
|
|
2835
|
+
*/
|
|
2835
2836
|
Browser.name = browserInfo.name;
|
|
2836
2837
|
|
|
2837
2838
|
/**
|
|
2838
|
-
* @deprecated
|
|
2839
|
-
* This parameter currently exists for retrocompatibility reasons.
|
|
2840
|
-
* Use Browser.data.fullVersion instead.
|
|
2841
|
-
*/
|
|
2839
|
+
* @deprecated
|
|
2840
|
+
* This parameter currently exists for retrocompatibility reasons.
|
|
2841
|
+
* Use Browser.data.fullVersion instead.
|
|
2842
|
+
*/
|
|
2842
2843
|
Browser.version = browserInfo.version;
|
|
2843
2844
|
Browser.userAgent = navigator.userAgent;
|
|
2844
2845
|
Browser.data = getBrowserData();
|
|
@@ -2874,7 +2875,9 @@ function extend(parent, properties) {
|
|
|
2874
2875
|
args[_key] = arguments[_key];
|
|
2875
2876
|
}
|
|
2876
2877
|
_this = _callSuper(this, Surrogate, [].concat(args));
|
|
2877
|
-
if (properties.initialize)
|
|
2878
|
+
if (properties.initialize) {
|
|
2879
|
+
properties.initialize.apply(_this, args);
|
|
2880
|
+
}
|
|
2878
2881
|
return _this;
|
|
2879
2882
|
}
|
|
2880
2883
|
_inherits(Surrogate, _parent);
|
|
@@ -2905,7 +2908,17 @@ var Fullscreen = {
|
|
|
2905
2908
|
},
|
|
2906
2909
|
cancelFullscreen: function cancelFullscreen() {
|
|
2907
2910
|
var el = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document;
|
|
2908
|
-
if (el.exitFullscreen)
|
|
2911
|
+
if (el.exitFullscreen) {
|
|
2912
|
+
el.exitFullscreen();
|
|
2913
|
+
} else if (el.webkitCancelFullScreen) {
|
|
2914
|
+
el.webkitCancelFullScreen();
|
|
2915
|
+
} else if (el.webkitExitFullscreen) {
|
|
2916
|
+
el.webkitExitFullscreen();
|
|
2917
|
+
} else if (el.mozCancelFullScreen) {
|
|
2918
|
+
el.mozCancelFullScreen();
|
|
2919
|
+
} else if (el.msExitFullscreen) {
|
|
2920
|
+
el.msExitFullscreen();
|
|
2921
|
+
}
|
|
2909
2922
|
},
|
|
2910
2923
|
fullscreenEnabled: function fullscreenEnabled() {
|
|
2911
2924
|
return !!(document.fullscreenEnabled || document.webkitFullscreenEnabled || document.mozFullScreenEnabled || document.msFullscreenEnabled);
|
|
@@ -2939,13 +2952,12 @@ var QueryString = /*#__PURE__*/function () {
|
|
|
2939
2952
|
key: "parse",
|
|
2940
2953
|
value: function parse(paramsString) {
|
|
2941
2954
|
var match;
|
|
2942
|
-
var pl = /\+/g
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
params = {};
|
|
2955
|
+
var pl = /\+/g; // Regex for replacing addition symbol with a space
|
|
2956
|
+
var search = /([^&=]+)=?([^&]*)/g;
|
|
2957
|
+
var decode = function decode(s) {
|
|
2958
|
+
return decodeURIComponent(s.replace(pl, ' '));
|
|
2959
|
+
};
|
|
2960
|
+
var params = {};
|
|
2949
2961
|
while (match = search.exec(paramsString)) {
|
|
2950
2962
|
// eslint-disable-line no-cond-assign
|
|
2951
2963
|
params[decode(match[1]).toLowerCase()] = decode(match[2]);
|
|
@@ -2993,7 +3005,9 @@ function getBrowserLanguage() {
|
|
|
2993
3005
|
return window.navigator && window.navigator.language;
|
|
2994
3006
|
}
|
|
2995
3007
|
function now$3() {
|
|
2996
|
-
if (window.performance && window.performance.now)
|
|
3008
|
+
if (window.performance && window.performance.now) {
|
|
3009
|
+
return performance.now();
|
|
3010
|
+
}
|
|
2997
3011
|
return Date.now();
|
|
2998
3012
|
}
|
|
2999
3013
|
|
|
@@ -3009,8 +3023,12 @@ function canAutoPlayMedia(cb, options) {
|
|
|
3009
3023
|
}, options);
|
|
3010
3024
|
var element = options.element ? options.element : document.createElement(options.type);
|
|
3011
3025
|
element.muted = options.muted;
|
|
3012
|
-
if (options.muted === true)
|
|
3013
|
-
|
|
3026
|
+
if (options.muted === true) {
|
|
3027
|
+
element.setAttribute('muted', 'muted');
|
|
3028
|
+
}
|
|
3029
|
+
if (options.inline === true) {
|
|
3030
|
+
element.setAttribute('playsinline', 'playsinline');
|
|
3031
|
+
}
|
|
3014
3032
|
element.src = options.source;
|
|
3015
3033
|
var promise = element.play();
|
|
3016
3034
|
var timeoutId = setTimeout(function () {
|
|
@@ -3045,7 +3063,9 @@ var DomRecycler = /*#__PURE__*/function () {
|
|
|
3045
3063
|
}, {
|
|
3046
3064
|
key: "create",
|
|
3047
3065
|
value: function create(name) {
|
|
3048
|
-
if (this.options.recycleVideo && name === 'video' && videoStack.length > 0)
|
|
3066
|
+
if (this.options.recycleVideo && name === 'video' && videoStack.length > 0) {
|
|
3067
|
+
return videoStack.shift();
|
|
3068
|
+
}
|
|
3049
3069
|
return document.createElement(name);
|
|
3050
3070
|
}
|
|
3051
3071
|
}, {
|
|
@@ -3164,7 +3184,9 @@ var Log = /*#__PURE__*/function () {
|
|
|
3164
3184
|
}
|
|
3165
3185
|
var color = COLORS[level];
|
|
3166
3186
|
var klassDescription = '';
|
|
3167
|
-
if (klass)
|
|
3187
|
+
if (klass) {
|
|
3188
|
+
klassDescription = '[' + klass + ']';
|
|
3189
|
+
}
|
|
3168
3190
|
window.console && window.console.log && window.console.log.apply(console, ['%c[' + DESCRIPTIONS[level] + ']' + klassDescription, color].concat(message));
|
|
3169
3191
|
}
|
|
3170
3192
|
}]);
|
|
@@ -3174,7 +3196,9 @@ Log.LEVEL_INFO = LEVEL_INFO;
|
|
|
3174
3196
|
Log.LEVEL_WARN = LEVEL_WARN;
|
|
3175
3197
|
Log.LEVEL_ERROR = LEVEL_ERROR;
|
|
3176
3198
|
Log.getInstance = function () {
|
|
3177
|
-
if (this._instance === undefined)
|
|
3199
|
+
if (this._instance === undefined) {
|
|
3200
|
+
this._instance = new this();
|
|
3201
|
+
}
|
|
3178
3202
|
return this._instance;
|
|
3179
3203
|
};
|
|
3180
3204
|
Log.setLevel = function (level) {
|
|
@@ -3200,25 +3224,29 @@ var eventsApi = function eventsApi(obj, action, name, rest) {
|
|
|
3200
3224
|
|
|
3201
3225
|
// Handle event maps.
|
|
3202
3226
|
if (_typeof(name) === 'object') {
|
|
3203
|
-
for (var key in name)
|
|
3227
|
+
for (var key in name) {
|
|
3228
|
+
obj[action].apply(obj, [key, name[key]].concat(rest));
|
|
3229
|
+
}
|
|
3204
3230
|
return false;
|
|
3205
3231
|
}
|
|
3206
3232
|
|
|
3207
3233
|
// Handle space separated event names.
|
|
3208
3234
|
if (eventSplitter.test(name)) {
|
|
3209
3235
|
var names = name.split(eventSplitter);
|
|
3210
|
-
for (var i = 0, l = names.length; i < l; i++)
|
|
3236
|
+
for (var i = 0, l = names.length; i < l; i++) {
|
|
3237
|
+
obj[action].apply(obj, [names[i]].concat(rest));
|
|
3238
|
+
}
|
|
3211
3239
|
return false;
|
|
3212
3240
|
}
|
|
3213
3241
|
return true;
|
|
3214
3242
|
};
|
|
3215
3243
|
var triggerEvents = function triggerEvents(events, args, klass, name) {
|
|
3216
|
-
var ev
|
|
3217
|
-
|
|
3218
|
-
var l = events.length
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3244
|
+
var ev;
|
|
3245
|
+
var i = -1;
|
|
3246
|
+
var l = events.length;
|
|
3247
|
+
var a1 = args[0];
|
|
3248
|
+
var a2 = args[1];
|
|
3249
|
+
var a3 = args[2];
|
|
3222
3250
|
run();
|
|
3223
3251
|
function run() {
|
|
3224
3252
|
try {
|
|
@@ -3226,32 +3254,37 @@ var triggerEvents = function triggerEvents(events, args, klass, name) {
|
|
|
3226
3254
|
/* eslint-disable curly */
|
|
3227
3255
|
case 0:
|
|
3228
3256
|
while (++i < l) {
|
|
3229
|
-
|
|
3257
|
+
ev = events[i];
|
|
3258
|
+
ev.callback.call(ev.ctx);
|
|
3230
3259
|
}
|
|
3231
3260
|
return;
|
|
3232
3261
|
case 1:
|
|
3233
3262
|
while (++i < l) {
|
|
3234
|
-
|
|
3263
|
+
ev = events[i];
|
|
3264
|
+
ev.callback.call(ev.ctx, a1);
|
|
3235
3265
|
}
|
|
3236
3266
|
return;
|
|
3237
3267
|
case 2:
|
|
3238
3268
|
while (++i < l) {
|
|
3239
|
-
|
|
3269
|
+
ev = events[i];
|
|
3270
|
+
ev.callback.call(ev.ctx, a1, a2);
|
|
3240
3271
|
}
|
|
3241
3272
|
return;
|
|
3242
3273
|
case 3:
|
|
3243
3274
|
while (++i < l) {
|
|
3244
|
-
|
|
3275
|
+
ev = events[i];
|
|
3276
|
+
ev.callback.call(ev.ctx, a1, a2, a3);
|
|
3245
3277
|
}
|
|
3246
3278
|
return;
|
|
3247
3279
|
default:
|
|
3248
3280
|
while (++i < l) {
|
|
3249
|
-
|
|
3281
|
+
ev = events[i];
|
|
3282
|
+
ev.callback.apply(ev.ctx, args);
|
|
3250
3283
|
}
|
|
3251
3284
|
return;
|
|
3252
3285
|
}
|
|
3253
3286
|
} catch (exception) {
|
|
3254
|
-
Log.error.apply(Log, [klass, 'error on event', name, 'trigger', '-', exception]);
|
|
3287
|
+
Log.error.apply(Log, [klass, 'error on event', name, 'trigger', '-', exception]); // eslint-disable-line
|
|
3255
3288
|
run();
|
|
3256
3289
|
}
|
|
3257
3290
|
}
|
|
@@ -3299,12 +3332,11 @@ var Events$1 = /*#__PURE__*/function () {
|
|
|
3299
3332
|
key: "once",
|
|
3300
3333
|
value: function _once(name, callback, context) {
|
|
3301
3334
|
var _this = this;
|
|
3302
|
-
var _once;
|
|
3303
3335
|
if (!eventsApi(this, 'once', name, [callback, context]) || !callback) return this;
|
|
3304
3336
|
var off = function off() {
|
|
3305
3337
|
return _this.off(name, _once);
|
|
3306
3338
|
};
|
|
3307
|
-
_once = function once() {
|
|
3339
|
+
var _once = function once() {
|
|
3308
3340
|
off();
|
|
3309
3341
|
callback.apply(this, arguments);
|
|
3310
3342
|
};
|
|
@@ -3322,13 +3354,13 @@ var Events$1 = /*#__PURE__*/function () {
|
|
|
3322
3354
|
}, {
|
|
3323
3355
|
key: "off",
|
|
3324
3356
|
value: function off(name, callback, context) {
|
|
3325
|
-
var retain, ev, events,
|
|
3357
|
+
var retain, ev, events, i, l, j, k;
|
|
3326
3358
|
if (!this._events || !eventsApi(this, 'off', name, [callback, context])) return this;
|
|
3327
3359
|
if (!name && !callback && !context) {
|
|
3328
3360
|
this._events = void 0;
|
|
3329
3361
|
return this;
|
|
3330
3362
|
}
|
|
3331
|
-
names = name ? [name] : Object.keys(this._events);
|
|
3363
|
+
var names = name ? [name] : Object.keys(this._events);
|
|
3332
3364
|
// jshint maxdepth:5
|
|
3333
3365
|
for (i = 0, l = names.length; i < l; i++) {
|
|
3334
3366
|
name = names[i];
|
|
@@ -3764,7 +3796,7 @@ Events$1.PLAYBACK_FRAGMENT_LOADED = 'playback:fragment:loaded';
|
|
|
3764
3796
|
*
|
|
3765
3797
|
* @event PLAYBACK_FRAGMENT_BUFFERED
|
|
3766
3798
|
* @param {Object} data Data
|
|
3767
|
-
*
|
|
3799
|
+
*
|
|
3768
3800
|
*/
|
|
3769
3801
|
Events$1.PLAYBACK_FRAGMENT_BUFFERED = 'playback:fragment:buffered';
|
|
3770
3802
|
// TODO doc
|
|
@@ -3822,11 +3854,11 @@ Events$1.CORE_CONTAINERS_CREATED = 'core:containers:created';
|
|
|
3822
3854
|
Events$1.CORE_ACTIVE_CONTAINER_CHANGED = 'core:active:container:changed';
|
|
3823
3855
|
|
|
3824
3856
|
/**
|
|
3825
|
-
|
|
3826
|
-
|
|
3827
|
-
|
|
3828
|
-
|
|
3829
|
-
|
|
3857
|
+
* Fired before options are changed in core
|
|
3858
|
+
*
|
|
3859
|
+
* @event CORE_OPTIONS_WILL_CHANGE
|
|
3860
|
+
* @param {Object} current options before change
|
|
3861
|
+
*/
|
|
3830
3862
|
Events$1.CORE_OPTIONS_WILL_CHANGE = 'core:options:will:change';
|
|
3831
3863
|
|
|
3832
3864
|
/**
|
|
@@ -3968,10 +4000,10 @@ Events$1.CONTAINER_SUBTITLE_CHANGED = 'container:subtitle:changed';
|
|
|
3968
4000
|
Events$1.CONTAINER_AUDIO_AVAILABLE = 'container:audio:available';
|
|
3969
4001
|
|
|
3970
4002
|
/**
|
|
3971
|
-
|
|
3972
|
-
|
|
3973
|
-
|
|
3974
|
-
|
|
4003
|
+
* Fired whenever the current audio track has changed
|
|
4004
|
+
* @event CONTAINER_AUDIO_CHANGED
|
|
4005
|
+
* @param {import('../playback/playback').AudioTrack} track - audio track active after change
|
|
4006
|
+
*/
|
|
3975
4007
|
Events$1.CONTAINER_AUDIO_CHANGED = 'container:audio:changed';
|
|
3976
4008
|
|
|
3977
4009
|
/**
|
|
@@ -4491,10 +4523,14 @@ var UIObject = /*#__PURE__*/function (_BaseObject) {
|
|
|
4491
4523
|
if (method && method.constructor !== Function) method = this[events[key]];
|
|
4492
4524
|
if (!method) continue;
|
|
4493
4525
|
var match = key.match(delegateEventSplitter);
|
|
4494
|
-
var eventName = match[1]
|
|
4495
|
-
|
|
4526
|
+
var eventName = match[1];
|
|
4527
|
+
var selector = match[2];
|
|
4496
4528
|
eventName += '.delegateEvents' + this.cid;
|
|
4497
|
-
if (selector === '')
|
|
4529
|
+
if (selector === '') {
|
|
4530
|
+
this.$el.on(eventName, method.bind(this));
|
|
4531
|
+
} else {
|
|
4532
|
+
this.$el.on(eventName, selector, method.bind(this));
|
|
4533
|
+
}
|
|
4498
4534
|
}
|
|
4499
4535
|
return this;
|
|
4500
4536
|
}
|
|
@@ -4522,7 +4558,7 @@ var UIObject = /*#__PURE__*/function (_BaseObject) {
|
|
|
4522
4558
|
if (!this.el) {
|
|
4523
4559
|
var attrs = $.extend(true, {}, this.attributes);
|
|
4524
4560
|
if (this.id) attrs.id = this.id;
|
|
4525
|
-
if (this.className) attrs[
|
|
4561
|
+
if (this.className) attrs["class"] = this.className;
|
|
4526
4562
|
var $el = $(DomRecycler.create(this.tagName)).attr(attrs);
|
|
4527
4563
|
this.setElement($el, false);
|
|
4528
4564
|
} else {
|
|
@@ -4640,7 +4676,7 @@ var ErrorMixin = {
|
|
|
4640
4676
|
var errorData = Object.assign({}, defaultError, error, {
|
|
4641
4677
|
code: options.useCodePrefix ? prefixedCode : error.code
|
|
4642
4678
|
});
|
|
4643
|
-
if (i18n && errorData.level
|
|
4679
|
+
if (i18n && errorData.level === PlayerError.Levels.FATAL && !errorData.UI) {
|
|
4644
4680
|
var defaultUI = {
|
|
4645
4681
|
title: i18n.t('default_error_title'),
|
|
4646
4682
|
message: i18n.t('default_error_message')
|
|
@@ -5066,7 +5102,9 @@ var Container = /*#__PURE__*/function (_UIObject) {
|
|
|
5066
5102
|
}, {
|
|
5067
5103
|
key: "error",
|
|
5068
5104
|
value: function error(_error) {
|
|
5069
|
-
if (!this.isReady)
|
|
5105
|
+
if (!this.isReady) {
|
|
5106
|
+
this.ready();
|
|
5107
|
+
}
|
|
5070
5108
|
this.trigger(Events$1.CONTAINER_ERROR, _error, this.name);
|
|
5071
5109
|
}
|
|
5072
5110
|
}, {
|
|
@@ -5197,7 +5235,9 @@ var Container = /*#__PURE__*/function (_UIObject) {
|
|
|
5197
5235
|
}, {
|
|
5198
5236
|
key: "onContextMenu",
|
|
5199
5237
|
value: function onContextMenu(event) {
|
|
5200
|
-
if (!this.options.chromeless || this.options.allowUserInteraction)
|
|
5238
|
+
if (!this.options.chromeless || this.options.allowUserInteraction) {
|
|
5239
|
+
this.trigger(Events$1.CONTAINER_CONTEXTMENU, event, this.name);
|
|
5240
|
+
}
|
|
5201
5241
|
}
|
|
5202
5242
|
}, {
|
|
5203
5243
|
key: "seek",
|
|
@@ -5294,22 +5334,30 @@ var Container = /*#__PURE__*/function (_UIObject) {
|
|
|
5294
5334
|
}, {
|
|
5295
5335
|
key: "mouseEnter",
|
|
5296
5336
|
value: function mouseEnter() {
|
|
5297
|
-
if (!this.options.chromeless || this.options.allowUserInteraction)
|
|
5337
|
+
if (!this.options.chromeless || this.options.allowUserInteraction) {
|
|
5338
|
+
this.trigger(Events$1.CONTAINER_MOUSE_ENTER);
|
|
5339
|
+
}
|
|
5298
5340
|
}
|
|
5299
5341
|
}, {
|
|
5300
5342
|
key: "mouseLeave",
|
|
5301
5343
|
value: function mouseLeave() {
|
|
5302
|
-
if (!this.options.chromeless || this.options.allowUserInteraction)
|
|
5344
|
+
if (!this.options.chromeless || this.options.allowUserInteraction) {
|
|
5345
|
+
this.trigger(Events$1.CONTAINER_MOUSE_LEAVE);
|
|
5346
|
+
}
|
|
5303
5347
|
}
|
|
5304
5348
|
}, {
|
|
5305
5349
|
key: "mouseUp",
|
|
5306
5350
|
value: function mouseUp() {
|
|
5307
|
-
if (!this.options.chromeless || this.options.allowUserInteraction)
|
|
5351
|
+
if (!this.options.chromeless || this.options.allowUserInteraction) {
|
|
5352
|
+
this.trigger(Events$1.CONTAINER_MOUSE_UP);
|
|
5353
|
+
}
|
|
5308
5354
|
}
|
|
5309
5355
|
}, {
|
|
5310
5356
|
key: "mouseDown",
|
|
5311
5357
|
value: function mouseDown() {
|
|
5312
|
-
if (!this.options.chromeless || this.options.allowUserInteraction)
|
|
5358
|
+
if (!this.options.chromeless || this.options.allowUserInteraction) {
|
|
5359
|
+
this.trigger(Events$1.CONTAINER_MOUSE_DOWN);
|
|
5360
|
+
}
|
|
5313
5361
|
}
|
|
5314
5362
|
}, {
|
|
5315
5363
|
key: "enterPiP",
|
|
@@ -5356,7 +5404,11 @@ var Container = /*#__PURE__*/function (_UIObject) {
|
|
|
5356
5404
|
}, {
|
|
5357
5405
|
key: "updateStyle",
|
|
5358
5406
|
value: function updateStyle() {
|
|
5359
|
-
if (!this.options.chromeless || this.options.allowUserInteraction)
|
|
5407
|
+
if (!this.options.chromeless || this.options.allowUserInteraction) {
|
|
5408
|
+
this.$el.removeClass('chromeless');
|
|
5409
|
+
} else {
|
|
5410
|
+
this.$el.addClass('chromeless');
|
|
5411
|
+
}
|
|
5360
5412
|
}
|
|
5361
5413
|
}, {
|
|
5362
5414
|
key: "enableResizeObserver",
|
|
@@ -5647,6 +5699,17 @@ var Playback = /*#__PURE__*/function (_UIObject) {
|
|
|
5647
5699
|
return 0;
|
|
5648
5700
|
}
|
|
5649
5701
|
|
|
5702
|
+
/**
|
|
5703
|
+
* gets the frame rate of the current source
|
|
5704
|
+
* @method getFrameRate
|
|
5705
|
+
* @return {Number|null} frame rate (fps) of the current source, or null if unavailable
|
|
5706
|
+
*/
|
|
5707
|
+
}, {
|
|
5708
|
+
key: "getFrameRate",
|
|
5709
|
+
value: function getFrameRate() {
|
|
5710
|
+
return null;
|
|
5711
|
+
}
|
|
5712
|
+
|
|
5650
5713
|
/**
|
|
5651
5714
|
* checks if the playback is playing.
|
|
5652
5715
|
* @method isPlaying
|
|
@@ -5957,7 +6020,8 @@ var ContainerFactory = /*#__PURE__*/function (_BaseObject) {
|
|
|
5957
6020
|
var playbackPlugin = this.findPlaybackPlugin(resolvedSource, mimeType);
|
|
5958
6021
|
|
|
5959
6022
|
// Fallback to empty playback object until we sort out unsupported sources error without NoOp playback
|
|
5960
|
-
var playback = playbackPlugin ? new playbackPlugin(options, this._i18n, this.playerError)
|
|
6023
|
+
var playback = playbackPlugin ? new playbackPlugin(options, this._i18n, this.playerError) // eslint-disable-line
|
|
6024
|
+
: new Playback();
|
|
5961
6025
|
options = _objectSpread2$1(_objectSpread2$1({}, options), {}, {
|
|
5962
6026
|
playback: playback
|
|
5963
6027
|
});
|
|
@@ -6002,7 +6066,7 @@ var Core = /*#__PURE__*/function (_UIObject) {
|
|
|
6002
6066
|
_this.styleRendered = false;
|
|
6003
6067
|
_this.plugins = [];
|
|
6004
6068
|
_this.containers = [];
|
|
6005
|
-
//FIXME fullscreen api sucks
|
|
6069
|
+
// FIXME fullscreen api sucks
|
|
6006
6070
|
_this._boundFullscreenHandler = function () {
|
|
6007
6071
|
return _this.handleFullscreenChange();
|
|
6008
6072
|
};
|
|
@@ -6548,7 +6612,9 @@ var CoreFactory = /*#__PURE__*/function (_BaseObject) {
|
|
|
6548
6612
|
key: "setupExternalInterface",
|
|
6549
6613
|
value: function setupExternalInterface(plugin) {
|
|
6550
6614
|
var externalFunctions = plugin.getExternalInterface();
|
|
6551
|
-
for (var key in externalFunctions)
|
|
6615
|
+
for (var key in externalFunctions) {
|
|
6616
|
+
this.player[key] = externalFunctions[key].bind(plugin);
|
|
6617
|
+
}
|
|
6552
6618
|
}
|
|
6553
6619
|
}]);
|
|
6554
6620
|
}(BaseObject);
|
|
@@ -6611,7 +6677,8 @@ var filterPluginsByType = function filterPluginsByType(plugins, type) {
|
|
|
6611
6677
|
var _ref4 = _slicedToArray(_ref3, 2),
|
|
6612
6678
|
key = _ref4[0],
|
|
6613
6679
|
value = _ref4[1];
|
|
6614
|
-
|
|
6680
|
+
obj[key] = value;
|
|
6681
|
+
return obj;
|
|
6615
6682
|
}, {});
|
|
6616
6683
|
};
|
|
6617
6684
|
|
|
@@ -6627,7 +6694,7 @@ var Loader = (function () {
|
|
|
6627
6694
|
plugins: {},
|
|
6628
6695
|
playbacks: []
|
|
6629
6696
|
};
|
|
6630
|
-
var currentVersion = "0.
|
|
6697
|
+
var currentVersion = "0.13.0";
|
|
6631
6698
|
return /*#__PURE__*/function () {
|
|
6632
6699
|
/**
|
|
6633
6700
|
* builds the loader
|
|
@@ -6653,7 +6720,6 @@ var Loader = (function () {
|
|
|
6653
6720
|
/**
|
|
6654
6721
|
* groups by type the external plugins that were passed through `options.plugins` it they're on a flat array
|
|
6655
6722
|
* @method addExternalPlugins
|
|
6656
|
-
* @private
|
|
6657
6723
|
* @param {Object} an config object or an array of plugins
|
|
6658
6724
|
* @return {Object} plugins the config object with the plugins separated by type
|
|
6659
6725
|
*/
|
|
@@ -6688,7 +6754,6 @@ var Loader = (function () {
|
|
|
6688
6754
|
/**
|
|
6689
6755
|
* adds all the external plugins that were passed through `options.plugins`
|
|
6690
6756
|
* @method addExternalPlugins
|
|
6691
|
-
* @private
|
|
6692
6757
|
* @param {Object} plugins the config object with all plugins
|
|
6693
6758
|
*/
|
|
6694
6759
|
}, {
|
|
@@ -6699,19 +6764,22 @@ var Loader = (function () {
|
|
|
6699
6764
|
plugins = this.groupPluginsByType(plugins);
|
|
6700
6765
|
if (plugins.playback) {
|
|
6701
6766
|
var playbacks = plugins.playback.filter(function (playback) {
|
|
6702
|
-
|
|
6767
|
+
Loader.checkVersionSupport(playback);
|
|
6768
|
+
return true;
|
|
6703
6769
|
});
|
|
6704
6770
|
this.playbackPlugins = loadExternalPlaybacksFirst ? this.removeDups(playbacks.concat(this.playbackPlugins)) : this.removeDups(this.playbackPlugins.concat(playbacks), true);
|
|
6705
6771
|
}
|
|
6706
6772
|
if (plugins.container) {
|
|
6707
6773
|
var containerPlugins = plugins.container.filter(function (plugin) {
|
|
6708
|
-
|
|
6774
|
+
Loader.checkVersionSupport(plugin);
|
|
6775
|
+
return true;
|
|
6709
6776
|
});
|
|
6710
6777
|
this.containerPlugins = loadExternalPluginsFirst ? this.removeDups(containerPlugins.concat(this.containerPlugins)) : this.removeDups(this.containerPlugins.concat(containerPlugins), true);
|
|
6711
6778
|
}
|
|
6712
6779
|
if (plugins.core) {
|
|
6713
6780
|
var corePlugins = plugins.core.filter(function (plugin) {
|
|
6714
|
-
|
|
6781
|
+
Loader.checkVersionSupport(plugin);
|
|
6782
|
+
return true;
|
|
6715
6783
|
});
|
|
6716
6784
|
this.corePlugins = loadExternalPluginsFirst ? this.removeDups(corePlugins.concat(this.corePlugins)) : this.removeDups(this.corePlugins.concat(corePlugins), true);
|
|
6717
6785
|
}
|
|
@@ -6720,7 +6788,6 @@ var Loader = (function () {
|
|
|
6720
6788
|
/**
|
|
6721
6789
|
* validate if the external plugins that were passed through `options.plugins` are associated to the correct type
|
|
6722
6790
|
* @method validateExternalPluginsType
|
|
6723
|
-
* @private
|
|
6724
6791
|
* @param {Object} plugins the config object with all plugins
|
|
6725
6792
|
*/
|
|
6726
6793
|
}, {
|
|
@@ -6728,7 +6795,8 @@ var Loader = (function () {
|
|
|
6728
6795
|
value: function validateExternalPluginsType(plugins) {
|
|
6729
6796
|
var pluginTypes = ['playback', 'container', 'core'];
|
|
6730
6797
|
pluginTypes.forEach(function (type) {
|
|
6731
|
-
|
|
6798
|
+
var pluginsByType = plugins[type] || [];
|
|
6799
|
+
pluginsByType.forEach(function (el) {
|
|
6732
6800
|
var errorMessage = 'external ' + el.type + ' plugin on ' + type + ' array';
|
|
6733
6801
|
if (el.type !== type) throw new ReferenceError(errorMessage);
|
|
6734
6802
|
});
|
|
@@ -6779,7 +6847,9 @@ var Loader = (function () {
|
|
|
6779
6847
|
var pluginRegistry = registry.plugins;
|
|
6780
6848
|
if (!pluginRegistry) return false;
|
|
6781
6849
|
var previousEntry = pluginRegistry[pluginEntry.prototype.name];
|
|
6782
|
-
if (previousEntry)
|
|
6850
|
+
if (previousEntry) {
|
|
6851
|
+
Log.warn('Loader', "overriding plugin entry: ".concat(pluginEntry.prototype.name, " - ").concat(previousEntry));
|
|
6852
|
+
}
|
|
6783
6853
|
pluginRegistry[pluginEntry.prototype.name] = pluginEntry;
|
|
6784
6854
|
return true;
|
|
6785
6855
|
}
|
|
@@ -7036,7 +7106,9 @@ var Player$1 = /*#__PURE__*/function (_BaseObject) {
|
|
|
7036
7106
|
return _createClass(Player, [{
|
|
7037
7107
|
key: "loader",
|
|
7038
7108
|
get: function get() {
|
|
7039
|
-
if (!this._loader)
|
|
7109
|
+
if (!this._loader) {
|
|
7110
|
+
this._loader = new Loader(this.options.plugins || {}, this.options.playerId);
|
|
7111
|
+
}
|
|
7040
7112
|
return this._loader;
|
|
7041
7113
|
}
|
|
7042
7114
|
|
|
@@ -7126,7 +7198,11 @@ var Player$1 = /*#__PURE__*/function (_BaseObject) {
|
|
|
7126
7198
|
}, {
|
|
7127
7199
|
key: "_addEventListeners",
|
|
7128
7200
|
value: function _addEventListeners() {
|
|
7129
|
-
if (!this.core.isReady)
|
|
7201
|
+
if (!this.core.isReady) {
|
|
7202
|
+
this.listenToOnce(this.core, Events$1.CORE_READY, this._onReady);
|
|
7203
|
+
} else {
|
|
7204
|
+
this._onReady();
|
|
7205
|
+
}
|
|
7130
7206
|
this.listenTo(this.core, Events$1.CORE_ACTIVE_CONTAINER_CHANGED, this._containerChanged);
|
|
7131
7207
|
this.listenTo(this.core, Events$1.CORE_FULLSCREEN, this._onFullscreenChange);
|
|
7132
7208
|
this.listenTo(this.core, Events$1.CORE_RESIZE, this._onResize);
|
|
@@ -7280,9 +7356,11 @@ var Player$1 = /*#__PURE__*/function (_BaseObject) {
|
|
|
7280
7356
|
}, {
|
|
7281
7357
|
key: "load",
|
|
7282
7358
|
value: function load(sources, mimeType, autoPlay) {
|
|
7283
|
-
if (autoPlay !== undefined)
|
|
7284
|
-
|
|
7285
|
-
|
|
7359
|
+
if (autoPlay !== undefined) {
|
|
7360
|
+
this.configure({
|
|
7361
|
+
autoPlay: !!autoPlay
|
|
7362
|
+
});
|
|
7363
|
+
}
|
|
7286
7364
|
this.core.load(sources, mimeType);
|
|
7287
7365
|
return this;
|
|
7288
7366
|
}
|
|
@@ -7676,22 +7754,22 @@ var tracksHTML = "<% for (var i = 0; i < tracks.length; i++) { %>\n <track data
|
|
|
7676
7754
|
var css_248z$2 = "[data-html5-video] {\n position: absolute;\n height: 100%;\n width: 100%;\n display: block; }\n";
|
|
7677
7755
|
|
|
7678
7756
|
var MIMETYPES = {
|
|
7679
|
-
|
|
7757
|
+
mp4: ['avc1.42E01E', 'avc1.58A01E', 'avc1.4D401E', 'avc1.64001E', 'mp4v.20.8', 'mp4v.20.240', 'mp4a.40.2'].map(function (codec) {
|
|
7680
7758
|
return 'video/mp4; codecs="' + codec + ', mp4a.40.2"';
|
|
7681
7759
|
}),
|
|
7682
|
-
|
|
7760
|
+
ogg: ['video/ogg; codecs="theora, vorbis"', 'video/ogg; codecs="dirac"', 'video/ogg; codecs="theora, speex"'],
|
|
7683
7761
|
'3gpp': ['video/3gpp; codecs="mp4v.20.8, samr"'],
|
|
7684
|
-
|
|
7685
|
-
|
|
7686
|
-
|
|
7762
|
+
webm: ['video/webm; codecs="vp8, vorbis"'],
|
|
7763
|
+
mkv: ['video/x-matroska; codecs="theora, vorbis"'],
|
|
7764
|
+
m3u8: ['application/x-mpegurl']
|
|
7687
7765
|
};
|
|
7688
|
-
MIMETYPES
|
|
7766
|
+
MIMETYPES.ogv = MIMETYPES.ogg;
|
|
7689
7767
|
MIMETYPES['3gp'] = MIMETYPES['3gpp'];
|
|
7690
7768
|
var AUDIO_MIMETYPES = {
|
|
7691
|
-
|
|
7692
|
-
|
|
7693
|
-
|
|
7694
|
-
|
|
7769
|
+
wav: ['audio/wav'],
|
|
7770
|
+
mp3: ['audio/mp3', 'audio/mpeg;codecs="mp3"'],
|
|
7771
|
+
aac: ['audio/mp4;codecs="mp4a.40.5"'],
|
|
7772
|
+
oga: ['audio/ogg']
|
|
7695
7773
|
};
|
|
7696
7774
|
var KNOWN_AUDIO_MIMETYPES = Object.keys(AUDIO_MIMETYPES).reduce(function (acc, k) {
|
|
7697
7775
|
return [].concat(_toConsumableArray(acc), _toConsumableArray(AUDIO_MIMETYPES[k]));
|
|
@@ -7728,7 +7806,11 @@ var HTML5Video$1 = /*#__PURE__*/function (_Playback) {
|
|
|
7728
7806
|
var preload = playbackConfig.preload || (Browser.isSafari ? 'auto' : _this.options.preload);
|
|
7729
7807
|
var posterUrl; // FIXME: poster plugin should always convert poster to object with expected properties ?
|
|
7730
7808
|
if (_this.options.poster) {
|
|
7731
|
-
if (typeof _this.options.poster === 'string')
|
|
7809
|
+
if (typeof _this.options.poster === 'string') {
|
|
7810
|
+
posterUrl = _this.options.poster;
|
|
7811
|
+
} else if (typeof _this.options.poster.url === 'string') {
|
|
7812
|
+
posterUrl = _this.options.poster.url;
|
|
7813
|
+
}
|
|
7732
7814
|
}
|
|
7733
7815
|
$.extend(true, _this.el, {
|
|
7734
7816
|
muted: _this.options.mute,
|
|
@@ -7739,7 +7821,9 @@ var HTML5Video$1 = /*#__PURE__*/function (_Playback) {
|
|
|
7739
7821
|
crossOrigin: playbackConfig.crossOrigin,
|
|
7740
7822
|
'x-webkit-playsinline': playbackConfig.playInline
|
|
7741
7823
|
});
|
|
7742
|
-
if (playbackConfig.controls || _this.options.useVideoTagDefaultControls)
|
|
7824
|
+
if (playbackConfig.controls || _this.options.useVideoTagDefaultControls) {
|
|
7825
|
+
_this.$el.attr('controls', '');
|
|
7826
|
+
}
|
|
7743
7827
|
playbackConfig.playInline && _this.$el.attr({
|
|
7744
7828
|
playsinline: 'playsinline'
|
|
7745
7829
|
});
|
|
@@ -7767,7 +7851,7 @@ var HTML5Video$1 = /*#__PURE__*/function (_Playback) {
|
|
|
7767
7851
|
key: "supportedVersion",
|
|
7768
7852
|
get: function get() {
|
|
7769
7853
|
return {
|
|
7770
|
-
min: "0.
|
|
7854
|
+
min: "0.13.0"
|
|
7771
7855
|
};
|
|
7772
7856
|
}
|
|
7773
7857
|
}, {
|
|
@@ -7793,23 +7877,23 @@ var HTML5Video$1 = /*#__PURE__*/function (_Playback) {
|
|
|
7793
7877
|
key: "events",
|
|
7794
7878
|
get: function get() {
|
|
7795
7879
|
return {
|
|
7796
|
-
|
|
7797
|
-
|
|
7798
|
-
|
|
7799
|
-
|
|
7800
|
-
|
|
7801
|
-
|
|
7802
|
-
|
|
7803
|
-
|
|
7804
|
-
|
|
7805
|
-
|
|
7806
|
-
|
|
7807
|
-
|
|
7808
|
-
|
|
7809
|
-
|
|
7810
|
-
|
|
7811
|
-
|
|
7812
|
-
|
|
7880
|
+
canplay: '_onCanPlay',
|
|
7881
|
+
canplaythrough: '_handleBufferingEvents',
|
|
7882
|
+
durationchange: '_onDurationChange',
|
|
7883
|
+
ended: '_onEnded',
|
|
7884
|
+
error: '_onError',
|
|
7885
|
+
loadeddata: '_onLoadedData',
|
|
7886
|
+
loadedmetadata: '_onLoadedMetadata',
|
|
7887
|
+
pause: '_onPause',
|
|
7888
|
+
playing: '_onPlaying',
|
|
7889
|
+
progress: '_onProgress',
|
|
7890
|
+
seeking: '_onSeeking',
|
|
7891
|
+
seeked: '_onSeeked',
|
|
7892
|
+
stalled: '_handleBufferingEvents',
|
|
7893
|
+
timeupdate: '_onTimeUpdate',
|
|
7894
|
+
waiting: '_onWaiting',
|
|
7895
|
+
enterpictureinpicture: '_onEnterPiP',
|
|
7896
|
+
leavepictureinpicture: '_onExitPiP'
|
|
7813
7897
|
};
|
|
7814
7898
|
}
|
|
7815
7899
|
|
|
@@ -7906,7 +7990,9 @@ var HTML5Video$1 = /*#__PURE__*/function (_Playback) {
|
|
|
7906
7990
|
};
|
|
7907
7991
|
|
|
7908
7992
|
// Use current video element if recycling feature enabled with mobile devices
|
|
7909
|
-
if (Browser.isMobile && DomRecycler.options.recycleVideo)
|
|
7993
|
+
if (Browser.isMobile && DomRecycler.options.recycleVideo) {
|
|
7994
|
+
opts.element = this.el;
|
|
7995
|
+
}
|
|
7910
7996
|
|
|
7911
7997
|
// Desktop browser autoplay policy may require user action
|
|
7912
7998
|
// Mobile browser autoplay require user consent and video recycling feature enabled
|
|
@@ -7948,7 +8034,9 @@ var HTML5Video$1 = /*#__PURE__*/function (_Playback) {
|
|
|
7948
8034
|
}, {
|
|
7949
8035
|
key: "_setupSrc",
|
|
7950
8036
|
value: function _setupSrc(srcUrl) {
|
|
7951
|
-
if (this.el.src === srcUrl)
|
|
8037
|
+
if (this.el.src === srcUrl) {
|
|
8038
|
+
return;
|
|
8039
|
+
}
|
|
7952
8040
|
this._ccIsSetup = false;
|
|
7953
8041
|
this.el.src = srcUrl;
|
|
7954
8042
|
this._src = this.el.src;
|
|
@@ -7963,7 +8051,9 @@ var HTML5Video$1 = /*#__PURE__*/function (_Playback) {
|
|
|
7963
8051
|
});
|
|
7964
8052
|
this._updateSettings();
|
|
7965
8053
|
var autoSeekFromUrl = typeof this._options.autoSeekFromUrl === 'undefined' || this._options.autoSeekFromUrl;
|
|
7966
|
-
if (this.getPlaybackType() !== Playback.LIVE && autoSeekFromUrl)
|
|
8054
|
+
if (this.getPlaybackType() !== Playback.LIVE && autoSeekFromUrl) {
|
|
8055
|
+
this._checkInitialSeek();
|
|
8056
|
+
}
|
|
7967
8057
|
}
|
|
7968
8058
|
}, {
|
|
7969
8059
|
key: "_onDurationChange",
|
|
@@ -7978,7 +8068,11 @@ var HTML5Video$1 = /*#__PURE__*/function (_Playback) {
|
|
|
7978
8068
|
value: function _updateSettings() {
|
|
7979
8069
|
// we can't figure out if hls resource is VoD or not until it is being loaded or duration has changed.
|
|
7980
8070
|
// that's why we check it again and update media control accordingly.
|
|
7981
|
-
if (this.getPlaybackType() === Playback.VOD || this.getPlaybackType() === Playback.AOD)
|
|
8071
|
+
if (this.getPlaybackType() === Playback.VOD || this.getPlaybackType() === Playback.AOD) {
|
|
8072
|
+
this.settings.left = ['playpause', 'position', 'duration'];
|
|
8073
|
+
} else {
|
|
8074
|
+
this.settings.left = ['playstop'];
|
|
8075
|
+
}
|
|
7982
8076
|
this.settings.seekEnabled = this.isSeekEnabled();
|
|
7983
8077
|
this.trigger(Events$1.PLAYBACK_SETTINGSUPDATE);
|
|
7984
8078
|
}
|
|
@@ -8029,9 +8123,11 @@ var HTML5Video$1 = /*#__PURE__*/function (_Playback) {
|
|
|
8029
8123
|
this._handleBufferingEvents();
|
|
8030
8124
|
var promise = this.el.play();
|
|
8031
8125
|
// For more details, see https://developers.google.com/web/updates/2016/03/play-returns-promise
|
|
8032
|
-
if (promise && promise["catch"])
|
|
8033
|
-
|
|
8034
|
-
|
|
8126
|
+
if (promise && promise["catch"]) {
|
|
8127
|
+
promise["catch"](function (error) {
|
|
8128
|
+
return Log.warn(_this4.name, 'HTML5 play failed', error);
|
|
8129
|
+
});
|
|
8130
|
+
}
|
|
8035
8131
|
return promise;
|
|
8036
8132
|
}
|
|
8037
8133
|
}, {
|
|
@@ -8105,7 +8201,9 @@ var HTML5Video$1 = /*#__PURE__*/function (_Playback) {
|
|
|
8105
8201
|
}, {
|
|
8106
8202
|
key: "_startPlayheadMovingChecks",
|
|
8107
8203
|
value: function _startPlayheadMovingChecks() {
|
|
8108
|
-
if (this._playheadMovingTimer !== null || !this._playheadMovingCheckEnabled)
|
|
8204
|
+
if (this._playheadMovingTimer !== null || !this._playheadMovingCheckEnabled) {
|
|
8205
|
+
return;
|
|
8206
|
+
}
|
|
8109
8207
|
this._playheadMovingTimeOnCheck = null;
|
|
8110
8208
|
this._determineIfPlayheadMoving();
|
|
8111
8209
|
this._playheadMovingTimer = setInterval(this._determineIfPlayheadMoving.bind(this), this._playheadMovingCheckInterval);
|
|
@@ -8113,7 +8211,9 @@ var HTML5Video$1 = /*#__PURE__*/function (_Playback) {
|
|
|
8113
8211
|
}, {
|
|
8114
8212
|
key: "_stopPlayheadMovingChecks",
|
|
8115
8213
|
value: function _stopPlayheadMovingChecks() {
|
|
8116
|
-
if (this._playheadMovingTimer === null)
|
|
8214
|
+
if (this._playheadMovingTimer === null) {
|
|
8215
|
+
return;
|
|
8216
|
+
}
|
|
8117
8217
|
clearInterval(this._playheadMovingTimer);
|
|
8118
8218
|
this._playheadMovingTimer = null;
|
|
8119
8219
|
this._playheadMoving = false;
|
|
@@ -8243,10 +8343,16 @@ var HTML5Video$1 = /*#__PURE__*/function (_Playback) {
|
|
|
8243
8343
|
var isMissingMediaDataToPlay = this.el.readyState < this.el.HAVE_FUTURE_DATA;
|
|
8244
8344
|
var playheadShouldBeMoving = !this.el.ended && !this.el.paused && !this._playheadMoving;
|
|
8245
8345
|
var buffering = isLoading && isMissingMediaDataToPlay;
|
|
8246
|
-
if (this._playheadMovingCheckEnabled)
|
|
8346
|
+
if (this._playheadMovingCheckEnabled) {
|
|
8347
|
+
buffering = buffering || isLoading && playheadShouldBeMoving;
|
|
8348
|
+
}
|
|
8247
8349
|
if (this._isBuffering !== buffering) {
|
|
8248
8350
|
this._isBuffering = buffering;
|
|
8249
|
-
if (buffering)
|
|
8351
|
+
if (buffering) {
|
|
8352
|
+
this.trigger(Events$1.PLAYBACK_BUFFERING, this.name);
|
|
8353
|
+
} else {
|
|
8354
|
+
this.trigger(Events$1.PLAYBACK_BUFFERFULL, this.name);
|
|
8355
|
+
}
|
|
8250
8356
|
}
|
|
8251
8357
|
}
|
|
8252
8358
|
}, {
|
|
@@ -8262,7 +8368,11 @@ var HTML5Video$1 = /*#__PURE__*/function (_Playback) {
|
|
|
8262
8368
|
raw: this.el.error,
|
|
8263
8369
|
level: isUnknownError ? PlayerError.Levels.WARN : PlayerError.Levels.FATAL
|
|
8264
8370
|
});
|
|
8265
|
-
if (isUnknownError)
|
|
8371
|
+
if (isUnknownError) {
|
|
8372
|
+
Log.warn(this.name, 'HTML5 unknown error: ', formattedError);
|
|
8373
|
+
} else {
|
|
8374
|
+
this.trigger(Events$1.PLAYBACK_ERROR, formattedError);
|
|
8375
|
+
}
|
|
8266
8376
|
}
|
|
8267
8377
|
}, {
|
|
8268
8378
|
key: "destroy",
|
|
@@ -8282,7 +8392,7 @@ var HTML5Video$1 = /*#__PURE__*/function (_Playback) {
|
|
|
8282
8392
|
value: function _updateDvr(status) {
|
|
8283
8393
|
this.trigger(Events$1.PLAYBACK_DVR, status);
|
|
8284
8394
|
this.trigger(Events$1.PLAYBACK_STATS_ADD, {
|
|
8285
|
-
|
|
8395
|
+
dvr: status
|
|
8286
8396
|
});
|
|
8287
8397
|
}
|
|
8288
8398
|
}, {
|
|
@@ -8305,7 +8415,9 @@ var HTML5Video$1 = /*#__PURE__*/function (_Playback) {
|
|
|
8305
8415
|
key: "_checkInitialSeek",
|
|
8306
8416
|
value: function _checkInitialSeek() {
|
|
8307
8417
|
var seekTime = seekStringToSeconds();
|
|
8308
|
-
if (seekTime !== 0)
|
|
8418
|
+
if (seekTime !== 0) {
|
|
8419
|
+
this.seek(seekTime);
|
|
8420
|
+
}
|
|
8309
8421
|
}
|
|
8310
8422
|
}, {
|
|
8311
8423
|
key: "getCurrentTime",
|
|
@@ -8348,7 +8460,9 @@ var HTML5Video$1 = /*#__PURE__*/function (_Playback) {
|
|
|
8348
8460
|
}, {
|
|
8349
8461
|
key: "_onProgress",
|
|
8350
8462
|
value: function _onProgress() {
|
|
8351
|
-
if (!this.el.buffered.length)
|
|
8463
|
+
if (!this.el.buffered.length) {
|
|
8464
|
+
return;
|
|
8465
|
+
}
|
|
8352
8466
|
var buffered = [];
|
|
8353
8467
|
var bufferedPos = 0;
|
|
8354
8468
|
for (var i = 0; i < this.el.buffered.length; i++) {
|
|
@@ -8356,7 +8470,9 @@ var HTML5Video$1 = /*#__PURE__*/function (_Playback) {
|
|
|
8356
8470
|
start: this.el.buffered.start(i),
|
|
8357
8471
|
end: this.el.buffered.end(i)
|
|
8358
8472
|
}]);
|
|
8359
|
-
if (this.el.currentTime >= buffered[i].start && this.el.currentTime <= buffered[i].end)
|
|
8473
|
+
if (this.el.currentTime >= buffered[i].start && this.el.currentTime <= buffered[i].end) {
|
|
8474
|
+
bufferedPos = i;
|
|
8475
|
+
}
|
|
8360
8476
|
}
|
|
8361
8477
|
var progress = {
|
|
8362
8478
|
start: buffered[bufferedPos].start,
|
|
@@ -8369,14 +8485,18 @@ var HTML5Video$1 = /*#__PURE__*/function (_Playback) {
|
|
|
8369
8485
|
key: "_typeFor",
|
|
8370
8486
|
value: function _typeFor(src) {
|
|
8371
8487
|
var mimeTypes = HTML5Video._mimeTypesForUrl(src, MIMETYPES, this.options.mimeType);
|
|
8372
|
-
if (mimeTypes.length === 0)
|
|
8488
|
+
if (mimeTypes.length === 0) {
|
|
8489
|
+
mimeTypes = HTML5Video._mimeTypesForUrl(src, AUDIO_MIMETYPES, this.options.mimeType);
|
|
8490
|
+
}
|
|
8373
8491
|
var mimeType = mimeTypes[0] || '';
|
|
8374
8492
|
return mimeType.split(';')[0];
|
|
8375
8493
|
}
|
|
8376
8494
|
}, {
|
|
8377
8495
|
key: "_ready",
|
|
8378
8496
|
value: function _ready() {
|
|
8379
|
-
if (this._isReadyState)
|
|
8497
|
+
if (this._isReadyState) {
|
|
8498
|
+
return;
|
|
8499
|
+
}
|
|
8380
8500
|
this._isReadyState = true;
|
|
8381
8501
|
this.trigger(Events$1.PLAYBACK_READY, this.name);
|
|
8382
8502
|
}
|
|
@@ -8440,7 +8560,9 @@ var HTML5Video$1 = /*#__PURE__*/function (_Playback) {
|
|
|
8440
8560
|
return this._ccTrackId;
|
|
8441
8561
|
},
|
|
8442
8562
|
set: function set(trackId) {
|
|
8443
|
-
if (!isNumber$1(trackId))
|
|
8563
|
+
if (!isNumber$1(trackId)) {
|
|
8564
|
+
return;
|
|
8565
|
+
}
|
|
8444
8566
|
var tracks = this.closedCaptionsTracks;
|
|
8445
8567
|
var showingTrack;
|
|
8446
8568
|
|
|
@@ -8449,9 +8571,13 @@ var HTML5Video$1 = /*#__PURE__*/function (_Playback) {
|
|
|
8449
8571
|
showingTrack = tracks.find(function (track) {
|
|
8450
8572
|
return track.id === trackId;
|
|
8451
8573
|
});
|
|
8452
|
-
if (!showingTrack)
|
|
8574
|
+
if (!showingTrack) {
|
|
8575
|
+
return;
|
|
8576
|
+
} // Track id not found
|
|
8453
8577
|
|
|
8454
|
-
if (showingTrack.track.mode === 'showing')
|
|
8578
|
+
if (showingTrack.track.mode === 'showing') {
|
|
8579
|
+
return;
|
|
8580
|
+
} // Track already showing
|
|
8455
8581
|
}
|
|
8456
8582
|
|
|
8457
8583
|
// Since it is possible to display multiple tracks,
|
|
@@ -8459,7 +8585,7 @@ var HTML5Video$1 = /*#__PURE__*/function (_Playback) {
|
|
|
8459
8585
|
tracks.filter(function (track) {
|
|
8460
8586
|
return track.track.mode !== 'hidden';
|
|
8461
8587
|
}).forEach(function (track) {
|
|
8462
|
-
|
|
8588
|
+
track.track.mode = 'hidden';
|
|
8463
8589
|
});
|
|
8464
8590
|
showingTrack && (showingTrack.track.mode = 'showing');
|
|
8465
8591
|
this._ccTrackId = trackId;
|
|
@@ -8529,7 +8655,7 @@ var HTML5Audio = /*#__PURE__*/function (_HTML5Video) {
|
|
|
8529
8655
|
key: "supportedVersion",
|
|
8530
8656
|
get: function get() {
|
|
8531
8657
|
return {
|
|
8532
|
-
min: "0.
|
|
8658
|
+
min: "0.13.0"
|
|
8533
8659
|
};
|
|
8534
8660
|
}
|
|
8535
8661
|
}, {
|
|
@@ -8586,7 +8712,7 @@ var HTMLImg = /*#__PURE__*/function (_Playback) {
|
|
|
8586
8712
|
key: "supportedVersion",
|
|
8587
8713
|
get: function get() {
|
|
8588
8714
|
return {
|
|
8589
|
-
min: "0.
|
|
8715
|
+
min: "0.13.0"
|
|
8590
8716
|
};
|
|
8591
8717
|
}
|
|
8592
8718
|
}, {
|
|
@@ -8669,7 +8795,7 @@ var NoOp = /*#__PURE__*/function (_Playback) {
|
|
|
8669
8795
|
key: "supportedVersion",
|
|
8670
8796
|
get: function get() {
|
|
8671
8797
|
return {
|
|
8672
|
-
min: "0.
|
|
8798
|
+
min: "0.13.0"
|
|
8673
8799
|
};
|
|
8674
8800
|
}
|
|
8675
8801
|
}, {
|
|
@@ -8697,7 +8823,9 @@ var NoOp = /*#__PURE__*/function (_Playback) {
|
|
|
8697
8823
|
}));
|
|
8698
8824
|
this.trigger(Events$1.PLAYBACK_READY, this.name);
|
|
8699
8825
|
var showForNoOp = !!(this.options.poster && this.options.poster.showForNoOp);
|
|
8700
|
-
if (this.options.autoPlay || !showForNoOp)
|
|
8826
|
+
if (this.options.autoPlay || !showForNoOp) {
|
|
8827
|
+
this._animate();
|
|
8828
|
+
}
|
|
8701
8829
|
return this;
|
|
8702
8830
|
}
|
|
8703
8831
|
}, {
|
|
@@ -8715,12 +8843,14 @@ var NoOp = /*#__PURE__*/function (_Playback) {
|
|
|
8715
8843
|
} catch (err) {
|
|
8716
8844
|
buffer32 = new Uint32Array(this.context.canvas.width * this.context.canvas.height * 4);
|
|
8717
8845
|
var data = idata.data;
|
|
8718
|
-
for (var i = 0; i < data.length; i++)
|
|
8846
|
+
for (var i = 0; i < data.length; i++) {
|
|
8847
|
+
buffer32[i] = data[i];
|
|
8848
|
+
}
|
|
8719
8849
|
}
|
|
8720
|
-
var len = buffer32.length
|
|
8721
|
-
|
|
8722
|
-
var run = 0
|
|
8723
|
-
|
|
8850
|
+
var len = buffer32.length;
|
|
8851
|
+
var m = Math.random() * 6 + 4;
|
|
8852
|
+
var run = 0;
|
|
8853
|
+
var color = 0;
|
|
8724
8854
|
for (var _i = 0; _i < len;) {
|
|
8725
8855
|
if (run < 0) {
|
|
8726
8856
|
run = m * Math.random();
|
|
@@ -8736,7 +8866,9 @@ var NoOp = /*#__PURE__*/function (_Playback) {
|
|
|
8736
8866
|
key: "_loop",
|
|
8737
8867
|
value: function _loop() {
|
|
8738
8868
|
var _this2 = this;
|
|
8739
|
-
if (this._stop)
|
|
8869
|
+
if (this._stop) {
|
|
8870
|
+
return;
|
|
8871
|
+
}
|
|
8740
8872
|
this._noise();
|
|
8741
8873
|
this._animationHandle = requestAnimationFrame$1(function () {
|
|
8742
8874
|
return _this2._loop();
|
|
@@ -8795,14 +8927,14 @@ var Strings = /*#__PURE__*/function (_CorePlugin) {
|
|
|
8795
8927
|
key: "supportedVersion",
|
|
8796
8928
|
get: function get() {
|
|
8797
8929
|
return {
|
|
8798
|
-
min: "0.
|
|
8930
|
+
min: "0.13.0"
|
|
8799
8931
|
};
|
|
8800
8932
|
}
|
|
8801
8933
|
}, {
|
|
8802
8934
|
key: "t",
|
|
8803
8935
|
value: function t(key) {
|
|
8804
8936
|
var lang = this._language();
|
|
8805
|
-
var fallbackLang = this._messages
|
|
8937
|
+
var fallbackLang = this._messages.en;
|
|
8806
8938
|
var i18n = lang && this._messages[lang] || fallbackLang;
|
|
8807
8939
|
return i18n[key] || fallbackLang[key] || key;
|
|
8808
8940
|
}
|
|
@@ -8907,17 +9039,17 @@ var Strings = /*#__PURE__*/function (_CorePlugin) {
|
|
|
8907
9039
|
}
|
|
8908
9040
|
};
|
|
8909
9041
|
this._messages = $.extend(true, defaultMessages, this.core.options.strings || {});
|
|
8910
|
-
this._messages['de-DE'] = this._messages
|
|
8911
|
-
this._messages['pt-BR'] = this._messages
|
|
8912
|
-
this._messages['en-US'] = this._messages
|
|
8913
|
-
this._messages['bg-BG'] = this._messages
|
|
8914
|
-
this._messages['es-419'] = this._messages
|
|
8915
|
-
this._messages['es-ES'] = this._messages
|
|
8916
|
-
this._messages['fr-FR'] = this._messages
|
|
8917
|
-
this._messages['tr-TR'] = this._messages
|
|
8918
|
-
this._messages['et-EE'] = this._messages
|
|
8919
|
-
this._messages['ar-IQ'] = this._messages
|
|
8920
|
-
this._messages['zh-CN'] = this._messages
|
|
9042
|
+
this._messages['de-DE'] = this._messages.de;
|
|
9043
|
+
this._messages['pt-BR'] = this._messages.pt;
|
|
9044
|
+
this._messages['en-US'] = this._messages.en;
|
|
9045
|
+
this._messages['bg-BG'] = this._messages.bg;
|
|
9046
|
+
this._messages['es-419'] = this._messages.es_am;
|
|
9047
|
+
this._messages['es-ES'] = this._messages.es;
|
|
9048
|
+
this._messages['fr-FR'] = this._messages.fr;
|
|
9049
|
+
this._messages['tr-TR'] = this._messages.tr;
|
|
9050
|
+
this._messages['et-EE'] = this._messages.et;
|
|
9051
|
+
this._messages['ar-IQ'] = this._messages.ar;
|
|
9052
|
+
this._messages['zh-CN'] = this._messages.zh;
|
|
8921
9053
|
}
|
|
8922
9054
|
}]);
|
|
8923
9055
|
}(CorePlugin);
|
|
@@ -8937,7 +9069,7 @@ var SourcesPlugin = /*#__PURE__*/function (_CorePlugin) {
|
|
|
8937
9069
|
key: "supportedVersion",
|
|
8938
9070
|
get: function get() {
|
|
8939
9071
|
return {
|
|
8940
|
-
min: "0.
|
|
9072
|
+
min: "0.13.0"
|
|
8941
9073
|
};
|
|
8942
9074
|
}
|
|
8943
9075
|
}, {
|
|
@@ -48500,7 +48632,7 @@ Hls.defaultConfig = void 0;
|
|
|
48500
48632
|
|
|
48501
48633
|
// assert(process.env.CLAPPR_VERSION, 'CLAPPR_VERSION is required');
|
|
48502
48634
|
// export const CLAPPR_VERSION: string = process.env.CLAPPR_VERSION || '0.11.3';
|
|
48503
|
-
const CLAPPR_VERSION = '0.
|
|
48635
|
+
const CLAPPR_VERSION = '0.13.0';
|
|
48504
48636
|
|
|
48505
48637
|
// Copyright 2014 Globo.com Player authors. All rights reserved.
|
|
48506
48638
|
// Use of this source code is governed by a BSD-style
|
|
@@ -49958,11 +50090,11 @@ class Player {
|
|
|
49958
50090
|
}
|
|
49959
50091
|
}
|
|
49960
50092
|
|
|
49961
|
-
var version$1 = "2.28.
|
|
50093
|
+
var version$1 = "2.28.14";
|
|
49962
50094
|
|
|
49963
50095
|
var packages = {
|
|
49964
50096
|
"node_modules/@clappr/core": {
|
|
49965
|
-
version: "0.
|
|
50097
|
+
version: "0.13.0"},
|
|
49966
50098
|
"node_modules/dashjs": {
|
|
49967
50099
|
version: "4.7.4"},
|
|
49968
50100
|
"node_modules/hls.js": {
|