@gcorevideo/player 2.20.12 → 2.20.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/dist/core.js +26 -2
  2. package/dist/index.css +1197 -1197
  3. package/dist/index.js +33 -19
  4. package/dist/player.d.ts +8 -10
  5. package/dist/plugins/index.css +1619 -1619
  6. package/dist/plugins/index.js +8 -13
  7. package/docs/api/player.md +1 -1
  8. package/docs/api/player.mediacontrol.md +2 -11
  9. package/docs/api/player.playbackerror.md +2 -2
  10. package/docs/api/player.playbackerror.origin.md +1 -1
  11. package/docs/api/player.playbackerror.scope.md +1 -1
  12. package/docs/api/player.poster.md +1 -1
  13. package/docs/api/player.sourcecontroller.md +2 -33
  14. package/lib/Player.js +1 -1
  15. package/lib/playback/HTML5Video.d.ts +5 -0
  16. package/lib/playback/HTML5Video.d.ts.map +1 -1
  17. package/lib/playback/HTML5Video.js +21 -0
  18. package/lib/playback/hls-playback/HlsPlayback.d.ts +2 -2
  19. package/lib/playback/hls-playback/HlsPlayback.d.ts.map +1 -1
  20. package/lib/playback/hls-playback/HlsPlayback.js +4 -0
  21. package/lib/playback.types.d.ts +2 -2
  22. package/lib/plugins/click-to-pause/ClickToPause.d.ts.map +1 -1
  23. package/lib/plugins/click-to-pause/ClickToPause.js +0 -4
  24. package/lib/plugins/dvr-controls/DvrControls.d.ts.map +1 -1
  25. package/lib/plugins/dvr-controls/DvrControls.js +0 -1
  26. package/lib/plugins/media-control/MediaControl.d.ts +1 -8
  27. package/lib/plugins/media-control/MediaControl.d.ts.map +1 -1
  28. package/lib/plugins/media-control/MediaControl.js +2 -9
  29. package/lib/plugins/poster/Poster.d.ts +2 -0
  30. package/lib/plugins/poster/Poster.d.ts.map +1 -1
  31. package/lib/plugins/poster/Poster.js +3 -3
  32. package/lib/plugins/source-controller/SourceController.d.ts +3 -0
  33. package/lib/plugins/source-controller/SourceController.d.ts.map +1 -1
  34. package/lib/plugins/source-controller/SourceController.js +3 -0
  35. package/package.json +1 -1
  36. package/src/Player.ts +1 -1
  37. package/src/playback/HTML5Video.ts +29 -1
  38. package/src/playback/__tests__/HTML5Video.test.ts +47 -0
  39. package/src/playback/hls-playback/HlsPlayback.ts +5 -1
  40. package/src/playback.types.ts +2 -2
  41. package/src/plugins/click-to-pause/ClickToPause.ts +0 -5
  42. package/src/plugins/dvr-controls/DvrControls.ts +0 -1
  43. package/src/plugins/media-control/MediaControl.ts +2 -9
  44. package/src/plugins/poster/Poster.ts +4 -3
  45. package/src/plugins/source-controller/SourceController.ts +3 -0
  46. package/temp/player.api.json +6 -40
  47. package/tsconfig.tsbuildinfo +1 -1
  48. package/docs/api/player.sourcecontroller._constructor_.md +0 -50
package/dist/index.js CHANGED
@@ -42266,6 +42266,10 @@ class HlsPlayback extends BasePlayback {
42266
42266
  details: data.details,
42267
42267
  });
42268
42268
  error.level = PlayerError.Levels.WARN;
42269
+ // TODO check
42270
+ // if (data.error instanceof MediaError && data.error.code === MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED) {
42271
+ // error.code = PlaybackErrorCode.MediaSourceUnavailable
42272
+ // }
42269
42273
  this._recover(evt, data, error);
42270
42274
  break;
42271
42275
  default:
@@ -42617,6 +42621,26 @@ HlsPlayback.canPlay = function (resource, mimeType) {
42617
42621
  };
42618
42622
 
