@gcorevideo/player 2.20.3 → 2.20.4

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 (60) hide show
  1. package/dist/core.js +30 -6
  2. package/dist/index.css +859 -859
  3. package/dist/index.js +39 -10
  4. package/dist/player.d.ts +10 -0
  5. package/dist/plugins/index.css +954 -954
  6. package/dist/plugins/index.js +10 -5
  7. package/docs/api/player.contextmenupluginsettings.label.md +3 -0
  8. package/docs/api/player.contextmenupluginsettings.md +8 -3
  9. package/docs/api/player.contextmenupluginsettings.preventshowcontextmenu.md +3 -0
  10. package/docs/api/player.contextmenupluginsettings.url.md +3 -0
  11. package/docs/api/player.md +6 -2
  12. package/docs/api/player.multicamera._constructor_.md +3 -0
  13. package/docs/api/player.multicamera.activebyid.md +3 -0
  14. package/docs/api/player.multicamera.attributes.md +3 -0
  15. package/docs/api/player.multicamera.bindevents.md +3 -0
  16. package/docs/api/player.multicamera.events.md +3 -0
  17. package/docs/api/player.multicamera.getcameraslist.md +3 -0
  18. package/docs/api/player.multicamera.getcurrentcamera.md +3 -0
  19. package/docs/api/player.multicamera.md +28 -1
  20. package/docs/api/player.multicamera.name.md +3 -0
  21. package/docs/api/player.multicamera.render.md +3 -0
  22. package/docs/api/player.multicamera.supportedversion.md +3 -0
  23. package/docs/api/player.multicamera.template.md +3 -0
  24. package/docs/api/player.multicamera.unbindevents.md +3 -0
  25. package/docs/api/player.multicamera.version.md +3 -0
  26. package/docs/api/player.volumefadeevents.md +7 -0
  27. package/docs/api/player.zeptoresult.md +1 -0
  28. package/lib/Player.d.ts +5 -3
  29. package/lib/Player.d.ts.map +1 -1
  30. package/lib/Player.js +30 -6
  31. package/lib/internal.types.d.ts +7 -7
  32. package/lib/internal.types.d.ts.map +1 -1
  33. package/lib/plugins/context-menu/ContextMenu.d.ts +4 -0
  34. package/lib/plugins/context-menu/ContextMenu.d.ts.map +1 -1
  35. package/lib/plugins/multi-camera/MultiCamera.d.ts +1 -0
  36. package/lib/plugins/multi-camera/MultiCamera.d.ts.map +1 -1
  37. package/lib/plugins/multi-camera/MultiCamera.js +3 -2
  38. package/lib/plugins/seek-time/SeekTime.js +1 -1
  39. package/lib/plugins/share/Share.js +1 -1
  40. package/lib/plugins/volume-fade/VolumeFade.d.ts +4 -0
  41. package/lib/plugins/volume-fade/VolumeFade.d.ts.map +1 -1
  42. package/lib/plugins/volume-fade/VolumeFade.js +4 -0
  43. package/lib/types.d.ts +9 -1
  44. package/lib/types.d.ts.map +1 -1
  45. package/lib/utils/types.d.ts +1 -0
  46. package/lib/utils/types.d.ts.map +1 -1
  47. package/package.json +1 -1
  48. package/release_notes +297 -0
  49. package/src/Player.ts +101 -46
  50. package/src/__tests__/Player.test.ts +23 -1
  51. package/src/internal.types.ts +86 -79
  52. package/src/plugins/context-menu/ContextMenu.ts +4 -0
  53. package/src/plugins/multi-camera/MultiCamera.ts +3 -2
  54. package/src/plugins/seek-time/SeekTime.ts +1 -1
  55. package/src/plugins/share/Share.ts +1 -1
  56. package/src/plugins/volume-fade/VolumeFade.ts +4 -0
  57. package/src/types.ts +11 -1
  58. package/src/utils/types.ts +1 -0
  59. package/temp/player.api.json +24 -24
  60. package/tsconfig.tsbuildinfo +1 -1
