@gcorevideo/player 2.28.11 → 2.28.13
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 +311 -179
- package/dist/index.css +285 -285
- package/dist/index.embed.js +315 -179
- package/dist/index.js +317 -181
- package/package.json +2 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/vitest.config.ts +1 -0
package/dist/index.embed.js
CHANGED
|
@@ -2168,9 +2168,7 @@ if (typeof Object.assign != 'function') {
|
|
|
2168
2168
|
// Skip over if undefined or null
|
|
2169
2169
|
for (var nextKey in nextSource) {
|
|
2170
2170
|
// Avoid bugs when hasOwnProperty is shadowed
|
|
2171
|
-
if (Object.prototype.hasOwnProperty.call(nextSource, nextKey))
|
|
2172
|
-
to[nextKey] = nextSource[nextKey];
|
|
2173
|
-
}
|
|
2171
|
+
if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) to[nextKey] = nextSource[nextKey];
|
|
2174
2172
|
}
|
|
2175
2173
|
}
|
|
2176
2174
|
}
|
|
@@ -2186,18 +2184,14 @@ if (!Array.prototype.findIndex) {
|
|
|
2186
2184
|
Object.defineProperty(Array.prototype, 'findIndex', {
|
|
2187
2185
|
value: function value(predicate) {
|
|
2188
2186
|
// 1. Let O be ? ToObject(this value).
|
|
2189
|
-
if (this == null)
|
|
2190
|
-
throw new TypeError('"this" is null or not defined');
|
|
2191
|
-
}
|
|
2187
|
+
if (this == null) throw new TypeError('"this" is null or not defined');
|
|
2192
2188
|
var o = Object(this);
|
|
2193
2189
|
|
|
2194
2190
|
// 2. Let len be ? ToLength(? Get(O, "length")).
|
|
2195
2191
|
var len = o.length >>> 0;
|
|
2196
2192
|
|
|
2197
2193
|
// 3. If IsCallable(predicate) is false, throw a TypeError exception.
|
|
2198
|
-
if (typeof predicate !== 'function')
|
|
2199
|
-
throw new TypeError('predicate must be a function');
|
|
2200
|
-
}
|
|
2194
|
+
if (typeof predicate !== 'function') throw new TypeError('predicate must be a function');
|
|
2201
2195
|
|
|
2202
2196
|
// 4. If thisArg was supplied, let T be thisArg; else let T be undefined.
|
|
2203
2197
|
var thisArg = arguments[1];
|
|
@@ -2212,9 +2206,8 @@ if (!Array.prototype.findIndex) {
|
|
|
2212
2206
|
// c. Let testResult be ToBoolean(? Call(predicate, T, « kValue, k, O »)).
|
|
2213
2207
|
// d. If testResult is true, return k.
|
|
2214
2208
|
var kValue = o[k];
|
|
2215
|
-
if (predicate.call(thisArg, kValue, k, o))
|
|
2216
|
-
|
|
2217
|
-
}
|
|
2209
|
+
if (predicate.call(thisArg, kValue, k, o)) return k;
|
|
2210
|
+
|
|
2218
2211
|
// e. Increase k by 1.
|
|
2219
2212
|
k++;
|
|
2220
2213
|
}
|
|
@@ -2493,8 +2486,8 @@ var hasFlash = function hasFlash() {
|
|
|
2493
2486
|
}
|
|
2494
2487
|
};
|
|
2495
2488
|
var getBrowserInfo = function getBrowserInfo(ua) {
|
|
2496
|
-
var parts = ua.match(/\b(playstation 4|nx|opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || []
|
|
2497
|
-
|
|
2489
|
+
var parts = ua.match(/\b(playstation 4|nx|opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || [];
|
|
2490
|
+
var extra;
|
|
2498
2491
|
if (/trident/i.test(parts[1])) {
|
|
2499
2492
|
extra = /\brv[ :]+(\d+)/g.exec(ua) || [];
|
|
2500
2493
|
return {
|
|
@@ -2544,7 +2537,9 @@ var getBrowserData = function getBrowserData() {
|
|
|
2544
2537
|
if (browser.versionIdentifier) {
|
|
2545
2538
|
var versionRegExp = new RegExp(browser.versionIdentifier.toLowerCase());
|
|
2546
2539
|
var versionRegExpResult = versionRegExp.exec(userAgent);
|
|
2547
|
-
if (versionRegExpResult != null && versionRegExpResult[1])
|
|
2540
|
+
if (versionRegExpResult != null && versionRegExpResult[1]) {
|
|
2541
|
+
setBrowserVersion(versionRegExpResult[1], browserObject);
|
|
2542
|
+
}
|
|
2548
2543
|
} else {
|
|
2549
2544
|
setBrowserVersion(browserRegExpResult[1], browserObject);
|
|
2550
2545
|
}
|
|
@@ -2600,7 +2595,9 @@ var getOsData = function getOsData() {
|
|
|
2600
2595
|
} else if (os.versionIdentifier) {
|
|
2601
2596
|
var versionRegExp = new RegExp(os.versionIdentifier.toLowerCase());
|
|
2602
2597
|
var versionRegExpResult = versionRegExp.exec(userAgent);
|
|
2603
|
-
if (versionRegExpResult != null && versionRegExpResult[1])
|
|
2598
|
+
if (versionRegExpResult != null && versionRegExpResult[1]) {
|
|
2599
|
+
setOsVersion(versionRegExpResult[1], os.versionSeparator ? os.versionSeparator : '.', osObject);
|
|
2600
|
+
}
|
|
2604
2601
|
}
|
|
2605
2602
|
break;
|
|
2606
2603
|
}
|
|
@@ -2615,16 +2612,20 @@ var getOsData = function getOsData() {
|
|
|
2615
2612
|
|
|
2616
2613
|
// Set OS version
|
|
2617
2614
|
var setOsVersion = function setOsVersion(version, separator, osObject) {
|
|
2618
|
-
var finalSeparator = separator.substr(0, 1)
|
|
2615
|
+
var finalSeparator = separator.substr(0, 1) === '[' ? new RegExp(separator, 'g') : separator;
|
|
2619
2616
|
var splitVersion = version.split(finalSeparator, 2);
|
|
2620
|
-
if (separator
|
|
2617
|
+
if (separator !== '.') version = version.replace(new RegExp(separator, 'g'), '.');
|
|
2621
2618
|
osObject.fullVersion = version;
|
|
2622
2619
|
|
|
2623
2620
|
// Major version
|
|
2624
|
-
if (splitVersion && splitVersion[0])
|
|
2621
|
+
if (splitVersion && splitVersion[0]) {
|
|
2622
|
+
osObject.majorVersion = parseInt(splitVersion[0]);
|
|
2623
|
+
}
|
|
2625
2624
|
|
|
2626
2625
|
// Minor version
|
|
2627
|
-
if (splitVersion && splitVersion[1])
|
|
2626
|
+
if (splitVersion && splitVersion[1]) {
|
|
2627
|
+
osObject.minorVersion = parseInt(splitVersion[1]);
|
|
2628
|
+
}
|
|
2628
2629
|
};
|
|
2629
2630
|
|
|
2630
2631
|
// Set viewport size
|
|
@@ -2673,17 +2674,17 @@ Browser.hasLocalstorage = hasLocalstorage();
|
|
|
2673
2674
|
Browser.hasFlash = hasFlash();
|
|
2674
2675
|
|
|
2675
2676
|
/**
|
|
2676
|
-
* @deprecated
|
|
2677
|
-
* This parameter currently exists for retrocompatibility reasons.
|
|
2678
|
-
* Use Browser.data.name instead.
|
|
2679
|
-
*/
|
|
2677
|
+
* @deprecated
|
|
2678
|
+
* This parameter currently exists for retrocompatibility reasons.
|
|
2679
|
+
* Use Browser.data.name instead.
|
|
2680
|
+
*/
|
|
2680
2681
|
Browser.name = browserInfo.name;
|
|
2681
2682
|
|
|
2682
2683
|
/**
|
|
2683
|
-
* @deprecated
|
|
2684
|
-
* This parameter currently exists for retrocompatibility reasons.
|
|
2685
|
-
* Use Browser.data.fullVersion instead.
|
|
2686
|
-
*/
|
|
2684
|
+
* @deprecated
|
|
2685
|
+
* This parameter currently exists for retrocompatibility reasons.
|
|
2686
|
+
* Use Browser.data.fullVersion instead.
|
|
2687
|
+
*/
|
|
2687
2688
|
Browser.version = browserInfo.version;
|
|
2688
2689
|
Browser.userAgent = navigator.userAgent;
|
|
2689
2690
|
Browser.data = getBrowserData();
|
|
@@ -2719,7 +2720,9 @@ function extend$1(parent, properties) {
|
|
|
2719
2720
|
args[_key] = arguments[_key];
|
|
2720
2721
|
}
|
|
2721
2722
|
_this = _callSuper(this, Surrogate, [].concat(args));
|
|
2722
|
-
if (properties.initialize)
|
|
2723
|
+
if (properties.initialize) {
|
|
2724
|
+
properties.initialize.apply(_this, args);
|
|
2725
|
+
}
|
|
2723
2726
|
return _this;
|
|
2724
2727
|
}
|
|
2725
2728
|
_inherits(Surrogate, _parent);
|
|
@@ -2777,7 +2780,17 @@ var Fullscreen$1 = {
|
|
|
2777
2780
|
},
|
|
2778
2781
|
cancelFullscreen: function cancelFullscreen() {
|
|
2779
2782
|
var el = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document;
|
|
2780
|
-
if (el.exitFullscreen)
|
|
2783
|
+
if (el.exitFullscreen) {
|
|
2784
|
+
el.exitFullscreen();
|
|
2785
|
+
} else if (el.webkitCancelFullScreen) {
|
|
2786
|
+
el.webkitCancelFullScreen();
|
|
2787
|
+
} else if (el.webkitExitFullscreen) {
|
|
2788
|
+
el.webkitExitFullscreen();
|
|
2789
|
+
} else if (el.mozCancelFullScreen) {
|
|
2790
|
+
el.mozCancelFullScreen();
|
|
2791
|
+
} else if (el.msExitFullscreen) {
|
|
2792
|
+
el.msExitFullscreen();
|
|
2793
|
+
}
|
|
2781
2794
|
},
|
|
2782
2795
|
fullscreenEnabled: function fullscreenEnabled() {
|
|
2783
2796
|
return !!(document.fullscreenEnabled || document.webkitFullscreenEnabled || document.mozFullScreenEnabled || document.msFullscreenEnabled);
|
|
@@ -2814,7 +2827,9 @@ var Config$1 = /*#__PURE__*/function () {
|
|
|
2814
2827
|
}, {
|
|
2815
2828
|
key: "restore",
|
|
2816
2829
|
value: function restore(key) {
|
|
2817
|
-
if (Browser.hasLocalstorage && localStorage[this._createKeyspace(key)])
|
|
2830
|
+
if (Browser.hasLocalstorage && localStorage[this._createKeyspace(key)]) {
|
|
2831
|
+
return this._defaultConfig()[key].parse(localStorage[this._createKeyspace(key)]);
|
|
2832
|
+
}
|
|
2818
2833
|
return this._defaultValueFor(key);
|
|
2819
2834
|
}
|
|
2820
2835
|
}, {
|
|
@@ -2859,13 +2874,12 @@ var QueryString = /*#__PURE__*/function () {
|
|
|
2859
2874
|
key: "parse",
|
|
2860
2875
|
value: function parse(paramsString) {
|
|
2861
2876
|
var match;
|
|
2862
|
-
var pl = /\+/g
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
params = {};
|
|
2877
|
+
var pl = /\+/g; // Regex for replacing addition symbol with a space
|
|
2878
|
+
var search = /([^&=]+)=?([^&]*)/g;
|
|
2879
|
+
var decode = function decode(s) {
|
|
2880
|
+
return decodeURIComponent(s.replace(pl, ' '));
|
|
2881
|
+
};
|
|
2882
|
+
var params = {};
|
|
2869
2883
|
while (match = search.exec(paramsString)) {
|
|
2870
2884
|
// eslint-disable-line no-cond-assign
|
|
2871
2885
|
params[decode(match[1]).toLowerCase()] = decode(match[2]);
|
|
@@ -2913,14 +2927,18 @@ function getBrowserLanguage() {
|
|
|
2913
2927
|
return window.navigator && window.navigator.language;
|
|
2914
2928
|
}
|
|
2915
2929
|
function now$3() {
|
|
2916
|
-
if (window.performance && window.performance.now)
|
|
2930
|
+
if (window.performance && window.performance.now) {
|
|
2931
|
+
return performance.now();
|
|
2932
|
+
}
|
|
2917
2933
|
return Date.now();
|
|
2918
2934
|
}
|
|
2919
2935
|
|
|
2920
2936
|
// remove the item from the array if it exists in the array
|
|
2921
2937
|
function removeArrayItem$1(arr, item) {
|
|
2922
2938
|
var i = arr.indexOf(item);
|
|
2923
|
-
if (i >= 0)
|
|
2939
|
+
if (i >= 0) {
|
|
2940
|
+
arr.splice(i, 1);
|
|
2941
|
+
}
|
|
2924
2942
|
}
|
|
2925
2943
|
|
|
2926
2944
|
// https://github.com/video-dev/can-autoplay
|
|
@@ -2935,8 +2953,12 @@ function canAutoPlayMedia(cb, options) {
|
|
|
2935
2953
|
}, options);
|
|
2936
2954
|
var element = options.element ? options.element : document.createElement(options.type);
|
|
2937
2955
|
element.muted = options.muted;
|
|
2938
|
-
if (options.muted === true)
|
|
2939
|
-
|
|
2956
|
+
if (options.muted === true) {
|
|
2957
|
+
element.setAttribute('muted', 'muted');
|
|
2958
|
+
}
|
|
2959
|
+
if (options.inline === true) {
|
|
2960
|
+
element.setAttribute('playsinline', 'playsinline');
|
|
2961
|
+
}
|
|
2940
2962
|
element.src = options.source;
|
|
2941
2963
|
var promise = element.play();
|
|
2942
2964
|
var timeoutId = setTimeout(function () {
|
|
@@ -2971,7 +2993,9 @@ var DomRecycler = /*#__PURE__*/function () {
|
|
|
2971
2993
|
}, {
|
|
2972
2994
|
key: "create",
|
|
2973
2995
|
value: function create(name) {
|
|
2974
|
-
if (this.options.recycleVideo && name === 'video' && videoStack.length > 0)
|
|
2996
|
+
if (this.options.recycleVideo && name === 'video' && videoStack.length > 0) {
|
|
2997
|
+
return videoStack.shift();
|
|
2998
|
+
}
|
|
2975
2999
|
return document.createElement(name);
|
|
2976
3000
|
}
|
|
2977
3001
|
}, {
|
|
@@ -3095,7 +3119,9 @@ var Log = /*#__PURE__*/function () {
|
|
|
3095
3119
|
}
|
|
3096
3120
|
var color = COLORS[level];
|
|
3097
3121
|
var klassDescription = '';
|
|
3098
|
-
if (klass)
|
|
3122
|
+
if (klass) {
|
|
3123
|
+
klassDescription = '[' + klass + ']';
|
|
3124
|
+
}
|
|
3099
3125
|
window.console && window.console.log && window.console.log.apply(console, ['%c[' + DESCRIPTIONS[level] + ']' + klassDescription, color].concat(message));
|
|
3100
3126
|
}
|
|
3101
3127
|
}]);
|
|
@@ -3105,7 +3131,9 @@ Log.LEVEL_INFO = LEVEL_INFO;
|
|
|
3105
3131
|
Log.LEVEL_WARN = LEVEL_WARN;
|
|
3106
3132
|
Log.LEVEL_ERROR = LEVEL_ERROR;
|
|
3107
3133
|
Log.getInstance = function () {
|
|
3108
|
-
if (this._instance === undefined)
|
|
3134
|
+
if (this._instance === undefined) {
|
|
3135
|
+
this._instance = new this();
|
|
3136
|
+
}
|
|
3109
3137
|
return this._instance;
|
|
3110
3138
|
};
|
|
3111
3139
|
Log.setLevel = function (level) {
|
|
@@ -3131,25 +3159,29 @@ var eventsApi = function eventsApi(obj, action, name, rest) {
|
|
|
3131
3159
|
|
|
3132
3160
|
// Handle event maps.
|
|
3133
3161
|
if (_typeof(name) === 'object') {
|
|
3134
|
-
for (var key in name)
|
|
3162
|
+
for (var key in name) {
|
|
3163
|
+
obj[action].apply(obj, [key, name[key]].concat(rest));
|
|
3164
|
+
}
|
|
3135
3165
|
return false;
|
|
3136
3166
|
}
|
|
3137
3167
|
|
|
3138
3168
|
// Handle space separated event names.
|
|
3139
3169
|
if (eventSplitter.test(name)) {
|
|
3140
3170
|
var names = name.split(eventSplitter);
|
|
3141
|
-
for (var i = 0, l = names.length; i < l; i++)
|
|
3171
|
+
for (var i = 0, l = names.length; i < l; i++) {
|
|
3172
|
+
obj[action].apply(obj, [names[i]].concat(rest));
|
|
3173
|
+
}
|
|
3142
3174
|
return false;
|
|
3143
3175
|
}
|
|
3144
3176
|
return true;
|
|
3145
3177
|
};
|
|
3146
3178
|
var triggerEvents = function triggerEvents(events, args, klass, name) {
|
|
3147
|
-
var ev
|
|
3148
|
-
|
|
3149
|
-
var l = events.length
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3179
|
+
var ev;
|
|
3180
|
+
var i = -1;
|
|
3181
|
+
var l = events.length;
|
|
3182
|
+
var a1 = args[0];
|
|
3183
|
+
var a2 = args[1];
|
|
3184
|
+
var a3 = args[2];
|
|
3153
3185
|
run();
|
|
3154
3186
|
function run() {
|
|
3155
3187
|
try {
|
|
@@ -3157,32 +3189,37 @@ var triggerEvents = function triggerEvents(events, args, klass, name) {
|
|
|
3157
3189
|
/* eslint-disable curly */
|
|
3158
3190
|
case 0:
|
|
3159
3191
|
while (++i < l) {
|
|
3160
|
-
|
|
3192
|
+
ev = events[i];
|
|
3193
|
+
ev.callback.call(ev.ctx);
|
|
3161
3194
|
}
|
|
3162
3195
|
return;
|
|
3163
3196
|
case 1:
|
|
3164
3197
|
while (++i < l) {
|
|
3165
|
-
|
|
3198
|
+
ev = events[i];
|
|
3199
|
+
ev.callback.call(ev.ctx, a1);
|
|
3166
3200
|
}
|
|
3167
3201
|
return;
|
|
3168
3202
|
case 2:
|
|
3169
3203
|
while (++i < l) {
|
|
3170
|
-
|
|
3204
|
+
ev = events[i];
|
|
3205
|
+
ev.callback.call(ev.ctx, a1, a2);
|
|
3171
3206
|
}
|
|
3172
3207
|
return;
|
|
3173
3208
|
case 3:
|
|
3174
3209
|
while (++i < l) {
|
|
3175
|
-
|
|
3210
|
+
ev = events[i];
|
|
3211
|
+
ev.callback.call(ev.ctx, a1, a2, a3);
|
|
3176
3212
|
}
|
|
3177
3213
|
return;
|
|
3178
3214
|
default:
|
|
3179
3215
|
while (++i < l) {
|
|
3180
|
-
|
|
3216
|
+
ev = events[i];
|
|
3217
|
+
ev.callback.apply(ev.ctx, args);
|
|
3181
3218
|
}
|
|
3182
3219
|
return;
|
|
3183
3220
|
}
|
|
3184
3221
|
} catch (exception) {
|
|
3185
|
-
Log.error.apply(Log, [klass, 'error on event', name, 'trigger', '-', exception]);
|
|
3222
|
+
Log.error.apply(Log, [klass, 'error on event', name, 'trigger', '-', exception]); // eslint-disable-line
|
|
3186
3223
|
run();
|
|
3187
3224
|
}
|
|
3188
3225
|
}
|
|
@@ -3230,12 +3267,11 @@ var Events$1 = /*#__PURE__*/function () {
|
|
|
3230
3267
|
key: "once",
|
|
3231
3268
|
value: function _once(name, callback, context) {
|
|
3232
3269
|
var _this = this;
|
|
3233
|
-
var _once;
|
|
3234
3270
|
if (!eventsApi(this, 'once', name, [callback, context]) || !callback) return this;
|
|
3235
3271
|
var off = function off() {
|
|
3236
3272
|
return _this.off(name, _once);
|
|
3237
3273
|
};
|
|
3238
|
-
_once = function once() {
|
|
3274
|
+
var _once = function once() {
|
|
3239
3275
|
off();
|
|
3240
3276
|
callback.apply(this, arguments);
|
|
3241
3277
|
};
|
|
@@ -3253,13 +3289,13 @@ var Events$1 = /*#__PURE__*/function () {
|
|
|
3253
3289
|
}, {
|
|
3254
3290
|
key: "off",
|
|
3255
3291
|
value: function off(name, callback, context) {
|
|
3256
|
-
var retain, ev, events,
|
|
3292
|
+
var retain, ev, events, i, l, j, k;
|
|
3257
3293
|
if (!this._events || !eventsApi(this, 'off', name, [callback, context])) return this;
|
|
3258
3294
|
if (!name && !callback && !context) {
|
|
3259
3295
|
this._events = void 0;
|
|
3260
3296
|
return this;
|
|
3261
3297
|
}
|
|
3262
|
-
names = name ? [name] : Object.keys(this._events);
|
|
3298
|
+
var names = name ? [name] : Object.keys(this._events);
|
|
3263
3299
|
// jshint maxdepth:5
|
|
3264
3300
|
for (i = 0, l = names.length; i < l; i++) {
|
|
3265
3301
|
name = names[i];
|
|
@@ -3695,7 +3731,7 @@ Events$1.PLAYBACK_FRAGMENT_LOADED = 'playback:fragment:loaded';
|
|
|
3695
3731
|
*
|
|
3696
3732
|
* @event PLAYBACK_FRAGMENT_BUFFERED
|
|
3697
3733
|
* @param {Object} data Data
|
|
3698
|
-
*
|
|
3734
|
+
*
|
|
3699
3735
|
*/
|
|
3700
3736
|
Events$1.PLAYBACK_FRAGMENT_BUFFERED = 'playback:fragment:buffered';
|
|
3701
3737
|
// TODO doc
|
|
@@ -3753,11 +3789,11 @@ Events$1.CORE_CONTAINERS_CREATED = 'core:containers:created';
|
|
|
3753
3789
|
Events$1.CORE_ACTIVE_CONTAINER_CHANGED = 'core:active:container:changed';
|
|
3754
3790
|
|
|
3755
3791
|
/**
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
|
|
3792
|
+
* Fired before options are changed in core
|
|
3793
|
+
*
|
|
3794
|
+
* @event CORE_OPTIONS_WILL_CHANGE
|
|
3795
|
+
* @param {Object} current options before change
|
|
3796
|
+
*/
|
|
3761
3797
|
Events$1.CORE_OPTIONS_WILL_CHANGE = 'core:options:will:change';
|
|
3762
3798
|
|
|
3763
3799
|
/**
|
|
@@ -3899,10 +3935,10 @@ Events$1.CONTAINER_SUBTITLE_CHANGED = 'container:subtitle:changed';
|
|
|
3899
3935
|
Events$1.CONTAINER_AUDIO_AVAILABLE = 'container:audio:available';
|
|
3900
3936
|
|
|
3901
3937
|
/**
|
|
3902
|
-
|
|
3903
|
-
|
|
3904
|
-
|
|
3905
|
-
|
|
3938
|
+
* Fired whenever the current audio track has changed
|
|
3939
|
+
* @event CONTAINER_AUDIO_CHANGED
|
|
3940
|
+
* @param {import('../playback/playback').AudioTrack} track - audio track active after change
|
|
3941
|
+
*/
|
|
3906
3942
|
Events$1.CONTAINER_AUDIO_CHANGED = 'container:audio:changed';
|
|
3907
3943
|
|
|
3908
3944
|
/**
|
|
@@ -4422,10 +4458,14 @@ var UIObject = /*#__PURE__*/function (_BaseObject) {
|
|
|
4422
4458
|
if (method && method.constructor !== Function) method = this[events[key]];
|
|
4423
4459
|
if (!method) continue;
|
|
4424
4460
|
var match = key.match(delegateEventSplitter);
|
|
4425
|
-
var eventName = match[1]
|
|
4426
|
-
|
|
4461
|
+
var eventName = match[1];
|
|
4462
|
+
var selector = match[2];
|
|
4427
4463
|
eventName += '.delegateEvents' + this.cid;
|
|
4428
|
-
if (selector === '')
|
|
4464
|
+
if (selector === '') {
|
|
4465
|
+
this.$el.on(eventName, method.bind(this));
|
|
4466
|
+
} else {
|
|
4467
|
+
this.$el.on(eventName, selector, method.bind(this));
|
|
4468
|
+
}
|
|
4429
4469
|
}
|
|
4430
4470
|
return this;
|
|
4431
4471
|
}
|
|
@@ -4453,7 +4493,7 @@ var UIObject = /*#__PURE__*/function (_BaseObject) {
|
|
|
4453
4493
|
if (!this.el) {
|
|
4454
4494
|
var attrs = $.extend(true, {}, this.attributes);
|
|
4455
4495
|
if (this.id) attrs.id = this.id;
|
|
4456
|
-
if (this.className) attrs[
|
|
4496
|
+
if (this.className) attrs["class"] = this.className;
|
|
4457
4497
|
var $el = $(DomRecycler.create(this.tagName)).attr(attrs);
|
|
4458
4498
|
this.setElement($el, false);
|
|
4459
4499
|
} else {
|
|
@@ -4571,7 +4611,7 @@ var ErrorMixin = {
|
|
|
4571
4611
|
var errorData = Object.assign({}, defaultError, error, {
|
|
4572
4612
|
code: options.useCodePrefix ? prefixedCode : error.code
|
|
4573
4613
|
});
|
|
4574
|
-
if (i18n && errorData.level
|
|
4614
|
+
if (i18n && errorData.level === PlayerError.Levels.FATAL && !errorData.UI) {
|
|
4575
4615
|
var defaultUI = {
|
|
4576
4616
|
title: i18n.t('default_error_title'),
|
|
4577
4617
|
message: i18n.t('default_error_message')
|
|
@@ -4997,7 +5037,9 @@ var Container = /*#__PURE__*/function (_UIObject) {
|
|
|
4997
5037
|
}, {
|
|
4998
5038
|
key: "error",
|
|
4999
5039
|
value: function error(_error) {
|
|
5000
|
-
if (!this.isReady)
|
|
5040
|
+
if (!this.isReady) {
|
|
5041
|
+
this.ready();
|
|
5042
|
+
}
|
|
5001
5043
|
this.trigger(Events$1.CONTAINER_ERROR, _error, this.name);
|
|
5002
5044
|
}
|
|
5003
5045
|
}, {
|
|
@@ -5128,7 +5170,9 @@ var Container = /*#__PURE__*/function (_UIObject) {
|
|
|
5128
5170
|
}, {
|
|
5129
5171
|
key: "onContextMenu",
|
|
5130
5172
|
value: function onContextMenu(event) {
|
|
5131
|
-
if (!this.options.chromeless || this.options.allowUserInteraction)
|
|
5173
|
+
if (!this.options.chromeless || this.options.allowUserInteraction) {
|
|
5174
|
+
this.trigger(Events$1.CONTAINER_CONTEXTMENU, event, this.name);
|
|
5175
|
+
}
|
|
5132
5176
|
}
|
|
5133
5177
|
}, {
|
|
5134
5178
|
key: "seek",
|
|
@@ -5225,22 +5269,30 @@ var Container = /*#__PURE__*/function (_UIObject) {
|
|
|
5225
5269
|
}, {
|
|
5226
5270
|
key: "mouseEnter",
|
|
5227
5271
|
value: function mouseEnter() {
|
|
5228
|
-
if (!this.options.chromeless || this.options.allowUserInteraction)
|
|
5272
|
+
if (!this.options.chromeless || this.options.allowUserInteraction) {
|
|
5273
|
+
this.trigger(Events$1.CONTAINER_MOUSE_ENTER);
|
|
5274
|
+
}
|
|
5229
5275
|
}
|
|
5230
5276
|
}, {
|
|
5231
5277
|
key: "mouseLeave",
|
|
5232
5278
|
value: function mouseLeave() {
|
|
5233
|
-
if (!this.options.chromeless || this.options.allowUserInteraction)
|
|
5279
|
+
if (!this.options.chromeless || this.options.allowUserInteraction) {
|
|
5280
|
+
this.trigger(Events$1.CONTAINER_MOUSE_LEAVE);
|
|
5281
|
+
}
|
|
5234
5282
|
}
|
|
5235
5283
|
}, {
|
|
5236
5284
|
key: "mouseUp",
|
|
5237
5285
|
value: function mouseUp() {
|
|
5238
|
-
if (!this.options.chromeless || this.options.allowUserInteraction)
|
|
5286
|
+
if (!this.options.chromeless || this.options.allowUserInteraction) {
|
|
5287
|
+
this.trigger(Events$1.CONTAINER_MOUSE_UP);
|
|
5288
|
+
}
|
|
5239
5289
|
}
|
|
5240
5290
|
}, {
|
|
5241
5291
|
key: "mouseDown",
|
|
5242
5292
|
value: function mouseDown() {
|
|
5243
|
-
if (!this.options.chromeless || this.options.allowUserInteraction)
|
|
5293
|
+
if (!this.options.chromeless || this.options.allowUserInteraction) {
|
|
5294
|
+
this.trigger(Events$1.CONTAINER_MOUSE_DOWN);
|
|
5295
|
+
}
|
|
5244
5296
|
}
|
|
5245
5297
|
}, {
|
|
5246
5298
|
key: "enterPiP",
|
|
@@ -5287,7 +5339,11 @@ var Container = /*#__PURE__*/function (_UIObject) {
|
|
|
5287
5339
|
}, {
|
|
5288
5340
|
key: "updateStyle",
|
|
5289
5341
|
value: function updateStyle() {
|
|
5290
|
-
if (!this.options.chromeless || this.options.allowUserInteraction)
|
|
5342
|
+
if (!this.options.chromeless || this.options.allowUserInteraction) {
|
|
5343
|
+
this.$el.removeClass('chromeless');
|
|
5344
|
+
} else {
|
|
5345
|
+
this.$el.addClass('chromeless');
|
|
5346
|
+
}
|
|
5291
5347
|
}
|
|
5292
5348
|
}, {
|
|
5293
5349
|
key: "enableResizeObserver",
|
|
@@ -5578,6 +5634,17 @@ var Playback = /*#__PURE__*/function (_UIObject) {
|
|
|
5578
5634
|
return 0;
|
|
5579
5635
|
}
|
|
5580
5636
|
|
|
5637
|
+
/**
|
|
5638
|
+
* gets the frame rate of the current source
|
|
5639
|
+
* @method getFrameRate
|
|
5640
|
+
* @return {Number|null} frame rate (fps) of the current source, or null if unavailable
|
|
5641
|
+
*/
|
|
5642
|
+
}, {
|
|
5643
|
+
key: "getFrameRate",
|
|
5644
|
+
value: function getFrameRate() {
|
|
5645
|
+
return null;
|
|
5646
|
+
}
|
|
5647
|
+
|
|
5581
5648
|
/**
|
|
5582
5649
|
* checks if the playback is playing.
|
|
5583
5650
|
* @method isPlaying
|
|
@@ -5888,7 +5955,8 @@ var ContainerFactory = /*#__PURE__*/function (_BaseObject) {
|
|
|
5888
5955
|
var playbackPlugin = this.findPlaybackPlugin(resolvedSource, mimeType);
|
|
5889
5956
|
|
|
5890
5957
|
// Fallback to empty playback object until we sort out unsupported sources error without NoOp playback
|
|
5891
|
-
var playback = playbackPlugin ? new playbackPlugin(options, this._i18n, this.playerError)
|
|
5958
|
+
var playback = playbackPlugin ? new playbackPlugin(options, this._i18n, this.playerError) // eslint-disable-line
|
|
5959
|
+
: new Playback();
|
|
5892
5960
|
options = _objectSpread2$1(_objectSpread2$1({}, options), {}, {
|
|
5893
5961
|
playback: playback
|
|
5894
5962
|
});
|
|
@@ -5933,7 +6001,7 @@ var Core = /*#__PURE__*/function (_UIObject) {
|
|
|
5933
6001
|
_this.styleRendered = false;
|
|
5934
6002
|
_this.plugins = [];
|
|
5935
6003
|
_this.containers = [];
|
|
5936
|
-
//FIXME fullscreen api sucks
|
|
6004
|
+
// FIXME fullscreen api sucks
|
|
5937
6005
|
_this._boundFullscreenHandler = function () {
|
|
5938
6006
|
return _this.handleFullscreenChange();
|
|
5939
6007
|
};
|
|
@@ -6479,7 +6547,9 @@ var CoreFactory = /*#__PURE__*/function (_BaseObject) {
|
|
|
6479
6547
|
key: "setupExternalInterface",
|
|
6480
6548
|
value: function setupExternalInterface(plugin) {
|
|
6481
6549
|
var externalFunctions = plugin.getExternalInterface();
|
|
6482
|
-
for (var key in externalFunctions)
|
|
6550
|
+
for (var key in externalFunctions) {
|
|
6551
|
+
this.player[key] = externalFunctions[key].bind(plugin);
|
|
6552
|
+
}
|
|
6483
6553
|
}
|
|
6484
6554
|
}]);
|
|
6485
6555
|
}(BaseObject);
|
|
@@ -6542,7 +6612,8 @@ var filterPluginsByType = function filterPluginsByType(plugins, type) {
|
|
|
6542
6612
|
var _ref4 = _slicedToArray(_ref3, 2),
|
|
6543
6613
|
key = _ref4[0],
|
|
6544
6614
|
value = _ref4[1];
|
|
6545
|
-
|
|
6615
|
+
obj[key] = value;
|
|
6616
|
+
return obj;
|
|
6546
6617
|
}, {});
|
|
6547
6618
|
};
|
|
6548
6619
|
|
|
@@ -6558,7 +6629,7 @@ var Loader = (function () {
|
|
|
6558
6629
|
plugins: {},
|
|
6559
6630
|
playbacks: []
|
|
6560
6631
|
};
|
|
6561
|
-
var currentVersion = "0.
|
|
6632
|
+
var currentVersion = "0.13.0";
|
|
6562
6633
|
return /*#__PURE__*/function () {
|
|
6563
6634
|
/**
|
|
6564
6635
|
* builds the loader
|
|
@@ -6584,7 +6655,6 @@ var Loader = (function () {
|
|
|
6584
6655
|
/**
|
|
6585
6656
|
* groups by type the external plugins that were passed through `options.plugins` it they're on a flat array
|
|
6586
6657
|
* @method addExternalPlugins
|
|
6587
|
-
* @private
|
|
6588
6658
|
* @param {Object} an config object or an array of plugins
|
|
6589
6659
|
* @return {Object} plugins the config object with the plugins separated by type
|
|
6590
6660
|
*/
|
|
@@ -6619,7 +6689,6 @@ var Loader = (function () {
|
|
|
6619
6689
|
/**
|
|
6620
6690
|
* adds all the external plugins that were passed through `options.plugins`
|
|
6621
6691
|
* @method addExternalPlugins
|
|
6622
|
-
* @private
|
|
6623
6692
|
* @param {Object} plugins the config object with all plugins
|
|
6624
6693
|
*/
|
|
6625
6694
|
}, {
|
|
@@ -6630,19 +6699,22 @@ var Loader = (function () {
|
|
|
6630
6699
|
plugins = this.groupPluginsByType(plugins);
|
|
6631
6700
|
if (plugins.playback) {
|
|
6632
6701
|
var playbacks = plugins.playback.filter(function (playback) {
|
|
6633
|
-
|
|
6702
|
+
Loader.checkVersionSupport(playback);
|
|
6703
|
+
return true;
|
|
6634
6704
|
});
|
|
6635
6705
|
this.playbackPlugins = loadExternalPlaybacksFirst ? this.removeDups(playbacks.concat(this.playbackPlugins)) : this.removeDups(this.playbackPlugins.concat(playbacks), true);
|
|
6636
6706
|
}
|
|
6637
6707
|
if (plugins.container) {
|
|
6638
6708
|
var containerPlugins = plugins.container.filter(function (plugin) {
|
|
6639
|
-
|
|
6709
|
+
Loader.checkVersionSupport(plugin);
|
|
6710
|
+
return true;
|
|
6640
6711
|
});
|
|
6641
6712
|
this.containerPlugins = loadExternalPluginsFirst ? this.removeDups(containerPlugins.concat(this.containerPlugins)) : this.removeDups(this.containerPlugins.concat(containerPlugins), true);
|
|
6642
6713
|
}
|
|
6643
6714
|
if (plugins.core) {
|
|
6644
6715
|
var corePlugins = plugins.core.filter(function (plugin) {
|
|
6645
|
-
|
|
6716
|
+
Loader.checkVersionSupport(plugin);
|
|
6717
|
+
return true;
|
|
6646
6718
|
});
|
|
6647
6719
|
this.corePlugins = loadExternalPluginsFirst ? this.removeDups(corePlugins.concat(this.corePlugins)) : this.removeDups(this.corePlugins.concat(corePlugins), true);
|
|
6648
6720
|
}
|
|
@@ -6651,7 +6723,6 @@ var Loader = (function () {
|
|
|
6651
6723
|
/**
|
|
6652
6724
|
* validate if the external plugins that were passed through `options.plugins` are associated to the correct type
|
|
6653
6725
|
* @method validateExternalPluginsType
|
|
6654
|
-
* @private
|
|
6655
6726
|
* @param {Object} plugins the config object with all plugins
|
|
6656
6727
|
*/
|
|
6657
6728
|
}, {
|
|
@@ -6659,7 +6730,8 @@ var Loader = (function () {
|
|
|
6659
6730
|
value: function validateExternalPluginsType(plugins) {
|
|
6660
6731
|
var pluginTypes = ['playback', 'container', 'core'];
|
|
6661
6732
|
pluginTypes.forEach(function (type) {
|
|
6662
|
-
|
|
6733
|
+
var pluginsByType = plugins[type] || [];
|
|
6734
|
+
pluginsByType.forEach(function (el) {
|
|
6663
6735
|
var errorMessage = 'external ' + el.type + ' plugin on ' + type + ' array';
|
|
6664
6736
|
if (el.type !== type) throw new ReferenceError(errorMessage);
|
|
6665
6737
|
});
|
|
@@ -6710,7 +6782,9 @@ var Loader = (function () {
|
|
|
6710
6782
|
var pluginRegistry = registry.plugins;
|
|
6711
6783
|
if (!pluginRegistry) return false;
|
|
6712
6784
|
var previousEntry = pluginRegistry[pluginEntry.prototype.name];
|
|
6713
|
-
if (previousEntry)
|
|
6785
|
+
if (previousEntry) {
|
|
6786
|
+
Log.warn('Loader', "overriding plugin entry: ".concat(pluginEntry.prototype.name, " - ").concat(previousEntry));
|
|
6787
|
+
}
|
|
6714
6788
|
pluginRegistry[pluginEntry.prototype.name] = pluginEntry;
|
|
6715
6789
|
return true;
|
|
6716
6790
|
}
|
|
@@ -6967,7 +7041,9 @@ var Player$1 = /*#__PURE__*/function (_BaseObject) {
|
|
|
6967
7041
|
return _createClass(Player, [{
|
|
6968
7042
|
key: "loader",
|
|
6969
7043
|
get: function get() {
|
|
6970
|
-
if (!this._loader)
|
|
7044
|
+
if (!this._loader) {
|
|
7045
|
+
this._loader = new Loader(this.options.plugins || {}, this.options.playerId);
|
|
7046
|
+
}
|
|
6971
7047
|
return this._loader;
|
|
6972
7048
|
}
|
|
6973
7049
|
|
|
@@ -7057,7 +7133,11 @@ var Player$1 = /*#__PURE__*/function (_BaseObject) {
|
|
|
7057
7133
|
}, {
|
|
7058
7134
|
key: "_addEventListeners",
|
|
7059
7135
|
value: function _addEventListeners() {
|
|
7060
|
-
if (!this.core.isReady)
|
|
7136
|
+
if (!this.core.isReady) {
|
|
7137
|
+
this.listenToOnce(this.core, Events$1.CORE_READY, this._onReady);
|
|
7138
|
+
} else {
|
|
7139
|
+
this._onReady();
|
|
7140
|
+
}
|
|
7061
7141
|
this.listenTo(this.core, Events$1.CORE_ACTIVE_CONTAINER_CHANGED, this._containerChanged);
|
|
7062
7142
|
this.listenTo(this.core, Events$1.CORE_FULLSCREEN, this._onFullscreenChange);
|
|
7063
7143
|
this.listenTo(this.core, Events$1.CORE_RESIZE, this._onResize);
|
|
@@ -7211,9 +7291,11 @@ var Player$1 = /*#__PURE__*/function (_BaseObject) {
|
|
|
7211
7291
|
}, {
|
|
7212
7292
|
key: "load",
|
|
7213
7293
|
value: function load(sources, mimeType, autoPlay) {
|
|
7214
|
-
if (autoPlay !== undefined)
|
|
7215
|
-
|
|
7216
|
-
|
|
7294
|
+
if (autoPlay !== undefined) {
|
|
7295
|
+
this.configure({
|
|
7296
|
+
autoPlay: !!autoPlay
|
|
7297
|
+
});
|
|
7298
|
+
}
|
|
7217
7299
|
this.core.load(sources, mimeType);
|
|
7218
7300
|
return this;
|
|
7219
7301
|
}
|
|
@@ -7607,22 +7689,22 @@ var tracksHTML = "<% for (var i = 0; i < tracks.length; i++) { %>\n <track data
|
|
|
7607
7689
|
var css_248z$2 = "[data-html5-video] {\n position: absolute;\n height: 100%;\n width: 100%;\n display: block; }\n";
|
|
7608
7690
|
|
|
7609
7691
|
var MIMETYPES = {
|
|
7610
|
-
|
|
7692
|
+
mp4: ['avc1.42E01E', 'avc1.58A01E', 'avc1.4D401E', 'avc1.64001E', 'mp4v.20.8', 'mp4v.20.240', 'mp4a.40.2'].map(function (codec) {
|
|
7611
7693
|
return 'video/mp4; codecs="' + codec + ', mp4a.40.2"';
|
|
7612
7694
|
}),
|
|
7613
|
-
|
|
7695
|
+
ogg: ['video/ogg; codecs="theora, vorbis"', 'video/ogg; codecs="dirac"', 'video/ogg; codecs="theora, speex"'],
|
|
7614
7696
|
'3gpp': ['video/3gpp; codecs="mp4v.20.8, samr"'],
|
|
7615
|
-
|
|
7616
|
-
|
|
7617
|
-
|
|
7697
|
+
webm: ['video/webm; codecs="vp8, vorbis"'],
|
|
7698
|
+
mkv: ['video/x-matroska; codecs="theora, vorbis"'],
|
|
7699
|
+
m3u8: ['application/x-mpegurl']
|
|
7618
7700
|
};
|
|
7619
|
-
MIMETYPES
|
|
7701
|
+
MIMETYPES.ogv = MIMETYPES.ogg;
|
|
7620
7702
|
MIMETYPES['3gp'] = MIMETYPES['3gpp'];
|
|
7621
7703
|
var AUDIO_MIMETYPES = {
|
|
7622
|
-
|
|
7623
|
-
|
|
7624
|
-
|
|
7625
|
-
|
|
7704
|
+
wav: ['audio/wav'],
|
|
7705
|
+
mp3: ['audio/mp3', 'audio/mpeg;codecs="mp3"'],
|
|
7706
|
+
aac: ['audio/mp4;codecs="mp4a.40.5"'],
|
|
7707
|
+
oga: ['audio/ogg']
|
|
7626
7708
|
};
|
|
7627
7709
|
var KNOWN_AUDIO_MIMETYPES = Object.keys(AUDIO_MIMETYPES).reduce(function (acc, k) {
|
|
7628
7710
|
return [].concat(_toConsumableArray(acc), _toConsumableArray(AUDIO_MIMETYPES[k]));
|
|
@@ -7659,7 +7741,11 @@ var HTML5Video$1 = /*#__PURE__*/function (_Playback) {
|
|
|
7659
7741
|
var preload = playbackConfig.preload || (Browser.isSafari ? 'auto' : _this.options.preload);
|
|
7660
7742
|
var posterUrl; // FIXME: poster plugin should always convert poster to object with expected properties ?
|
|
7661
7743
|
if (_this.options.poster) {
|
|
7662
|
-
if (typeof _this.options.poster === 'string')
|
|
7744
|
+
if (typeof _this.options.poster === 'string') {
|
|
7745
|
+
posterUrl = _this.options.poster;
|
|
7746
|
+
} else if (typeof _this.options.poster.url === 'string') {
|
|
7747
|
+
posterUrl = _this.options.poster.url;
|
|
7748
|
+
}
|
|
7663
7749
|
}
|
|
7664
7750
|
$.extend(true, _this.el, {
|
|
7665
7751
|
muted: _this.options.mute,
|
|
@@ -7670,7 +7756,9 @@ var HTML5Video$1 = /*#__PURE__*/function (_Playback) {
|
|
|
7670
7756
|
crossOrigin: playbackConfig.crossOrigin,
|
|
7671
7757
|
'x-webkit-playsinline': playbackConfig.playInline
|
|
7672
7758
|
});
|
|
7673
|
-
if (playbackConfig.controls || _this.options.useVideoTagDefaultControls)
|
|
7759
|
+
if (playbackConfig.controls || _this.options.useVideoTagDefaultControls) {
|
|
7760
|
+
_this.$el.attr('controls', '');
|
|
7761
|
+
}
|
|
7674
7762
|
playbackConfig.playInline && _this.$el.attr({
|
|
7675
7763
|
playsinline: 'playsinline'
|
|
7676
7764
|
});
|
|
@@ -7698,7 +7786,7 @@ var HTML5Video$1 = /*#__PURE__*/function (_Playback) {
|
|
|
7698
7786
|
key: "supportedVersion",
|
|
7699
7787
|
get: function get() {
|
|
7700
7788
|
return {
|
|
7701
|
-
min: "0.
|
|
7789
|
+
min: "0.13.0"
|
|
7702
7790
|
};
|
|
7703
7791
|
}
|
|
7704
7792
|
}, {
|
|
@@ -7724,23 +7812,23 @@ var HTML5Video$1 = /*#__PURE__*/function (_Playback) {
|
|
|
7724
7812
|
key: "events",
|
|
7725
7813
|
get: function get() {
|
|
7726
7814
|
return {
|
|
7727
|
-
|
|
7728
|
-
|
|
7729
|
-
|
|
7730
|
-
|
|
7731
|
-
|
|
7732
|
-
|
|
7733
|
-
|
|
7734
|
-
|
|
7735
|
-
|
|
7736
|
-
|
|
7737
|
-
|
|
7738
|
-
|
|
7739
|
-
|
|
7740
|
-
|
|
7741
|
-
|
|
7742
|
-
|
|
7743
|
-
|
|
7815
|
+
canplay: '_onCanPlay',
|
|
7816
|
+
canplaythrough: '_handleBufferingEvents',
|
|
7817
|
+
durationchange: '_onDurationChange',
|
|
7818
|
+
ended: '_onEnded',
|
|
7819
|
+
error: '_onError',
|
|
7820
|
+
loadeddata: '_onLoadedData',
|
|
7821
|
+
loadedmetadata: '_onLoadedMetadata',
|
|
7822
|
+
pause: '_onPause',
|
|
7823
|
+
playing: '_onPlaying',
|
|
7824
|
+
progress: '_onProgress',
|
|
7825
|
+
seeking: '_onSeeking',
|
|
7826
|
+
seeked: '_onSeeked',
|
|
7827
|
+
stalled: '_handleBufferingEvents',
|
|
7828
|
+
timeupdate: '_onTimeUpdate',
|
|
7829
|
+
waiting: '_onWaiting',
|
|
7830
|
+
enterpictureinpicture: '_onEnterPiP',
|
|
7831
|
+
leavepictureinpicture: '_onExitPiP'
|
|
7744
7832
|
};
|
|
7745
7833
|
}
|
|
7746
7834
|
|
|
@@ -7837,7 +7925,9 @@ var HTML5Video$1 = /*#__PURE__*/function (_Playback) {
|
|
|
7837
7925
|
};
|
|
7838
7926
|
|
|
7839
7927
|
// Use current video element if recycling feature enabled with mobile devices
|
|
7840
|
-
if (Browser.isMobile && DomRecycler.options.recycleVideo)
|
|
7928
|
+
if (Browser.isMobile && DomRecycler.options.recycleVideo) {
|
|
7929
|
+
opts.element = this.el;
|
|
7930
|
+
}
|
|
7841
7931
|
|
|
7842
7932
|
// Desktop browser autoplay policy may require user action
|
|
7843
7933
|
// Mobile browser autoplay require user consent and video recycling feature enabled
|
|
@@ -7879,7 +7969,9 @@ var HTML5Video$1 = /*#__PURE__*/function (_Playback) {
|
|
|
7879
7969
|
}, {
|
|
7880
7970
|
key: "_setupSrc",
|
|
7881
7971
|
value: function _setupSrc(srcUrl) {
|
|
7882
|
-
if (this.el.src === srcUrl)
|
|
7972
|
+
if (this.el.src === srcUrl) {
|
|
7973
|
+
return;
|
|
7974
|
+
}
|
|
7883
7975
|
this._ccIsSetup = false;
|
|
7884
7976
|
this.el.src = srcUrl;
|
|
7885
7977
|
this._src = this.el.src;
|
|
@@ -7894,7 +7986,9 @@ var HTML5Video$1 = /*#__PURE__*/function (_Playback) {
|
|
|
7894
7986
|
});
|
|
7895
7987
|
this._updateSettings();
|
|
7896
7988
|
var autoSeekFromUrl = typeof this._options.autoSeekFromUrl === 'undefined' || this._options.autoSeekFromUrl;
|
|
7897
|
-
if (this.getPlaybackType() !== Playback.LIVE && autoSeekFromUrl)
|
|
7989
|
+
if (this.getPlaybackType() !== Playback.LIVE && autoSeekFromUrl) {
|
|
7990
|
+
this._checkInitialSeek();
|
|
7991
|
+
}
|
|
7898
7992
|
}
|
|
7899
7993
|
}, {
|
|
7900
7994
|
key: "_onDurationChange",
|
|
@@ -7909,7 +8003,11 @@ var HTML5Video$1 = /*#__PURE__*/function (_Playback) {
|
|
|
7909
8003
|
value: function _updateSettings() {
|
|
7910
8004
|
// we can't figure out if hls resource is VoD or not until it is being loaded or duration has changed.
|
|
7911
8005
|
// that's why we check it again and update media control accordingly.
|
|
7912
|
-
if (this.getPlaybackType() === Playback.VOD || this.getPlaybackType() === Playback.AOD)
|
|
8006
|
+
if (this.getPlaybackType() === Playback.VOD || this.getPlaybackType() === Playback.AOD) {
|
|
8007
|
+
this.settings.left = ['playpause', 'position', 'duration'];
|
|
8008
|
+
} else {
|
|
8009
|
+
this.settings.left = ['playstop'];
|
|
8010
|
+
}
|
|
7913
8011
|
this.settings.seekEnabled = this.isSeekEnabled();
|
|
7914
8012
|
this.trigger(Events$1.PLAYBACK_SETTINGSUPDATE);
|
|
7915
8013
|
}
|
|
@@ -7960,9 +8058,11 @@ var HTML5Video$1 = /*#__PURE__*/function (_Playback) {
|
|
|
7960
8058
|
this._handleBufferingEvents();
|
|
7961
8059
|
var promise = this.el.play();
|
|
7962
8060
|
// For more details, see https://developers.google.com/web/updates/2016/03/play-returns-promise
|
|
7963
|
-
if (promise && promise["catch"])
|
|
7964
|
-
|
|
7965
|
-
|
|
8061
|
+
if (promise && promise["catch"]) {
|
|
8062
|
+
promise["catch"](function (error) {
|
|
8063
|
+
return Log.warn(_this4.name, 'HTML5 play failed', error);
|
|
8064
|
+
});
|
|
8065
|
+
}
|
|
7966
8066
|
return promise;
|
|
7967
8067
|
}
|
|
7968
8068
|
}, {
|
|
@@ -8036,7 +8136,9 @@ var HTML5Video$1 = /*#__PURE__*/function (_Playback) {
|
|
|
8036
8136
|
}, {
|
|
8037
8137
|
key: "_startPlayheadMovingChecks",
|
|
8038
8138
|
value: function _startPlayheadMovingChecks() {
|
|
8039
|
-
if (this._playheadMovingTimer !== null || !this._playheadMovingCheckEnabled)
|
|
8139
|
+
if (this._playheadMovingTimer !== null || !this._playheadMovingCheckEnabled) {
|
|
8140
|
+
return;
|
|
8141
|
+
}
|
|
8040
8142
|
this._playheadMovingTimeOnCheck = null;
|
|
8041
8143
|
this._determineIfPlayheadMoving();
|
|
8042
8144
|
this._playheadMovingTimer = setInterval(this._determineIfPlayheadMoving.bind(this), this._playheadMovingCheckInterval);
|
|
@@ -8044,7 +8146,9 @@ var HTML5Video$1 = /*#__PURE__*/function (_Playback) {
|
|
|
8044
8146
|
}, {
|
|
8045
8147
|
key: "_stopPlayheadMovingChecks",
|
|
8046
8148
|
value: function _stopPlayheadMovingChecks() {
|
|
8047
|
-
if (this._playheadMovingTimer === null)
|
|
8149
|
+
if (this._playheadMovingTimer === null) {
|
|
8150
|
+
return;
|
|
8151
|
+
}
|
|
8048
8152
|
clearInterval(this._playheadMovingTimer);
|
|
8049
8153
|
this._playheadMovingTimer = null;
|
|
8050
8154
|
this._playheadMoving = false;
|
|
@@ -8174,10 +8278,16 @@ var HTML5Video$1 = /*#__PURE__*/function (_Playback) {
|
|
|
8174
8278
|
var isMissingMediaDataToPlay = this.el.readyState < this.el.HAVE_FUTURE_DATA;
|
|
8175
8279
|
var playheadShouldBeMoving = !this.el.ended && !this.el.paused && !this._playheadMoving;
|
|
8176
8280
|
var buffering = isLoading && isMissingMediaDataToPlay;
|
|
8177
|
-
if (this._playheadMovingCheckEnabled)
|
|
8281
|
+
if (this._playheadMovingCheckEnabled) {
|
|
8282
|
+
buffering = buffering || isLoading && playheadShouldBeMoving;
|
|
8283
|
+
}
|
|
8178
8284
|
if (this._isBuffering !== buffering) {
|
|
8179
8285
|
this._isBuffering = buffering;
|
|
8180
|
-
if (buffering)
|
|
8286
|
+
if (buffering) {
|
|
8287
|
+
this.trigger(Events$1.PLAYBACK_BUFFERING, this.name);
|
|
8288
|
+
} else {
|
|
8289
|
+
this.trigger(Events$1.PLAYBACK_BUFFERFULL, this.name);
|
|
8290
|
+
}
|
|
8181
8291
|
}
|
|
8182
8292
|
}
|
|
8183
8293
|
}, {
|
|
@@ -8193,7 +8303,11 @@ var HTML5Video$1 = /*#__PURE__*/function (_Playback) {
|
|
|
8193
8303
|
raw: this.el.error,
|
|
8194
8304
|
level: isUnknownError ? PlayerError.Levels.WARN : PlayerError.Levels.FATAL
|
|
8195
8305
|
});
|
|
8196
|
-
if (isUnknownError)
|
|
8306
|
+
if (isUnknownError) {
|
|
8307
|
+
Log.warn(this.name, 'HTML5 unknown error: ', formattedError);
|
|
8308
|
+
} else {
|
|
8309
|
+
this.trigger(Events$1.PLAYBACK_ERROR, formattedError);
|
|
8310
|
+
}
|
|
8197
8311
|
}
|
|
8198
8312
|
}, {
|
|
8199
8313
|
key: "destroy",
|
|
@@ -8213,7 +8327,7 @@ var HTML5Video$1 = /*#__PURE__*/function (_Playback) {
|
|
|
8213
8327
|
value: function _updateDvr(status) {
|
|
8214
8328
|
this.trigger(Events$1.PLAYBACK_DVR, status);
|
|
8215
8329
|
this.trigger(Events$1.PLAYBACK_STATS_ADD, {
|
|
8216
|
-
|
|
8330
|
+
dvr: status
|
|
8217
8331
|
});
|
|
8218
8332
|
}
|
|
8219
8333
|
}, {
|
|
@@ -8236,7 +8350,9 @@ var HTML5Video$1 = /*#__PURE__*/function (_Playback) {
|
|
|
8236
8350
|
key: "_checkInitialSeek",
|
|
8237
8351
|
value: function _checkInitialSeek() {
|
|
8238
8352
|
var seekTime = seekStringToSeconds();
|
|
8239
|
-
if (seekTime !== 0)
|
|
8353
|
+
if (seekTime !== 0) {
|
|
8354
|
+
this.seek(seekTime);
|
|
8355
|
+
}
|
|
8240
8356
|
}
|
|
8241
8357
|
}, {
|
|
8242
8358
|
key: "getCurrentTime",
|
|
@@ -8279,7 +8395,9 @@ var HTML5Video$1 = /*#__PURE__*/function (_Playback) {
|
|
|
8279
8395
|
}, {
|
|
8280
8396
|
key: "_onProgress",
|
|
8281
8397
|
value: function _onProgress() {
|
|
8282
|
-
if (!this.el.buffered.length)
|
|
8398
|
+
if (!this.el.buffered.length) {
|
|
8399
|
+
return;
|
|
8400
|
+
}
|
|
8283
8401
|
var buffered = [];
|
|
8284
8402
|
var bufferedPos = 0;
|
|
8285
8403
|
for (var i = 0; i < this.el.buffered.length; i++) {
|
|
@@ -8287,7 +8405,9 @@ var HTML5Video$1 = /*#__PURE__*/function (_Playback) {
|
|
|
8287
8405
|
start: this.el.buffered.start(i),
|
|
8288
8406
|
end: this.el.buffered.end(i)
|
|
8289
8407
|
}]);
|
|
8290
|
-
if (this.el.currentTime >= buffered[i].start && this.el.currentTime <= buffered[i].end)
|
|
8408
|
+
if (this.el.currentTime >= buffered[i].start && this.el.currentTime <= buffered[i].end) {
|
|
8409
|
+
bufferedPos = i;
|
|
8410
|
+
}
|
|
8291
8411
|
}
|
|
8292
8412
|
var progress = {
|
|
8293
8413
|
start: buffered[bufferedPos].start,
|
|
@@ -8300,14 +8420,18 @@ var HTML5Video$1 = /*#__PURE__*/function (_Playback) {
|
|
|
8300
8420
|
key: "_typeFor",
|
|
8301
8421
|
value: function _typeFor(src) {
|
|
8302
8422
|
var mimeTypes = HTML5Video._mimeTypesForUrl(src, MIMETYPES, this.options.mimeType);
|
|
8303
|
-
if (mimeTypes.length === 0)
|
|
8423
|
+
if (mimeTypes.length === 0) {
|
|
8424
|
+
mimeTypes = HTML5Video._mimeTypesForUrl(src, AUDIO_MIMETYPES, this.options.mimeType);
|
|
8425
|
+
}
|
|
8304
8426
|
var mimeType = mimeTypes[0] || '';
|
|
8305
8427
|
return mimeType.split(';')[0];
|
|
8306
8428
|
}
|
|
8307
8429
|
}, {
|
|
8308
8430
|
key: "_ready",
|
|
8309
8431
|
value: function _ready() {
|
|
8310
|
-
if (this._isReadyState)
|
|
8432
|
+
if (this._isReadyState) {
|
|
8433
|
+
return;
|
|
8434
|
+
}
|
|
8311
8435
|
this._isReadyState = true;
|
|
8312
8436
|
this.trigger(Events$1.PLAYBACK_READY, this.name);
|
|
8313
8437
|
}
|
|
@@ -8371,7 +8495,9 @@ var HTML5Video$1 = /*#__PURE__*/function (_Playback) {
|
|
|
8371
8495
|
return this._ccTrackId;
|
|
8372
8496
|
},
|
|
8373
8497
|
set: function set(trackId) {
|
|
8374
|
-
if (!isNumber$1(trackId))
|
|
8498
|
+
if (!isNumber$1(trackId)) {
|
|
8499
|
+
return;
|
|
8500
|
+
}
|
|
8375
8501
|
var tracks = this.closedCaptionsTracks;
|
|
8376
8502
|
var showingTrack;
|
|
8377
8503
|
|
|
@@ -8380,9 +8506,13 @@ var HTML5Video$1 = /*#__PURE__*/function (_Playback) {
|
|
|
8380
8506
|
showingTrack = tracks.find(function (track) {
|
|
8381
8507
|
return track.id === trackId;
|
|
8382
8508
|
});
|
|
8383
|
-
if (!showingTrack)
|
|
8509
|
+
if (!showingTrack) {
|
|
8510
|
+
return;
|
|
8511
|
+
} // Track id not found
|
|
8384
8512
|
|
|
8385
|
-
if (showingTrack.track.mode === 'showing')
|
|
8513
|
+
if (showingTrack.track.mode === 'showing') {
|
|
8514
|
+
return;
|
|
8515
|
+
} // Track already showing
|
|
8386
8516
|
}
|
|
8387
8517
|
|
|
8388
8518
|
// Since it is possible to display multiple tracks,
|
|
@@ -8390,7 +8520,7 @@ var HTML5Video$1 = /*#__PURE__*/function (_Playback) {
|
|
|
8390
8520
|
tracks.filter(function (track) {
|
|
8391
8521
|
return track.track.mode !== 'hidden';
|
|
8392
8522
|
}).forEach(function (track) {
|
|
8393
|
-
|
|
8523
|
+
track.track.mode = 'hidden';
|
|
8394
8524
|
});
|
|
8395
8525
|
showingTrack && (showingTrack.track.mode = 'showing');
|
|
8396
8526
|
this._ccTrackId = trackId;
|
|
@@ -8460,7 +8590,7 @@ var HTML5Audio = /*#__PURE__*/function (_HTML5Video) {
|
|
|
8460
8590
|
key: "supportedVersion",
|
|
8461
8591
|
get: function get() {
|
|
8462
8592
|
return {
|
|
8463
|
-
min: "0.
|
|
8593
|
+
min: "0.13.0"
|
|
8464
8594
|
};
|
|
8465
8595
|
}
|
|
8466
8596
|
}, {
|
|
@@ -8517,7 +8647,7 @@ var HTMLImg = /*#__PURE__*/function (_Playback) {
|
|
|
8517
8647
|
key: "supportedVersion",
|
|
8518
8648
|
get: function get() {
|
|
8519
8649
|
return {
|
|
8520
|
-
min: "0.
|
|
8650
|
+
min: "0.13.0"
|
|
8521
8651
|
};
|
|
8522
8652
|
}
|
|
8523
8653
|
}, {
|
|
@@ -8600,7 +8730,7 @@ var NoOp = /*#__PURE__*/function (_Playback) {
|
|
|
8600
8730
|
key: "supportedVersion",
|
|
8601
8731
|
get: function get() {
|
|
8602
8732
|
return {
|
|
8603
|
-
min: "0.
|
|
8733
|
+
min: "0.13.0"
|
|
8604
8734
|
};
|
|
8605
8735
|
}
|
|
8606
8736
|
}, {
|
|
@@ -8628,7 +8758,9 @@ var NoOp = /*#__PURE__*/function (_Playback) {
|
|
|
8628
8758
|
}));
|
|
8629
8759
|
this.trigger(Events$1.PLAYBACK_READY, this.name);
|
|
8630
8760
|
var showForNoOp = !!(this.options.poster && this.options.poster.showForNoOp);
|
|
8631
|
-
if (this.options.autoPlay || !showForNoOp)
|
|
8761
|
+
if (this.options.autoPlay || !showForNoOp) {
|
|
8762
|
+
this._animate();
|
|
8763
|
+
}
|
|
8632
8764
|
return this;
|
|
8633
8765
|
}
|
|
8634
8766
|
}, {
|
|
@@ -8646,12 +8778,14 @@ var NoOp = /*#__PURE__*/function (_Playback) {
|
|
|
8646
8778
|
} catch (err) {
|
|
8647
8779
|
buffer32 = new Uint32Array(this.context.canvas.width * this.context.canvas.height * 4);
|
|
8648
8780
|
var data = idata.data;
|
|
8649
|
-
for (var i = 0; i < data.length; i++)
|
|
8781
|
+
for (var i = 0; i < data.length; i++) {
|
|
8782
|
+
buffer32[i] = data[i];
|
|
8783
|
+
}
|
|
8650
8784
|
}
|
|
8651
|
-
var len = buffer32.length
|
|
8652
|
-
|
|
8653
|
-
var run = 0
|
|
8654
|
-
|
|
8785
|
+
var len = buffer32.length;
|
|
8786
|
+
var m = Math.random() * 6 + 4;
|
|
8787
|
+
var run = 0;
|
|
8788
|
+
var color = 0;
|
|
8655
8789
|
for (var _i = 0; _i < len;) {
|
|
8656
8790
|
if (run < 0) {
|
|
8657
8791
|
run = m * Math.random();
|
|
@@ -8667,7 +8801,9 @@ var NoOp = /*#__PURE__*/function (_Playback) {
|
|
|
8667
8801
|
key: "_loop",
|
|
8668
8802
|
value: function _loop() {
|
|
8669
8803
|
var _this2 = this;
|
|
8670
|
-
if (this._stop)
|
|
8804
|
+
if (this._stop) {
|
|
8805
|
+
return;
|
|
8806
|
+
}
|
|
8671
8807
|
this._noise();
|
|
8672
8808
|
this._animationHandle = requestAnimationFrame$1(function () {
|
|
8673
8809
|
return _this2._loop();
|
|
@@ -8726,14 +8862,14 @@ var Strings = /*#__PURE__*/function (_CorePlugin) {
|
|
|
8726
8862
|
key: "supportedVersion",
|
|
8727
8863
|
get: function get() {
|
|
8728
8864
|
return {
|
|
8729
|
-
min: "0.
|
|
8865
|
+
min: "0.13.0"
|
|
8730
8866
|
};
|
|
8731
8867
|
}
|
|
8732
8868
|
}, {
|
|
8733
8869
|
key: "t",
|
|
8734
8870
|
value: function t(key) {
|
|
8735
8871
|
var lang = this._language();
|
|
8736
|
-
var fallbackLang = this._messages
|
|
8872
|
+
var fallbackLang = this._messages.en;
|
|
8737
8873
|
var i18n = lang && this._messages[lang] || fallbackLang;
|
|
8738
8874
|
return i18n[key] || fallbackLang[key] || key;
|
|
8739
8875
|
}
|
|
@@ -8838,17 +8974,17 @@ var Strings = /*#__PURE__*/function (_CorePlugin) {
|
|
|
8838
8974
|
}
|
|
8839
8975
|
};
|
|
8840
8976
|
this._messages = $.extend(true, defaultMessages, this.core.options.strings || {});
|
|
8841
|
-
this._messages['de-DE'] = this._messages
|
|
8842
|
-
this._messages['pt-BR'] = this._messages
|
|
8843
|
-
this._messages['en-US'] = this._messages
|
|
8844
|
-
this._messages['bg-BG'] = this._messages
|
|
8845
|
-
this._messages['es-419'] = this._messages
|
|
8846
|
-
this._messages['es-ES'] = this._messages
|
|
8847
|
-
this._messages['fr-FR'] = this._messages
|
|
8848
|
-
this._messages['tr-TR'] = this._messages
|
|
8849
|
-
this._messages['et-EE'] = this._messages
|
|
8850
|
-
this._messages['ar-IQ'] = this._messages
|
|
8851
|
-
this._messages['zh-CN'] = this._messages
|
|
8977
|
+
this._messages['de-DE'] = this._messages.de;
|
|
8978
|
+
this._messages['pt-BR'] = this._messages.pt;
|
|
8979
|
+
this._messages['en-US'] = this._messages.en;
|
|
8980
|
+
this._messages['bg-BG'] = this._messages.bg;
|
|
8981
|
+
this._messages['es-419'] = this._messages.es_am;
|
|
8982
|
+
this._messages['es-ES'] = this._messages.es;
|
|
8983
|
+
this._messages['fr-FR'] = this._messages.fr;
|
|
8984
|
+
this._messages['tr-TR'] = this._messages.tr;
|
|
8985
|
+
this._messages['et-EE'] = this._messages.et;
|
|
8986
|
+
this._messages['ar-IQ'] = this._messages.ar;
|
|
8987
|
+
this._messages['zh-CN'] = this._messages.zh;
|
|
8852
8988
|
}
|
|
8853
8989
|
}]);
|
|
8854
8990
|
}(CorePlugin);
|
|
@@ -8868,7 +9004,7 @@ var SourcesPlugin = /*#__PURE__*/function (_CorePlugin) {
|
|
|
8868
9004
|
key: "supportedVersion",
|
|
8869
9005
|
get: function get() {
|
|
8870
9006
|
return {
|
|
8871
|
-
min: "0.
|
|
9007
|
+
min: "0.13.0"
|
|
8872
9008
|
};
|
|
8873
9009
|
}
|
|
8874
9010
|
}, {
|