@gcorevideo/player 2.20.4 → 2.20.5
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/assets/error-screen/error_screen.ejs +3 -1
- package/dist/core.js +407 -205
- package/dist/index.css +1238 -1238
- package/dist/index.js +542 -383
- package/dist/plugins/index.css +993 -993
- package/dist/plugins/index.js +113 -159
- package/lib/Player.d.ts.map +1 -1
- package/lib/Player.js +2 -2
- package/lib/playback/BasePlayback.d.ts +11 -0
- package/lib/playback/BasePlayback.d.ts.map +1 -0
- package/lib/playback/BasePlayback.js +33 -0
- package/lib/playback/dash-playback/DashPlayback.d.ts +3 -2
- package/lib/playback/dash-playback/DashPlayback.d.ts.map +1 -1
- package/lib/playback/dash-playback/DashPlayback.js +7 -7
- package/lib/playback/hls-playback/HlsPlayback.d.ts +2 -2
- package/lib/playback/hls-playback/HlsPlayback.d.ts.map +1 -1
- package/lib/playback/hls-playback/HlsPlayback.js +8 -5
- package/lib/playback/utils.d.ts +2 -0
- package/lib/playback/utils.d.ts.map +1 -0
- package/lib/playback/utils.js +1 -0
- package/lib/playback.types.d.ts +10 -3
- package/lib/playback.types.d.ts.map +1 -1
- package/lib/playback.types.js +3 -3
- package/lib/plugins/context-menu/ContextMenu.d.ts.map +1 -1
- package/lib/plugins/context-menu/ContextMenu.js +1 -2
- package/lib/plugins/error-screen/ErrorScreen.d.ts +39 -24
- package/lib/plugins/error-screen/ErrorScreen.d.ts.map +1 -1
- package/lib/plugins/error-screen/ErrorScreen.js +70 -136
- package/lib/plugins/media-control/MediaControl.d.ts +1 -1
- package/lib/plugins/media-control/MediaControl.d.ts.map +1 -1
- package/lib/plugins/media-control/MediaControl.js +7 -5
- package/lib/plugins/multi-camera/MultiCamera.d.ts.map +1 -1
- package/lib/plugins/multi-camera/MultiCamera.js +2 -3
- package/lib/plugins/poster/Poster.js +1 -1
- package/lib/plugins/source-controller/SourceController.d.ts +2 -1
- package/lib/plugins/source-controller/SourceController.d.ts.map +1 -1
- package/lib/plugins/source-controller/SourceController.js +12 -6
- package/lib/plugins/spinner-three-bounce/SpinnerThreeBounce.d.ts +2 -1
- package/lib/plugins/spinner-three-bounce/SpinnerThreeBounce.d.ts.map +1 -1
- package/lib/plugins/spinner-three-bounce/SpinnerThreeBounce.js +19 -3
- package/lib/testUtils.d.ts +66 -2
- package/lib/testUtils.d.ts.map +1 -1
- package/lib/testUtils.js +95 -2
- package/package.json +2 -2
- package/src/Player.ts +2 -2
- package/src/__tests__/Player.test.ts +2 -3
- package/src/playback/BasePlayback.ts +41 -0
- package/src/playback/dash-playback/DashPlayback.ts +11 -15
- package/src/playback/hls-playback/HlsPlayback.ts +7 -5
- package/src/playback/utils.ts +2 -0
- package/src/playback.types.ts +11 -3
- package/src/plugins/context-menu/ContextMenu.ts +1 -2
- package/src/plugins/error-screen/ErrorScreen.ts +121 -195
- package/src/plugins/error-screen/__tests__/ErrorScreen.test.ts +113 -0
- package/src/plugins/error-screen/__tests__/__snapshots__/ErrorScreen.test.ts.snap +20 -0
- package/src/plugins/level-selector/__tests__/LevelSelector.test.ts +32 -57
- package/src/plugins/media-control/MediaControl.ts +8 -5
- package/src/plugins/multi-camera/MultiCamera.ts +2 -3
- package/src/plugins/poster/Poster.ts +1 -1
- package/src/plugins/source-controller/SourceController.ts +20 -14
- package/src/plugins/source-controller/__tests__/SourceController.test.ts +29 -46
- package/src/plugins/spinner-three-bounce/SpinnerThreeBounce.ts +20 -3
- package/src/testUtils.ts +100 -3
- package/tsconfig.tsbuildinfo +1 -1
package/dist/index.js
CHANGED
|
@@ -11152,13 +11152,13 @@ var config = {};
|
|
|
11152
11152
|
|
|
11153
11153
|
function noop$1() {}
|
|
11154
11154
|
|
|
11155
|
-
var on
|
|
11155
|
+
var on = noop$1;
|
|
11156
11156
|
var addListener = noop$1;
|
|
11157
|
-
var once
|
|
11158
|
-
var off
|
|
11157
|
+
var once = noop$1;
|
|
11158
|
+
var off = noop$1;
|
|
11159
11159
|
var removeListener = noop$1;
|
|
11160
11160
|
var removeAllListeners = noop$1;
|
|
11161
|
-
var emit
|
|
11161
|
+
var emit = noop$1;
|
|
11162
11162
|
|
|
11163
11163
|
function binding(name) {
|
|
11164
11164
|
throw new Error('process.binding is not supported');
|
|
@@ -11211,13 +11211,13 @@ var browser$1 = {
|
|
|
11211
11211
|
argv: argv,
|
|
11212
11212
|
version: version$2,
|
|
11213
11213
|
versions: versions,
|
|
11214
|
-
on: on
|
|
11214
|
+
on: on,
|
|
11215
11215
|
addListener: addListener,
|
|
11216
|
-
once: once
|
|
11217
|
-
off: off
|
|
11216
|
+
once: once,
|
|
11217
|
+
off: off,
|
|
11218
11218
|
removeListener: removeListener,
|
|
11219
11219
|
removeAllListeners: removeAllListeners,
|
|
11220
|
-
emit: emit
|
|
11220
|
+
emit: emit,
|
|
11221
11221
|
binding: binding,
|
|
11222
11222
|
cwd: cwd,
|
|
11223
11223
|
chdir: chdir,
|
|
@@ -12114,186 +12114,359 @@ function ifError(err) {
|
|
|
12114
12114
|
if (err) throw err;
|
|
12115
12115
|
}
|
|
12116
12116
|
|
|
12117
|
-
|
|
12118
|
-
|
|
12119
|
-
*
|
|
12120
|
-
* @copyright Yusuke Kawasaki
|
|
12121
|
-
* @license MIT
|
|
12122
|
-
* @constructor
|
|
12123
|
-
* @see https://github.com/kawanet/event-lite
|
|
12124
|
-
* @see http://kawanet.github.io/event-lite/EventLite.html
|
|
12125
|
-
* @example
|
|
12126
|
-
* var EventLite = require("event-lite");
|
|
12127
|
-
*
|
|
12128
|
-
* function MyClass() {...} // your class
|
|
12129
|
-
*
|
|
12130
|
-
* EventLite.mixin(MyClass.prototype); // import event methods
|
|
12131
|
-
*
|
|
12132
|
-
* var obj = new MyClass();
|
|
12133
|
-
* obj.on("foo", function() {...}); // add event listener
|
|
12134
|
-
* obj.once("bar", function() {...}); // add one-time event listener
|
|
12135
|
-
* obj.emit("foo"); // dispatch event
|
|
12136
|
-
* obj.emit("bar"); // dispatch another event
|
|
12137
|
-
* obj.off("foo"); // remove event listener
|
|
12138
|
-
*/
|
|
12139
|
-
|
|
12140
|
-
function EventLite() {
|
|
12141
|
-
if (!(this instanceof EventLite)) return new EventLite();
|
|
12117
|
+
function getDefaultExportFromCjs$1 (x) {
|
|
12118
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
12142
12119
|
}
|
|
12143
12120
|
|
|
12144
|
-
|
|
12145
|
-
// export the class for node.js
|
|
12146
|
-
// if ("undefined" !== typeof module) module.exports = EventLite;
|
|
12121
|
+
var eventemitter3$1 = {exports: {}};
|
|
12147
12122
|
|
|
12148
|
-
|
|
12149
|
-
var LISTENERS = "listeners";
|
|
12123
|
+
var hasRequiredEventemitter3;
|
|
12150
12124
|
|
|
12151
|
-
|
|
12152
|
-
|
|
12153
|
-
|
|
12154
|
-
|
|
12155
|
-
off: off,
|
|
12156
|
-
emit: emit
|
|
12157
|
-
};
|
|
12125
|
+
function requireEventemitter3 () {
|
|
12126
|
+
if (hasRequiredEventemitter3) return eventemitter3$1.exports;
|
|
12127
|
+
hasRequiredEventemitter3 = 1;
|
|
12128
|
+
(function (module) {
|
|
12158
12129
|
|
|
12159
|
-
|
|
12160
|
-
|
|
12130
|
+
var has = Object.prototype.hasOwnProperty
|
|
12131
|
+
, prefix = '~';
|
|
12161
12132
|
|
|
12162
|
-
|
|
12163
|
-
|
|
12133
|
+
/**
|
|
12134
|
+
* Constructor to create a storage for our `EE` objects.
|
|
12135
|
+
* An `Events` instance is a plain object whose properties are event names.
|
|
12136
|
+
*
|
|
12137
|
+
* @constructor
|
|
12138
|
+
* @private
|
|
12139
|
+
*/
|
|
12140
|
+
function Events() {}
|
|
12141
|
+
|
|
12142
|
+
//
|
|
12143
|
+
// We try to not inherit from `Object.prototype`. In some engines creating an
|
|
12144
|
+
// instance in this way is faster than calling `Object.create(null)` directly.
|
|
12145
|
+
// If `Object.create(null)` is not supported we prefix the event names with a
|
|
12146
|
+
// character to make sure that the built-in object properties are not
|
|
12147
|
+
// overridden or used as an attack vector.
|
|
12148
|
+
//
|
|
12149
|
+
if (Object.create) {
|
|
12150
|
+
Events.prototype = Object.create(null);
|
|
12151
|
+
|
|
12152
|
+
//
|
|
12153
|
+
// This hack is needed because the `__proto__` property is still inherited in
|
|
12154
|
+
// some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.
|
|
12155
|
+
//
|
|
12156
|
+
if (!new Events().__proto__) prefix = false;
|
|
12157
|
+
}
|
|
12164
12158
|
|
|
12165
|
-
|
|
12166
|
-
|
|
12167
|
-
|
|
12168
|
-
|
|
12169
|
-
|
|
12170
|
-
|
|
12159
|
+
/**
|
|
12160
|
+
* Representation of a single event listener.
|
|
12161
|
+
*
|
|
12162
|
+
* @param {Function} fn The listener function.
|
|
12163
|
+
* @param {*} context The context to invoke the listener with.
|
|
12164
|
+
* @param {Boolean} [once=false] Specify if the listener is a one-time listener.
|
|
12165
|
+
* @constructor
|
|
12166
|
+
* @private
|
|
12167
|
+
*/
|
|
12168
|
+
function EE(fn, context, once) {
|
|
12169
|
+
this.fn = fn;
|
|
12170
|
+
this.context = context;
|
|
12171
|
+
this.once = once || false;
|
|
12172
|
+
}
|
|
12171
12173
|
|
|
12172
|
-
|
|
12173
|
-
|
|
12174
|
-
|
|
12175
|
-
|
|
12176
|
-
|
|
12177
|
-
|
|
12174
|
+
/**
|
|
12175
|
+
* Add a listener for a given event.
|
|
12176
|
+
*
|
|
12177
|
+
* @param {EventEmitter} emitter Reference to the `EventEmitter` instance.
|
|
12178
|
+
* @param {(String|Symbol)} event The event name.
|
|
12179
|
+
* @param {Function} fn The listener function.
|
|
12180
|
+
* @param {*} context The context to invoke the listener with.
|
|
12181
|
+
* @param {Boolean} once Specify if the listener is a one-time listener.
|
|
12182
|
+
* @returns {EventEmitter}
|
|
12183
|
+
* @private
|
|
12184
|
+
*/
|
|
12185
|
+
function addListener(emitter, event, fn, context, once) {
|
|
12186
|
+
if (typeof fn !== 'function') {
|
|
12187
|
+
throw new TypeError('The listener must be a function');
|
|
12188
|
+
}
|
|
12178
12189
|
|
|
12179
|
-
|
|
12180
|
-
|
|
12181
|
-
*
|
|
12182
|
-
* @function EventLite.prototype.on
|
|
12183
|
-
* @param type {string}
|
|
12184
|
-
* @param func {Function}
|
|
12185
|
-
* @returns {EventLite} Self for method chaining
|
|
12186
|
-
*/
|
|
12190
|
+
var listener = new EE(fn, context || emitter, once)
|
|
12191
|
+
, evt = prefix ? prefix + event : event;
|
|
12187
12192
|
|
|
12188
|
-
|
|
12189
|
-
|
|
12190
|
-
|
|
12191
|
-
}
|
|
12193
|
+
if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++;
|
|
12194
|
+
else if (!emitter._events[evt].fn) emitter._events[evt].push(listener);
|
|
12195
|
+
else emitter._events[evt] = [emitter._events[evt], listener];
|
|
12192
12196
|
|
|
12193
|
-
|
|
12194
|
-
|
|
12195
|
-
*
|
|
12196
|
-
* @function EventLite.prototype.once
|
|
12197
|
-
* @param type {string}
|
|
12198
|
-
* @param func {Function}
|
|
12199
|
-
* @returns {EventLite} Self for method chaining
|
|
12200
|
-
*/
|
|
12197
|
+
return emitter;
|
|
12198
|
+
}
|
|
12201
12199
|
|
|
12202
|
-
|
|
12203
|
-
|
|
12204
|
-
|
|
12205
|
-
|
|
12206
|
-
|
|
12200
|
+
/**
|
|
12201
|
+
* Clear event by name.
|
|
12202
|
+
*
|
|
12203
|
+
* @param {EventEmitter} emitter Reference to the `EventEmitter` instance.
|
|
12204
|
+
* @param {(String|Symbol)} evt The Event name.
|
|
12205
|
+
* @private
|
|
12206
|
+
*/
|
|
12207
|
+
function clearEvent(emitter, evt) {
|
|
12208
|
+
if (--emitter._eventsCount === 0) emitter._events = new Events();
|
|
12209
|
+
else delete emitter._events[evt];
|
|
12210
|
+
}
|
|
12207
12211
|
|
|
12208
|
-
|
|
12209
|
-
|
|
12210
|
-
|
|
12211
|
-
|
|
12212
|
-
|
|
12212
|
+
/**
|
|
12213
|
+
* Minimal `EventEmitter` interface that is molded against the Node.js
|
|
12214
|
+
* `EventEmitter` interface.
|
|
12215
|
+
*
|
|
12216
|
+
* @constructor
|
|
12217
|
+
* @public
|
|
12218
|
+
*/
|
|
12219
|
+
function EventEmitter() {
|
|
12220
|
+
this._events = new Events();
|
|
12221
|
+
this._eventsCount = 0;
|
|
12222
|
+
}
|
|
12213
12223
|
|
|
12214
|
-
|
|
12215
|
-
|
|
12216
|
-
|
|
12217
|
-
|
|
12218
|
-
|
|
12219
|
-
|
|
12220
|
-
|
|
12221
|
-
|
|
12224
|
+
/**
|
|
12225
|
+
* Return an array listing the events for which the emitter has registered
|
|
12226
|
+
* listeners.
|
|
12227
|
+
*
|
|
12228
|
+
* @returns {Array}
|
|
12229
|
+
* @public
|
|
12230
|
+
*/
|
|
12231
|
+
EventEmitter.prototype.eventNames = function eventNames() {
|
|
12232
|
+
var names = []
|
|
12233
|
+
, events
|
|
12234
|
+
, name;
|
|
12222
12235
|
|
|
12223
|
-
|
|
12224
|
-
var that = this;
|
|
12225
|
-
var listners;
|
|
12226
|
-
if (!arguments.length) {
|
|
12227
|
-
delete that[LISTENERS];
|
|
12228
|
-
} else if (!func) {
|
|
12229
|
-
listners = that[LISTENERS];
|
|
12230
|
-
if (listners) {
|
|
12231
|
-
delete listners[type];
|
|
12232
|
-
if (!Object.keys(listners).length) return off.call(that);
|
|
12233
|
-
}
|
|
12234
|
-
} else {
|
|
12235
|
-
listners = getListeners(that, type, true);
|
|
12236
|
-
if (listners) {
|
|
12237
|
-
listners = listners.filter(ne);
|
|
12238
|
-
if (!listners.length) return off.call(that, type);
|
|
12239
|
-
that[LISTENERS][type] = listners;
|
|
12240
|
-
}
|
|
12241
|
-
}
|
|
12242
|
-
return that;
|
|
12236
|
+
if (this._eventsCount === 0) return names;
|
|
12243
12237
|
|
|
12244
|
-
|
|
12245
|
-
|
|
12246
|
-
|
|
12247
|
-
}
|
|
12238
|
+
for (name in (events = this._events)) {
|
|
12239
|
+
if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);
|
|
12240
|
+
}
|
|
12248
12241
|
|
|
12249
|
-
|
|
12250
|
-
|
|
12251
|
-
|
|
12252
|
-
* @function EventLite.prototype.emit
|
|
12253
|
-
* @param type {string}
|
|
12254
|
-
* @param [value] {*}
|
|
12255
|
-
* @returns {boolean} True when a listener received the event
|
|
12256
|
-
*/
|
|
12242
|
+
if (Object.getOwnPropertySymbols) {
|
|
12243
|
+
return names.concat(Object.getOwnPropertySymbols(events));
|
|
12244
|
+
}
|
|
12257
12245
|
|
|
12258
|
-
|
|
12259
|
-
|
|
12260
|
-
var listeners = getListeners(that, type, true);
|
|
12261
|
-
if (!listeners) return false;
|
|
12262
|
-
var arglen = arguments.length;
|
|
12263
|
-
if (arglen === 1) {
|
|
12264
|
-
listeners.forEach(zeroarg);
|
|
12265
|
-
} else if (arglen === 2) {
|
|
12266
|
-
listeners.forEach(onearg);
|
|
12267
|
-
} else {
|
|
12268
|
-
var args = Array.prototype.slice.call(arguments, 1);
|
|
12269
|
-
listeners.forEach(moreargs);
|
|
12270
|
-
}
|
|
12271
|
-
return !!listeners.length;
|
|
12246
|
+
return names;
|
|
12247
|
+
};
|
|
12272
12248
|
|
|
12273
|
-
|
|
12274
|
-
|
|
12275
|
-
|
|
12249
|
+
/**
|
|
12250
|
+
* Return the listeners registered for a given event.
|
|
12251
|
+
*
|
|
12252
|
+
* @param {(String|Symbol)} event The event name.
|
|
12253
|
+
* @returns {Array} The registered listeners.
|
|
12254
|
+
* @public
|
|
12255
|
+
*/
|
|
12256
|
+
EventEmitter.prototype.listeners = function listeners(event) {
|
|
12257
|
+
var evt = prefix ? prefix + event : event
|
|
12258
|
+
, handlers = this._events[evt];
|
|
12276
12259
|
|
|
12277
|
-
|
|
12278
|
-
|
|
12279
|
-
}
|
|
12260
|
+
if (!handlers) return [];
|
|
12261
|
+
if (handlers.fn) return [handlers.fn];
|
|
12280
12262
|
|
|
12281
|
-
|
|
12282
|
-
|
|
12283
|
-
|
|
12284
|
-
}
|
|
12263
|
+
for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {
|
|
12264
|
+
ee[i] = handlers[i].fn;
|
|
12265
|
+
}
|
|
12285
12266
|
|
|
12286
|
-
|
|
12287
|
-
|
|
12288
|
-
*/
|
|
12267
|
+
return ee;
|
|
12268
|
+
};
|
|
12289
12269
|
|
|
12290
|
-
|
|
12291
|
-
|
|
12292
|
-
|
|
12293
|
-
|
|
12294
|
-
|
|
12270
|
+
/**
|
|
12271
|
+
* Return the number of listeners listening to a given event.
|
|
12272
|
+
*
|
|
12273
|
+
* @param {(String|Symbol)} event The event name.
|
|
12274
|
+
* @returns {Number} The number of listeners.
|
|
12275
|
+
* @public
|
|
12276
|
+
*/
|
|
12277
|
+
EventEmitter.prototype.listenerCount = function listenerCount(event) {
|
|
12278
|
+
var evt = prefix ? prefix + event : event
|
|
12279
|
+
, listeners = this._events[evt];
|
|
12280
|
+
|
|
12281
|
+
if (!listeners) return 0;
|
|
12282
|
+
if (listeners.fn) return 1;
|
|
12283
|
+
return listeners.length;
|
|
12284
|
+
};
|
|
12285
|
+
|
|
12286
|
+
/**
|
|
12287
|
+
* Calls each of the listeners registered for a given event.
|
|
12288
|
+
*
|
|
12289
|
+
* @param {(String|Symbol)} event The event name.
|
|
12290
|
+
* @returns {Boolean} `true` if the event had listeners, else `false`.
|
|
12291
|
+
* @public
|
|
12292
|
+
*/
|
|
12293
|
+
EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {
|
|
12294
|
+
var evt = prefix ? prefix + event : event;
|
|
12295
|
+
|
|
12296
|
+
if (!this._events[evt]) return false;
|
|
12297
|
+
|
|
12298
|
+
var listeners = this._events[evt]
|
|
12299
|
+
, len = arguments.length
|
|
12300
|
+
, args
|
|
12301
|
+
, i;
|
|
12302
|
+
|
|
12303
|
+
if (listeners.fn) {
|
|
12304
|
+
if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);
|
|
12305
|
+
|
|
12306
|
+
switch (len) {
|
|
12307
|
+
case 1: return listeners.fn.call(listeners.context), true;
|
|
12308
|
+
case 2: return listeners.fn.call(listeners.context, a1), true;
|
|
12309
|
+
case 3: return listeners.fn.call(listeners.context, a1, a2), true;
|
|
12310
|
+
case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;
|
|
12311
|
+
case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;
|
|
12312
|
+
case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;
|
|
12313
|
+
}
|
|
12314
|
+
|
|
12315
|
+
for (i = 1, args = new Array(len -1); i < len; i++) {
|
|
12316
|
+
args[i - 1] = arguments[i];
|
|
12317
|
+
}
|
|
12318
|
+
|
|
12319
|
+
listeners.fn.apply(listeners.context, args);
|
|
12320
|
+
} else {
|
|
12321
|
+
var length = listeners.length
|
|
12322
|
+
, j;
|
|
12323
|
+
|
|
12324
|
+
for (i = 0; i < length; i++) {
|
|
12325
|
+
if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);
|
|
12326
|
+
|
|
12327
|
+
switch (len) {
|
|
12328
|
+
case 1: listeners[i].fn.call(listeners[i].context); break;
|
|
12329
|
+
case 2: listeners[i].fn.call(listeners[i].context, a1); break;
|
|
12330
|
+
case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;
|
|
12331
|
+
case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;
|
|
12332
|
+
default:
|
|
12333
|
+
if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {
|
|
12334
|
+
args[j - 1] = arguments[j];
|
|
12335
|
+
}
|
|
12336
|
+
|
|
12337
|
+
listeners[i].fn.apply(listeners[i].context, args);
|
|
12338
|
+
}
|
|
12339
|
+
}
|
|
12340
|
+
}
|
|
12341
|
+
|
|
12342
|
+
return true;
|
|
12343
|
+
};
|
|
12344
|
+
|
|
12345
|
+
/**
|
|
12346
|
+
* Add a listener for a given event.
|
|
12347
|
+
*
|
|
12348
|
+
* @param {(String|Symbol)} event The event name.
|
|
12349
|
+
* @param {Function} fn The listener function.
|
|
12350
|
+
* @param {*} [context=this] The context to invoke the listener with.
|
|
12351
|
+
* @returns {EventEmitter} `this`.
|
|
12352
|
+
* @public
|
|
12353
|
+
*/
|
|
12354
|
+
EventEmitter.prototype.on = function on(event, fn, context) {
|
|
12355
|
+
return addListener(this, event, fn, context, false);
|
|
12356
|
+
};
|
|
12357
|
+
|
|
12358
|
+
/**
|
|
12359
|
+
* Add a one-time listener for a given event.
|
|
12360
|
+
*
|
|
12361
|
+
* @param {(String|Symbol)} event The event name.
|
|
12362
|
+
* @param {Function} fn The listener function.
|
|
12363
|
+
* @param {*} [context=this] The context to invoke the listener with.
|
|
12364
|
+
* @returns {EventEmitter} `this`.
|
|
12365
|
+
* @public
|
|
12366
|
+
*/
|
|
12367
|
+
EventEmitter.prototype.once = function once(event, fn, context) {
|
|
12368
|
+
return addListener(this, event, fn, context, true);
|
|
12369
|
+
};
|
|
12370
|
+
|
|
12371
|
+
/**
|
|
12372
|
+
* Remove the listeners of a given event.
|
|
12373
|
+
*
|
|
12374
|
+
* @param {(String|Symbol)} event The event name.
|
|
12375
|
+
* @param {Function} fn Only remove the listeners that match this function.
|
|
12376
|
+
* @param {*} context Only remove the listeners that have this context.
|
|
12377
|
+
* @param {Boolean} once Only remove one-time listeners.
|
|
12378
|
+
* @returns {EventEmitter} `this`.
|
|
12379
|
+
* @public
|
|
12380
|
+
*/
|
|
12381
|
+
EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {
|
|
12382
|
+
var evt = prefix ? prefix + event : event;
|
|
12383
|
+
|
|
12384
|
+
if (!this._events[evt]) return this;
|
|
12385
|
+
if (!fn) {
|
|
12386
|
+
clearEvent(this, evt);
|
|
12387
|
+
return this;
|
|
12388
|
+
}
|
|
12389
|
+
|
|
12390
|
+
var listeners = this._events[evt];
|
|
12391
|
+
|
|
12392
|
+
if (listeners.fn) {
|
|
12393
|
+
if (
|
|
12394
|
+
listeners.fn === fn &&
|
|
12395
|
+
(!once || listeners.once) &&
|
|
12396
|
+
(!context || listeners.context === context)
|
|
12397
|
+
) {
|
|
12398
|
+
clearEvent(this, evt);
|
|
12399
|
+
}
|
|
12400
|
+
} else {
|
|
12401
|
+
for (var i = 0, events = [], length = listeners.length; i < length; i++) {
|
|
12402
|
+
if (
|
|
12403
|
+
listeners[i].fn !== fn ||
|
|
12404
|
+
(once && !listeners[i].once) ||
|
|
12405
|
+
(context && listeners[i].context !== context)
|
|
12406
|
+
) {
|
|
12407
|
+
events.push(listeners[i]);
|
|
12408
|
+
}
|
|
12409
|
+
}
|
|
12410
|
+
|
|
12411
|
+
//
|
|
12412
|
+
// Reset the array, or remove it completely if we have no more listeners.
|
|
12413
|
+
//
|
|
12414
|
+
if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;
|
|
12415
|
+
else clearEvent(this, evt);
|
|
12416
|
+
}
|
|
12417
|
+
|
|
12418
|
+
return this;
|
|
12419
|
+
};
|
|
12420
|
+
|
|
12421
|
+
/**
|
|
12422
|
+
* Remove all listeners, or those of the specified event.
|
|
12423
|
+
*
|
|
12424
|
+
* @param {(String|Symbol)} [event] The event name.
|
|
12425
|
+
* @returns {EventEmitter} `this`.
|
|
12426
|
+
* @public
|
|
12427
|
+
*/
|
|
12428
|
+
EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {
|
|
12429
|
+
var evt;
|
|
12430
|
+
|
|
12431
|
+
if (event) {
|
|
12432
|
+
evt = prefix ? prefix + event : event;
|
|
12433
|
+
if (this._events[evt]) clearEvent(this, evt);
|
|
12434
|
+
} else {
|
|
12435
|
+
this._events = new Events();
|
|
12436
|
+
this._eventsCount = 0;
|
|
12437
|
+
}
|
|
12438
|
+
|
|
12439
|
+
return this;
|
|
12440
|
+
};
|
|
12441
|
+
|
|
12442
|
+
//
|
|
12443
|
+
// Alias methods names because people roll like that.
|
|
12444
|
+
//
|
|
12445
|
+
EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
|
|
12446
|
+
EventEmitter.prototype.addListener = EventEmitter.prototype.on;
|
|
12447
|
+
|
|
12448
|
+
//
|
|
12449
|
+
// Expose the prefix.
|
|
12450
|
+
//
|
|
12451
|
+
EventEmitter.prefixed = prefix;
|
|
12295
12452
|
|
|
12296
|
-
//
|
|
12453
|
+
//
|
|
12454
|
+
// Allow `EventEmitter` to be imported as module namespace.
|
|
12455
|
+
//
|
|
12456
|
+
EventEmitter.EventEmitter = EventEmitter;
|
|
12457
|
+
|
|
12458
|
+
//
|
|
12459
|
+
// Expose the module.
|
|
12460
|
+
//
|
|
12461
|
+
{
|
|
12462
|
+
module.exports = EventEmitter;
|
|
12463
|
+
}
|
|
12464
|
+
} (eventemitter3$1));
|
|
12465
|
+
return eventemitter3$1.exports;
|
|
12466
|
+
}
|
|
12467
|
+
|
|
12468
|
+
var eventemitter3Exports$1 = requireEventemitter3();
|
|
12469
|
+
const EventEmitter$1 = /*@__PURE__*/getDefaultExportFromCjs$1(eventemitter3Exports$1);
|
|
12297
12470
|
|
|
12298
12471
|
/**
|
|
12299
12472
|
* A top-level event on the player object
|
|
@@ -12413,10 +12586,6 @@ function isHlsSource(source, mimeType) {
|
|
|
12413
12586
|
return source.endsWith('.m3u8');
|
|
12414
12587
|
}
|
|
12415
12588
|
|
|
12416
|
-
function getDefaultExportFromCjs$1 (x) {
|
|
12417
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
12418
|
-
}
|
|
12419
|
-
|
|
12420
12589
|
var dash_all_min = {exports: {}};
|
|
12421
12590
|
|
|
12422
12591
|
var hasRequiredDash_all_min;
|
|
@@ -12443,25 +12612,57 @@ var PlaybackErrorCode;
|
|
|
12443
12612
|
/**
|
|
12444
12613
|
* An unknown or uncategorised error.
|
|
12445
12614
|
*/
|
|
12446
|
-
PlaybackErrorCode[
|
|
12615
|
+
PlaybackErrorCode["Generic"] = "GENERIC_ERROR";
|
|
12447
12616
|
/**
|
|
12448
12617
|
* The media source is not available. Typically a network error.
|
|
12449
12618
|
*/
|
|
12450
|
-
PlaybackErrorCode[
|
|
12619
|
+
PlaybackErrorCode["MediaSourceUnavailable"] = "MEDIA_SOURCE_UNAVAILABLE";
|
|
12451
12620
|
/**
|
|
12452
12621
|
* The media source is not accessible due to some protection policy.
|
|
12453
12622
|
*/
|
|
12454
|
-
PlaybackErrorCode[
|
|
12623
|
+
PlaybackErrorCode["MediaSourceAccessDenied"] = "MEDIA_SOURCE_ACCESS_DENIED";
|
|
12455
12624
|
})(PlaybackErrorCode || (PlaybackErrorCode = {}));
|
|
12456
12625
|
|
|
12626
|
+
/**
|
|
12627
|
+
* This class adds common behaviors to all playback modules.
|
|
12628
|
+
* @internal
|
|
12629
|
+
* TODO use custom HTML5Video playback with this layer applied
|
|
12630
|
+
*/
|
|
12631
|
+
class BasePlayback extends HTML5Video {
|
|
12632
|
+
createError(errorData, options) {
|
|
12633
|
+
const i18n = this.i18n ||
|
|
12634
|
+
// @ts-ignore
|
|
12635
|
+
(this.core && this.core.i18n) ||
|
|
12636
|
+
// @ts-ignore
|
|
12637
|
+
(this.container && this.container.i18n);
|
|
12638
|
+
if (i18n &&
|
|
12639
|
+
!errorData.UI &&
|
|
12640
|
+
errorData.code === PlaybackErrorCode.MediaSourceUnavailable) {
|
|
12641
|
+
const defaultUI = {
|
|
12642
|
+
title: i18n.t('no_broadcast'),
|
|
12643
|
+
message: '',
|
|
12644
|
+
};
|
|
12645
|
+
errorData.UI = defaultUI;
|
|
12646
|
+
}
|
|
12647
|
+
if (errorData.level === PlayerError.Levels.FATAL) {
|
|
12648
|
+
this.trigger(Events$1.PLAYBACK_MEDIACONTROL_DISABLE);
|
|
12649
|
+
}
|
|
12650
|
+
return super.createError(errorData, options);
|
|
12651
|
+
}
|
|
12652
|
+
_onProgress() {
|
|
12653
|
+
super._onProgress();
|
|
12654
|
+
this.trigger(Events$1.PLAYBACK_MEDIACONTROL_ENABLE);
|
|
12655
|
+
}
|
|
12656
|
+
}
|
|
12657
|
+
|
|
12457
12658
|
// Copyright 2014 Globo.com Player authors. All rights reserved.
|
|
12458
12659
|
// Use of this source code is governed by a BSD-style
|
|
12459
12660
|
// license that can be found in the LICENSE file.
|
|
12460
12661
|
const AUTO$2 = -1;
|
|
12461
12662
|
const { now: now$2 } = Utils;
|
|
12462
|
-
const T$
|
|
12663
|
+
const T$g = 'playback.dash';
|
|
12463
12664
|
// @ts-expect-error
|
|
12464
|
-
class DashPlayback extends
|
|
12665
|
+
class DashPlayback extends BasePlayback {
|
|
12465
12666
|
_levels = null;
|
|
12466
12667
|
_currentLevel = null;
|
|
12467
12668
|
// true when the actual duration is longer than hlsjs's live sync point
|
|
@@ -12729,10 +12930,10 @@ class DashPlayback extends HTML5Video {
|
|
|
12729
12930
|
}
|
|
12730
12931
|
_onPlaybackError = (event) => {
|
|
12731
12932
|
// TODO
|
|
12732
|
-
trace(`${T$
|
|
12933
|
+
trace(`${T$g} _onPlaybackError`, { event });
|
|
12733
12934
|
};
|
|
12734
12935
|
_onDASHJSSError = (event) => {
|
|
12735
|
-
trace(`${T$
|
|
12936
|
+
trace(`${T$g} _onDASHJSSError`, { event });
|
|
12736
12937
|
this._stopTimeUpdateTimer();
|
|
12737
12938
|
// Note that the other error types are deprecated
|
|
12738
12939
|
const e = event.error;
|
|
@@ -12767,12 +12968,11 @@ class DashPlayback extends HTML5Video {
|
|
|
12767
12968
|
}
|
|
12768
12969
|
};
|
|
12769
12970
|
triggerError(error) {
|
|
12770
|
-
trace(`${T$
|
|
12771
|
-
this
|
|
12772
|
-
|
|
12773
|
-
|
|
12774
|
-
|
|
12775
|
-
});
|
|
12971
|
+
trace(`${T$g} triggerError`, { error });
|
|
12972
|
+
// this triggers Events.ERROR to be handled by the UI
|
|
12973
|
+
this.trigger(Events$1.PLAYBACK_ERROR, this.createError(error, {
|
|
12974
|
+
useCodePrefix: false,
|
|
12975
|
+
}));
|
|
12776
12976
|
// only reset the dash player in 10ms async, so that the rest of the
|
|
12777
12977
|
// calling function finishes
|
|
12778
12978
|
setTimeout(() => {
|
|
@@ -12807,7 +13007,7 @@ class DashPlayback extends HTML5Video {
|
|
|
12807
13007
|
}
|
|
12808
13008
|
get dvrEnabled() {
|
|
12809
13009
|
if (!this._dash) {
|
|
12810
|
-
trace(`${T$
|
|
13010
|
+
trace(`${T$g} dvrEnable no dash player instance`);
|
|
12811
13011
|
return false;
|
|
12812
13012
|
}
|
|
12813
13013
|
return (this._dash?.getDVRWindowSize() >= this._minDvrSize &&
|
|
@@ -12829,7 +13029,7 @@ class DashPlayback extends HTML5Video {
|
|
|
12829
13029
|
this.trigger(Events$1.PLAYBACK_PROGRESS, progress, {});
|
|
12830
13030
|
}
|
|
12831
13031
|
play() {
|
|
12832
|
-
trace(`${T$
|
|
13032
|
+
trace(`${T$g} play`, { dash: !!this._dash });
|
|
12833
13033
|
if (!this._dash) {
|
|
12834
13034
|
this._setup();
|
|
12835
13035
|
}
|
|
@@ -41570,15 +41770,15 @@ const CLAPPR_VERSION = '0.11.3';
|
|
|
41570
41770
|
|
|
41571
41771
|
// Copyright 2014 Globo.com Player authors. All rights reserved.
|
|
41572
41772
|
// Use of this source code is governed by a BSD-style
|
|
41573
|
-
// license that can be found
|
|
41574
|
-
const { now} = Utils;
|
|
41773
|
+
// license that can be found on https://github.com/clappr/hlsjs-playback/blob/main/LICENSE
|
|
41774
|
+
const { now } = Utils;
|
|
41575
41775
|
const AUTO$1 = -1;
|
|
41576
41776
|
const DEFAULT_RECOVER_ATTEMPTS = 16;
|
|
41577
41777
|
Events$1.register('PLAYBACK_FRAGMENT_CHANGED');
|
|
41578
41778
|
Events$1.register('PLAYBACK_FRAGMENT_PARSING_METADATA');
|
|
41579
|
-
const T$
|
|
41779
|
+
const T$f = 'playback.hls';
|
|
41580
41780
|
// @ts-expect-error
|
|
41581
|
-
class HlsPlayback extends
|
|
41781
|
+
class HlsPlayback extends BasePlayback {
|
|
41582
41782
|
_ccIsSetup = false;
|
|
41583
41783
|
_ccTracksUpdated = false;
|
|
41584
41784
|
_currentFragment = null;
|
|
@@ -41806,7 +42006,7 @@ class HlsPlayback extends HTML5Video {
|
|
|
41806
42006
|
maxBufferLength: 2,
|
|
41807
42007
|
maxMaxBufferLength: 4,
|
|
41808
42008
|
}, this.options.playback.hlsjsConfig);
|
|
41809
|
-
trace(`${T$
|
|
42009
|
+
trace(`${T$f} _createHLSInstance`, { config });
|
|
41810
42010
|
this._hls = new Hls(config);
|
|
41811
42011
|
}
|
|
41812
42012
|
_attachHLSMedia() {
|
|
@@ -41895,7 +42095,7 @@ class HlsPlayback extends HTML5Video {
|
|
|
41895
42095
|
}
|
|
41896
42096
|
else {
|
|
41897
42097
|
Log.error('hlsjs: failed to recover', { evt, data });
|
|
41898
|
-
trace(`${T$
|
|
42098
|
+
trace(`${T$f} _recover failed to recover`, {
|
|
41899
42099
|
type: data.type,
|
|
41900
42100
|
details: data.details,
|
|
41901
42101
|
});
|
|
@@ -41981,7 +42181,7 @@ class HlsPlayback extends HTML5Video {
|
|
|
41981
42181
|
this.trigger(Events$1.PLAYBACK_SETTINGSUPDATE);
|
|
41982
42182
|
}
|
|
41983
42183
|
_onHLSJSError(evt, data) {
|
|
41984
|
-
trace(`${T$
|
|
42184
|
+
trace(`${T$f} _onHLSJSError`, {
|
|
41985
42185
|
fatal: data.fatal,
|
|
41986
42186
|
type: data.type,
|
|
41987
42187
|
details: data.details,
|
|
@@ -42029,7 +42229,7 @@ class HlsPlayback extends HTML5Video {
|
|
|
42029
42229
|
evt,
|
|
42030
42230
|
data,
|
|
42031
42231
|
});
|
|
42032
|
-
trace(`${T$
|
|
42232
|
+
trace(`${T$f} _onHLSJSError trying to recover from network error`, {
|
|
42033
42233
|
details: data.details,
|
|
42034
42234
|
});
|
|
42035
42235
|
error.level = PlayerError.Levels.WARN;
|
|
@@ -42042,7 +42242,7 @@ class HlsPlayback extends HTML5Video {
|
|
|
42042
42242
|
evt,
|
|
42043
42243
|
data,
|
|
42044
42244
|
});
|
|
42045
|
-
trace(`${T$
|
|
42245
|
+
trace(`${T$f} _onHLSJSError trying to recover from media error`, {
|
|
42046
42246
|
details: data.details,
|
|
42047
42247
|
});
|
|
42048
42248
|
error.level = PlayerError.Levels.WARN;
|
|
@@ -42072,7 +42272,7 @@ class HlsPlayback extends HTML5Video {
|
|
|
42072
42272
|
return;
|
|
42073
42273
|
}
|
|
42074
42274
|
Log.warn('hlsjs: non-fatal error occurred', { evt, data });
|
|
42075
|
-
trace(`${T$
|
|
42275
|
+
trace(`${T$f} _onHLSJSError non-fatal error occurred`, {
|
|
42076
42276
|
type: data.type,
|
|
42077
42277
|
details: data.details,
|
|
42078
42278
|
});
|
|
@@ -42383,7 +42583,9 @@ class HlsPlayback extends HTML5Video {
|
|
|
42383
42583
|
return this._playbackType === Playback.VOD || this.dvrEnabled;
|
|
42384
42584
|
}
|
|
42385
42585
|
triggerError(error) {
|
|
42386
|
-
this.trigger(Events$1.PLAYBACK_ERROR, error
|
|
42586
|
+
this.trigger(Events$1.PLAYBACK_ERROR, this.createError(error, {
|
|
42587
|
+
useCodePrefix: false,
|
|
42588
|
+
}));
|
|
42387
42589
|
this.stop();
|
|
42388
42590
|
}
|
|
42389
42591
|
}
|
|
@@ -42400,7 +42602,7 @@ function registerPlaybacks() {
|
|
|
42400
42602
|
Loader.registerPlayback(DashPlayback);
|
|
42401
42603
|
}
|
|
42402
42604
|
|
|
42403
|
-
const T$
|
|
42605
|
+
const T$e = 'GPlayer';
|
|
42404
42606
|
const DEFAULT_OPTIONS = {
|
|
42405
42607
|
autoPlay: false,
|
|
42406
42608
|
debug: 'none',
|
|
@@ -42421,7 +42623,7 @@ const DEFAULT_OPTIONS = {
|
|
|
42421
42623
|
*/
|
|
42422
42624
|
class Player {
|
|
42423
42625
|
config = DEFAULT_OPTIONS;
|
|
42424
|
-
emitter = new
|
|
42626
|
+
emitter = new EventEmitter$1();
|
|
42425
42627
|
player = null;
|
|
42426
42628
|
ready = false;
|
|
42427
42629
|
rootNode = null;
|
|
@@ -42495,7 +42697,7 @@ class Player {
|
|
|
42495
42697
|
}
|
|
42496
42698
|
const coreOpts = this.buildCoreOptions(playerElement);
|
|
42497
42699
|
const { core, container } = Player.getRegisteredPlugins();
|
|
42498
|
-
trace(`${T$
|
|
42700
|
+
trace(`${T$e} init`, {
|
|
42499
42701
|
registeredPlaybacks: Loader.registeredPlaybacks.map((p) => p.name),
|
|
42500
42702
|
});
|
|
42501
42703
|
coreOpts.plugins = {
|
|
@@ -42509,7 +42711,7 @@ class Player {
|
|
|
42509
42711
|
* Destroys the player, releasing all resources and unmounting its UI from the DOM.
|
|
42510
42712
|
*/
|
|
42511
42713
|
destroy() {
|
|
42512
|
-
trace(`${T$
|
|
42714
|
+
trace(`${T$e} destroy`, {
|
|
42513
42715
|
player: !!this.player,
|
|
42514
42716
|
});
|
|
42515
42717
|
if (this.player) {
|
|
@@ -42691,7 +42893,7 @@ class Player {
|
|
|
42691
42893
|
this.config = $.extend(true, this.config, config);
|
|
42692
42894
|
}
|
|
42693
42895
|
initPlayer(coreOptions) {
|
|
42694
|
-
trace(`${T$
|
|
42896
|
+
trace(`${T$e} initPlayer`, {
|
|
42695
42897
|
autoPlay: coreOptions.autoPlay,
|
|
42696
42898
|
sources: coreOptions.sources,
|
|
42697
42899
|
// TODO selected options
|
|
@@ -42716,7 +42918,7 @@ class Player {
|
|
|
42716
42918
|
}
|
|
42717
42919
|
}
|
|
42718
42920
|
triggerAutoPlay() {
|
|
42719
|
-
trace(`${T$
|
|
42921
|
+
trace(`${T$e} triggerAutoPlay`);
|
|
42720
42922
|
setTimeout(() => {
|
|
42721
42923
|
this.player?.play({
|
|
42722
42924
|
autoPlay: true,
|
|
@@ -42734,7 +42936,7 @@ class Player {
|
|
|
42734
42936
|
// TODO test
|
|
42735
42937
|
events = {
|
|
42736
42938
|
onReady: () => {
|
|
42737
|
-
trace(`${T$
|
|
42939
|
+
trace(`${T$e} onReady`, {
|
|
42738
42940
|
ready: this.ready,
|
|
42739
42941
|
});
|
|
42740
42942
|
if (this.ready) {
|
|
@@ -42768,7 +42970,7 @@ class Player {
|
|
|
42768
42970
|
buildCoreOptions(rootNode) {
|
|
42769
42971
|
const sources = this.buildMediaSourcesList();
|
|
42770
42972
|
const source = sources[0];
|
|
42771
|
-
trace(`${T$
|
|
42973
|
+
trace(`${T$e} buildCoreOptions`, {
|
|
42772
42974
|
source,
|
|
42773
42975
|
sources,
|
|
42774
42976
|
});
|
|
@@ -42829,7 +43031,7 @@ class Player {
|
|
|
42829
43031
|
assert.ok(this.player, 'Player is not initialized');
|
|
42830
43032
|
const core = this.player.core;
|
|
42831
43033
|
core.on(Events$1.CORE_SCREEN_ORIENTATION_CHANGED, ({ orientation }) => {
|
|
42832
|
-
trace(`${T$
|
|
43034
|
+
trace(`${T$e} on CORE_SCREEN_ORIENTATION_CHANGED`, {
|
|
42833
43035
|
orientation,
|
|
42834
43036
|
rootNode: {
|
|
42835
43037
|
width: this.rootNode?.clientWidth,
|
|
@@ -42844,14 +43046,14 @@ class Player {
|
|
|
42844
43046
|
}
|
|
42845
43047
|
}, null);
|
|
42846
43048
|
core.on(Events$1.CORE_RESIZE, ({ width, height }) => {
|
|
42847
|
-
trace(`${T$
|
|
43049
|
+
trace(`${T$e} on CORE_RESIZE`, {
|
|
42848
43050
|
width,
|
|
42849
43051
|
height,
|
|
42850
43052
|
});
|
|
42851
43053
|
this.safeTriggerEvent(PlayerEvent.Resize, { width, height });
|
|
42852
43054
|
}, null);
|
|
42853
43055
|
core.on(Events$1.CORE_FULLSCREEN, (isFullscreen) => {
|
|
42854
|
-
trace(`${T$
|
|
43056
|
+
trace(`${T$e} CORE_FULLSCREEN`, {
|
|
42855
43057
|
isFullscreen,
|
|
42856
43058
|
});
|
|
42857
43059
|
this.safeTriggerEvent(PlayerEvent.Fullscreen, isFullscreen);
|
|
@@ -42859,7 +43061,7 @@ class Player {
|
|
|
42859
43061
|
}
|
|
42860
43062
|
}
|
|
42861
43063
|
|
|
42862
|
-
var version$1 = "2.20.
|
|
43064
|
+
var version$1 = "2.20.5";
|
|
42863
43065
|
|
|
42864
43066
|
var packages = {
|
|
42865
43067
|
"node_modules/@clappr/core": {
|
|
@@ -43192,7 +43394,7 @@ const volumeOffIcon = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fil
|
|
|
43192
43394
|
|
|
43193
43395
|
const pluginHtml$7 = "<div class=\"big-mute-icon-wrapper\" data-big-mute>\n <div class=\"big-mute-icon gcore-skin-border-color\" data-big-mute-icon></div>\n</div>\n";
|
|
43194
43396
|
|
|
43195
|
-
const T$
|
|
43397
|
+
const T$d = 'plugins.big_mute_button';
|
|
43196
43398
|
// TODO rewrite as a container plugin
|
|
43197
43399
|
/**
|
|
43198
43400
|
* Displays a big mute button over the video when it's muted.
|
|
@@ -43234,7 +43436,7 @@ class BigMuteButton extends UICorePlugin {
|
|
|
43234
43436
|
this.listenTo(this.core, Events$1.CORE_READY, this.onCoreReady);
|
|
43235
43437
|
this.listenTo(this.core, 'core:advertisement:start', this.onStartAd);
|
|
43236
43438
|
this.listenTo(this.core, 'core:advertisement:finish', this.onFinishAd);
|
|
43237
|
-
trace(`${T$
|
|
43439
|
+
trace(`${T$d} bindEvents`, {
|
|
43238
43440
|
mediacontrol: !!this.core.mediaControl,
|
|
43239
43441
|
});
|
|
43240
43442
|
this.listenTo(this.core.mediaControl, Events$1.MEDIACONTROL_RENDERED, this.mediaControlRendered);
|
|
@@ -43259,12 +43461,12 @@ class BigMuteButton extends UICorePlugin {
|
|
|
43259
43461
|
}
|
|
43260
43462
|
mediaControlRendered() {
|
|
43261
43463
|
const container = this.core.activeContainer;
|
|
43262
|
-
trace(`${T$
|
|
43464
|
+
trace(`${T$d} mediaControlRendered`, {
|
|
43263
43465
|
container: !!container,
|
|
43264
43466
|
});
|
|
43265
43467
|
if (container) {
|
|
43266
43468
|
this.listenTo(container.playback, Events$1.PLAYBACK_PLAY, () => {
|
|
43267
|
-
trace(`${T$
|
|
43469
|
+
trace(`${T$d} PLAYBACK_PLAY`);
|
|
43268
43470
|
this.render();
|
|
43269
43471
|
});
|
|
43270
43472
|
}
|
|
@@ -43288,7 +43490,7 @@ class BigMuteButton extends UICorePlugin {
|
|
|
43288
43490
|
}
|
|
43289
43491
|
const { autoPlay, wasMuted } = this.options;
|
|
43290
43492
|
const volume = container.volume;
|
|
43291
|
-
trace(`${T$
|
|
43493
|
+
trace(`${T$d} shouldRender`, {
|
|
43292
43494
|
autoPlay,
|
|
43293
43495
|
wasMuted,
|
|
43294
43496
|
volume,
|
|
@@ -43300,7 +43502,7 @@ class BigMuteButton extends UICorePlugin {
|
|
|
43300
43502
|
*/
|
|
43301
43503
|
render() {
|
|
43302
43504
|
if (this.shouldRender()) {
|
|
43303
|
-
trace(`${T$
|
|
43505
|
+
trace(`${T$d} render`, {
|
|
43304
43506
|
el: !!this.$el,
|
|
43305
43507
|
});
|
|
43306
43508
|
this.$el.html(BigMuteButton.template());
|
|
@@ -43346,7 +43548,7 @@ const gearIcon = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"n
|
|
|
43346
43548
|
const gearHdIcon = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <g clip-path=\"url(#clip0_28_1567)\">\n <path\n d=\"M19.14 12.94C19.18 12.64 19.2 12.33 19.2 12C19.2 11.68 19.18 11.36 19.13 11.06L21.16 9.47999C21.34 9.33999 21.39 9.06999 21.28 8.86999L19.36 5.54999C19.24 5.32999 18.99 5.25999 18.77 5.32999L16.38 6.28999C15.88 5.90999 15.35 5.58999 14.76 5.34999L14.4 2.80999C14.36 2.56999 14.16 2.39999 13.92 2.39999H10.08C9.83999 2.39999 9.64999 2.56999 9.60999 2.80999L9.24999 5.34999C8.65999 5.58999 8.11999 5.91999 7.62999 6.28999L5.23999 5.32999C5.01999 5.24999 4.76999 5.32999 4.64999 5.54999L2.73999 8.86999C2.61999 9.07999 2.65999 9.33999 2.85999 9.47999L4.88999 11.06C4.83999 11.36 4.79999 11.69 4.79999 12C4.79999 12.31 4.81999 12.64 4.86999 12.94L2.83999 14.52C2.65999 14.66 2.60999 14.93 2.71999 15.13L4.63999 18.45C4.75999 18.67 5.00999 18.74 5.22999 18.67L7.61999 17.71C8.11999 18.09 8.64999 18.41 9.23999 18.65L9.59999 21.19C9.64999 21.43 9.83999 21.6 10.08 21.6H13.92C14.16 21.6 14.36 21.43 14.39 21.19L14.75 18.65C15.34 18.41 15.88 18.09 16.37 17.71L18.76 18.67C18.98 18.75 19.23 18.67 19.35 18.45L21.27 15.13C21.39 14.91 21.34 14.66 21.15 14.52L19.14 12.94ZM12 15.6C10.02 15.6 8.39999 13.98 8.39999 12C8.39999 10.02 10.02 8.39999 12 8.39999C13.98 8.39999 15.6 10.02 15.6 12C15.6 13.98 13.98 15.6 12 15.6Z\"\n fill=\"#C9C9C9\"/>\n <rect x=\"13\" width=\"11\" height=\"7\" rx=\"1\" fill=\"#F6413B\"/>\n <path\n d=\"M14.6962 6V1.63636H15.3546V3.53267H17.53V1.63636H18.1905V6H17.53V4.0973H15.3546V6H14.6962ZM20.562 6H19.1493V1.63636H20.6067C21.0343 1.63636 21.4015 1.72372 21.7083 1.89844C22.0151 2.07173 22.2502 2.32102 22.4135 2.64631C22.5783 2.97017 22.6607 3.35866 22.6607 3.81179C22.6607 4.26634 22.5776 4.65696 22.4114 4.98366C22.2466 5.31037 22.008 5.56179 21.6955 5.73793C21.383 5.91264 21.0051 6 20.562 6ZM19.8077 5.42472H20.5257C20.8581 5.42472 21.1344 5.36222 21.3546 5.23722C21.5748 5.1108 21.7395 4.92827 21.8489 4.68963C21.9583 4.44957 22.013 4.15696 22.013 3.81179C22.013 3.46946 21.9583 3.17898 21.8489 2.94034C21.7409 2.7017 21.5797 2.5206 21.3652 2.39702C21.1507 2.27344 20.8844 2.21165 20.5662 2.21165H19.8077V5.42472Z\"\n fill=\"#C9C9C9\"/>\n </g>\n <defs>\n <clipPath id=\"clip0_28_1567\">\n <rect width=\"24\" height=\"24\" fill=\"white\"/>\n </clipPath>\n </defs>\n</svg>\n";
|
|
43347
43549
|
|
|
43348
43550
|
const VERSION$5 = '2.19.12';
|
|
43349
|
-
const T$
|
|
43551
|
+
const T$c = 'plugins.bottom_gear';
|
|
43350
43552
|
/**
|
|
43351
43553
|
* Custom events emitted by the plugin
|
|
43352
43554
|
* @beta
|
|
@@ -43432,11 +43634,11 @@ class BottomGear extends UICorePlugin {
|
|
|
43432
43634
|
this.$el.find('.gear-wrapper').html(content);
|
|
43433
43635
|
}
|
|
43434
43636
|
onActiveContainerChanged() {
|
|
43435
|
-
trace(`${T$
|
|
43637
|
+
trace(`${T$c} onActiveContainerChanged`);
|
|
43436
43638
|
this.bindContainerEvents();
|
|
43437
43639
|
}
|
|
43438
43640
|
bindContainerEvents() {
|
|
43439
|
-
trace(`${T$
|
|
43641
|
+
trace(`${T$c} bindContainerEvents`);
|
|
43440
43642
|
this.listenTo(this.core.activeContainer, Events$1.CONTAINER_HIGHDEFINITIONUPDATE, this.highDefinitionUpdate);
|
|
43441
43643
|
}
|
|
43442
43644
|
highDefinitionUpdate(isHd) {
|
|
@@ -46238,7 +46440,7 @@ class ClapprStats extends ContainerPlugin {
|
|
|
46238
46440
|
//Copyright 2014 Globo.com Player authors. All rights reserved.
|
|
46239
46441
|
// Use of this source code is governed by a BSD-style
|
|
46240
46442
|
// license that can be found at https://github.com/clappr/clappr-plugins/blob/master/LICENSE.
|
|
46241
|
-
const T$
|
|
46443
|
+
const T$b = 'plugins.click_to_pause_custom';
|
|
46242
46444
|
/**
|
|
46243
46445
|
* Adds a behavior of toggling the playback state on click over the container
|
|
46244
46446
|
* @beta
|
|
@@ -46268,7 +46470,7 @@ class ClickToPause extends ContainerPlugin {
|
|
|
46268
46470
|
click() {
|
|
46269
46471
|
const isLivePlayback = this.container.getPlaybackType() === Playback.LIVE;
|
|
46270
46472
|
const isDvrEnabled = this.container.isDvrEnabled();
|
|
46271
|
-
trace(`${T$
|
|
46473
|
+
trace(`${T$b} click`, {
|
|
46272
46474
|
isLivePlayback,
|
|
46273
46475
|
isDvrEnabled,
|
|
46274
46476
|
});
|
|
@@ -46286,7 +46488,7 @@ class ClickToPause extends ContainerPlugin {
|
|
|
46286
46488
|
settingsUpdate() {
|
|
46287
46489
|
const isLivePlayback = this.container.getPlaybackType() === Playback.LIVE;
|
|
46288
46490
|
const pointerEnabled = !isLivePlayback || this.container.isDvrEnabled();
|
|
46289
|
-
trace(`${T$
|
|
46491
|
+
trace(`${T$b} settingsUpdate`, {
|
|
46290
46492
|
isLivePlayback,
|
|
46291
46493
|
pointerEnabled,
|
|
46292
46494
|
});
|
|
@@ -46591,7 +46793,7 @@ class ContextMenu extends UIContainerPlugin {
|
|
|
46591
46793
|
this._url = this.options.contextMenu.url;
|
|
46592
46794
|
}
|
|
46593
46795
|
this.render();
|
|
46594
|
-
this.
|
|
46796
|
+
$('body').on('click', this.hideOnBodyClick);
|
|
46595
46797
|
}
|
|
46596
46798
|
/**
|
|
46597
46799
|
* @internal
|
|
@@ -46599,7 +46801,6 @@ class ContextMenu extends UIContainerPlugin {
|
|
|
46599
46801
|
bindEvents() {
|
|
46600
46802
|
this.listenTo(this.container, Events$1.CONTAINER_CONTEXTMENU, this.toggleContextMenu);
|
|
46601
46803
|
this.listenTo(this.container, Events$1.CONTAINER_CLICK, this.hide);
|
|
46602
|
-
$('body').on('click', this.hideOnBodyClick);
|
|
46603
46804
|
}
|
|
46604
46805
|
/**
|
|
46605
46806
|
* @internal
|
|
@@ -46768,183 +46969,117 @@ class DvrControls extends UICorePlugin {
|
|
|
46768
46969
|
|
|
46769
46970
|
const reloadIcon = "<svg fill=\"#FFFFFF\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z\"/>\n <path d=\"M0 0h24v24H0z\" fill=\"none\"/>\n</svg>";
|
|
46770
46971
|
|
|
46771
|
-
const templateHtml = "<div class=\"player-error-screen__content\" data-error-screen>\n <% if (icon) { %>\n <div class=\"player-error-screen__icon\" data-error-screen><%= icon %></div>\n <% } %>\n <div class=\"player-error-screen__title\" data-error-screen><%= title %></div>\n <% if (message) { %>\n <div class=\"player-error-screen__message\" data-error-screen><%= message %></div>\n <% } %>\n <% if (code) { %>\n <div class=\"player-error-screen__code\" data-error-screen>Error code: <%= code %></div>\n <% } %>\n <div class=\"player-error-screen__reload\" data-error-screen><%= reloadIcon %></div>\n</div>\n";
|
|
46972
|
+
const templateHtml = "<div class=\"player-error-screen__content\" data-error-screen>\n <% if (icon) { %>\n <div class=\"player-error-screen__icon\" data-error-screen><%= icon %></div>\n <% } %>\n <div class=\"player-error-screen__title\" data-error-screen><%= title %></div>\n <% if (message) { %>\n <div class=\"player-error-screen__message\" data-error-screen><%= message %></div>\n <% } %>\n <% if (code) { %>\n <div class=\"player-error-screen__code\" data-error-screen>Error code: <%= code %></div>\n <% } %>\n <% if (reloadIcon) { %>\n <div class=\"player-error-screen__reload\" data-error-screen><%= reloadIcon %></div>\n <% } %>\n</div>\n";
|
|
46772
46973
|
|
|
46773
|
-
const
|
|
46774
|
-
const MAX_RETRY = 10;
|
|
46775
|
-
const T$9 = 'plugins.error_screen';
|
|
46974
|
+
const T$a = 'plugins.error_screen';
|
|
46776
46975
|
/**
|
|
46777
|
-
* Displays
|
|
46976
|
+
* Displays an error nicely in the overlay on top of the player.
|
|
46778
46977
|
* @beta
|
|
46779
46978
|
*/
|
|
46780
46979
|
class ErrorScreen extends UICorePlugin {
|
|
46781
|
-
_retry = 0;
|
|
46782
46980
|
err = null;
|
|
46783
|
-
|
|
46784
|
-
|
|
46785
|
-
|
|
46981
|
+
/**
|
|
46982
|
+
* @internal
|
|
46983
|
+
*/
|
|
46786
46984
|
get name() {
|
|
46787
|
-
return '
|
|
46985
|
+
return 'error_screen';
|
|
46788
46986
|
}
|
|
46987
|
+
/**
|
|
46988
|
+
* @internal
|
|
46989
|
+
*/
|
|
46789
46990
|
get supportedVersion() {
|
|
46790
46991
|
return { min: CLAPPR_VERSION };
|
|
46791
46992
|
}
|
|
46792
|
-
|
|
46793
|
-
|
|
46794
|
-
|
|
46795
|
-
|
|
46796
|
-
return this.core.activeContainer;
|
|
46797
|
-
}
|
|
46993
|
+
static template = tmpl(templateHtml);
|
|
46994
|
+
/**
|
|
46995
|
+
* @internal
|
|
46996
|
+
*/
|
|
46798
46997
|
get attributes() {
|
|
46799
46998
|
return {
|
|
46800
|
-
|
|
46999
|
+
class: 'player-error-screen',
|
|
46801
47000
|
'data-error-screen': '',
|
|
46802
47001
|
};
|
|
46803
47002
|
}
|
|
47003
|
+
/**
|
|
47004
|
+
* @internal
|
|
47005
|
+
*/
|
|
46804
47006
|
bindEvents() {
|
|
46805
47007
|
this.listenTo(this.core, Events$1.ERROR, this.onError);
|
|
46806
|
-
this.listenTo(this.core, Events$1.
|
|
46807
|
-
this.listenTo(this.core, 'core:advertisement:start', this.onStartAd);
|
|
46808
|
-
this.listenTo(this.core, 'core:advertisement:finish', this.onFinishAd);
|
|
46809
|
-
this.listenTo(this.core.mediaControl, Events$1.MEDIACONTROL_CONTAINERCHANGED, this.onContainerChanged);
|
|
46810
|
-
}
|
|
46811
|
-
onCoreReady() {
|
|
46812
|
-
trace(`${T$9} onCoreReady`);
|
|
46813
|
-
if (this.core.activePlayback) {
|
|
46814
|
-
this.listenTo(this.core.activePlayback, Events$1.PLAYBACK_PLAY, this.onPlay);
|
|
46815
|
-
}
|
|
47008
|
+
this.listenTo(this.core, Events$1.CORE_ACTIVE_CONTAINER_CHANGED, this.onActiveContainerChanged);
|
|
46816
47009
|
}
|
|
46817
47010
|
onPlay() {
|
|
46818
|
-
trace(`${T$
|
|
46819
|
-
this.
|
|
47011
|
+
trace(`${T$a} onPlay`);
|
|
47012
|
+
this.unmount();
|
|
46820
47013
|
}
|
|
46821
|
-
|
|
46822
|
-
trace(`${T$
|
|
46823
|
-
this._retry = 0;
|
|
47014
|
+
unmount() {
|
|
47015
|
+
trace(`${T$a} unmount`);
|
|
46824
47016
|
this.err = null;
|
|
46825
|
-
|
|
46826
|
-
|
|
46827
|
-
this.timeout = null;
|
|
46828
|
-
}
|
|
46829
|
-
this.$el.hide();
|
|
46830
|
-
}
|
|
46831
|
-
unBindEvents() {
|
|
46832
|
-
// @ts-ignore
|
|
46833
|
-
this.stopListening(this.core, 'core:advertisement:start');
|
|
46834
|
-
// @ts-ignore
|
|
46835
|
-
this.stopListening(this.core, 'core:advertisement:finish');
|
|
46836
|
-
// @ts-ignore
|
|
46837
|
-
this.stopListening(this.core, Events$1.ERROR);
|
|
47017
|
+
this.$el.empty();
|
|
47018
|
+
// this.$el.hide();
|
|
46838
47019
|
}
|
|
46839
|
-
|
|
46840
|
-
|
|
46841
|
-
|
|
47020
|
+
/**
|
|
47021
|
+
* @internal
|
|
47022
|
+
*/
|
|
47023
|
+
get events() {
|
|
47024
|
+
return {
|
|
47025
|
+
'click .player-error-screen__reload': 'reload',
|
|
47026
|
+
};
|
|
46842
47027
|
}
|
|
46843
47028
|
reload() {
|
|
46844
|
-
|
|
46845
|
-
|
|
46846
|
-
|
|
46847
|
-
|
|
46848
|
-
|
|
46849
|
-
|
|
46850
|
-
|
|
46851
|
-
}
|
|
46852
|
-
unbindReload() {
|
|
46853
|
-
this.reloadButton && this.reloadButton.off('click');
|
|
47029
|
+
setTimeout(() => {
|
|
47030
|
+
this.core.configure({
|
|
47031
|
+
reloading: true,
|
|
47032
|
+
source: this.core.options.source,
|
|
47033
|
+
sources: this.core.options.sources,
|
|
47034
|
+
});
|
|
47035
|
+
}, 0);
|
|
46854
47036
|
}
|
|
46855
|
-
|
|
47037
|
+
onActiveContainerChanged() {
|
|
47038
|
+
trace(`${T$a} onActiveContainerChanged`, {
|
|
47039
|
+
reloading: this.core.options.reloading,
|
|
47040
|
+
});
|
|
46856
47041
|
this.err = null;
|
|
46857
|
-
|
|
46858
|
-
|
|
46859
|
-
|
|
46860
|
-
|
|
46861
|
-
|
|
46862
|
-
|
|
46863
|
-
|
|
46864
|
-
|
|
46865
|
-
|
|
46866
|
-
this.hide();
|
|
46867
|
-
}
|
|
46868
|
-
}
|
|
46869
|
-
onFinishAd() {
|
|
46870
|
-
this.hideValue = false;
|
|
46871
|
-
if (this.err) {
|
|
46872
|
-
this.container.disableMediaControl();
|
|
46873
|
-
this.container.stop();
|
|
46874
|
-
this.show();
|
|
47042
|
+
this.listenTo(this.core.activeContainer.playback, Events$1.PLAYBACK_PLAY, this.onPlay);
|
|
47043
|
+
if (this.core.options.reloading) {
|
|
47044
|
+
setTimeout(() => {
|
|
47045
|
+
this.core.options.reloading = false;
|
|
47046
|
+
this.unmount();
|
|
47047
|
+
this.core.activeContainer.play({
|
|
47048
|
+
reloading: true,
|
|
47049
|
+
});
|
|
47050
|
+
}, 0);
|
|
46875
47051
|
}
|
|
46876
47052
|
}
|
|
46877
47053
|
onError(err) {
|
|
46878
|
-
trace(`${T$
|
|
46879
|
-
if (err.
|
|
46880
|
-
err
|
|
46881
|
-
|
|
47054
|
+
trace(`${T$a} onError`, { err });
|
|
47055
|
+
if (err.UI) {
|
|
47056
|
+
if (this.err) {
|
|
47057
|
+
this.unmount();
|
|
47058
|
+
}
|
|
46882
47059
|
this.err = {
|
|
46883
|
-
title:
|
|
46884
|
-
message:
|
|
46885
|
-
code:
|
|
46886
|
-
|
|
46887
|
-
icon: '',
|
|
46888
|
-
reloadIcon,
|
|
47060
|
+
title: err.UI.title,
|
|
47061
|
+
message: err.UI.message,
|
|
47062
|
+
code: err.code,
|
|
47063
|
+
icon: err.UI.icon,
|
|
46889
47064
|
};
|
|
46890
|
-
|
|
46891
|
-
return;
|
|
46892
|
-
}
|
|
46893
|
-
if (this.options.errorScreen?.neverStopToRetry) {
|
|
46894
|
-
this._retry = 0;
|
|
46895
|
-
}
|
|
46896
|
-
if (this._retry >= MAX_RETRY) {
|
|
46897
|
-
this.drying();
|
|
46898
|
-
return;
|
|
46899
|
-
}
|
|
46900
|
-
const ctp = this.container.getPlugin('click_to_pause_custom');
|
|
46901
|
-
const toggleCTP = !!ctp?.enabled;
|
|
46902
|
-
if (toggleCTP) {
|
|
46903
|
-
// clickToPausePlugin.afterEnabled = true;
|
|
46904
|
-
ctp.disable();
|
|
46905
|
-
}
|
|
46906
|
-
this.timeout = setTimeout(() => {
|
|
46907
|
-
if (toggleCTP) {
|
|
46908
|
-
ctp.enable();
|
|
46909
|
-
}
|
|
46910
|
-
this.reload();
|
|
46911
|
-
}, TIME_FOR_UPDATE);
|
|
46912
|
-
const spinnerPlugin = this.container.getPlugin('spinner');
|
|
46913
|
-
if (spinnerPlugin) {
|
|
46914
|
-
spinnerPlugin.show(); // TODO remove?
|
|
46915
|
-
setTimeout(() => spinnerPlugin.show(), 0);
|
|
46916
|
-
}
|
|
46917
|
-
}
|
|
46918
|
-
}
|
|
46919
|
-
drying() {
|
|
46920
|
-
const spinnerPlugin = this.container.getPlugin('spinner');
|
|
46921
|
-
spinnerPlugin?.hide();
|
|
46922
|
-
this._retry = 0;
|
|
46923
|
-
if (!this.hideValue) {
|
|
46924
|
-
this.container.disableMediaControl();
|
|
46925
|
-
this.container.stop();
|
|
46926
|
-
this.show();
|
|
46927
|
-
}
|
|
46928
|
-
}
|
|
46929
|
-
show(err) {
|
|
46930
|
-
if (err) {
|
|
46931
|
-
this.err = err;
|
|
47065
|
+
this.render();
|
|
46932
47066
|
}
|
|
46933
|
-
// TODO use container.disableMediaControl() instead
|
|
46934
|
-
this.core.mediaControl.disable();
|
|
46935
|
-
this.render();
|
|
46936
|
-
this.$el.show();
|
|
46937
|
-
}
|
|
46938
|
-
hide() {
|
|
46939
|
-
this.$el.hide();
|
|
46940
47067
|
}
|
|
47068
|
+
/**
|
|
47069
|
+
* @internal
|
|
47070
|
+
*/
|
|
46941
47071
|
render() {
|
|
46942
47072
|
if (!this.err) {
|
|
46943
47073
|
return this;
|
|
46944
47074
|
}
|
|
46945
|
-
this.$el.html(
|
|
46946
|
-
|
|
46947
|
-
|
|
47075
|
+
this.$el.html(ErrorScreen.template({
|
|
47076
|
+
...this.err,
|
|
47077
|
+
reloadIcon: this.options.errorScreen?.noReload ? null : reloadIcon,
|
|
47078
|
+
}));
|
|
47079
|
+
// TODO append to container instead of core?
|
|
47080
|
+
if (!this.el.parentElement) {
|
|
47081
|
+
this.core.$el.append(this.el);
|
|
47082
|
+
}
|
|
46948
47083
|
return this;
|
|
46949
47084
|
}
|
|
46950
47085
|
}
|
|
@@ -47388,7 +47523,7 @@ const arrowLeftIcon = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fil
|
|
|
47388
47523
|
|
|
47389
47524
|
const checkIcon = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\"\n d=\"M20.5793 4.19296C20.1216 3.86696 19.4777 3.96396 19.1424 4.40896L9.37295 17.3809L4.81634 12.107C4.45222 11.683 3.80218 11.6289 3.36709 11.9839C2.932 12.3389 2.87543 12.97 3.2416 13.393L8.64165 19.643C8.83708 19.869 9.12506 20 9.42849 20C9.4398 20 9.45114 20 9.46246 19.999C9.77926 19.989 10.0724 19.838 10.2586 19.59L20.8015 5.58996C21.1368 5.14496 21.0371 4.51896 20.5793 4.19296Z\"\n fill=\"#C9C9C9\"/>\n</svg>\n";
|
|
47390
47525
|
|
|
47391
|
-
const T$
|
|
47526
|
+
const T$9 = 'plugins.level_selector';
|
|
47392
47527
|
const VERSION$4 = '2.19.4';
|
|
47393
47528
|
/**
|
|
47394
47529
|
* A {@link MediaControl | media control} plugin that provides a UI to control the quality level of the playback.
|
|
@@ -47490,10 +47625,10 @@ class LevelSelector extends UICorePlugin {
|
|
|
47490
47625
|
}
|
|
47491
47626
|
}
|
|
47492
47627
|
onStop() {
|
|
47493
|
-
trace(`${T$
|
|
47628
|
+
trace(`${T$9} onStop`);
|
|
47494
47629
|
const currentPlayback = this.core.activePlayback;
|
|
47495
47630
|
this.listenToOnce(currentPlayback, Events$1.PLAYBACK_PLAY, () => {
|
|
47496
|
-
trace(`${T$
|
|
47631
|
+
trace(`${T$9} on PLAYBACK_PLAY after stop`, { selectedLevelId: this.selectedLevelId });
|
|
47497
47632
|
if (currentPlayback.getPlaybackType() === 'live') {
|
|
47498
47633
|
if (this.selectedLevelId !== -1) {
|
|
47499
47634
|
currentPlayback.currentLevel = this.selectedLevelId;
|
|
@@ -47589,13 +47724,13 @@ class LevelSelector extends UICorePlugin {
|
|
|
47589
47724
|
return false;
|
|
47590
47725
|
}
|
|
47591
47726
|
goBack() {
|
|
47592
|
-
trace(`${T$
|
|
47727
|
+
trace(`${T$9} goBack`);
|
|
47593
47728
|
this.isOpen = false;
|
|
47594
47729
|
this.core.trigger('gear:refresh');
|
|
47595
47730
|
this.deferRender();
|
|
47596
47731
|
}
|
|
47597
47732
|
setLevel(index) {
|
|
47598
|
-
trace(`${T$
|
|
47733
|
+
trace(`${T$9} setIndexLevel`, { index });
|
|
47599
47734
|
this.selectedLevelId = index;
|
|
47600
47735
|
if (!this.core.activePlayback) {
|
|
47601
47736
|
return;
|
|
@@ -47613,7 +47748,7 @@ class LevelSelector extends UICorePlugin {
|
|
|
47613
47748
|
this.deferRender();
|
|
47614
47749
|
}
|
|
47615
47750
|
onShowLevelSelectMenu() {
|
|
47616
|
-
trace(`${T$
|
|
47751
|
+
trace(`${T$9} onShowLevelSelectMenu`);
|
|
47617
47752
|
this.isOpen = true;
|
|
47618
47753
|
this.renderDropdown();
|
|
47619
47754
|
this.highlightCurrentLevel();
|
|
@@ -47649,11 +47784,11 @@ class LevelSelector extends UICorePlugin {
|
|
|
47649
47784
|
return this.levelLabels[index] ?? formatLevelLabel(this.levels[index]);
|
|
47650
47785
|
}
|
|
47651
47786
|
updateCurrentLevel(info) {
|
|
47652
|
-
trace(`${T$
|
|
47787
|
+
trace(`${T$9} updateCurrentLevel`, { info });
|
|
47653
47788
|
this.highlightCurrentLevel();
|
|
47654
47789
|
}
|
|
47655
47790
|
highlightCurrentLevel() {
|
|
47656
|
-
trace(`${T$
|
|
47791
|
+
trace(`${T$9} highlightCurrentLevel`, {
|
|
47657
47792
|
selectedLevelId: this.selectedLevelId,
|
|
47658
47793
|
});
|
|
47659
47794
|
this.allLevelElements().removeClass('current');
|
|
@@ -47905,6 +48040,7 @@ const fullscreenOnIcon = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\"
|
|
|
47905
48040
|
// Copyright 2014 Globo.com Player authors. All rights reserved.
|
|
47906
48041
|
// Use of this source code is governed by a BSD-style
|
|
47907
48042
|
// license that can be found in the LICENSE file.
|
|
48043
|
+
const T$8 = 'plugins.media_control';
|
|
47908
48044
|
const LEFT_ORDER = [
|
|
47909
48045
|
'playpause',
|
|
47910
48046
|
'playstop',
|
|
@@ -48149,9 +48285,10 @@ class MediaControl extends UICorePlugin {
|
|
|
48149
48285
|
}
|
|
48150
48286
|
}
|
|
48151
48287
|
/**
|
|
48152
|
-
*
|
|
48288
|
+
* Hides the media control UI
|
|
48153
48289
|
*/
|
|
48154
48290
|
disable() {
|
|
48291
|
+
trace(`${T$8} disable`);
|
|
48155
48292
|
this.userDisabled = true;
|
|
48156
48293
|
this.hide();
|
|
48157
48294
|
this.unbindKeyEvents();
|
|
@@ -48161,6 +48298,7 @@ class MediaControl extends UICorePlugin {
|
|
|
48161
48298
|
* Reenables the plugin disabled earlier with the {@link MediaControl.disable} method
|
|
48162
48299
|
*/
|
|
48163
48300
|
enable() {
|
|
48301
|
+
trace(`${T$8} enable`);
|
|
48164
48302
|
if (this.options.chromeless) {
|
|
48165
48303
|
return;
|
|
48166
48304
|
}
|
|
@@ -48838,13 +48976,13 @@ class MediaControl extends UICorePlugin {
|
|
|
48838
48976
|
destroy() {
|
|
48839
48977
|
$(document).unbind('mouseup', this.stopDrag);
|
|
48840
48978
|
$(document).unbind('mousemove', this.updateDrag);
|
|
48979
|
+
$(document).unbind('touchend', this.stopDrag);
|
|
48980
|
+
$(document).unbind('touchmove', this.updateDrag);
|
|
48841
48981
|
this.unbindKeyEvents();
|
|
48842
|
-
// @ts-ignore
|
|
48843
|
-
this.stopListening();
|
|
48844
48982
|
return super.destroy();
|
|
48845
48983
|
}
|
|
48846
48984
|
configure() {
|
|
48847
|
-
this.advertisementPlaying ? this.disable() : this.enable()
|
|
48985
|
+
// this.advertisementPlaying ? this.disable() : this.enable()
|
|
48848
48986
|
this.trigger(Events$1.MEDIACONTROL_OPTIONS_CHANGE);
|
|
48849
48987
|
}
|
|
48850
48988
|
/**
|
|
@@ -49240,13 +49378,12 @@ class MultiCamera extends UICorePlugin {
|
|
|
49240
49378
|
catch (error) {
|
|
49241
49379
|
reportError(error);
|
|
49242
49380
|
}
|
|
49243
|
-
// TODO
|
|
49244
|
-
this.core.getPlugin('
|
|
49381
|
+
// TODO trigger error instead
|
|
49382
|
+
this.core.getPlugin('error_screen')?.show({
|
|
49245
49383
|
title: this.core.i18n.t('source_offline'),
|
|
49246
49384
|
message: '',
|
|
49247
49385
|
code: '',
|
|
49248
49386
|
icon: '',
|
|
49249
|
-
reloadIcon: '',
|
|
49250
49387
|
});
|
|
49251
49388
|
}
|
|
49252
49389
|
hideError() {
|
|
@@ -49716,7 +49853,7 @@ class Poster extends UIContainerPlugin {
|
|
|
49716
49853
|
}
|
|
49717
49854
|
static template = tmpl(posterHTML);
|
|
49718
49855
|
get shouldRender() {
|
|
49719
|
-
if (!this.enabled) {
|
|
49856
|
+
if (!this.enabled || this.options.reloading) {
|
|
49720
49857
|
return false;
|
|
49721
49858
|
}
|
|
49722
49859
|
const showForNoOp = !!this.options.poster?.showForNoOp;
|
|
@@ -50357,6 +50494,7 @@ class SpinnerThreeBounce extends UIContainerPlugin {
|
|
|
50357
50494
|
'class': 'spinner-three-bounce'
|
|
50358
50495
|
};
|
|
50359
50496
|
}
|
|
50497
|
+
hideTimeout = null;
|
|
50360
50498
|
showTimeout = null;
|
|
50361
50499
|
template = tmpl(spinnerHTML);
|
|
50362
50500
|
hasFatalError = false;
|
|
@@ -50412,8 +50550,18 @@ class SpinnerThreeBounce extends UIContainerPlugin {
|
|
|
50412
50550
|
/**
|
|
50413
50551
|
* Shows the spinner
|
|
50414
50552
|
*/
|
|
50415
|
-
show() {
|
|
50416
|
-
|
|
50553
|
+
show(delay = 300) {
|
|
50554
|
+
trace(`${T$4} show`);
|
|
50555
|
+
if (this.showTimeout === null) {
|
|
50556
|
+
if (this.hideTimeout !== null) {
|
|
50557
|
+
clearTimeout(this.hideTimeout);
|
|
50558
|
+
this.hideTimeout = null;
|
|
50559
|
+
}
|
|
50560
|
+
this.showTimeout = setTimeout(() => {
|
|
50561
|
+
this.showTimeout = null;
|
|
50562
|
+
this.$el.show();
|
|
50563
|
+
}, delay);
|
|
50564
|
+
}
|
|
50417
50565
|
}
|
|
50418
50566
|
/**
|
|
50419
50567
|
* Hides the spinner
|
|
@@ -50423,7 +50571,12 @@ class SpinnerThreeBounce extends UIContainerPlugin {
|
|
|
50423
50571
|
clearTimeout(this.showTimeout);
|
|
50424
50572
|
this.showTimeout = null;
|
|
50425
50573
|
}
|
|
50426
|
-
this
|
|
50574
|
+
this.hideTimeout = setTimeout(() => {
|
|
50575
|
+
this.hideTimeout = null;
|
|
50576
|
+
if (this.showTimeout === null) {
|
|
50577
|
+
this.$el.hide();
|
|
50578
|
+
}
|
|
50579
|
+
}, 0);
|
|
50427
50580
|
}
|
|
50428
50581
|
/**
|
|
50429
50582
|
* @internal
|
|
@@ -50546,10 +50699,15 @@ class SourceController extends CorePlugin {
|
|
|
50546
50699
|
*/
|
|
50547
50700
|
bindEvents() {
|
|
50548
50701
|
super.bindEvents();
|
|
50549
|
-
this.listenTo(this.core, Events$1.
|
|
50702
|
+
this.listenTo(this.core, Events$1.CORE_READY, this.onCoreReady);
|
|
50703
|
+
this.listenTo(this.core, Events$1.CORE_ACTIVE_CONTAINER_CHANGED, this.onActiveContainerChanged);
|
|
50550
50704
|
}
|
|
50551
|
-
|
|
50552
|
-
trace(`${T$3}
|
|
50705
|
+
onCoreReady() {
|
|
50706
|
+
trace(`${T$3} onCoreReady`);
|
|
50707
|
+
this.core.getPlugin('error_screen')?.disable(); // TODO test
|
|
50708
|
+
}
|
|
50709
|
+
onActiveContainerChanged() {
|
|
50710
|
+
trace(`${T$3} onActiveContainerChanged`, {
|
|
50553
50711
|
retrying: this.active,
|
|
50554
50712
|
currentSource: this.sourcesList[this.currentSourceIndex],
|
|
50555
50713
|
});
|
|
@@ -50565,7 +50723,7 @@ class SourceController extends CorePlugin {
|
|
|
50565
50723
|
this.bindContainerEventListeners();
|
|
50566
50724
|
if (this.active) {
|
|
50567
50725
|
this.core.activeContainer?.getPlugin('poster_custom')?.disable();
|
|
50568
|
-
spinner?.show();
|
|
50726
|
+
spinner?.show(0);
|
|
50569
50727
|
}
|
|
50570
50728
|
}
|
|
50571
50729
|
bindContainerEventListeners() {
|
|
@@ -50582,7 +50740,7 @@ class SourceController extends CorePlugin {
|
|
|
50582
50740
|
switch (error.code) {
|
|
50583
50741
|
case PlaybackErrorCode.MediaSourceUnavailable:
|
|
50584
50742
|
this.core.activeContainer?.getPlugin('poster_custom')?.disable();
|
|
50585
|
-
this.retryPlayback();
|
|
50743
|
+
setTimeout(() => this.retryPlayback(), 0);
|
|
50586
50744
|
break;
|
|
50587
50745
|
}
|
|
50588
50746
|
});
|
|
@@ -50609,6 +50767,7 @@ class SourceController extends CorePlugin {
|
|
|
50609
50767
|
currentSource: this.sourcesList[this.currentSourceIndex],
|
|
50610
50768
|
});
|
|
50611
50769
|
this.active = true;
|
|
50770
|
+
this.core.activeContainer?.getPlugin('spinner')?.show(0);
|
|
50612
50771
|
this.getNextMediaSource().then((nextSource) => {
|
|
50613
50772
|
trace(`${T$3} retryPlayback syncing...`, {
|
|
50614
50773
|
nextSource,
|