@unlk/keymaster 1.3.5 → 1.3.7

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.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Unlock Keymaster v1.3.5 (https://unlock-com.github.io/keymaster)
2
+ * Unlock Keymaster v1.3.7 (https://unlock-com.github.io/keymaster)
3
3
  * Copyright 2022-2025 Unlk Developers
4
4
  */
5
5
  (function (global, factory) {
@@ -7668,7 +7668,11 @@
7668
7668
  if (window.YT?.Player) {
7669
7669
  resolve();
7670
7670
  } else {
7671
+ const prev = window.onYouTubeIframeAPIReady;
7671
7672
  window.onYouTubeIframeAPIReady = () => {
7673
+ try {
7674
+ if (typeof prev === 'function') prev();
7675
+ } catch {}
7672
7676
  resolve();
7673
7677
  };
7674
7678
  const script = document.createElement('script');
@@ -7719,6 +7723,8 @@
7719
7723
  id: vimeoId,
7720
7724
  autoplay: true
7721
7725
  });
7726
+ this._element.dataset.vimeoId = String(vimeoId);
7727
+ this._element.__unlkVimeoPlayer = this._vimeoPlayer;
7722
7728
  return;
7723
7729
  }
7724
7730
  if (this._youtubeSrc) {
@@ -7732,6 +7738,8 @@
7732
7738
  rel: 0
7733
7739
  }
7734
7740
  });
7741
+ this._element.dataset.ytId = youtubeId;
7742
+ this._element.__unlkYtPlayer = this._youtubePlayer;
7735
7743
  }
7736
7744
  }
7737
7745
  _onHide() {
@@ -7743,6 +7751,10 @@
7743
7751
  this._youtubePlayer.destroy();
7744
7752
  this._youtubePlayer = null;
7745
7753
  }
7754
+ delete this._element.__unlkYtPlayer;
7755
+ delete this._element.dataset.ytId;
7756
+ delete this._element.__unlkVimeoPlayer;
7757
+ delete this._element.dataset.vimeoId;
7746
7758
  }
7747
7759
  _getYouTubeId(url) {
7748
7760
  const match = url.match(/(?:youtube\.com\/(?:watch\?v=|embed\/|v\/)|youtu\.be\/)([\w-]{11})/);