@gcorevideo/player 2.19.10 → 2.19.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.
package/dist/index.js CHANGED
@@ -12594,14 +12594,13 @@ class DashPlayback extends HTML5Video {
12594
12594
  this._dash = dash;
12595
12595
  this._dash.initialize();
12596
12596
  if (this.options.dash) {
12597
- // TODO use $.extend
12598
- const settings = $.extend({}, this.options.dash, {
12597
+ const settings = $.extend(true, {
12599
12598
  streaming: {
12600
12599
  text: {
12601
12600
  defaultEnabled: false,
12602
12601
  },
12603
12602
  },
12604
- });
12603
+ }, this.options.dash);
12605
12604
  this._dash.updateSettings(settings);
12606
12605
  }
12607
12606
  this._dash.attachView(this.el);
@@ -42426,8 +42425,6 @@ class Player {
42426
42425
  player = null;
42427
42426
  ready = false;
42428
42427
  rootNode = null;
42429
- tuneInTimerId = null;
42430
- tunedIn = false;
42431
42428
  constructor(config) {
42432
42429
  this.setConfig(config);
42433
42430
  // TODO decide whether the order of playback modules might vary,
@@ -42520,11 +42517,6 @@ class Player {
42520
42517
  this.player = null;
42521
42518
  }
42522
42519
  this.ready = false;
42523
- this.tunedIn = false;
42524
- if (this.tuneInTimerId) {
42525
- clearTimeout(this.tuneInTimerId);
42526
- this.tuneInTimerId = null;
42527
- }
42528
42520
  }
42529
42521
  /**
42530
42522
  * Current playback (time since the beginning of the stream), if appropriate.
@@ -42683,36 +42675,16 @@ class Player {
42683
42675
  assert.ok(!this.player, 'Player already initialized');
42684
42676
  const player = new Player$1(coreOptions);
42685
42677
  this.player = player;
42686
- // TODO checks if the whole thing is necessary
42687
- this.tuneInTimerId = globalThis.setTimeout(() => {
42688
- trace(`${T$a} tuneInTimer`, {
42689
- ready: this.ready,
42690
- tunedIn: this.tunedIn,
42691
- });
42692
- this.tuneInTimerId = null;
42693
- this.tuneIn();
42694
- }, 4000);
42678
+ this.bindCoreListeners();
42695
42679
  }
42696
42680
  async tuneIn() {
42697
42681
  assert.ok(this.player);
42698
- trace(`${T$a} tuneIn`, {
42699
- ready: this.ready,
42700
- tunedIn: this.tunedIn,
42701
- });
42702
- if (this.tunedIn) {
42703
- return;
42704
- }
42705
- this.tunedIn = true;
42706
- const player = this.player;
42707
- this.bindContainerEventListeners(player);
42708
- player.core.on(Events$1.CORE_ACTIVE_CONTAINER_CHANGED, () => this.bindContainerEventListeners(player), null);
42709
- this.bindSizeManagementListeners(player);
42682
+ this.bindContainerEventListeners();
42683
+ this.player.core.on(Events$1.CORE_ACTIVE_CONTAINER_CHANGED, () => this.bindContainerEventListeners(), null);
42710
42684
  if (this.config.autoPlay) {
42685
+ trace(`${T$a} autoPlay`);
42711
42686
  setTimeout(() => {
42712
- trace(`${T$a} autoPlay`, {
42713
- playback: this.player?.core.activePlayback.name,
42714
- });
42715
- player.play({
42687
+ this.player?.play({
42716
42688
  autoPlay: true,
42717
42689
  });
42718
42690
  }, 0);
@@ -42742,11 +42714,6 @@ class Player {
42742
42714
  return;
42743
42715
  }
42744
42716
  this.ready = true;
42745
- if (this.tuneInTimerId) {
42746
- clearTimeout(this.tuneInTimerId);
42747
- this.tuneInTimerId = null;
42748
- }
42749
- // TODO ensure that CORE_ACTIVE_CONTAINER_CHANGED does not get caught before onReady
42750
42717
  setTimeout(() => this.tuneIn(), 0);
42751
42718
  },
42752
42719
  onPlay: () => {
@@ -42779,15 +42746,11 @@ class Player {
42779
42746
  sources,
42780
42747
  });
42781
42748
  this.rootNode = rootNode;
42782
- const coreOptions = $.extend(true, this.config, {
42749
+ const coreOptions = $.extend(true, {
42783
42750
  allowUserInteraction: true,
42784
- autoPlay: false,
42785
- dash: this.config.dash,
42786
- debug: this.config.debug || 'none',
42751
+ debug: 'none',
42787
42752
  events: this.events,
42788
42753
  height: rootNode.clientHeight,
42789
- loop: this.config.loop,
42790
- mute: this.config.mute,
42791
42754
  playback: {
42792
42755
  controls: false,
42793
42756
  playInline: true,
@@ -42799,12 +42762,12 @@ class Player {
42799
42762
  },
42800
42763
  },
42801
42764
  parent: rootNode,
42802
- playbackType: this.config.playbackType,
42803
42765
  width: rootNode.clientWidth,
42804
42766
  source: source ? source.source : undefined,
42805
42767
  mimeType: source ? source.mimeType : undefined,
42768
+ }, this.config, {
42769
+ autoPlay: false, // TODO write a test to check it's reset to false
42806
42770
  sources,
42807
- strings: this.config.strings,
42808
42771
  });
42809
42772
  return coreOptions;
42810
42773
  }
@@ -42816,23 +42779,27 @@ class Player {
42816
42779
  // TODO ensure unsupported sources are filtered out
42817
42780
  this.config.sources.map((s) => wrapSource(s)), this.config.priorityTransport);
42818
42781
  }
42819
- bindContainerEventListeners(player) {
42820
- if (Browser.isiOS && player.core.activePlayback) {
42821
- player.core.activePlayback.$el.on('webkitendfullscreen', () => {
42782
+ bindContainerEventListeners() {
42783
+ const activePlayback = this.player?.core.activePlayback;
42784
+ const activeContainer = this.player?.core.activeContainer;
42785
+ if (Browser.isiOS && activePlayback) {
42786
+ // TODO check out
42787
+ activePlayback.$el.on('webkitendfullscreen', () => {
42822
42788
  try {
42823
- player.core.handleFullscreenChange();
42789
+ activeContainer?.handleFullscreenChange();
42824
42790
  }
42825
42791
  catch (e) {
42826
42792
  reportError(e);
42827
42793
  }
42828
42794
  });
42829
42795
  }
42830
- player.core.activeContainer.on(Events$1.CONTAINER_VOLUME, (volume) => {
42796
+ activeContainer?.on(Events$1.CONTAINER_VOLUME, (volume) => {
42831
42797
  this.safeTriggerEvent(PlayerEvent.VolumeUpdate, volume);
42832
42798
  }, null);
42833
42799
  }
42834
- bindSizeManagementListeners(player) {
42835
- player.core.on(Events$1.CORE_SCREEN_ORIENTATION_CHANGED, ({ orientation }) => {
42800
+ bindCoreListeners() {
42801
+ const core = this.player?.core;
42802
+ core?.on(Events$1.CORE_SCREEN_ORIENTATION_CHANGED, ({ orientation }) => {
42836
42803
  trace(`${T$a} on CORE_SCREEN_ORIENTATION_CHANGED`, {
42837
42804
  orientation,
42838
42805
  rootNode: {
@@ -42841,20 +42808,20 @@ class Player {
42841
42808
  },
42842
42809
  });
42843
42810
  if (Browser.isiOS && this.rootNode) {
42844
- player.core.resize({
42811
+ core?.resize({
42845
42812
  width: this.rootNode.clientWidth,
42846
42813
  height: this.rootNode.clientHeight,
42847
42814
  });
42848
42815
  }
42849
42816
  }, null);
42850
- player.core.on(Events$1.CORE_RESIZE, ({ width, height }) => {
42817
+ core?.on(Events$1.CORE_RESIZE, ({ width, height }) => {
42851
42818
  trace(`${T$a} on CORE_RESIZE`, {
42852
42819
  width,
42853
42820
  height,
42854
42821
  });
42855
42822
  this.safeTriggerEvent(PlayerEvent.Resize, { width, height });
42856
42823
  }, null);
42857
- player.core.on(Events$1.CORE_FULLSCREEN, (isFullscreen) => {
42824
+ core?.on(Events$1.CORE_FULLSCREEN, (isFullscreen) => {
42858
42825
  trace(`${T$a} CORE_FULLSCREEN`, {
42859
42826
  isFullscreen,
42860
42827
  });
@@ -42863,7 +42830,7 @@ class Player {
42863
42830
  }
42864
42831
  }
42865
42832
 
42866
- var version$1 = "2.19.10";
42833
+ var version$1 = "2.19.12";
42867
42834
 
42868
42835
  var packages = {
42869
42836
  "node_modules/@clappr/core": {
@@ -47810,7 +47777,7 @@ class MediaControl extends UICorePlugin {
47810
47777
  $volumeBarScrubber = null;
47811
47778
  $volumeContainer = null;
47812
47779
  $volumeIcon = null;
47813
- template = tmpl(mediaControlHTML);
47780
+ static template = tmpl(mediaControlHTML);
47814
47781
  get name() {
47815
47782
  return 'media_control';
47816
47783
  }
@@ -48596,9 +48563,6 @@ class MediaControl extends UICorePlugin {
48596
48563
  parseColors() {
48597
48564
  const design = this.options.design || {};
48598
48565
  let variables = [];
48599
- if (!tmpl) {
48600
- return;
48601
- }
48602
48566
  // TODO camel case
48603
48567
  if (design.background_color) {
48604
48568
  variables = variables.concat([
@@ -48641,7 +48605,7 @@ class MediaControl extends UICorePlugin {
48641
48605
  }
48642
48606
  render() {
48643
48607
  const timeout = this.options.hideMediaControlDelay || 2000;
48644
- const html = this.template({ settings: this.settings ?? {} });
48608
+ const html = MediaControl.template({ settings: this.settings ?? {} });
48645
48609
  this.$el.html(html);
48646
48610
  // const style = Styler.getStyleFor(mediaControlStyle, { baseUrl: this.options.baseUrl });
48647
48611
  // this.$el.append(style[0]);
@@ -51208,7 +51172,6 @@ class SourceController extends CorePlugin {
51208
51172
  else {
51209
51173
  this.sync = noSync;
51210
51174
  }
51211
- // TODO bind to CORE_ACTIVE_CONTAINER_CHANGED
51212
51175
  this.bindContainerEventListeners();
51213
51176
  if (this.active) {
51214
51177
  this.core.activeContainer?.getPlugin('poster_custom')?.disable();
package/dist/player.d.ts CHANGED
@@ -661,7 +661,7 @@ export declare class MediaControl extends UICorePlugin {
661
661
  private $volumeBarScrubber;
662
662
  private $volumeContainer;
663
663
  private $volumeIcon;
664
- private readonly template;
664
+ private static readonly template;
665
665
  get name(): string;
666
666
  get supportedVersion(): {
667
667
  min: string;