@gcorevideo/player 2.20.13 → 2.20.15

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.
@@ -37249,7 +37249,7 @@ class ClipsPlugin extends UICorePlugin {
37249
37249
 
37250
37250
  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";
37251
37251
 
37252
- var version$1 = "2.20.13";
37252
+ var version$1 = "2.20.15";
37253
37253
 
37254
37254
  var packages = {
37255
37255
  "node_modules/@clappr/core": {
@@ -37506,7 +37506,7 @@ class DvrControls extends UICorePlugin {
37506
37506
 
37507
37507
  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>";
37508
37508
 
37509
- 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";
37509
+ 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><%= i18n.t('error_code') %>: <%= code %></div>\n <% } %>\n <% if (reloadIcon) { %>\n <div class=\"player-error-screen__reload\" data-error-screen><%= reloadIcon %></div>\n <% } %>\n</div>\n";
37510
37510
 
37511
37511
  const T$a = 'plugins.error_screen';
37512
37512
  /**
@@ -37608,6 +37608,7 @@ class ErrorScreen extends UICorePlugin {
37608
37608
  this.$el.html(ErrorScreen.template({
37609
37609
  ...this.err,
37610
37610
  reloadIcon: this.options.errorScreen?.noReload ? null : reloadIcon,
37611
+ i18n: this.core.i18n,
37611
37612
  }));
37612
37613
  if (!this.el.parentElement) {
37613
37614
  this.core.$el.append(this.el);
@@ -38909,7 +38910,8 @@ class PlaybackRate extends UICorePlugin {
38909
38910
  }
38910
38911
  onPlaybackRateChange(playbackRate) {
38911
38912
  const selectedRate = parseInt(this.selectedRate, 10);
38912
- if (playbackRate !== selectedRate) {
38913
+ // TODO check it doesn't interfere with the DASH.js or HLS.js playback live catchup
38914
+ if (Math.abs(playbackRate - selectedRate) > 0.1) {
38913
38915
  this.core.activePlayback?.setPlaybackRate(selectedRate);
38914
38916
  }
38915
38917
  }
@@ -1 +1 @@
1
- {"version":3,"file":"HTML5Video.d.ts","sourceRoot":"","sources":["../../src/playback/HTML5Video.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAG3C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAEhD,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,YAAY;IAClD;;OAEG;IACM,WAAW,CAAC,SAAS,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,YAAY;CAqB5D"}
1
+ {"version":3,"file":"HTML5Video.d.ts","sourceRoot":"","sources":["../../src/playback/HTML5Video.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAG3C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAKhD,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,YAAY;IAClD;;OAEG;IACM,WAAW,CAAC,SAAS,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,YAAY;CAwB5D"}
@@ -1,10 +1,15 @@
1
1
  import { PlaybackErrorCode } from '../playback.types.js';
2
2
  import { BasePlayback } from './BasePlayback.js';
3
+ import { trace } from '@gcorevideo/utils';
4
+ const T = 'playback.html5_video';
3
5
  export default class HTML5Video extends BasePlayback {
4
6
  /**
5
7
  * @internal
6
8
  */
7
9
  createError(errorData, options) {
10
+ trace(`${T} createError`, {
11
+ errorData
12
+ });
8
13
  const i18n = this.i18n ||
9
14
  // @ts-ignore
10
15
  (this.core && this.core.i18n) ||
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorScreen.d.ts","sourceRoot":"","sources":["../../../src/plugins/error-screen/ErrorScreen.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAoB,MAAM,cAAc,CAAA;AAO7D,OAAO,gDAAgD,CAAA;AAUvD;;;GAGG;AACH,MAAM,MAAM,yBAAyB,GAAG;IACtC;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAID;;;GAGG;AACH,qBAAa,WAAY,SAAQ,YAAY;IAC3C,OAAO,CAAC,GAAG,CAA+B;IAE1C;;OAEG;IACH,IAAI,IAAI,WAEP;IAED;;OAEG;IACH,IAAI,gBAAgB;;MAEnB;IAED,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAyB;IAEzD;;OAEG;IACH,IAAa,UAAU;;;MAKtB;IAED;;OAEG;IACM,UAAU;IASnB,OAAO,CAAC,MAAM;IAKd,OAAO,CAAC,OAAO;IAMf;;OAEG;IACH,IAAa,MAAM;;MAIlB;IAED,OAAO,CAAC,MAAM;IAUd,OAAO,CAAC,wBAAwB;IAqBhC,OAAO,CAAC,OAAO;IAgBf;;OAEG;IACM,MAAM;CAiBhB"}
1
+ {"version":3,"file":"ErrorScreen.d.ts","sourceRoot":"","sources":["../../../src/plugins/error-screen/ErrorScreen.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAoB,MAAM,cAAc,CAAA;AAO7D,OAAO,gDAAgD,CAAA;AAUvD;;;GAGG;AACH,MAAM,MAAM,yBAAyB,GAAG;IACtC;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAID;;;GAGG;AACH,qBAAa,WAAY,SAAQ,YAAY;IAC3C,OAAO,CAAC,GAAG,CAA+B;IAE1C;;OAEG;IACH,IAAI,IAAI,WAEP;IAED;;OAEG;IACH,IAAI,gBAAgB;;MAEnB;IAED,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAyB;IAEzD;;OAEG;IACH,IAAa,UAAU;;;MAKtB;IAED;;OAEG;IACM,UAAU;IASnB,OAAO,CAAC,MAAM;IAKd,OAAO,CAAC,OAAO;IAMf;;OAEG;IACH,IAAa,MAAM;;MAIlB;IAED,OAAO,CAAC,MAAM;IAWd,OAAO,CAAC,wBAAwB;IAqBhC,OAAO,CAAC,OAAO;IAgBf;;OAEG;IACM,MAAM;CAkBhB"}
@@ -58,6 +58,7 @@ export class ErrorScreen extends UICorePlugin {
58
58
  };
59
59
  }
60
60
  reload() {
61
+ trace(`${T} reload`);
61
62
  setTimeout(() => {
62
63
  this.core.configure({
63
64
  reloading: true,
@@ -107,6 +108,7 @@ export class ErrorScreen extends UICorePlugin {
107
108
  this.$el.html(ErrorScreen.template({
108
109
  ...this.err,
109
110
  reloadIcon: this.options.errorScreen?.noReload ? null : reloadIcon,
111
+ i18n: this.core.i18n,
110
112
  }));
111
113
  if (!this.el.parentElement) {
112
114
  this.core.$el.append(this.el);
@@ -1 +1 @@
1
- {"version":3,"file":"PlaybackRate.d.ts","sourceRoot":"","sources":["../../../src/plugins/playback-rate/PlaybackRate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,YAAY,EAAsB,IAAI,EAAE,MAAM,cAAc,CAAC;AAoC9E;;;;;;;;;;;;GAYG;AACH,qBAAa,YAAa,SAAQ,YAAY;IAC5C,OAAO,CAAC,aAAa,CAAgD;IAGrE,OAAO,CAAC,gBAAgB,CAAqB;IAE7C,OAAO,CAAC,QAAQ,CAAS;IAEzB,OAAO,CAAC,YAAY,CAAiC;IAErD;;OAEG;IACH,IAAI,IAAI,WAEP;IAED;;OAEG;IACH,IAAI,gBAAgB;;MAEnB;IAED,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAwB;IAE9D,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAsB;gBAE9C,IAAI,EAAE,IAAI;IAMtB;;OAEG;IACH,IAAa,UAAU;;;MAKtB;IAED;;OAEG;IACH,IAAa,MAAM;;;;MAMlB;IAED;;OAEG;IACM,UAAU;IAKnB,OAAO,CAAC,WAAW;IAQnB,OAAO,CAAC,uBAAuB;IAO/B,OAAO,CAAC,cAAc;IAQtB,OAAO,CAAC,iBAAiB;IASzB,OAAO,CAAC,eAAe;IAIvB,OAAO,CAAC,WAAW;IAInB,OAAO,CAAC,oBAAoB;IAW5B,OAAO,CAAC,YAAY;IAYpB;;OAEG;IACM,MAAM;IA6Bf,OAAO,CAAC,SAAS;IAMjB,OAAO,CAAC,UAAU;IAMlB,OAAO,CAAC,MAAM;IAQd,OAAO,CAAC,iBAAiB;IAIzB,OAAO,CAAC,MAAM;IAGd,OAAO,CAAC,YAAY;IAWpB,OAAO,CAAC,UAAU;IAUlB,OAAO,CAAC,MAAM;IAMd,OAAO,CAAC,eAAe;IAMvB,OAAO,CAAC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}
@@ -121,7 +121,8 @@ export class PlaybackRate extends UICorePlugin {
121
121
  }
122
122
  onPlaybackRateChange(playbackRate) {
123
123
  const selectedRate = parseInt(this.selectedRate, 10);
124
- if (playbackRate !== selectedRate) {
124
+ // TODO check it doesn't interfere with the DASH.js or HLS.js playback live catchup
125
+ if (Math.abs(playbackRate - selectedRate) > 0.1) {
125
126
  trace(`${T} onPlaybackRateChange setting target rate`, {
126
127
  playbackRate,
127
128
  selectedRate,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gcorevideo/player",
3
- "version": "2.20.13",
3
+ "version": "2.20.15",
4
4
  "description": "Gcore JavaScript video player",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -2,12 +2,18 @@ import { ErrorOptions } from '@clappr/core'
2
2
 
3
3
  import { PlaybackErrorCode } from '../playback.types.js'
4
4
  import { BasePlayback } from './BasePlayback.js'
5
+ import { trace } from '@gcorevideo/utils'
6
+
7
+ const T = 'playback.html5_video'
5
8
 
6
9
  export default class HTML5Video extends BasePlayback {
7
10
  /**
8
11
  * @internal
9
12
  */
10
13
  override createError(errorData: any, options?: ErrorOptions) {
14
+ trace(`${T} createError`, {
15
+ errorData
16
+ })
11
17
  const i18n =
12
18
  this.i18n ||
13
19
  // @ts-ignore
@@ -94,6 +94,7 @@ export class ErrorScreen extends UICorePlugin {
94
94
  }
95
95
 
96
96
  private reload() {
97
+ trace(`${T} reload`)
97
98
  setTimeout(() => {
98
99
  this.core.configure({
99
100
  reloading: true,
@@ -151,6 +152,7 @@ export class ErrorScreen extends UICorePlugin {
151
152
  ErrorScreen.template({
152
153
  ...this.err,
153
154
  reloadIcon: this.options.errorScreen?.noReload ? null : reloadIcon,
155
+ i18n: this.core.i18n,
154
156
  }),
155
157
  )
156
158
 
@@ -10,7 +10,7 @@ exports[`ErrorScreen > on error > targeted at UI > should render 1`] = `
10
10
  <div class="player-error-screen__message" data-error-screen="">Lorem ipsum dolor sit amet</div>
11
11
 
12
12
 
13
- <div class="player-error-screen__code" data-error-screen="">Error code: foo</div>
13
+ <div class="player-error-screen__code" data-error-screen="">error_code: foo</div>
14
14
 
15
15
 
16
16
  <div class="player-error-screen__reload" data-error-screen="">/assets/icons/old/reload.svg</div>
@@ -152,7 +152,8 @@ export class PlaybackRate extends UICorePlugin {
152
152
 
153
153
  private onPlaybackRateChange(playbackRate: number) {
154
154
  const selectedRate = parseInt(this.selectedRate, 10);
155
- if (playbackRate !== selectedRate) {
155
+ // TODO check it doesn't interfere with the DASH.js or HLS.js playback live catchup
156
+ if (Math.abs(playbackRate - selectedRate) > 0.1) {
156
157
  trace(`${T} onPlaybackRateChange setting target rate`, {
157
158
  playbackRate,
158
159
  selectedRate,