42619
42623
  class HTML5Video extends BasePlayback {
42624
+ /**
42625
+ * @internal
42626
+ */
42627
+ createError(errorData, options) {
42628
+ const i18n = this.i18n ||
42629
+ // @ts-ignore
42630
+ (this.core && this.core.i18n) ||
42631
+ // @ts-ignore
42632
+ (this.container && this.container.i18n);
42633
+ if (i18n &&
42634
+ !errorData.UI &&
42635
+ errorData.code === MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED) {
42636
+ errorData.UI = {
42637
+ title: i18n.t('no_broadcast'),
42638
+ message: errorData.message,
42639
+ };
42640
+ errorData.code = PlaybackErrorCode.MediaSourceUnavailable;
42641
+ }
42642
+ return super.createError(errorData, { ...options, useCodePrefix: false });
42643
+ }
42620
42644
  }
42621
42645
 
42622
42646
  // TODO consider allowing the variation of the order of playback modules
@@ -42722,7 +42746,7 @@ class Player {
42722
42746
  const coreOpts = this.buildCoreOptions(playerElement);
42723
42747
  const { core, container } = Player.getRegisteredPlugins();
42724
42748
  trace(`${T$g} init`, {
42725
- registeredPlaybacks: Loader.registeredPlaybacks.map((p) => p.name),
42749
+ registeredPlaybacks: Loader.registeredPlaybacks.map((p) => p.prototype.name),
42726
42750
  });
42727
42751
  coreOpts.plugins = {
42728
42752
  core: Object.values(core),
@@ -43090,7 +43114,7 @@ class Player {
43090
43114
  }
43091
43115
  }
43092
43116
 
43093
- var version$1 = "2.20.12";
43117
+ var version$1 = "2.20.13";
43094
43118
 
43095
43119
  var packages = {
43096
43120
  "node_modules/@clappr/core": {
@@ -43879,17 +43903,10 @@ function orderByOrderPattern(arr, order) {
43879
43903
  return [...ordered, ...rest];
43880
43904
  }
43881
43905
  /**
43882
- * `PLUGIN` that provides a foundation for developing custom media controls UI.
43906
+ * `PLUGIN` that provides basic playback controls UI and a foundation for developing custom UI.
43883
43907
  * @beta
43884
43908
  * @remarks
43885
43909
  * The methods exposed are to be used by the other plugins that extend the media control UI.
43886
- * The plugin registration should be arranged so that MediaControl is initialized before every other `PLUGIN` that depends on it.
43887
- * @example
43888
- * ```ts
43889
- * Player.registerPlugin(MediaControl) // <--- This must go first
43890
- * Player.registerPlugin(LevelSelector) // a media control plugin
43891
- * Player.registerPlugin(NerdStats) // another media control plugin
43892
- * ```
43893
43910
  */
43894
43911
  class MediaControl extends UICorePlugin {
43895
43912
  advertisementPlaying = false;
@@ -44822,7 +44839,6 @@ class MediaControl extends UICorePlugin {
44822
44839
  return super.destroy();
44823
44840
  }
44824
44841
  configure() {
44825
- // this.advertisementPlaying ? this.disable() : this.enable()
44826
44842
  this.trigger(Events$1.MEDIACONTROL_OPTIONS_CHANGE);
44827
44843
  }
44828
44844
  /**
@@ -47883,10 +47899,6 @@ class ClickToPause extends ContainerPlugin {
47883
47899
  settingsUpdate() {
47884
47900
  const isLivePlayback = this.container.getPlaybackType() === Playback.LIVE;
47885
47901
  const pointerEnabled = !isLivePlayback || this.container.isDvrEnabled();
47886
- trace(`${T$c} settingsUpdate`, {
47887
- isLivePlayback,
47888
- pointerEnabled,
47889
- });
47890
47902
  if (pointerEnabled === this.pointerEnabled) {
47891
47903
  return;
47892
47904
  }
@@ -48273,7 +48285,6 @@ class DvrControls extends UICorePlugin {
48273
48285
  container.seek(container.getDuration());
48274
48286
  }
48275
48287
  settingsUpdate() {
48276
- trace(`${T$b} settingsUpdate`);
48277
48288
  this.core.getPlugin('media_control').$el.removeClass('live');
48278
48289
  this.render();
48279
48290
  }
@@ -49844,6 +49855,8 @@ const T$5 = 'plugins.poster';
49844
49855
  * @beta
49845
49856
  * @remarks
49846
49857
  * When the playback is stopped, media control UI is disabled.
49858
+ * Note that the poster image, if specified via the player config, will be used to update video element's poster attribute by the
49859
+ * HTML5-video-based playback module.
49847
49860
  *
49848
49861
  * Configuration options:
49849
49862
  *
@@ -49867,6 +49880,7 @@ const T$5 = 'plugins.poster';
49867
49880
  * ```
49868
49881
  */
49869
49882
  class Poster extends UIContainerPlugin {
49883
+ // TODO merge non-poster related functionality into the ClickToPause plugin
49870
49884
  hasFatalError = false;
49871
49885
  hasStartedPlaying = false;
49872
49886
  playRequested = false;
@@ -50022,9 +50036,6 @@ class Poster extends UIContainerPlugin {
50022
50036
  this.container.playback.play();
50023
50037
  }
50024
50038
  }
50025
- else {
50026
- this.container.trigger('container:start');
50027
- }
50028
50039
  return false;
50029
50040
  }
50030
50041
  shouldHideOnPlay() {
@@ -50730,6 +50741,9 @@ class SourceController extends CorePlugin {
50730
50741
  get supportedVersion() {
50731
50742
  return { min: CLAPPR_VERSION };
50732
50743
  }
50744
+ /**
50745
+ * @internal
50746
+ */
50733
50747
  constructor(core) {
50734
50748
  super(core);
50735
50749
  this.sourcesList = this.core.options.sources;
package/dist/player.d.ts CHANGED
@@ -960,17 +960,10 @@ export declare class Logo extends UIContainerPlugin {
960
960
  export { LogTracer }
961
961
 
962
962
  /**
963
- * `PLUGIN` that provides a foundation for developing custom media controls UI.
963
+ * `PLUGIN` that provides basic playback controls UI and a foundation for developing custom UI.
964
964
  * @beta
965
965
  * @remarks
966
966
  * The methods exposed are to be used by the other plugins that extend the media control UI.
967
- * The plugin registration should be arranged so that MediaControl is initialized before every other `PLUGIN` that depends on it.
968
- * @example
969
- * ```ts
970
- * Player.registerPlugin(MediaControl) // <--- This must go first
971
- * Player.registerPlugin(LevelSelector) // a media control plugin
972
- * Player.registerPlugin(NerdStats) // another media control plugin
973
- * ```
974
967
  */
975
968
  export declare class MediaControl extends UICorePlugin {
976
969
  private advertisementPlaying;
@@ -1412,7 +1405,7 @@ export declare interface PlaybackError {
1412
1405
  */
1413
1406
  message: string;
1414
1407
  /**
1415
- * Exact component that originated the error.
1408
+ * Name of the component that originated the error.
1416
1409
  * @example
1417
1410
  * - 'core'
1418
1411
  * - 'dash'
@@ -1420,7 +1413,7 @@ export declare interface PlaybackError {
1420
1413
  */
1421
1414
  origin: string;
1422
1415
  /**
1423
- * Component subsystem of the error origin
1416
+ * Component subsystem of the error origin, together with the `origin` uniquely identifies the originating component.
1424
1417
  */
1425
1418
  scope: PlayerComponentType;
1426
1419
  /**
@@ -1965,6 +1958,8 @@ export declare type PlayerPluginConstructor = CorePluginConstructor | ContainerP
1965
1958
  * @beta
1966
1959
  * @remarks
1967
1960
  * When the playback is stopped, media control UI is disabled.
1961
+ * Note that the poster image, if specified via the player config, will be used to update video element's poster attribute by the
1962
+ * HTML5-video-based playback module.
1968
1963
  *
1969
1964
  * Configuration options:
1970
1965
  *
@@ -2227,6 +2222,9 @@ export declare class SourceController extends CorePlugin {
2227
2222
  get supportedVersion(): {
2228
2223
  min: string;
2229
2224
  };
2225
+ /**
2226
+ * @internal
2227
+ */
2230
2228
  constructor(core: Core);
2231
2229
  /**
2232
2230
  * @internal