@gcorevideo/player 2.20.3 → 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.
Files changed (108) hide show
  1. package/assets/error-screen/error_screen.ejs +3 -1
  2. package/dist/core.js +436 -210
  3. package/dist/index.css +1223 -1223
  4. package/dist/index.js +580 -392
  5. package/dist/player.d.ts +10 -0
  6. package/dist/plugins/index.css +754 -754
  7. package/dist/plugins/index.js +122 -163
  8. package/docs/api/player.contextmenupluginsettings.label.md +3 -0
  9. package/docs/api/player.contextmenupluginsettings.md +8 -3
  10. package/docs/api/player.contextmenupluginsettings.preventshowcontextmenu.md +3 -0
  11. package/docs/api/player.contextmenupluginsettings.url.md +3 -0
  12. package/docs/api/player.md +6 -2
  13. package/docs/api/player.multicamera._constructor_.md +3 -0
  14. package/docs/api/player.multicamera.activebyid.md +3 -0
  15. package/docs/api/player.multicamera.attributes.md +3 -0
  16. package/docs/api/player.multicamera.bindevents.md +3 -0
  17. package/docs/api/player.multicamera.events.md +3 -0
  18. package/docs/api/player.multicamera.getcameraslist.md +3 -0
  19. package/docs/api/player.multicamera.getcurrentcamera.md +3 -0
  20. package/docs/api/player.multicamera.md +28 -1
  21. package/docs/api/player.multicamera.name.md +3 -0
  22. package/docs/api/player.multicamera.render.md +3 -0
  23. package/docs/api/player.multicamera.supportedversion.md +3 -0
  24. package/docs/api/player.multicamera.template.md +3 -0
  25. package/docs/api/player.multicamera.unbindevents.md +3 -0
  26. package/docs/api/player.multicamera.version.md +3 -0
  27. package/docs/api/player.volumefadeevents.md +7 -0
  28. package/docs/api/player.zeptoresult.md +1 -0
  29. package/lib/Player.d.ts +5 -3
  30. package/lib/Player.d.ts.map +1 -1
  31. package/lib/Player.js +32 -8
  32. package/lib/internal.types.d.ts +7 -7
  33. package/lib/internal.types.d.ts.map +1 -1
  34. package/lib/playback/BasePlayback.d.ts +11 -0
  35. package/lib/playback/BasePlayback.d.ts.map +1 -0
  36. package/lib/playback/BasePlayback.js +33 -0
  37. package/lib/playback/dash-playback/DashPlayback.d.ts +3 -2
  38. package/lib/playback/dash-playback/DashPlayback.d.ts.map +1 -1
  39. package/lib/playback/dash-playback/DashPlayback.js +7 -7
  40. package/lib/playback/hls-playback/HlsPlayback.d.ts +2 -2
  41. package/lib/playback/hls-playback/HlsPlayback.d.ts.map +1 -1
  42. package/lib/playback/hls-playback/HlsPlayback.js +8 -5
  43. package/lib/playback/utils.d.ts +2 -0
  44. package/lib/playback/utils.d.ts.map +1 -0
  45. package/lib/playback/utils.js +1 -0
  46. package/lib/playback.types.d.ts +10 -3
  47. package/lib/playback.types.d.ts.map +1 -1
  48. package/lib/playback.types.js +3 -3
  49. package/lib/plugins/context-menu/ContextMenu.d.ts +4 -0
  50. package/lib/plugins/context-menu/ContextMenu.d.ts.map +1 -1
  51. package/lib/plugins/context-menu/ContextMenu.js +1 -2
  52. package/lib/plugins/error-screen/ErrorScreen.d.ts +39 -24
  53. package/lib/plugins/error-screen/ErrorScreen.d.ts.map +1 -1
  54. package/lib/plugins/error-screen/ErrorScreen.js +70 -136
  55. package/lib/plugins/media-control/MediaControl.d.ts +1 -1
  56. package/lib/plugins/media-control/MediaControl.d.ts.map +1 -1
  57. package/lib/plugins/media-control/MediaControl.js +7 -5
  58. package/lib/plugins/multi-camera/MultiCamera.d.ts +1 -0
  59. package/lib/plugins/multi-camera/MultiCamera.d.ts.map +1 -1
  60. package/lib/plugins/multi-camera/MultiCamera.js +5 -5
  61. package/lib/plugins/poster/Poster.js +1 -1
  62. package/lib/plugins/seek-time/SeekTime.js +1 -1
  63. package/lib/plugins/share/Share.js +1 -1
  64. package/lib/plugins/source-controller/SourceController.d.ts +2 -1
  65. package/lib/plugins/source-controller/SourceController.d.ts.map +1 -1
  66. package/lib/plugins/source-controller/SourceController.js +12 -6
  67. package/lib/plugins/spinner-three-bounce/SpinnerThreeBounce.d.ts +2 -1
  68. package/lib/plugins/spinner-three-bounce/SpinnerThreeBounce.d.ts.map +1 -1
  69. package/lib/plugins/spinner-three-bounce/SpinnerThreeBounce.js +19 -3
  70. package/lib/plugins/volume-fade/VolumeFade.d.ts +4 -0
  71. package/lib/plugins/volume-fade/VolumeFade.d.ts.map +1 -1
  72. package/lib/plugins/volume-fade/VolumeFade.js +4 -0
  73. package/lib/testUtils.d.ts +66 -2
  74. package/lib/testUtils.d.ts.map +1 -1
  75. package/lib/testUtils.js +95 -2
  76. package/lib/types.d.ts +9 -1
  77. package/lib/types.d.ts.map +1 -1
  78. package/lib/utils/types.d.ts +1 -0
  79. package/lib/utils/types.d.ts.map +1 -1
  80. package/package.json +2 -2
  81. package/release_notes +297 -0
  82. package/src/Player.ts +103 -48
  83. package/src/__tests__/Player.test.ts +25 -4
  84. package/src/internal.types.ts +86 -79
  85. package/src/playback/BasePlayback.ts +41 -0
  86. package/src/playback/dash-playback/DashPlayback.ts +11 -15
  87. package/src/playback/hls-playback/HlsPlayback.ts +7 -5
  88. package/src/playback/utils.ts +2 -0
  89. package/src/playback.types.ts +11 -3
  90. package/src/plugins/context-menu/ContextMenu.ts +5 -2
  91. package/src/plugins/error-screen/ErrorScreen.ts +121 -195
  92. package/src/plugins/error-screen/__tests__/ErrorScreen.test.ts +113 -0
  93. package/src/plugins/error-screen/__tests__/__snapshots__/ErrorScreen.test.ts.snap +20 -0
  94. package/src/plugins/level-selector/__tests__/LevelSelector.test.ts +32 -57
  95. package/src/plugins/media-control/MediaControl.ts +8 -5
  96. package/src/plugins/multi-camera/MultiCamera.ts +5 -5
  97. package/src/plugins/poster/Poster.ts +1 -1
  98. package/src/plugins/seek-time/SeekTime.ts +1 -1
  99. package/src/plugins/share/Share.ts +1 -1
  100. package/src/plugins/source-controller/SourceController.ts +20 -14
  101. package/src/plugins/source-controller/__tests__/SourceController.test.ts +29 -46
  102. package/src/plugins/spinner-three-bounce/SpinnerThreeBounce.ts +20 -3
  103. package/src/plugins/volume-fade/VolumeFade.ts +4 -0
  104. package/src/testUtils.ts +100 -3
  105. package/src/types.ts +11 -1
  106. package/src/utils/types.ts +1 -0
  107. package/temp/player.api.json +24 -24
  108. 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$1 = noop$1;