package/dist/core.js CHANGED
@@ -42408,7 +42408,7 @@ class Player {
42408
42408
  Log.setLevel(0);
42409
42409
  }
42410
42410
  const coreOpts = this.buildCoreOptions(playerElement);
42411
- const { core, container } = Loader.registeredPlugins;
42411
+ const { core, container } = Player.getRegisteredPlugins();
42412
42412
  trace(`${T} init`, {
42413
42413
  registeredPlaybacks: Loader.registeredPlaybacks.map((p) => p.name),
42414
42414
  });
@@ -42570,13 +42570,35 @@ class Player {
42570
42570
  * ```
42571
42571
  */
42572
42572
  static registerPlugin(plugin) {
42573
+ assert.ok(plugin.type === 'core' || plugin.type === 'container', 'Invalid plugin type');
42574
+ if (plugin.type === 'core') {
42575
+ if (plugin.prototype.name === 'media_control') {
42576
+ Player.corePlugins.unshift(plugin);
42577
+ }
42578
+ else {
42579
+ Player.corePlugins.push(plugin);
42580
+ }
42581
+ return;
42582
+ }
42573
42583
  Loader.registerPlugin(plugin);
42574
42584
  }
42585
+ static getRegisteredPlugins() {
42586
+ for (const plugin of Player.corePlugins) {
42587
+ Loader.registerPlugin(plugin);
42588
+ }
42589
+ return Loader.registeredPlugins;
42590
+ }
42591
+ static corePlugins = [];
42575
42592
  /**
42576
42593
  * Unregisters a plugin registered earlier with {@link Player.registerPlugin}.
42577
42594
  * @param plugin - a plugin class
42578
42595
  */
42579
42596
  static unregisterPlugin(plugin) {
42597
+ assert.ok(plugin.type === 'core' || plugin.type === 'container', 'Invalid plugin type');
42598
+ if (plugin.type === 'core') {
42599
+ Player.corePlugins = Player.corePlugins.filter((p) => p !== plugin);
42600
+ return;
42601
+ }
42580
42602
  Loader.unregisterPlugin(plugin);
42581
42603
  }
42582
42604
  setConfig(config) {
@@ -42717,8 +42739,10 @@ class Player {
42717
42739
  }, null);
42718
42740
  }
42719
42741
  bindCoreListeners() {
42720
- const core = this.player?.core;
42721
- core?.on(Events$1.CORE_SCREEN_ORIENTATION_CHANGED, ({ orientation }) => {
42742
+ // TODO create an class inherited from PlayerClappr
42743
+ assert.ok(this.player, 'Player is not initialized');
42744
+ const core = this.player.core;
42745
+ core.on(Events$1.CORE_SCREEN_ORIENTATION_CHANGED, ({ orientation }) => {
42722
42746
  trace(`${T} on CORE_SCREEN_ORIENTATION_CHANGED`, {
42723
42747
  orientation,
42724
42748
  rootNode: {
@@ -42733,14 +42757,14 @@ class Player {
42733
42757
  });
42734
42758
  }
42735
42759
  }, null);
42736
- core?.on(Events$1.CORE_RESIZE, ({ width, height }) => {
42760
+ core.on(Events$1.CORE_RESIZE, ({ width, height }) => {
42737
42761
  trace(`${T} on CORE_RESIZE`, {
42738
42762
  width,
42739
42763
  height,
42740
42764
  });
42741
42765
  this.safeTriggerEvent(PlayerEvent.Resize, { width, height });
42742
42766
  }, null);
42743
- core?.on(Events$1.CORE_FULLSCREEN, (isFullscreen) => {
42767
+ core.on(Events$1.CORE_FULLSCREEN, (isFullscreen) => {
42744
42768
  trace(`${T} CORE_FULLSCREEN`, {
42745
42769
  isFullscreen,
42746
42770
  });
@@ -42749,7 +42773,7 @@ class Player {
42749
42773
  }
42750
42774
  }
42751
42775
 
42752
- var version$1 = "2.20.3";
42776
+ var version$1 = "2.20.4";
42753
42777
 
42754
42778
  var packages = {
42755
42779
  "node_modules/@clappr/core": {