@gcorevideo/player 2.19.10 → 2.19.11

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/core.js CHANGED
@@ -12508,14 +12508,13 @@ class DashPlayback extends HTML5Video {
12508
12508
  this._dash = dash;
12509
12509
  this._dash.initialize();
12510
12510
  if (this.options.dash) {
12511
- // TODO use $.extend
12512
- const settings = $.extend({}, this.options.dash, {
12511
+ const settings = $.extend(true, {
12513
12512
  streaming: {
12514
12513
  text: {
12515
12514
  defaultEnabled: false,
12516
12515
  },
12517
12516
  },
12518
- });
12517
+ }, this.options.dash);
12519
12518
  this._dash.updateSettings(settings);
12520
12519
  }
12521
12520
  this._dash.attachView(this.el);
@@ -42340,8 +42339,6 @@ class Player {
42340
42339
  player = null;
42341
42340
  ready = false;
42342
42341
  rootNode = null;
42343
- tuneInTimerId = null;
42344
- tunedIn = false;
42345
42342
  constructor(config) {
42346
42343
  this.setConfig(config);
42347
42344
  // TODO decide whether the order of playback modules might vary,
@@ -42434,11 +42431,6 @@ class Player {
42434
42431
  this.player = null;
42435
42432
  }
42436
42433
  this.ready = false;
42437
- this.tunedIn = false;
42438
- if (this.tuneInTimerId) {
42439
- clearTimeout(this.tuneInTimerId);
42440
- this.tuneInTimerId = null;
42441
- }
42442
42434
  }
42443
42435
  /**
42444
42436
  * Current playback (time since the beginning of the stream), if appropriate.
@@ -42597,36 +42589,16 @@ class Player {
42597
42589
  assert.ok(!this.player, 'Player already initialized');
42598
42590
  const player = new Player$1(coreOptions);
42599
42591
  this.player = player;
42600
- // TODO checks if the whole thing is necessary
42601
- this.tuneInTimerId = globalThis.setTimeout(() => {
42602
- trace(`${T} tuneInTimer`, {
42603
- ready: this.ready,
42604
- tunedIn: this.tunedIn,
42605
- });
42606
- this.tuneInTimerId = null;
42607
- this.tuneIn();
42608
- }, 4000);
42592
+ this.bindCoreListeners();
42609
42593
  }
42610
42594
  async tuneIn() {
42611
42595
  assert.ok(this.player);
42612
- trace(`${T} tuneIn`, {
42613
- ready: this.ready,
42614
- tunedIn: this.tunedIn,
42615
- });
42616
- if (this.tunedIn) {
42617
- return;
42618
- }
42619
- this.tunedIn = true;
42620
- const player = this.player;
42621
- this.bindContainerEventListeners(player);
42622
- player.core.on(Events$1.CORE_ACTIVE_CONTAINER_CHANGED, () => this.bindContainerEventListeners(player), null);
42623
- this.bindSizeManagementListeners(player);
42596
+ this.bindContainerEventListeners();
42597
+ this.player.core.on(Events$1.CORE_ACTIVE_CONTAINER_CHANGED, () => this.bindContainerEventListeners(), null);
42624
42598
  if (this.config.autoPlay) {
42599
+ trace(`${T} autoPlay`);
42625
42600
  setTimeout(() => {
42626
- trace(`${T} autoPlay`, {
42627
- playback: this.player?.core.activePlayback.name,
42628
- });
42629
- player.play({
42601
+ this.player?.play({
42630
42602
  autoPlay: true,
42631
42603
  });
42632
42604
  }, 0);
@@ -42656,11 +42628,6 @@ class Player {
42656
42628
  return;
42657
42629
  }
42658
42630
  this.ready = true;
42659
- if (this.tuneInTimerId) {
42660
- clearTimeout(this.tuneInTimerId);
42661
- this.tuneInTimerId = null;
42662
- }
42663
- // TODO ensure that CORE_ACTIVE_CONTAINER_CHANGED does not get caught before onReady
42664
42631
  setTimeout(() => this.tuneIn(), 0);
42665
42632
  },
42666
42633
  onPlay: () => {
@@ -42693,15 +42660,12 @@ class Player {
42693
42660
  sources,
42694
42661
  });
42695
42662
  this.rootNode = rootNode;
42696
- const coreOptions = $.extend(true, this.config, {
42663
+ const coreOptions = $.extend(true, {
42697
42664
  allowUserInteraction: true,
42698
42665
  autoPlay: false,
42699
- dash: this.config.dash,
42700
- debug: this.config.debug || 'none',
42666
+ debug: 'none',
42701
42667
  events: this.events,
42702
42668
  height: rootNode.clientHeight,
42703
- loop: this.config.loop,
42704
- mute: this.config.mute,
42705
42669
  playback: {
42706
42670
  controls: false,
42707
42671
  playInline: true,
@@ -42713,12 +42677,11 @@ class Player {
42713
42677
  },
42714
42678
  },
42715
42679
  parent: rootNode,
42716
- playbackType: this.config.playbackType,
42717
42680
  width: rootNode.clientWidth,
42718
42681
  source: source ? source.source : undefined,
42719
42682
  mimeType: source ? source.mimeType : undefined,
42683
+ }, this.config, {
42720
42684
  sources,
42721
- strings: this.config.strings,
42722
42685
  });
42723
42686
  return coreOptions;
42724
42687
  }
@@ -42730,23 +42693,27 @@ class Player {
42730
42693
  // TODO ensure unsupported sources are filtered out
42731
42694
  this.config.sources.map((s) => wrapSource(s)), this.config.priorityTransport);
42732
42695
  }
42733
- bindContainerEventListeners(player) {
42734
- if (Browser.isiOS && player.core.activePlayback) {
42735
- player.core.activePlayback.$el.on('webkitendfullscreen', () => {
42696
+ bindContainerEventListeners() {
42697
+ const activePlayback = this.player?.core.activePlayback;
42698
+ const activeContainer = this.player?.core.activeContainer;
42699
+ if (Browser.isiOS && activePlayback) {
42700
+ // TODO check out
42701
+ activePlayback.$el.on('webkitendfullscreen', () => {
42736
42702
  try {
42737
- player.core.handleFullscreenChange();
42703
+ activeContainer?.handleFullscreenChange();
42738
42704
  }
42739
42705
  catch (e) {
42740
42706
  reportError(e);
42741
42707
  }
42742
42708
  });
42743
42709
  }
42744
- player.core.activeContainer.on(Events$1.CONTAINER_VOLUME, (volume) => {
42710
+ activeContainer?.on(Events$1.CONTAINER_VOLUME, (volume) => {
42745
42711
  this.safeTriggerEvent(PlayerEvent.VolumeUpdate, volume);
42746
42712
  }, null);
42747
42713
  }
42748
- bindSizeManagementListeners(player) {
42749
- player.core.on(Events$1.CORE_SCREEN_ORIENTATION_CHANGED, ({ orientation }) => {
42714
+ bindCoreListeners() {
42715
+ const core = this.player?.core;
42716
+ core?.on(Events$1.CORE_SCREEN_ORIENTATION_CHANGED, ({ orientation }) => {
42750
42717
  trace(`${T} on CORE_SCREEN_ORIENTATION_CHANGED`, {
42751
42718
  orientation,
42752
42719
  rootNode: {
@@ -42755,20 +42722,20 @@ class Player {
42755
42722
  },
42756
42723
  });
42757
42724
  if (Browser.isiOS && this.rootNode) {
42758
- player.core.resize({
42725
+ core?.resize({
42759
42726
  width: this.rootNode.clientWidth,
42760
42727
  height: this.rootNode.clientHeight,
42761
42728
  });
42762
42729
  }
42763
42730
  }, null);
42764
- player.core.on(Events$1.CORE_RESIZE, ({ width, height }) => {
42731
+ core?.on(Events$1.CORE_RESIZE, ({ width, height }) => {
42765
42732
  trace(`${T} on CORE_RESIZE`, {
42766
42733
  width,
42767
42734
  height,
42768
42735
  });
42769
42736
  this.safeTriggerEvent(PlayerEvent.Resize, { width, height });
42770
42737
  }, null);
42771
- player.core.on(Events$1.CORE_FULLSCREEN, (isFullscreen) => {
42738
+ core?.on(Events$1.CORE_FULLSCREEN, (isFullscreen) => {
42772
42739
  trace(`${T} CORE_FULLSCREEN`, {
42773
42740
  isFullscreen,
42774
42741
  });
@@ -42777,7 +42744,7 @@ class Player {
42777
42744
  }
42778
42745
  }
42779
42746
 
42780
- var version$1 = "2.19.10";
42747
+ var version$1 = "2.19.11";
42781
42748
 
42782
42749
  var packages = {
42783
42750
  "node_modules/@clappr/core": {