11155
+ var on = noop$1;
11156
11156
  var addListener = noop$1;
11157
- var once$1 = noop$1;
11158
- var off$1 = noop$1;
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$1 = noop$1;
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$1,
11214
+ on: on,
11215
11215
  addListener: addListener,
11216
- once: once$1,
11217
- off: off$1,
11216
+ once: once,
11217
+ off: off,
11218
11218
  removeListener: removeListener,
11219
11219
  removeAllListeners: removeAllListeners,
11220
- emit: emit$1,
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
- * event-lite.js - Light-weight EventEmitter (less than 1KB when gzipped)
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
- // (function(EventLite) {
12145
- // export the class for node.js
12146
- // if ("undefined" !== typeof module) module.exports = EventLite;
12121
+ var eventemitter3$1 = {exports: {}};
12147
12122
 
12148
- // property name to hold listeners
12149
- var LISTENERS = "listeners";
12123
+ var hasRequiredEventemitter3;
12150
12124
 
12151
- // methods to export
12152
- var methods = {
12153
- on: on,
12154
- once: once,
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
- // mixin to self
12160
- mixin(EventLite.prototype);
12130
+ var has = Object.prototype.hasOwnProperty
12131
+ , prefix = '~';
12161
12132
 
12162
- // export mixin function
12163
- EventLite.mixin = mixin;
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
- * Import on(), once(), off() and emit() methods into target object.
12167
- *
12168
- * @function EventLite.mixin
12169
- * @param target {Prototype}
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
- function mixin(target) {
12173
- for (var key in methods) {
12174
- target[key] = methods[key];
12175
- }
12176
- return target;
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
- * Add an event listener.
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
- function on(type, func) {
12189
- getListeners(this, type).push(func);
12190
- return this;
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
- * Add one-time event listener.
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
- function once(type, func) {
12203
- var that = this;
12204
- wrap.originalListener = func;
12205
- getListeners(that, type).push(wrap);
12206
- return that;
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
- function wrap() {
12209
- off.call(that, type, wrap);
12210
- func.apply(this, arguments);
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
- * Remove an event listener.
12216
- *
12217
- * @function EventLite.prototype.off
12218
- * @param [type] {string}
12219
- * @param [func] {Function}
12220
- * @returns {EventLite} Self for method chaining
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
- function off(type, func) {
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
- function ne(test) {
12245
- return test !== func && test.originalListener !== func;
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
- * Dispatch (trigger) an event.
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
- function emit(type, value) {
12259
- var that = this;
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
- function zeroarg(func) {
12274
- func.call(that);
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
- function onearg(func) {
12278
- func.call(that, value);
12279
- }
12260
+ if (!handlers) return [];
12261
+ if (handlers.fn) return [handlers.fn];
12280
12262
 
12281
- function moreargs(func) {
12282
- func.apply(that, args);
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
- * @ignore
12288
- */
12267
+ return ee;
12268
+ };
12289
12269
 
12290
- function getListeners(that, type, readonly) {
12291
- if (readonly && !that[LISTENERS]) return;
12292
- var listeners = that[LISTENERS] || (that[LISTENERS] = {});
12293
- return listeners[type] || (listeners[type] = []);
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
+ };
12295
12441
 
12296
- // })(EventLite);
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;
12452
+
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[PlaybackErrorCode["Generic"] = 0] = "Generic";
12615
+ PlaybackErrorCode["Generic"] = "GENERIC_ERROR";
12447
12616
  /**
12448
12617
  * The media source is not available. Typically a network error.
12449
12618
  */
12450
- PlaybackErrorCode[PlaybackErrorCode["MediaSourceUnavailable"] = 1] = "MediaSourceUnavailable";
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[PlaybackErrorCode["MediaSourceAccessDenied"] = 3] = "MediaSourceAccessDenied";
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$f = 'playback.dash';
12663
+ const T$g = 'playback.dash';
12463
12664
  // @ts-expect-error
12464
- class DashPlayback extends HTML5Video {
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$f} _onPlaybackError`, { event });
12933
+ trace(`${T$g} _onPlaybackError`, { event });
12733
12934
  };
12734
12935
  _onDASHJSSError = (event) => {
12735
- trace(`${T$f} _onDASHJSSError`, { event });
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$f} triggerError`, { error });
12771
- this.trigger(Events$1.PLAYBACK_ERROR, {
12772
- ...error,
12773
- origin: this.name,
12774
- scope: DashPlayback.type,
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$f} dvrEnable no dash player instance`);
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$f} play`, { dash: !!this._dash });
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 in the LICENSE file.
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$e = 'playback.hls';
41779
+ const T$f = 'playback.hls';
41580
41780
  // @ts-expect-error
41581
- class HlsPlayback extends HTML5Video {
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$e} _createHLSInstance`, { config });
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$e} _recover failed to recover`, {
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$e} _onHLSJSError`, {
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$e} _onHLSJSError trying to recover from network error`, {
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$e} _onHLSJSError trying to recover from media error`, {
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$e} _onHLSJSError non-fatal error occurred`, {
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$d = 'GPlayer';
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 EventLite();
42626
+ emitter = new EventEmitter$1();
42425
42627
  player = null;
42426
42628
  ready = false;
42427
42629
  rootNode = null;
@@ -42494,8 +42696,8 @@ class Player {
42494
42696
  Log.setLevel(0);
42495
42697
  }
42496
42698
  const coreOpts = this.buildCoreOptions(playerElement);
42497
- const { core, container } = Loader.registeredPlugins;
42498
- trace(`${T$d} init`, {
42699
+ const { core, container } = Player.getRegisteredPlugins();
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$d} destroy`, {
42714
+ trace(`${T$e} destroy`, {
42513
42715
  player: !!this.player,
42514
42716
  });
42515
42717
  if (this.player) {
@@ -42656,20 +42858,42 @@ class Player {
42656
42858
  * ```
42657
42859
  */
42658
42860
  static registerPlugin(plugin) {
42861
+ assert.ok(plugin.type === 'core' || plugin.type === 'container', 'Invalid plugin type');
42862
+ if (plugin.type === 'core') {
42863
+ if (plugin.prototype.name === 'media_control') {
42864
+ Player.corePlugins.unshift(plugin);
42865
+ }
42866
+ else {
42867
+ Player.corePlugins.push(plugin);
42868
+ }
42869
+ return;
42870
+ }
42659
42871
  Loader.registerPlugin(plugin);
42660
42872
  }
42873
+ static getRegisteredPlugins() {
42874
+ for (const plugin of Player.corePlugins) {
42875
+ Loader.registerPlugin(plugin);
42876
+ }
42877
+ return Loader.registeredPlugins;
42878
+ }
42879
+ static corePlugins = [];
42661
42880
  /**
42662
42881
  * Unregisters a plugin registered earlier with {@link Player.registerPlugin}.
42663
42882
  * @param plugin - a plugin class
42664
42883
  */
42665
42884
  static unregisterPlugin(plugin) {
42885
+ assert.ok(plugin.type === 'core' || plugin.type === 'container', 'Invalid plugin type');
42886
+ if (plugin.type === 'core') {
42887
+ Player.corePlugins = Player.corePlugins.filter((p) => p !== plugin);
42888
+ return;
42889
+ }
42666
42890
  Loader.unregisterPlugin(plugin);
42667
42891
  }
42668
42892
  setConfig(config) {
42669
42893
  this.config = $.extend(true, this.config, config);
42670
42894
  }
42671
42895
  initPlayer(coreOptions) {
42672
- trace(`${T$d} initPlayer`, {
42896
+ trace(`${T$e} initPlayer`, {
42673
42897
  autoPlay: coreOptions.autoPlay,
42674
42898
  sources: coreOptions.sources,
42675
42899
  // TODO selected options
@@ -42694,7 +42918,7 @@ class Player {
42694
42918
  }
42695
42919
  }
42696
42920
  triggerAutoPlay() {
42697
- trace(`${T$d} triggerAutoPlay`);
42921
+ trace(`${T$e} triggerAutoPlay`);
42698
42922
  setTimeout(() => {
42699
42923
  this.player?.play({
42700
42924
  autoPlay: true,
@@ -42712,7 +42936,7 @@ class Player {
42712
42936
  // TODO test
42713
42937
  events = {
42714
42938
  onReady: () => {
42715
- trace(`${T$d} onReady`, {
42939
+ trace(`${T$e} onReady`, {
42716
42940
  ready: this.ready,
42717
42941
  });
42718
42942
  if (this.ready) {
@@ -42746,7 +42970,7 @@ class Player {
42746
42970
  buildCoreOptions(rootNode) {
42747
42971
  const sources = this.buildMediaSourcesList();
42748
42972
  const source = sources[0];
42749
- trace(`${T$d} buildCoreOptions`, {
42973
+ trace(`${T$e} buildCoreOptions`, {
42750
42974
  source,
42751
42975
  sources,
42752
42976
  });
@@ -42803,9 +43027,11 @@ class Player {
42803
43027
  }, null);
42804
43028
  }
42805
43029
  bindCoreListeners() {
42806
- const core = this.player?.core;
42807
- core?.on(Events$1.CORE_SCREEN_ORIENTATION_CHANGED, ({ orientation }) => {
42808
- trace(`${T$d} on CORE_SCREEN_ORIENTATION_CHANGED`, {
43030
+ // TODO create an class inherited from PlayerClappr
43031
+ assert.ok(this.player, 'Player is not initialized');
43032
+ const core = this.player.core;
43033
+ core.on(Events$1.CORE_SCREEN_ORIENTATION_CHANGED, ({ orientation }) => {
43034
+ trace(`${T$e} on CORE_SCREEN_ORIENTATION_CHANGED`, {
42809
43035
  orientation,
42810
43036
  rootNode: {
42811
43037
  width: this.rootNode?.clientWidth,
@@ -42819,15 +43045,15 @@ class Player {
42819
43045
  });
42820
43046
  }
42821
43047
  }, null);
42822
- core?.on(Events$1.CORE_RESIZE, ({ width, height }) => {
42823
- trace(`${T$d} on CORE_RESIZE`, {
43048
+ core.on(Events$1.CORE_RESIZE, ({ width, height }) => {
43049
+ trace(`${T$e} on CORE_RESIZE`, {
42824
43050
  width,
42825
43051
  height,
42826
43052
  });
42827
43053
  this.safeTriggerEvent(PlayerEvent.Resize, { width, height });
42828
43054
  }, null);
42829
- core?.on(Events$1.CORE_FULLSCREEN, (isFullscreen) => {
42830
- trace(`${T$d} CORE_FULLSCREEN`, {
43055
+ core.on(Events$1.CORE_FULLSCREEN, (isFullscreen) => {
43056
+ trace(`${T$e} CORE_FULLSCREEN`, {
42831
43057
  isFullscreen,
42832
43058
  });
42833
43059
  this.safeTriggerEvent(PlayerEvent.Fullscreen, isFullscreen);
@@ -42835,7 +43061,7 @@ class Player {
42835
43061
  }
42836
43062
  }
42837
43063
 
42838
- var version$1 = "2.20.3";
43064
+ var version$1 = "2.20.5";
42839
43065
 
42840
43066
  var packages = {
42841
43067
  "node_modules/@clappr/core": {
@@ -43168,7 +43394,7 @@ const volumeOffIcon = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fil
43168
43394
 
43169
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";
43170
43396
 
43171
- const T$c = 'plugins.big_mute_button';
43397
+ const T$d = 'plugins.big_mute_button';
43172
43398
  // TODO rewrite as a container plugin
43173
43399
  /**
43174
43400
  * Displays a big mute button over the video when it's muted.
@@ -43210,7 +43436,7 @@ class BigMuteButton extends UICorePlugin {
43210
43436
  this.listenTo(this.core, Events$1.CORE_READY, this.onCoreReady);
43211
43437
  this.listenTo(this.core, 'core:advertisement:start', this.onStartAd);
43212
43438
  this.listenTo(this.core, 'core:advertisement:finish', this.onFinishAd);
43213
- trace(`${T$c} bindEvents`, {
43439
+ trace(`${T$d} bindEvents`, {
43214
43440
  mediacontrol: !!this.core.mediaControl,
43215
43441
  });
43216
43442
  this.listenTo(this.core.mediaControl, Events$1.MEDIACONTROL_RENDERED, this.mediaControlRendered);
@@ -43235,12 +43461,12 @@ class BigMuteButton extends UICorePlugin {
43235
43461
  }
43236
43462
  mediaControlRendered() {
43237
43463
  const container = this.core.activeContainer;
43238
- trace(`${T$c} mediaControlRendered`, {
43464
+ trace(`${T$d} mediaControlRendered`, {
43239
43465
  container: !!container,
43240
43466
  });
43241
43467
  if (container) {
43242
43468
  this.listenTo(container.playback, Events$1.PLAYBACK_PLAY, () => {
43243
- trace(`${T$c} PLAYBACK_PLAY`);
43469
+ trace(`${T$d} PLAYBACK_PLAY`);
43244
43470
  this.render();
43245
43471
  });
43246
43472
  }
@@ -43264,7 +43490,7 @@ class BigMuteButton extends UICorePlugin {
43264
43490
  }
43265
43491
  const { autoPlay, wasMuted } = this.options;
43266
43492
  const volume = container.volume;
43267
- trace(`${T$c} shouldRender`, {
43493
+ trace(`${T$d} shouldRender`, {
43268
43494
  autoPlay,
43269
43495
  wasMuted,
43270
43496
  volume,
@@ -43276,7 +43502,7 @@ class BigMuteButton extends UICorePlugin {
43276
43502
  */
43277
43503
  render() {
43278
43504
  if (this.shouldRender()) {
43279
- trace(`${T$c} render`, {
43505
+ trace(`${T$d} render`, {
43280
43506
  el: !!this.$el,
43281
43507
  });
43282
43508
  this.$el.html(BigMuteButton.template());
@@ -43322,7 +43548,7 @@ const gearIcon = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"n
43322
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";
43323
43549
 
43324
43550
  const VERSION$5 = '2.19.12';
43325
- const T$b = 'plugins.bottom_gear';
43551
+ const T$c = 'plugins.bottom_gear';
43326
43552
  /**
43327
43553
  * Custom events emitted by the plugin
43328
43554
  * @beta
@@ -43408,11 +43634,11 @@ class BottomGear extends UICorePlugin {
43408
43634
  this.$el.find('.gear-wrapper').html(content);
43409
43635
  }
43410
43636
  onActiveContainerChanged() {
43411
- trace(`${T$b} onActiveContainerChanged`);
43637
+ trace(`${T$c} onActiveContainerChanged`);
43412
43638
  this.bindContainerEvents();
43413
43639
  }
43414
43640
  bindContainerEvents() {
43415
- trace(`${T$b} bindContainerEvents`);
43641
+ trace(`${T$c} bindContainerEvents`);
43416
43642
  this.listenTo(this.core.activeContainer, Events$1.CONTAINER_HIGHDEFINITIONUPDATE, this.highDefinitionUpdate);
43417
43643
  }
43418
43644
  highDefinitionUpdate(isHd) {
@@ -46214,7 +46440,7 @@ class ClapprStats extends ContainerPlugin {
46214
46440
  //Copyright 2014 Globo.com Player authors. All rights reserved.
46215
46441
  // Use of this source code is governed by a BSD-style
46216
46442
  // license that can be found at https://github.com/clappr/clappr-plugins/blob/master/LICENSE.
46217
- const T$a = 'plugins.click_to_pause_custom';
46443
+ const T$b = 'plugins.click_to_pause_custom';
46218
46444
  /**
46219
46445
  * Adds a behavior of toggling the playback state on click over the container
46220
46446
  * @beta
@@ -46244,7 +46470,7 @@ class ClickToPause extends ContainerPlugin {
46244
46470
  click() {
46245
46471
  const isLivePlayback = this.container.getPlaybackType() === Playback.LIVE;
46246
46472
  const isDvrEnabled = this.container.isDvrEnabled();
46247
- trace(`${T$a} click`, {
46473
+ trace(`${T$b} click`, {
46248
46474
  isLivePlayback,
46249
46475
  isDvrEnabled,
46250
46476
  });
@@ -46262,7 +46488,7 @@ class ClickToPause extends ContainerPlugin {
46262
46488
  settingsUpdate() {
46263
46489
  const isLivePlayback = this.container.getPlaybackType() === Playback.LIVE;
46264
46490
  const pointerEnabled = !isLivePlayback || this.container.isDvrEnabled();
46265
- trace(`${T$a} settingsUpdate`, {
46491
+ trace(`${T$b} settingsUpdate`, {
46266
46492
  isLivePlayback,
46267
46493
  pointerEnabled,
46268
46494
  });
@@ -46567,7 +46793,7 @@ class ContextMenu extends UIContainerPlugin {
46567
46793
  this._url = this.options.contextMenu.url;
46568
46794
  }
46569
46795
  this.render();
46570
- this.bindEvents();
46796
+ $('body').on('click', this.hideOnBodyClick);
46571
46797
  }
46572
46798
  /**
46573
46799
  * @internal
@@ -46575,7 +46801,6 @@ class ContextMenu extends UIContainerPlugin {
46575
46801
  bindEvents() {
46576
46802
  this.listenTo(this.container, Events$1.CONTAINER_CONTEXTMENU, this.toggleContextMenu);
46577
46803
  this.listenTo(this.container, Events$1.CONTAINER_CLICK, this.hide);
46578
- $('body').on('click', this.hideOnBodyClick);
46579
46804
  }
46580
46805
  /**
46581
46806
  * @internal
@@ -46744,183 +46969,117 @@ class DvrControls extends UICorePlugin {
46744
46969
 
46745
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>";
46746
46971
 
46747
- 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";
46748
46973
 
46749
- const TIME_FOR_UPDATE = 10000;
46750
- const MAX_RETRY = 10;
46751
- const T$9 = 'plugins.error_screen';
46974
+ const T$a = 'plugins.error_screen';
46752
46975
  /**
46753
- * Displays a descriptive error in the overlay on top of the player.
46976
+ * Displays an error nicely in the overlay on top of the player.
46754
46977
  * @beta
46755
46978
  */
46756
46979
  class ErrorScreen extends UICorePlugin {
46757
- _retry = 0;
46758
46980
  err = null;
46759
- hideValue = false;
46760
- timeout = null;
46761
- reloadButton = null;
46981
+ /**
46982
+ * @internal
46983
+ */
46762
46984
  get name() {
46763
- return 'error_gplayer';
46985
+ return 'error_screen';
46764
46986
  }
46987
+ /**
46988
+ * @internal
46989
+ */
46765
46990
  get supportedVersion() {
46766
46991
  return { min: CLAPPR_VERSION };
46767
46992
  }
46768
- get template() {
46769
- return tmpl(templateHtml);
46770
- }
46771
- get container() {
46772
- return this.core.activeContainer;
46773
- }
46993
+ static template = tmpl(templateHtml);
46994
+ /**
46995
+ * @internal
46996
+ */
46774
46997
  get attributes() {
46775
46998
  return {
46776
- 'class': 'player-error-screen',
46999
+ class: 'player-error-screen',
46777
47000
  'data-error-screen': '',
46778
47001
  };
46779
47002
  }
47003
+ /**
47004
+ * @internal
47005
+ */
46780
47006
  bindEvents() {
46781
47007
  this.listenTo(this.core, Events$1.ERROR, this.onError);
46782
- this.listenTo(this.core, Events$1.CORE_READY, this.onCoreReady);
46783
- this.listenTo(this.core, 'core:advertisement:start', this.onStartAd);
46784
- this.listenTo(this.core, 'core:advertisement:finish', this.onFinishAd);
46785
- this.listenTo(this.core.mediaControl, Events$1.MEDIACONTROL_CONTAINERCHANGED, this.onContainerChanged);
46786
- }
46787
- onCoreReady() {
46788
- trace(`${T$9} onCoreReady`);
46789
- if (this.core.activePlayback) {
46790
- this.listenTo(this.core.activePlayback, Events$1.PLAYBACK_PLAY, this.onPlay);
46791
- }
47008
+ this.listenTo(this.core, Events$1.CORE_ACTIVE_CONTAINER_CHANGED, this.onActiveContainerChanged);
46792
47009
  }
46793
47010
  onPlay() {
46794
- trace(`${T$9} onPlay`);
46795
- this.destroyError();
47011
+ trace(`${T$a} onPlay`);
47012
+ this.unmount();
46796
47013
  }
46797
- destroyError() {
46798
- trace(`${T$9} destroyError`);
46799
- this._retry = 0;
47014
+ unmount() {
47015
+ trace(`${T$a} unmount`);
46800
47016
  this.err = null;
46801
- if (this.timeout !== null) {
46802
- clearTimeout(this.timeout);
46803
- this.timeout = null;
46804
- }
46805
- this.$el.hide();
47017
+ this.$el.empty();
47018
+ // this.$el.hide();
46806
47019
  }
46807
- unBindEvents() {
46808
- // @ts-ignore
46809
- this.stopListening(this.core, 'core:advertisement:start');
46810
- // @ts-ignore
46811
- this.stopListening(this.core, 'core:advertisement:finish');
46812
- // @ts-ignore
46813
- this.stopListening(this.core, Events$1.ERROR);
46814
- }
46815
- bindReload() {
46816
- this.reloadButton = this.$el.find('.player-error-screen__reload');
46817
- this.reloadButton && this.reloadButton.on('click', this.reload.bind(this));
47020
+ /**
47021
+ * @internal
47022
+ */
47023
+ get events() {
47024
+ return {
47025
+ 'click .player-error-screen__reload': 'reload',
47026
+ };
46818
47027
  }
46819
47028
  reload() {
46820
- this._retry++;
46821
- this.core.configure({
46822
- ...this.options,
46823
- autoPlay: true
46824
- });
46825
- this.core.activeContainer.mediaControlDisabled = false;
46826
- this.unbindReload();
46827
- }
46828
- unbindReload() {
46829
- 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);
46830
47036
  }
46831
- onContainerChanged() {
47037
+ onActiveContainerChanged() {
47038
+ trace(`${T$a} onActiveContainerChanged`, {
47039
+ reloading: this.core.options.reloading,
47040
+ });
46832
47041
  this.err = null;
46833
- if (this.core.getPlugin('error_screen')) {
46834
- this.core.getPlugin('error_screen').disable();
46835
- }
46836
- this.unbindReload();
46837
- this.hide();
46838
- }
46839
- onStartAd() {
46840
- this.hideValue = true;
46841
- if (this.err) {
46842
- this.hide();
46843
- }
46844
- }
46845
- onFinishAd() {
46846
- this.hideValue = false;
46847
- if (this.err) {
46848
- this.container.disableMediaControl();
46849
- this.container.stop();
46850
- 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);
46851
47051
  }
46852
47052
  }
46853
47053
  onError(err) {
46854
- trace(`${T$9} onError`, { err });
46855
- if (err.level === PlayerError.Levels.FATAL ||
46856
- err.details === 'bufferStalledError' ||
46857
- err.details === 'manifestParsingError') {
47054
+ trace(`${T$a} onError`, { err });
47055
+ if (err.UI) {
47056
+ if (this.err) {
47057
+ this.unmount();
47058
+ }
46858
47059
  this.err = {
46859
- title: this.core.i18n.t('no_broadcast'),
46860
- message: '',
46861
- code: '',
46862
- // icon: (this.err.UI && this.err.UI.icon) || '',
46863
- icon: '',
46864
- reloadIcon,
47060
+ title: err.UI.title,
47061
+ message: err.UI.message,
47062
+ code: err.code,
47063
+ icon: err.UI.icon,
46865
47064
  };
46866
- if (this.options.errorScreen?.reloadOnError === false) {
46867
- return;
46868
- }
46869
- if (this.options.errorScreen?.neverStopToRetry) {
46870
- this._retry = 0;
46871
- }
46872
- if (this._retry >= MAX_RETRY) {
46873
- this.drying();
46874
- return;
46875
- }
46876
- const ctp = this.container.getPlugin('click_to_pause_custom');
46877
- const toggleCTP = !!ctp?.enabled;
46878
- if (toggleCTP) {
46879
- // clickToPausePlugin.afterEnabled = true;
46880
- ctp.disable();
46881
- }
46882
- this.timeout = setTimeout(() => {
46883
- if (toggleCTP) {
46884
- ctp.enable();
46885
- }
46886
- this.reload();
46887
- }, TIME_FOR_UPDATE);
46888
- const spinnerPlugin = this.container.getPlugin('spinner');
46889
- if (spinnerPlugin) {
46890
- spinnerPlugin.show(); // TODO remove?
46891
- setTimeout(() => spinnerPlugin.show(), 0);
46892
- }
46893
- }
46894
- }
46895
- drying() {
46896
- const spinnerPlugin = this.container.getPlugin('spinner');
46897
- spinnerPlugin?.hide();
46898
- this._retry = 0;
46899
- if (!this.hideValue) {
46900
- this.container.disableMediaControl();
46901
- this.container.stop();
46902
- this.show();
46903
- }
46904
- }
46905
- show(err) {
46906
- if (err) {
46907
- this.err = err;
47065
+ this.render();
46908
47066
  }
46909
- // TODO use container.disableMediaControl() instead
46910
- this.core.mediaControl.disable();
46911
- this.render();
46912
- this.$el.show();
46913
- }
46914
- hide() {
46915
- this.$el.hide();
46916
47067
  }
47068
+ /**
47069
+ * @internal
47070
+ */
46917
47071
  render() {
46918
47072
  if (!this.err) {
46919
47073
  return this;
46920
47074
  }
46921
- this.$el.html(this.template(this.err));
46922
- this.core.$el.append(this.el);
46923
- this.bindReload();
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
+ }
46924
47083
  return this;
46925
47084
  }
46926
47085
  }
@@ -47364,7 +47523,7 @@ const arrowLeftIcon = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fil
47364
47523
 
47365
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";
47366
47525
 
47367
- const T$8 = 'plugins.level_selector';
47526
+ const T$9 = 'plugins.level_selector';
47368
47527
  const VERSION$4 = '2.19.4';
47369
47528
  /**
47370
47529
  * A {@link MediaControl | media control} plugin that provides a UI to control the quality level of the playback.
@@ -47466,10 +47625,10 @@ class LevelSelector extends UICorePlugin {
47466
47625
  }
47467
47626
  }
47468
47627
  onStop() {
47469
- trace(`${T$8} onStop`);
47628
+ trace(`${T$9} onStop`);
47470
47629
  const currentPlayback = this.core.activePlayback;
47471
47630
  this.listenToOnce(currentPlayback, Events$1.PLAYBACK_PLAY, () => {
47472
- trace(`${T$8} on PLAYBACK_PLAY after stop`, { selectedLevelId: this.selectedLevelId });
47631
+ trace(`${T$9} on PLAYBACK_PLAY after stop`, { selectedLevelId: this.selectedLevelId });
47473
47632
  if (currentPlayback.getPlaybackType() === 'live') {
47474
47633
  if (this.selectedLevelId !== -1) {
47475
47634
  currentPlayback.currentLevel = this.selectedLevelId;
@@ -47565,13 +47724,13 @@ class LevelSelector extends UICorePlugin {
47565
47724
  return false;
47566
47725
  }
47567
47726
  goBack() {
47568
- trace(`${T$8} goBack`);
47727
+ trace(`${T$9} goBack`);
47569
47728
  this.isOpen = false;
47570
47729
  this.core.trigger('gear:refresh');
47571
47730
  this.deferRender();
47572
47731
  }
47573
47732
  setLevel(index) {
47574
- trace(`${T$8} setIndexLevel`, { index });
47733
+ trace(`${T$9} setIndexLevel`, { index });
47575
47734
  this.selectedLevelId = index;
47576
47735
  if (!this.core.activePlayback) {
47577
47736
  return;
@@ -47589,7 +47748,7 @@ class LevelSelector extends UICorePlugin {
47589
47748
  this.deferRender();
47590
47749
  }
47591
47750
  onShowLevelSelectMenu() {
47592
- trace(`${T$8} onShowLevelSelectMenu`);
47751
+ trace(`${T$9} onShowLevelSelectMenu`);
47593
47752
  this.isOpen = true;
47594
47753
  this.renderDropdown();
47595
47754
  this.highlightCurrentLevel();
@@ -47625,11 +47784,11 @@ class LevelSelector extends UICorePlugin {
47625
47784
  return this.levelLabels[index] ?? formatLevelLabel(this.levels[index]);
47626
47785
  }
47627
47786
  updateCurrentLevel(info) {
47628
- trace(`${T$8} updateCurrentLevel`, { info });
47787
+ trace(`${T$9} updateCurrentLevel`, { info });
47629
47788
  this.highlightCurrentLevel();
47630
47789
  }
47631
47790
  highlightCurrentLevel() {
47632
- trace(`${T$8} highlightCurrentLevel`, {
47791
+ trace(`${T$9} highlightCurrentLevel`, {
47633
47792
  selectedLevelId: this.selectedLevelId,
47634
47793
  });
47635
47794
  this.allLevelElements().removeClass('current');
@@ -47881,6 +48040,7 @@ const fullscreenOnIcon = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\"
47881
48040
  // Copyright 2014 Globo.com Player authors. All rights reserved.
47882
48041
  // Use of this source code is governed by a BSD-style
47883
48042
  // license that can be found in the LICENSE file.
48043
+ const T$8 = 'plugins.media_control';
47884
48044
  const LEFT_ORDER = [
47885
48045
  'playpause',
47886
48046
  'playstop',
@@ -48125,9 +48285,10 @@ class MediaControl extends UICorePlugin {
48125
48285
  }
48126
48286
  }
48127
48287
  /**
48128
- * Disables the plugin and unmounts its UI
48288
+ * Hides the media control UI
48129
48289
  */
48130
48290
  disable() {
48291
+ trace(`${T$8} disable`);
48131
48292
  this.userDisabled = true;
48132
48293
  this.hide();
48133
48294
  this.unbindKeyEvents();
@@ -48137,6 +48298,7 @@ class MediaControl extends UICorePlugin {
48137
48298
  * Reenables the plugin disabled earlier with the {@link MediaControl.disable} method
48138
48299
  */
48139
48300
  enable() {
48301
+ trace(`${T$8} enable`);
48140
48302
  if (this.options.chromeless) {
48141
48303
  return;
48142
48304
  }
@@ -48814,13 +48976,13 @@ class MediaControl extends UICorePlugin {
48814
48976
  destroy() {
48815
48977
  $(document).unbind('mouseup', this.stopDrag);
48816
48978
  $(document).unbind('mousemove', this.updateDrag);
48979
+ $(document).unbind('touchend', this.stopDrag);
48980
+ $(document).unbind('touchmove', this.updateDrag);
48817
48981
  this.unbindKeyEvents();
48818
- // @ts-ignore
48819
- this.stopListening();
48820
48982
  return super.destroy();
48821
48983
  }
48822
48984
  configure() {
48823
- this.advertisementPlaying ? this.disable() : this.enable();
48985
+ // this.advertisementPlaying ? this.disable() : this.enable()
48824
48986
  this.trigger(Events$1.MEDIACONTROL_OPTIONS_CHANGE);
48825
48987
  }
48826
48988
  /**
@@ -48961,9 +49123,10 @@ const streamsMomentoIcon = "<svg id=\"Слой_1\" data-name=\"Слой 1\" xmln
48961
49123
  const streamsWhiteNightsIcon = "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"50\" height=\"50\" viewBox=\"0 0 50 50\">\n <defs>\n <clipPath id=\"clip-Icon\">\n <rect width=\"50\" height=\"50\"/>\n </clipPath>\n </defs>\n <g id=\"Icon\" clip-path=\"url(#clip-Icon)\">\n <g id=\"icon2\" transform=\"translate(-0.041 0)\">\n <path id=\"Контур_77\" data-name=\"Контур 77\" d=\"M6.493,13v8.266h6.275V19.74H8.31V17.714h4.006V16.3H8.31V14.53h4.365V13Zm7.5,0v8.266h1.7V15.732h.023l3.438,5.534h1.818V13h-1.7v5.545h-.023L15.8,13Z\" fill=\"#fff\"/>\n <path id=\"Контур_76\" data-name=\"Контур 76\" d=\"M29.949,29.1V26.774H31.94a1.4,1.4,0,0,1,.938.272,1.1,1.1,0,0,1,.313.874,1.155,1.155,0,0,1-.313.9,1.375,1.375,0,0,1-.938.278ZM28.132,25.36v8.266h1.817V30.4h1.818a1.353,1.353,0,0,1,.984.3,1.637,1.637,0,0,1,.394.949c.046.333.079.681.1,1.042a3.2,3.2,0,0,0,.185.938h1.819a1.218,1.218,0,0,1-.191-.423,3.611,3.611,0,0,1-.093-.527c-.019-.185-.033-.367-.041-.544s-.016-.332-.023-.463a5.052,5.052,0,0,0-.087-.625,2.109,2.109,0,0,0-.2-.573,1.586,1.586,0,0,0-.359-.451,1.414,1.414,0,0,0-.556-.284v-.023a1.926,1.926,0,0,0,1-.81,2.494,2.494,0,0,0,.307-1.262,2.308,2.308,0,0,0-.165-.88,2.128,2.128,0,0,0-.486-.724,2.3,2.3,0,0,0-.764-.492,2.67,2.67,0,0,0-1-.179ZM43.506,30.5V25.36H41.689V30.5a2.065,2.065,0,0,1-.37,1.36,1.7,1.7,0,0,1-1.343.434,2.086,2.086,0,0,1-.886-.156,1.283,1.283,0,0,1-.758-.978,3.748,3.748,0,0,1-.058-.66V25.36H36.456V30.5a3.16,3.16,0,0,0,.92,2.5,3.807,3.807,0,0,0,2.6.81,3.82,3.82,0,0,0,2.593-.816,3.132,3.132,0,0,0,.937-2.492Z\" fill=\"#fff\"/>\n <path id=\"Контур_80\" data-name=\"Контур 80\" d=\"M22.646,31.2H4.689a4.505,4.505,0,0,1-4.5-4.5V8.5A4.505,4.505,0,0,1,4.689,4h18.2a4.505,4.505,0,0,1,4.5,4.5v8.445l-.893.1a3.184,3.184,0,0,0-2.846,3.177V30.5l-.465.7ZM4.689,6a2.5,2.5,0,0,0-2.5,2.5V26.7a2.5,2.5,0,0,0,2.5,2.5H21.65V20.22a5.18,5.18,0,0,1,3.739-4.992V8.5a2.5,2.5,0,0,0-2.5-2.5Z\" fill=\"#fff\"/>\n <path id=\"Контур_81\" data-name=\"Контур 81\" d=\"M30.127,47.884a1,1,0,0,1-1-1V43.267H26.846a5.206,5.206,0,0,1-5.2-5.2V20.222a5.206,5.206,0,0,1,5.2-5.2H44.692a5.206,5.206,0,0,1,5.2,5.2V38.068a5.206,5.206,0,0,1-5.2,5.2H35.058l-4.216,4.316A1,1,0,0,1,30.127,47.884ZM26.846,17.022a3.2,3.2,0,0,0-3.2,3.2V38.067a3.2,3.2,0,0,0,3.2,3.2h3.281a1,1,0,0,1,1,1v2.162l2.8-2.86a1,1,0,0,1,.715-.3H44.692a3.2,3.2,0,0,0,3.2-3.2V20.222a3.2,3.2,0,0,0-3.2-3.2Z\" fill=\"#fff\"/>\n </g>\n </g>\n</svg>\n";
48962
49124
 
48963
49125
  const VERSION$3 = '0.0.1';
48964
- const T$7 = 'plugins.media_control_multicamera';
49126
+ const T$7 = 'plugins.multicamera';
48965
49127
  /**
48966
49128
  * The plugin adds support for loading multiple streams and switching between them using the media control UI.
49129
+ * @beta
48967
49130
  */
48968
49131
  class MultiCamera extends UICorePlugin {
48969
49132
  currentCamera = null;
@@ -48972,7 +49135,7 @@ class MultiCamera extends UICorePlugin {
48972
49135
  multicamera = [];
48973
49136
  noActiveStreams = false;
48974
49137
  get name() {
48975
- return 'media_control_multicamera';
49138
+ return 'multicamera';
48976
49139
  }
48977
49140
  get supportedVersion() {
48978
49141
  return { min: CLAPPR_VERSION };
@@ -49215,13 +49378,12 @@ class MultiCamera extends UICorePlugin {
49215
49378
  catch (error) {
49216
49379
  reportError(error);
49217
49380
  }
49218
- // TODO figure out
49219
- this.core.getPlugin('error_gplayer')?.show({
49381
+ // TODO trigger error instead
49382
+ this.core.getPlugin('error_screen')?.show({
49220
49383
  title: this.core.i18n.t('source_offline'),
49221
49384
  message: '',
49222
49385
  code: '',
49223
49386
  icon: '',
49224
- reloadIcon: '',
49225
49387
  });
49226
49388
  }
49227
49389
  hideError() {
@@ -49691,7 +49853,7 @@ class Poster extends UIContainerPlugin {
49691
49853
  }
49692
49854
  static template = tmpl(posterHTML);
49693
49855
  get shouldRender() {
49694
- if (!this.enabled) {
49856
+ if (!this.enabled || this.options.reloading) {
49695
49857
  return false;
49696
49858
  }
49697
49859
  const showForNoOp = !!this.options.poster?.showForNoOp;
@@ -49927,7 +50089,7 @@ const { formatTime } = Utils;
49927
50089
  */
49928
50090
  class SeekTime extends UICorePlugin {
49929
50091
  get name() {
49930
- return 'media_control_seek_time';
50092
+ return 'seek_time';
49931
50093
  }
49932
50094
  get supportedVersion() {
49933
50095
  return { min: CLAPPR_VERSION };
@@ -50088,7 +50250,7 @@ class Share extends UICorePlugin {
50088
50250
  hide = false;
50089
50251
  container = null;
50090
50252
  get name() {
50091
- return 'media_control_share';
50253
+ return 'share';
50092
50254
  }
50093
50255
  get supportedVersion() {
50094
50256
  return { min: CLAPPR_VERSION };
@@ -50332,6 +50494,7 @@ class SpinnerThreeBounce extends UIContainerPlugin {
50332
50494
  'class': 'spinner-three-bounce'
50333
50495
  };
50334
50496
  }
50497
+ hideTimeout = null;
50335
50498
  showTimeout = null;
50336
50499
  template = tmpl(spinnerHTML);
50337
50500
  hasFatalError = false;
@@ -50387,8 +50550,18 @@ class SpinnerThreeBounce extends UIContainerPlugin {
50387
50550
  /**
50388
50551
  * Shows the spinner
50389
50552
  */
50390
- show() {
50391
- this.showTimeout = setTimeout(() => this.$el.show(), 300);
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
+ }
50392
50565
  }
50393
50566
  /**
50394
50567
  * Hides the spinner
@@ -50398,7 +50571,12 @@ class SpinnerThreeBounce extends UIContainerPlugin {
50398
50571
  clearTimeout(this.showTimeout);
50399
50572
  this.showTimeout = null;
50400
50573
  }
50401
- this.$el.hide();
50574
+ this.hideTimeout = setTimeout(() => {
50575
+ this.hideTimeout = null;
50576
+ if (this.showTimeout === null) {
50577
+ this.$el.hide();
50578
+ }
50579
+ }, 0);
50402
50580
  }
50403
50581
  /**
50404
50582
  * @internal
@@ -50521,10 +50699,15 @@ class SourceController extends CorePlugin {
50521
50699
  */
50522
50700
  bindEvents() {
50523
50701
  super.bindEvents();
50524
- this.listenTo(this.core, Events$1.CORE_ACTIVE_CONTAINER_CHANGED, () => this.onReady());
50702
+ this.listenTo(this.core, Events$1.CORE_READY, this.onCoreReady);
50703
+ this.listenTo(this.core, Events$1.CORE_ACTIVE_CONTAINER_CHANGED, this.onActiveContainerChanged);
50525
50704
  }
50526
- onReady() {
50527
- trace(`${T$3} onReady`, {
50705
+ onCoreReady() {
50706
+ trace(`${T$3} onCoreReady`);
50707
+ this.core.getPlugin('error_screen')?.disable(); // TODO test
50708
+ }
50709
+ onActiveContainerChanged() {
50710
+ trace(`${T$3} onActiveContainerChanged`, {
50528
50711
  retrying: this.active,
50529
50712
  currentSource: this.sourcesList[this.currentSourceIndex],
50530
50713
  });
@@ -50540,7 +50723,7 @@ class SourceController extends CorePlugin {
50540
50723
  this.bindContainerEventListeners();
50541
50724
  if (this.active) {
50542
50725
  this.core.activeContainer?.getPlugin('poster_custom')?.disable();
50543
- spinner?.show();
50726
+ spinner?.show(0);
50544
50727
  }
50545
50728
  }
50546
50729
  bindContainerEventListeners() {
@@ -50557,7 +50740,7 @@ class SourceController extends CorePlugin {
50557
50740
  switch (error.code) {
50558
50741
  case PlaybackErrorCode.MediaSourceUnavailable:
50559
50742
  this.core.activeContainer?.getPlugin('poster_custom')?.disable();
50560
- this.retryPlayback();
50743
+ setTimeout(() => this.retryPlayback(), 0);
50561
50744
  break;
50562
50745
  }
50563
50746
  });
@@ -50584,6 +50767,7 @@ class SourceController extends CorePlugin {
50584
50767
  currentSource: this.sourcesList[this.currentSourceIndex],
50585
50768
  });
50586
50769
  this.active = true;
50770
+ this.core.activeContainer?.getPlugin('spinner')?.show(0);
50587
50771
  this.getNextMediaSource().then((nextSource) => {
50588
50772
  trace(`${T$3} retryPlayback syncing...`, {
50589
50773
  nextSource,
@@ -51731,6 +51915,10 @@ class Thumbnails extends UICorePlugin {
51731
51915
  }
51732
51916
  }
51733
51917
 
51918
+ /**
51919
+ * Events emitted by the VolumeFade plugin.
51920
+ * @beta
51921
+ */
51734
51922
  var VolumeFadeEvents;
51735
51923
  (function (VolumeFadeEvents) {
51736
51924
  VolumeFadeEvents["FADE"] = "core:volume:fade";