@gcorevideo/player 2.20.11 → 2.20.12

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 (29) hide show
  1. package/dist/core.js +1 -1
  2. package/dist/index.css +1377 -1377
  3. package/dist/index.js +29 -37
  4. package/dist/player.d.ts +39 -5
  5. package/dist/plugins/index.css +1136 -1136
  6. package/dist/plugins/index.js +29 -37
  7. package/docs/api/player.contextmenupluginsettings.md +1 -1
  8. package/docs/api/player.favicon.md +4 -174
  9. package/docs/api/{player.favicon.bindevents.md → player.faviconpluginsettings.faviconcolor.md} +5 -7
  10. package/docs/api/{player.favicon._constructor_.md → player.faviconpluginsettings.md} +17 -8
  11. package/docs/api/player.md +14 -3
  12. package/docs/api/{player.favicon.disable.md → player.mediacontrol.getcenterpanel.md} +4 -4
  13. package/docs/api/{player.favicon.configure.md → player.mediacontrol.getleftpanel.md} +8 -4
  14. package/docs/api/player.mediacontrol.md +28 -0
  15. package/lib/plugins/context-menu/ContextMenu.d.ts +1 -1
  16. package/lib/plugins/error-screen/ErrorScreen.d.ts.map +1 -1
  17. package/lib/plugins/error-screen/ErrorScreen.js +0 -1
  18. package/lib/plugins/favicon/Favicon.d.ts +30 -3
  19. package/lib/plugins/favicon/Favicon.d.ts.map +1 -1
  20. package/lib/plugins/favicon/Favicon.js +28 -35
  21. package/package.json +1 -1
  22. package/src/plugins/context-menu/ContextMenu.ts +1 -1
  23. package/src/plugins/error-screen/ErrorScreen.ts +0 -1
  24. package/src/plugins/favicon/Favicon.ts +38 -41
  25. package/temp/player.api.json +95 -206
  26. package/tsconfig.tsbuildinfo +1 -1
  27. package/docs/api/player.favicon.destroy.md +0 -18
  28. package/docs/api/player.favicon.name.md +0 -14
  29. package/docs/api/player.favicon.supportedversion.md +0 -16
package/dist/index.js CHANGED
@@ -43090,7 +43090,7 @@ class Player {
43090
43090
  }
43091
43091
  }
43092
43092
 
43093
- var version$1 = "2.20.11";
43093
+ var version$1 = "2.20.12";
43094
43094
 
43095
43095
  var packages = {
43096
43096
  "node_modules/@clappr/core": {
@@ -48411,7 +48411,6 @@ class ErrorScreen extends UICorePlugin {
48411
48411
  ...this.err,
48412
48412
  reloadIcon: this.options.errorScreen?.noReload ? null : reloadIcon,
48413
48413
  }));
48414
- // TODO append to container instead of core?
48415
48414
  if (!this.el.parentElement) {
48416
48415
  this.core.$el.append(this.el);
48417
48416
  }
