@gcorevideo/player 2.20.4 → 2.20.6
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 +1285 -1285
- package/dist/index.js +550 -386
- package/dist/plugins/index.css +966 -966
- package/dist/plugins/index.js +121 -162
- 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 +69 -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 +16 -8
- 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 +12 -17
- package/src/playback/hls-playback/HlsPlayback.ts +9 -7
- package/src/playback.types.ts +11 -3
- package/src/plugins/context-menu/ContextMenu.ts +1 -2
- package/src/plugins/error-screen/ErrorScreen.ts +120 -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 +16 -8
- 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/plugins/index.js
CHANGED
|
@@ -32649,7 +32649,7 @@ const volumeOffIcon = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fil
|
|
|
32649
32649
|
|
|
32650
32650
|
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";
|
|
32651
32651
|
|
|
32652
|
-
const T$
|
|
32652
|
+
const T$a = 'plugins.big_mute_button';
|
|
32653
32653
|
// TODO rewrite as a container plugin
|
|
32654
32654
|
/**
|
|
32655
32655
|
* Displays a big mute button over the video when it's muted.
|
|
@@ -32691,7 +32691,7 @@ class BigMuteButton extends UICorePlugin {
|
|
|
32691
32691
|
this.listenTo(this.core, Events$1.CORE_READY, this.onCoreReady);
|
|
32692
32692
|
this.listenTo(this.core, 'core:advertisement:start', this.onStartAd);
|
|
32693
32693
|
this.listenTo(this.core, 'core:advertisement:finish', this.onFinishAd);
|
|
32694
|
-
trace(`${T$
|
|
32694
|
+
trace(`${T$a} bindEvents`, {
|
|
32695
32695
|
mediacontrol: !!this.core.mediaControl,
|
|
32696
32696
|
});
|
|
32697
32697
|
this.listenTo(this.core.mediaControl, Events$1.MEDIACONTROL_RENDERED, this.mediaControlRendered);
|
|
@@ -32748,7 +32748,7 @@ class BigMuteButton extends UICorePlugin {
|
|
|
32748
32748
|
*/
|
|
32749
32749
|
render() {
|
|
32750
32750
|
if (this.shouldRender()) {
|
|
32751
|
-
trace(`${T$
|
|
32751
|
+
trace(`${T$a} render`, {
|
|
32752
32752
|
el: !!this.$el,
|
|
32753
32753
|
});
|
|
32754
32754
|
this.$el.html(BigMuteButton.template());
|
|
@@ -35958,7 +35958,7 @@ class ClipsPlugin extends UICorePlugin {
|
|
|
35958
35958
|
|
|
35959
35959
|
const templateHtml$1 = "<ul class=\"context-menu-list\">\n <% if(options) { %>\n <% for (var i = 0; i < options.length; i++) { %>\n <li class=\"context-menu-list-item <%= options[i].class %>\"\n data-<%= options[i].name %>><%= options[i].label %></li>\n <% } %>\n <% } %>\n</ul>\n";
|
|
35960
35960
|
|
|
35961
|
-
var version$1 = "2.20.
|
|
35961
|
+
var version$1 = "2.20.6";
|
|
35962
35962
|
|
|
35963
35963
|
var packages = {
|
|
35964
35964
|
"node_modules/@clappr/core": {
|
|
@@ -36040,7 +36040,7 @@ class ContextMenu extends UIContainerPlugin {
|
|
|
36040
36040
|
this._url = this.options.contextMenu.url;
|
|
36041
36041
|
}
|
|
36042
36042
|
this.render();
|
|
36043
|
-
this.
|
|
36043
|
+
$('body').on('click', this.hideOnBodyClick);
|
|
36044
36044
|
}
|
|
36045
36045
|
/**
|
|
36046
36046
|
* @internal
|
|
@@ -36048,7 +36048,6 @@ class ContextMenu extends UIContainerPlugin {
|
|
|
36048
36048
|
bindEvents() {
|
|
36049
36049
|
this.listenTo(this.container, Events$1.CONTAINER_CONTEXTMENU, this.toggleContextMenu);
|
|
36050
36050
|
this.listenTo(this.container, Events$1.CONTAINER_CLICK, this.hide);
|
|
36051
|
-
$('body').on('click', this.hideOnBodyClick);
|
|
36052
36051
|
}
|
|
36053
36052
|
/**
|
|
36054
36053
|
* @internal
|
|
@@ -36217,178 +36216,113 @@ class DvrControls extends UICorePlugin {
|
|
|
36217
36216
|
|
|
36218
36217
|
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>";
|
|
36219
36218
|
|
|
36220
|
-
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";
|
|
36219
|
+
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";
|
|
36221
36220
|
|
|
36222
|
-
const
|
|
36223
|
-
const MAX_RETRY = 10;
|
|
36221
|
+
const T$9 = 'plugins.error_screen';
|
|
36224
36222
|
/**
|
|
36225
|
-
* Displays
|
|
36223
|
+
* Displays an error nicely in the overlay on top of the player.
|
|
36226
36224
|
* @beta
|
|
36227
36225
|
*/
|
|
36228
36226
|
class ErrorScreen extends UICorePlugin {
|
|
36229
|
-
_retry = 0;
|
|
36230
36227
|
err = null;
|
|
36231
|
-
|
|
36232
|
-
|
|
36233
|
-
|
|
36228
|
+
/**
|
|
36229
|
+
* @internal
|
|
36230
|
+
*/
|
|
36234
36231
|
get name() {
|
|
36235
|
-
return '
|
|
36232
|
+
return 'error_screen';
|
|
36236
36233
|
}
|
|
36234
|
+
/**
|
|
36235
|
+
* @internal
|
|
36236
|
+
*/
|
|
36237
36237
|
get supportedVersion() {
|
|
36238
36238
|
return { min: CLAPPR_VERSION };
|
|
36239
36239
|
}
|
|
36240
|
-
|
|
36241
|
-
|
|
36242
|
-
|
|
36243
|
-
|
|
36244
|
-
return this.core.activeContainer;
|
|
36245
|
-
}
|
|
36240
|
+
static template = tmpl(templateHtml);
|
|
36241
|
+
/**
|
|
36242
|
+
* @internal
|
|
36243
|
+
*/
|
|
36246
36244
|
get attributes() {
|
|
36247
36245
|
return {
|
|
36248
|
-
|
|
36246
|
+
class: 'player-error-screen',
|
|
36249
36247
|
'data-error-screen': '',
|
|
36250
36248
|
};
|
|
36251
36249
|
}
|
|
36250
|
+
/**
|
|
36251
|
+
* @internal
|
|
36252
|
+
*/
|
|
36252
36253
|
bindEvents() {
|
|
36253
36254
|
this.listenTo(this.core, Events$1.ERROR, this.onError);
|
|
36254
|
-
this.listenTo(this.core, Events$1.
|
|
36255
|
-
this.listenTo(this.core, 'core:advertisement:start', this.onStartAd);
|
|
36256
|
-
this.listenTo(this.core, 'core:advertisement:finish', this.onFinishAd);
|
|
36257
|
-
this.listenTo(this.core.mediaControl, Events$1.MEDIACONTROL_CONTAINERCHANGED, this.onContainerChanged);
|
|
36258
|
-
}
|
|
36259
|
-
onCoreReady() {
|
|
36260
|
-
if (this.core.activePlayback) {
|
|
36261
|
-
this.listenTo(this.core.activePlayback, Events$1.PLAYBACK_PLAY, this.onPlay);
|
|
36262
|
-
}
|
|
36255
|
+
this.listenTo(this.core, Events$1.CORE_ACTIVE_CONTAINER_CHANGED, this.onActiveContainerChanged);
|
|
36263
36256
|
}
|
|
36264
36257
|
onPlay() {
|
|
36265
|
-
this.
|
|
36258
|
+
this.unmount();
|
|
36266
36259
|
}
|
|
36267
|
-
|
|
36268
|
-
this._retry = 0;
|
|
36260
|
+
unmount() {
|
|
36269
36261
|
this.err = null;
|
|
36270
|
-
|
|
36271
|
-
clearTimeout(this.timeout);
|
|
36272
|
-
this.timeout = null;
|
|
36273
|
-
}
|
|
36274
|
-
this.$el.hide();
|
|
36275
|
-
}
|
|
36276
|
-
unBindEvents() {
|
|
36277
|
-
// @ts-ignore
|
|
36278
|
-
this.stopListening(this.core, 'core:advertisement:start');
|
|
36279
|
-
// @ts-ignore
|
|
36280
|
-
this.stopListening(this.core, 'core:advertisement:finish');
|
|
36281
|
-
// @ts-ignore
|
|
36282
|
-
this.stopListening(this.core, Events$1.ERROR);
|
|
36262
|
+
this.$el.remove();
|
|
36283
36263
|
}
|
|
36284
|
-
|
|
36285
|
-
|
|
36286
|
-
|
|
36264
|
+
/**
|
|
36265
|
+
* @internal
|
|
36266
|
+
*/
|
|
36267
|
+
get events() {
|
|
36268
|
+
return {
|
|
36269
|
+
'click .player-error-screen__reload': 'reload',
|
|
36270
|
+
};
|
|
36287
36271
|
}
|
|
36288
36272
|
reload() {
|
|
36289
|
-
|
|
36290
|
-
|
|
36291
|
-
|
|
36292
|
-
|
|
36293
|
-
|
|
36294
|
-
|
|
36295
|
-
|
|
36296
|
-
}
|
|
36297
|
-
unbindReload() {
|
|
36298
|
-
this.reloadButton && this.reloadButton.off('click');
|
|
36273
|
+
setTimeout(() => {
|
|
36274
|
+
this.core.configure({
|
|
36275
|
+
reloading: true,
|
|
36276
|
+
source: this.core.options.source,
|
|
36277
|
+
sources: this.core.options.sources,
|
|
36278
|
+
});
|
|
36279
|
+
}, 0);
|
|
36299
36280
|
}
|
|
36300
|
-
|
|
36281
|
+
onActiveContainerChanged() {
|
|
36282
|
+
trace(`${T$9} onActiveContainerChanged`, {
|
|
36283
|
+
reloading: this.core.options.reloading,
|
|
36284
|
+
});
|
|
36301
36285
|
this.err = null;
|
|
36302
|
-
|
|
36303
|
-
|
|
36304
|
-
|
|
36305
|
-
|
|
36306
|
-
|
|
36307
|
-
|
|
36308
|
-
|
|
36309
|
-
|
|
36310
|
-
|
|
36311
|
-
this.hide();
|
|
36312
|
-
}
|
|
36313
|
-
}
|
|
36314
|
-
onFinishAd() {
|
|
36315
|
-
this.hideValue = false;
|
|
36316
|
-
if (this.err) {
|
|
36317
|
-
this.container.disableMediaControl();
|
|
36318
|
-
this.container.stop();
|
|
36319
|
-
this.show();
|
|
36286
|
+
this.listenTo(this.core.activeContainer.playback, Events$1.PLAYBACK_PLAY, this.onPlay);
|
|
36287
|
+
if (this.core.options.reloading) {
|
|
36288
|
+
setTimeout(() => {
|
|
36289
|
+
this.core.options.reloading = false;
|
|
36290
|
+
this.unmount();
|
|
36291
|
+
this.core.activeContainer.play({
|
|
36292
|
+
reloading: true,
|
|
36293
|
+
});
|
|
36294
|
+
}, 0);
|
|
36320
36295
|
}
|
|
36321
36296
|
}
|
|
36322
36297
|
onError(err) {
|
|
36323
|
-
if (err.
|
|
36324
|
-
err
|
|
36325
|
-
|
|
36298
|
+
if (err.UI) {
|
|
36299
|
+
if (this.err) {
|
|
36300
|
+
this.unmount();
|
|
36301
|
+
}
|
|
36326
36302
|
this.err = {
|
|
36327
|
-
title:
|
|
36328
|
-
message:
|
|
36329
|
-
code:
|
|
36330
|
-
|
|
36331
|
-
icon: '',
|
|
36332
|
-
reloadIcon,
|
|
36303
|
+
title: err.UI.title,
|
|
36304
|
+
message: err.UI.message,
|
|
36305
|
+
code: err.code,
|
|
36306
|
+
icon: err.UI.icon,
|
|
36333
36307
|
};
|
|
36334
|
-
|
|
36335
|
-
return;
|
|
36336
|
-
}
|
|
36337
|
-
if (this.options.errorScreen?.neverStopToRetry) {
|
|
36338
|
-
this._retry = 0;
|
|
36339
|
-
}
|
|
36340
|
-
if (this._retry >= MAX_RETRY) {
|
|
36341
|
-
this.drying();
|
|
36342
|
-
return;
|
|
36343
|
-
}
|
|
36344
|
-
const ctp = this.container.getPlugin('click_to_pause_custom');
|
|
36345
|
-
const toggleCTP = !!ctp?.enabled;
|
|
36346
|
-
if (toggleCTP) {
|
|
36347
|
-
// clickToPausePlugin.afterEnabled = true;
|
|
36348
|
-
ctp.disable();
|
|
36349
|
-
}
|
|
36350
|
-
this.timeout = setTimeout(() => {
|
|
36351
|
-
if (toggleCTP) {
|
|
36352
|
-
ctp.enable();
|
|
36353
|
-
}
|
|
36354
|
-
this.reload();
|
|
36355
|
-
}, TIME_FOR_UPDATE);
|
|
36356
|
-
const spinnerPlugin = this.container.getPlugin('spinner');
|
|
36357
|
-
if (spinnerPlugin) {
|
|
36358
|
-
spinnerPlugin.show(); // TODO remove?
|
|
36359
|
-
setTimeout(() => spinnerPlugin.show(), 0);
|
|
36360
|
-
}
|
|
36361
|
-
}
|
|
36362
|
-
}
|
|
36363
|
-
drying() {
|
|
36364
|
-
const spinnerPlugin = this.container.getPlugin('spinner');
|
|
36365
|
-
spinnerPlugin?.hide();
|
|
36366
|
-
this._retry = 0;
|
|
36367
|
-
if (!this.hideValue) {
|
|
36368
|
-
this.container.disableMediaControl();
|
|
36369
|
-
this.container.stop();
|
|
36370
|
-
this.show();
|
|
36371
|
-
}
|
|
36372
|
-
}
|
|
36373
|
-
show(err) {
|
|
36374
|
-
if (err) {
|
|
36375
|
-
this.err = err;
|
|
36308
|
+
this.render();
|
|
36376
36309
|
}
|
|
36377
|
-
// TODO use container.disableMediaControl() instead
|
|
36378
|
-
this.core.mediaControl.disable();
|
|
36379
|
-
this.render();
|
|
36380
|
-
this.$el.show();
|
|
36381
|
-
}
|
|
36382
|
-
hide() {
|
|
36383
|
-
this.$el.hide();
|
|
36384
36310
|
}
|
|
36311
|
+
/**
|
|
36312
|
+
* @internal
|
|
36313
|
+
*/
|
|
36385
36314
|
render() {
|
|
36386
36315
|
if (!this.err) {
|
|
36387
36316
|
return this;
|
|
36388
36317
|
}
|
|
36389
|
-
this.$el.html(
|
|
36390
|
-
|
|
36391
|
-
|
|
36318
|
+
this.$el.html(ErrorScreen.template({
|
|
36319
|
+
...this.err,
|
|
36320
|
+
reloadIcon: this.options.errorScreen?.noReload ? null : reloadIcon,
|
|
36321
|
+
}));
|
|
36322
|
+
// TODO append to container instead of core?
|
|
36323
|
+
if (!this.el.parentElement) {
|
|
36324
|
+
this.core.$el.append(this.el);
|
|
36325
|
+
}
|
|
36392
36326
|
return this;
|
|
36393
36327
|
}
|
|
36394
36328
|
}
|
|
@@ -37587,10 +37521,10 @@ class MediaControl extends UICorePlugin {
|
|
|
37587
37521
|
}
|
|
37588
37522
|
}
|
|
37589
37523
|
/**
|
|
37590
|
-
*
|
|
37524
|
+
* Hides the media control UI
|
|
37591
37525
|
*/
|
|
37592
37526
|
disable() {
|
|
37593
|
-
this.userDisabled = true;
|
|
37527
|
+
this.userDisabled = true; // TODO distinguish between user and system (e.g., unplayable) disabled?
|
|
37594
37528
|
this.hide();
|
|
37595
37529
|
this.unbindKeyEvents();
|
|
37596
37530
|
this.$el.hide();
|
|
@@ -37855,8 +37789,14 @@ class MediaControl extends UICorePlugin {
|
|
|
37855
37789
|
this.settingsUpdate();
|
|
37856
37790
|
this.core.activeContainer &&
|
|
37857
37791
|
this.core.activeContainer.trigger(Events$1.CONTAINER_PLAYBACKDVRSTATECHANGED, this.core.activeContainer.isDvrInUse());
|
|
37858
|
-
|
|
37859
|
-
this.
|
|
37792
|
+
// TODO test
|
|
37793
|
+
if (this.core.activeContainer.mediaControlDisabled) {
|
|
37794
|
+
this.disable();
|
|
37795
|
+
}
|
|
37796
|
+
else {
|
|
37797
|
+
this.enable();
|
|
37798
|
+
}
|
|
37799
|
+
this.trigger(Events$1.MEDIACONTROL_CONTAINERCHANGED); // TODO check
|
|
37860
37800
|
if (this.core.activeContainer.$el) {
|
|
37861
37801
|
this.core.activeContainer.$el.addClass('container-skin-1');
|
|
37862
37802
|
}
|
|
@@ -38275,13 +38215,13 @@ class MediaControl extends UICorePlugin {
|
|
|
38275
38215
|
destroy() {
|
|
38276
38216
|
$(document).unbind('mouseup', this.stopDrag);
|
|
38277
38217
|
$(document).unbind('mousemove', this.updateDrag);
|
|
38218
|
+
$(document).unbind('touchend', this.stopDrag);
|
|
38219
|
+
$(document).unbind('touchmove', this.updateDrag);
|
|
38278
38220
|
this.unbindKeyEvents();
|
|
38279
|
-
// @ts-ignore
|
|
38280
|
-
this.stopListening();
|
|
38281
38221
|
return super.destroy();
|
|
38282
38222
|
}
|
|
38283
38223
|
configure() {
|
|
38284
|
-
this.advertisementPlaying ? this.disable() : this.enable()
|
|
38224
|
+
// this.advertisementPlaying ? this.disable() : this.enable()
|
|
38285
38225
|
this.trigger(Events$1.MEDIACONTROL_OPTIONS_CHANGE);
|
|
38286
38226
|
}
|
|
38287
38227
|
/**
|
|
@@ -38673,13 +38613,12 @@ class MultiCamera extends UICorePlugin {
|
|
|
38673
38613
|
}
|
|
38674
38614
|
catch (error) {
|
|
38675
38615
|
}
|
|
38676
|
-
// TODO
|
|
38677
|
-
this.core.getPlugin('
|
|
38616
|
+
// TODO trigger error instead
|
|
38617
|
+
this.core.getPlugin('error_screen')?.show({
|
|
38678
38618
|
title: this.core.i18n.t('source_offline'),
|
|
38679
38619
|
message: '',
|
|
38680
38620
|
code: '',
|
|
38681
38621
|
icon: '',
|
|
38682
|
-
reloadIcon: '',
|
|
38683
38622
|
});
|
|
38684
38623
|
}
|
|
38685
38624
|
hideError() {
|
|
@@ -39140,7 +39079,7 @@ class Poster extends UIContainerPlugin {
|
|
|
39140
39079
|
}
|
|
39141
39080
|
static template = tmpl(posterHTML);
|
|
39142
39081
|
get shouldRender() {
|
|
39143
|
-
if (!this.enabled) {
|
|
39082
|
+
if (!this.enabled || this.options.reloading) {
|
|
39144
39083
|
return false;
|
|
39145
39084
|
}
|
|
39146
39085
|
const showForNoOp = !!this.options.poster?.showForNoOp;
|
|
@@ -39740,15 +39679,15 @@ var PlaybackErrorCode;
|
|
|
39740
39679
|
/**
|
|
39741
39680
|
* An unknown or uncategorised error.
|
|
39742
39681
|
*/
|
|
39743
|
-
PlaybackErrorCode[
|
|
39682
|
+
PlaybackErrorCode["Generic"] = "GENERIC_ERROR";
|
|
39744
39683
|
/**
|
|
39745
39684
|
* The media source is not available. Typically a network error.
|
|
39746
39685
|
*/
|
|
39747
|
-
PlaybackErrorCode[
|
|
39686
|
+
PlaybackErrorCode["MediaSourceUnavailable"] = "MEDIA_SOURCE_UNAVAILABLE";
|
|
39748
39687
|
/**
|
|
39749
39688
|
* The media source is not accessible due to some protection policy.
|
|
39750
39689
|
*/
|
|
39751
|
-
PlaybackErrorCode[
|
|
39690
|
+
PlaybackErrorCode["MediaSourceAccessDenied"] = "MEDIA_SOURCE_ACCESS_DENIED";
|
|
39752
39691
|
})(PlaybackErrorCode || (PlaybackErrorCode = {}));
|
|
39753
39692
|
|
|
39754
39693
|
const spinnerHTML = "<div data-bounce1></div>\n<div data-bounce2></div>\n<div data-bounce3></div>\n";
|
|
@@ -39796,6 +39735,7 @@ class SpinnerThreeBounce extends UIContainerPlugin {
|
|
|
39796
39735
|
'class': 'spinner-three-bounce'
|
|
39797
39736
|
};
|
|
39798
39737
|
}
|
|
39738
|
+
hideTimeout = null;
|
|
39799
39739
|
showTimeout = null;
|
|
39800
39740
|
template = tmpl(spinnerHTML);
|
|
39801
39741
|
hasFatalError = false;
|
|
@@ -39849,8 +39789,17 @@ class SpinnerThreeBounce extends UIContainerPlugin {
|
|
|
39849
39789
|
/**
|
|
39850
39790
|
* Shows the spinner
|
|
39851
39791
|
*/
|
|
39852
|
-
show() {
|
|
39853
|
-
this.showTimeout
|
|
39792
|
+
show(delay = 300) {
|
|
39793
|
+
if (this.showTimeout === null) {
|
|
39794
|
+
if (this.hideTimeout !== null) {
|
|
39795
|
+
clearTimeout(this.hideTimeout);
|
|
39796
|
+
this.hideTimeout = null;
|
|
39797
|
+
}
|
|
39798
|
+
this.showTimeout = setTimeout(() => {
|
|
39799
|
+
this.showTimeout = null;
|
|
39800
|
+
this.$el.show();
|
|
39801
|
+
}, delay);
|
|
39802
|
+
}
|
|
39854
39803
|
}
|
|
39855
39804
|
/**
|
|
39856
39805
|
* Hides the spinner
|
|
@@ -39860,7 +39809,12 @@ class SpinnerThreeBounce extends UIContainerPlugin {
|
|
|
39860
39809
|
clearTimeout(this.showTimeout);
|
|
39861
39810
|
this.showTimeout = null;
|
|
39862
39811
|
}
|
|
39863
|
-
this
|
|
39812
|
+
this.hideTimeout = setTimeout(() => {
|
|
39813
|
+
this.hideTimeout = null;
|
|
39814
|
+
if (this.showTimeout === null) {
|
|
39815
|
+
this.$el.hide();
|
|
39816
|
+
}
|
|
39817
|
+
}, 0);
|
|
39864
39818
|
}
|
|
39865
39819
|
/**
|
|
39866
39820
|
* @internal
|
|
@@ -39981,10 +39935,14 @@ class SourceController extends CorePlugin {
|
|
|
39981
39935
|
*/
|
|
39982
39936
|
bindEvents() {
|
|
39983
39937
|
super.bindEvents();
|
|
39984
|
-
this.listenTo(this.core, Events$1.
|
|
39938
|
+
this.listenTo(this.core, Events$1.CORE_READY, this.onCoreReady);
|
|
39939
|
+
this.listenTo(this.core, Events$1.CORE_ACTIVE_CONTAINER_CHANGED, this.onActiveContainerChanged);
|
|
39985
39940
|
}
|
|
39986
|
-
|
|
39987
|
-
|
|
39941
|
+
onCoreReady() {
|
|
39942
|
+
this.core.getPlugin('error_screen')?.disable(); // TODO test
|
|
39943
|
+
}
|
|
39944
|
+
onActiveContainerChanged() {
|
|
39945
|
+
trace(`${T$3} onActiveContainerChanged`, {
|
|
39988
39946
|
retrying: this.active,
|
|
39989
39947
|
currentSource: this.sourcesList[this.currentSourceIndex],
|
|
39990
39948
|
});
|
|
@@ -40000,7 +39958,7 @@ class SourceController extends CorePlugin {
|
|
|
40000
39958
|
this.bindContainerEventListeners();
|
|
40001
39959
|
if (this.active) {
|
|
40002
39960
|
this.core.activeContainer?.getPlugin('poster_custom')?.disable();
|
|
40003
|
-
spinner?.show();
|
|
39961
|
+
spinner?.show(0);
|
|
40004
39962
|
}
|
|
40005
39963
|
}
|
|
40006
39964
|
bindContainerEventListeners() {
|
|
@@ -40017,7 +39975,7 @@ class SourceController extends CorePlugin {
|
|
|
40017
39975
|
switch (error.code) {
|
|
40018
39976
|
case PlaybackErrorCode.MediaSourceUnavailable:
|
|
40019
39977
|
this.core.activeContainer?.getPlugin('poster_custom')?.disable();
|
|
40020
|
-
this.retryPlayback();
|
|
39978
|
+
setTimeout(() => this.retryPlayback(), 0);
|
|
40021
39979
|
break;
|
|
40022
39980
|
}
|
|
40023
39981
|
});
|
|
@@ -40044,6 +40002,7 @@ class SourceController extends CorePlugin {
|
|
|
40044
40002
|
currentSource: this.sourcesList[this.currentSourceIndex],
|
|
40045
40003
|
});
|
|
40046
40004
|
this.active = true;
|
|
40005
|
+
this.core.activeContainer?.getPlugin('spinner')?.show(0);
|
|
40047
40006
|
this.getNextMediaSource().then((nextSource) => {
|
|
40048
40007
|
const rnd = RETRY_DELAY_BLUR * Math.random();
|
|
40049
40008
|
this.sync(() => {
|
package/lib/Player.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Player.d.ts","sourceRoot":"","sources":["../src/Player.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EACV,aAAa,EAEb,uBAAuB,EACxB,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAGtD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAEjE;;GAEG;AACH,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,WAAW,IACjD,CAAC,SAAS,WAAW,CAAC,IAAI,GACtB,CAAC,MAAM,CAAC,GACR,CAAC,SAAS,WAAW,CAAC,YAAY,GAClC,CAAC,MAAM,CAAC,GACR,CAAC,SAAS,WAAW,CAAC,UAAU,GAChC,CAAC,YAAY,CAAC,GACd,CAAC,SAAS,WAAW,CAAC,MAAM,GAC5B,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,GACnC,CAAC,SAAS,WAAW,CAAC,UAAU,GAChC,CAAC,OAAO,CAAC,GACT,CAAC,SAAS,WAAW,CAAC,KAAK,GAC3B,CAAC,aAAa,CAAC,GACf,EAAE,CAAA;AAER;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,CAAC,CAAC,SAAS,WAAW,IAAI,CACtD,GAAG,IAAI,EAAE,iBAAiB,CAAC,CAAC,CAAC,KAC1B,IAAI,CAAA;AAeT;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,KAAK,GAAG,aAAa,CAAA;AAI3D;;;;;;;GAOG;AACH,qBAAa,MAAM;IACjB,OAAO,CAAC,MAAM,CAAgC;IAE9C,OAAO,CAAC,OAAO,
|
|
1
|
+
{"version":3,"file":"Player.d.ts","sourceRoot":"","sources":["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CAAC,eAAe;IASvB,OAAO,CAAC,gBAAgB;IAYxB,OAAO,CAAC,MAAM,CAgCb;IAED,OAAO,CAAC,gBAAgB;IAyCxB,OAAO,CAAC,kBAAkB;IAI1B,OAAO,CAAC,qBAAqB;IAQ7B,OAAO,CAAC,2BAA2B;IAsBnC,OAAO,CAAC,iBAAiB;CA6C1B"}
|
package/lib/Player.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Browser, Events as ClapprEvents, Log, Player as PlayerClappr, $, Loader, } from '@clappr/core';
|
|
2
2
|
import { reportError, trace } from '@gcorevideo/utils';
|
|
3
3
|
import assert from 'assert';
|
|
4
|
-
import
|
|
4
|
+
import EventEmitter from 'eventemitter3';
|
|
5
5
|
import { PlayerEvent } from './types.js';
|
|
6
6
|
import { buildMediaSourcesList, wrapSource } from './utils/mediaSources.js';
|
|
7
7
|
import { registerPlaybacks } from './playback/index.js';
|
|
@@ -26,7 +26,7 @@ const DEFAULT_OPTIONS = {
|
|
|
26
26
|
*/
|
|
27
27
|
export class Player {
|
|
28
28
|
config = DEFAULT_OPTIONS;
|
|
29
|
-
emitter = new
|
|
29
|
+
emitter = new EventEmitter();
|
|
30
30
|
player = null;
|
|
31
31
|
ready = false;
|
|
32
32
|
rootNode = null;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ErrorOptions, HTML5Video } from '@clappr/core';
|
|
2
|
+
/**
|
|
3
|
+
* This class adds common behaviors to all playback modules.
|
|
4
|
+
* @internal
|
|
5
|
+
* TODO use custom HTML5Video playback with this layer applied
|
|
6
|
+
*/
|
|
7
|
+
export declare class BasePlayback extends HTML5Video {
|
|
8
|
+
createError(errorData: any, options?: ErrorOptions): Error;
|
|
9
|
+
_onPlaying(): void;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=BasePlayback.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BasePlayback.d.ts","sourceRoot":"","sources":["../../src/playback/BasePlayback.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAU,UAAU,EAAe,MAAM,cAAc,CAAA;AAI5E;;;;GAIG;AACH,qBAAa,YAAa,SAAQ,UAAU;IAC1C,WAAW,CAAC,SAAS,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,YAAY;IA0BzC,UAAU;CAIpB"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Events, HTML5Video, PlayerError } from '@clappr/core';
|
|
2
|
+
import { PlaybackErrorCode } from '../playback.types.js';
|
|
3
|
+
/**
|
|
4
|
+
* This class adds common behaviors to all playback modules.
|
|
5
|
+
* @internal
|
|
6
|
+
* TODO use custom HTML5Video playback with this layer applied
|
|
7
|
+
*/
|
|
8
|
+
export class BasePlayback extends HTML5Video {
|
|
9
|
+
createError(errorData, options) {
|
|
10
|
+
const i18n = this.i18n ||
|
|
11
|
+
// @ts-ignore
|
|
12
|
+
(this.core && this.core.i18n) ||
|
|
13
|
+
// @ts-ignore
|
|
14
|
+
(this.container && this.container.i18n);
|
|
15
|
+
if (i18n &&
|
|
16
|
+
!errorData.UI &&
|
|
17
|
+
errorData.code === PlaybackErrorCode.MediaSourceUnavailable) {
|
|
18
|
+
const defaultUI = {
|
|
19
|
+
title: i18n.t('no_broadcast'),
|
|
20
|
+
message: '',
|
|
21
|
+
};
|
|
22
|
+
errorData.UI = defaultUI;
|
|
23
|
+
}
|
|
24
|
+
if (errorData.level === PlayerError.Levels.FATAL) {
|
|
25
|
+
this.trigger(Events.PLAYBACK_MEDIACONTROL_DISABLE);
|
|
26
|
+
}
|
|
27
|
+
return super.createError(errorData, options);
|
|
28
|
+
}
|
|
29
|
+
_onPlaying() {
|
|
30
|
+
super._onPlaying();
|
|
31
|
+
this.trigger(Events.PLAYBACK_MEDIACONTROL_ENABLE);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Playback } from '@clappr/core';
|
|
2
2
|
import DASHJS, { type BitrateInfo as DashBitrateInfo, IManifestInfo } from 'dashjs';
|
|
3
3
|
import { QualityLevel, TimePosition, TimeValue } from '../../playback.types.js';
|
|
4
|
+
import { BasePlayback } from '../BasePlayback.js';
|
|
4
5
|
type PlaybackType = typeof Playback.VOD | typeof Playback.LIVE | typeof Playback.AOD | typeof Playback.NO_OP;
|
|
5
6
|
type PlaylistType = string;
|
|
6
7
|
type LocalTimeCorrelation = {
|
|
7
8
|
local: number;
|
|
8
9
|
remote: number;
|
|
9
10
|
};
|
|
10
|
-
export default class DashPlayback extends
|
|
11
|
+
export default class DashPlayback extends BasePlayback {
|
|
11
12
|
_levels: QualityLevel[] | null;
|
|
12
13
|
_currentLevel: number | null;
|
|
13
14
|
_durationExcludesAfterLiveSyncPoint: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DashPlayback.d.ts","sourceRoot":"","sources":["../../../src/playback/dash-playback/DashPlayback.ts"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"DashPlayback.d.ts","sourceRoot":"","sources":["../../../src/playback/dash-playback/DashPlayback.ts"],"names":[],"mappings":"AAIA,OAAO,EAAe,QAAQ,EAAyB,MAAM,cAAc,CAAA;AAG3E,OAAO,MAAM,EAAE,EAIb,KAAK,WAAW,IAAI,eAAe,EAEnC,aAAa,EACd,MAAM,QAAQ,CAAA;AAEf,OAAO,EAIL,YAAY,EACZ,YAAY,EAEZ,SAAS,EACV,MAAM,yBAAyB,CAAA;AAEhC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAMjD,KAAK,YAAY,GACb,OAAO,QAAQ,CAAC,GAAG,GACnB,OAAO,QAAQ,CAAC,IAAI,GACpB,OAAO,QAAQ,CAAC,GAAG,GACnB,OAAO,QAAQ,CAAC,KAAK,CAAA;AAEzB,KAAK,YAAY,GAAG,MAAM,CAAA;AAE1B,KAAK,oBAAoB,GAAG;IAC1B,KAAK,EAAE,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AM;IAMN,MAAM;YAMW,SAAS;IAI1B,qBAAqB;IAQrB,oBAAoB;IAMpB,kBAAkB;IAOlB,WAAW,IAAI,SAAS;IAQxB,cAAc,IAAI,SAAS;IAO3B,kBAAkB,IAAI,SAAS;IAI/B,cAAc,CAAC,UAAU,EAAE,MAAM;IAejC,IAAI,CAAC,IAAI,EAAE,SAAS;IAgBpB,eAAe;IAIf,UAAU,CAAC,MAAM,EAAE,OAAO;IAKjB,eAAe;IAgBxB,OAAO,CAAC,gBAAgB,CAGvB;IAED,OAAO,CAAC,eAAe,CAmCtB;IAED,OAAO,CAAC,YAAY;IAmBpB,aAAa;IAqBb,iBAAiB;IAWjB,IAAI,UAAU,YASb;IAEQ,WAAW;IAmBpB,IAAI;IAUJ,KAAK;IAUL,IAAI;IASJ,OAAO;IAkBP,mBAAmB;IAYnB,WAAW,CAAC,MAAM,EAAE,eAAe,EAAE;IAarC,OAAO,CAAC,aAAa;IAKrB,OAAO,CAAC,gBAAgB;IAQxB,eAAe;IAIf,aAAa;IAIb,OAAO,CAAC,QAAQ;CAKjB"}
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
// Copyright 2014 Globo.com Player authors. All rights reserved.
|
|
2
2
|
// Use of this source code is governed by a BSD-style
|
|
3
3
|
// license that can be found in the LICENSE file.
|
|
4
|
-
import { Events,
|
|
4
|
+
import { Events, Log, Playback, PlayerError, Utils, $ } from '@clappr/core';
|
|
5
5
|
import { trace } from '@gcorevideo/utils';
|
|
6
6
|
import assert from 'assert';
|
|
7
7
|
import DASHJS from 'dashjs';
|
|
8
8
|
import { PlaybackErrorCode, } from '../../playback.types.js';
|
|
9
9
|
import { isDashSource } from '../../utils/mediaSources.js';
|
|
10
|
+
import { BasePlayback } from '../BasePlayback.js';
|
|
10
11
|
const AUTO = -1;
|
|
11
12
|
const { now } = Utils;
|
|
12
13
|
const T = 'playback.dash';
|
|
13
14
|
// @ts-expect-error
|
|
14
|
-
export default class DashPlayback extends
|
|
15
|
+
export default class DashPlayback extends BasePlayback {
|
|
15
16
|
_levels = null;
|
|
16
17
|
_currentLevel = null;
|
|
17
18
|
// true when the actual duration is longer than hlsjs's live sync point
|
|
@@ -318,11 +319,10 @@ export default class DashPlayback extends HTML5Video {
|
|
|
318
319
|
};
|
|
319
320
|
triggerError(error) {
|
|
320
321
|
trace(`${T} triggerError`, { error });
|
|
321
|
-
this
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
});
|
|
322
|
+
// this triggers Events.ERROR to be handled by the UI
|
|
323
|
+
this.trigger(Events.PLAYBACK_ERROR, this.createError(error, {
|
|
324
|
+
useCodePrefix: false,
|
|
325
|
+
}));
|
|
326
326
|
// only reset the dash player in 10ms async, so that the rest of the
|
|
327
327
|
// calling function finishes
|
|
328
328
|
setTimeout(() => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { HTML5Video } from '@clappr/core';
|
|
2
1
|
import HLSJS, { Events as HlsEvents, type ErrorData as HlsErrorData, type FragChangedData, type FragLoadedData, type FragParsingMetadataData, type LevelSwitchingData } from 'hls.js';
|
|
3
2
|
import { PlaybackError, QualityLevel } from '../../playback.types.js';
|
|
4
3
|
import { PlaybackType } from '../../types.js';
|
|
5
|
-
|
|
4
|
+
import { BasePlayback } from '../BasePlayback.js';
|
|
5
|
+
export default class HlsPlayback extends BasePlayback {
|
|
6
6
|
private _ccIsSetup;
|
|
7
7
|
private _ccTracksUpdated;
|
|
8
8
|
private _currentFragment;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HlsPlayback.d.ts","sourceRoot":"","sources":["../../../src/playback/hls-playback/HlsPlayback.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"HlsPlayback.d.ts","sourceRoot":"","sources":["../../../src/playback/hls-playback/HlsPlayback.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,EACZ,MAAM,IAAI,SAAS,EAEnB,KAAK,SAAS,IAAI,YAAY,EAE9B,KAAK,eA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