@@ -48421,26 +48420,32 @@ class ErrorScreen extends UICorePlugin {
48421
48420
 
48422
48421
  const FAVICON_COLOR = '#567';
48423
48422
  const FAVICON_SELECTOR = 'link[rel="shortcut icon"]';
48424
- // const oldIcon = $(FAVICON_SELECTOR);
48425
48423
  /**
48426
- * `PLUGIN` that adds custom favicon to the player's tab.
48424
+ * `PLUGIN` that changes the favicon according to the player's state.
48427
48425
  * @beta
48426
+ * @remarks
48427
+ * There are three states: stopped, playing and paused.
48428
48428
  */
48429
48429
  class Favicon extends CorePlugin {
48430
- _container = null;
48431
48430
  oldIcon;
48432
48431
  playIcon = null;
48433
48432
  pauseIcon = null;
48434
48433
  stopIcon = null;
48434
+ /**
48435
+ * @internal
48436
+ */
48435
48437
  get name() {
48436
48438
  return 'favicon';
48437
48439
  }
48440
+ /**
48441
+ * @internal
48442
+ */
48438
48443
  get supportedVersion() {
48439
48444
  return { min: CLAPPR_VERSION };
48440
48445
  }
48441
- // get oldIcon() {
48442
- // return oldIcon;
48443
- // }
48446
+ /**
48447
+ * @internal
48448
+ */
48444
48449
  constructor(core) {
48445
48450
  super(core);
48446
48451
  this.oldIcon = $(FAVICON_SELECTOR);
@@ -48448,41 +48453,31 @@ class Favicon extends CorePlugin {
48448
48453
  this.stopIcon = this.createIcon(stopIcon);
48449
48454
  this.changeIcon(this.stopIcon);
48450
48455
  }
48451
- this.configure();
48452
- }
48453
- configure() {
48454
- if (this.core.options.changeFavicon) {
48455
- if (!this.enabled) {
48456
- // @ts-ignore
48457
- this.stopListening(this.core, Events$1.CORE_OPTIONS_CHANGE);
48458
- this.enable();
48459
- }
48460
- }
48461
- else if (this.enabled) {
48462
- this.disable();
48463
- this.listenTo(this.core, Events$1.CORE_OPTIONS_CHANGE, this.configure);
48464
- }
48465
48456
  }
48457
+ /**
48458
+ * @internal
48459
+ */
48466
48460
  bindEvents() {
48467
- this.listenTo(this.core, Events$1.CORE_OPTIONS_CHANGE, this.configure);
48468
48461
  this.listenTo(this.core, Events$1.CORE_ACTIVE_CONTAINER_CHANGED, this.containerChanged);
48469
- this.core.activeContainer && this.containerChanged();
48470
48462
  }
48471
48463
  containerChanged() {
48472
- // @ts-ignore
48473
- this._container && this.stopListening(this._container);
48474
- this._container = this.core.activeContainer;
48475
- this.listenTo(this._container, Events$1.CONTAINER_PLAY, this.setPlayIcon);
48476
- this.listenTo(this._container, Events$1.CONTAINER_PAUSE, this.setPauseIcon);
48477
- this.listenTo(this._container, Events$1.CONTAINER_STOP, this.resetIcon);
48478
- this.listenTo(this._container, Events$1.CONTAINER_ENDED, this.resetIcon);
48479
- this.listenTo(this._container, Events$1.CONTAINER_ERROR, this.resetIcon);
48464
+ this.listenTo(this.core.activeContainer, Events$1.CONTAINER_PLAY, this.setPlayIcon);
48465
+ this.listenTo(this.core.activeContainer, Events$1.CONTAINER_PAUSE, this.setPauseIcon);
48466
+ this.listenTo(this.core.activeContainer, Events$1.CONTAINER_STOP, this.resetIcon);
48467
+ this.listenTo(this.core.activeContainer, Events$1.CONTAINER_ENDED, this.resetIcon);
48468
+ this.listenTo(this.core.activeContainer, Events$1.CONTAINER_ERROR, this.resetIcon);
48480
48469
  this.resetIcon();
48481
48470
  }
48471
+ /**
48472
+ * @internal
48473
+ */
48482
48474
  disable() {
48483
48475
  super.disable();
48484
48476
  this.resetIcon();
48485
48477
  }
48478
+ /**
48479
+ * @internal
48480
+ */
48486
48481
  destroy() {
48487
48482
  super.destroy();
48488
48483
  this.resetIcon();
@@ -48513,15 +48508,12 @@ class Favicon extends CorePlugin {
48513
48508
  this.changeIcon(this.pauseIcon);
48514
48509
  }
48515
48510
  resetIcon() {
48516
- $(FAVICON_SELECTOR).remove();
48517
48511
  const icon = this.oldIcon.length > 0 ? this.oldIcon : this.stopIcon;
48518
48512
  this.changeIcon(icon);
48519
48513
  }
48520
48514
  changeIcon(icon) {
48521
- if (icon) {
48522
- $('link[rel="shortcut icon"]').remove();
48523
- $('head').append(icon);
48524
- }
48515
+ $('link[rel="shortcut icon"]').remove();
48516
+ $('head').append(icon);
48525
48517
  }
48526
48518
  }
48527
48519
 
package/dist/player.d.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * @remarks
5
5
  * This package provides a video player for the Gcore streaming platform.
6
- * It is built on top of the Clappr library and provides a framework for building custom integrations.
6
+ * It is built on top of the {@link https://github.com/clappr/clappr | Clappr} library and provides a framework for building custom integrations.
7
7
  * Start with {@link Player} for more information.
8
8
  *
9
9
  * Various plugins (marked with `PLUGIN` keyword) are available to extend the player with additional features.
@@ -561,7 +561,7 @@ export declare class ContextMenu extends UIContainerPlugin {
561
561
  }
562
562
 
563
563
  /**
564
- * The plugin adds a context menu to the player.
564
+ * Context menu plugin settings
565
565
  * @beta
566
566
  */
567
567
  export declare interface ContextMenuPluginSettings {
@@ -703,24 +703,42 @@ export declare type ErrorScreenPluginSettings = {
703
703
  };
704
704
 
705
705
  /**
706
- * `PLUGIN` that adds custom favicon to the player's tab.
706
+ * `PLUGIN` that changes the favicon according to the player's state.
707
707
  * @beta
708
+ * @remarks
709
+ * There are three states: stopped, playing and paused.
708
710
  */
709
711
  export declare class Favicon extends CorePlugin {
710
- private _container;
711
712
  private oldIcon;
712
713
  private playIcon;
713
714
  private pauseIcon;
714
715
  private stopIcon;
716
+ /**
717
+ * @internal
718
+ */
715
719
  get name(): string;
720
+ /**
721
+ * @internal
722
+ */
716
723
  get supportedVersion(): {
717
724
  min: string;
718
725
  };
726
+ /**
727
+ * @internal
728
+ */
719
729
  constructor(core: Core);
720
- configure(): void;
730
+ /**
731
+ * @internal
732
+ */
721
733
  bindEvents(): void;
722
734
  private containerChanged;
735
+ /**
736
+ * @internal
737
+ */
723
738
  disable(): void;
739
+ /**
740
+ * @internal
741
+ */
724
742
  destroy(): void;
725
743
  private createIcon;
726
744
  private setPlayIcon;
@@ -729,6 +747,16 @@ export declare class Favicon extends CorePlugin {
729
747
  private changeIcon;
730
748
  }
731
749
 
750
+ /**
751
+ * @beta
752
+ */
753
+ export declare interface FaviconPluginSettings {
754
+ /**
755
+ * CSS color of the favicon.
756
+ */
757
+ faviconColor?: string;
758
+ }
759
+
732
760
  /**
733
761
  * An element inside the gear menu
734
762
  * @beta
@@ -1158,6 +1186,12 @@ export declare class MediaControl extends UICorePlugin {
1158
1186
  * @returns ZeptoSelector of the right panel element
1159
1187
  */
1160
1188
  getRightPanel(): any;
1189
+ /**
1190
+ * Get the left panel area to append custom elements to
1191
+ * @returns ZeptoSelector of the left panel element
1192
+ */
1193
+ getLeftPanel(): any;
1194
+ getCenterPanel(): any;
1161
1195
  private resetIndicators;
1162
1196
  private initializeIcons;
1163
1197
  private setSeekPercentage;