unified-video-framework 1.4.450 → 1.4.451

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.
@@ -1733,34 +1733,70 @@ export class WebPlayer extends BasePlayer {
1733
1733
 
1734
1734
  container.appendChild(iframeContainer);
1735
1735
 
1736
- // Create transparent overlay to block YouTube's native controls (when custom controls are enabled)
1737
- if (!this.youtubeNativeControls) {
1736
+ // Create transparent overlay for YouTube videos
1737
+ // When youtubeNativeControls=false: blocks YouTube controls and handles play/pause
1738
+ // When youtubeNativeControls=true with customControls=true: allows hover detection for our controls
1739
+ if (!this.youtubeNativeControls || this.useCustomControls) {
1738
1740
  const overlay = document.createElement('div');
1739
1741
  overlay.className = 'uvf-youtube-overlay';
1740
- // Styles are handled in CSS, just set essentials here
1741
- overlay.style.cssText = `
1742
- position: absolute;
1743
- top: 0;
1744
- left: 0;
1745
- width: 100%;
1746
- z-index: 2;
1747
- `;
1748
1742
 
1749
- // Handle click to toggle play/pause
1750
- overlay.addEventListener('click', () => {
1751
- this.togglePlayPause();
1743
+ // Different behavior based on mode
1744
+ if (!this.youtubeNativeControls) {
1745
+ // Full blocking mode - block all YouTube controls
1746
+ overlay.style.cssText = `
1747
+ position: absolute;
1748
+ top: 0;
1749
+ left: 0;
1750
+ width: 100%;
1751
+ z-index: 2;
1752
+ pointer-events: auto;
1753
+ `;
1754
+
1755
+ // Handle click to toggle play/pause
1756
+ overlay.addEventListener('click', () => {
1757
+ this.togglePlayPause();
1758
+ });
1759
+
1760
+ // Handle double-click for fullscreen
1761
+ overlay.addEventListener('dblclick', () => {
1762
+ if (this.isFullscreen()) {
1763
+ this.exitFullscreen();
1764
+ } else {
1765
+ this.enterFullscreen();
1766
+ }
1767
+ });
1768
+ } else {
1769
+ // Hybrid mode - transparent overlay just for hover detection, allow YouTube controls through
1770
+ overlay.style.cssText = `
1771
+ position: absolute;
1772
+ top: 0;
1773
+ left: 0;
1774
+ width: 100%;
1775
+ height: 100%;
1776
+ z-index: 2;
1777
+ pointer-events: none;
1778
+ `;
1779
+ }
1780
+
1781
+ // Always add mousemove listener for hover detection
1782
+ overlay.addEventListener('mouseenter', () => {
1783
+ this.playerWrapper?.classList.add('controls-visible');
1752
1784
  });
1753
1785
 
1754
- // Handle double-click for fullscreen
1755
- overlay.addEventListener('dblclick', () => {
1756
- if (this.isFullscreen()) {
1757
- this.exitFullscreen();
1758
- } else {
1759
- this.enterFullscreen();
1760
- }
1786
+ overlay.addEventListener('mouseleave', () => {
1787
+ this.playerWrapper?.classList.remove('controls-visible');
1761
1788
  });
1762
1789
 
1763
1790
  container.appendChild(overlay);
1791
+
1792
+ // Also add listeners to the container for fallback hover detection
1793
+ container.addEventListener('mouseenter', () => {
1794
+ this.playerWrapper?.classList.add('controls-visible');
1795
+ });
1796
+
1797
+ container.addEventListener('mouseleave', () => {
1798
+ this.playerWrapper?.classList.remove('controls-visible');
1799
+ });
1764
1800
  }
1765
1801
 
1766
1802
  // Load YouTube IFrame API if not loaded
@@ -5450,14 +5486,14 @@ export class WebPlayer extends BasePlayer {
5450
5486
  top: 0;
5451
5487
  height: 120px;
5452
5488
  background: linear-gradient(to bottom, var(--uvf-overlay-medium), var(--uvf-overlay-transparent));
5453
- z-index: 6;
5489
+ z-index: 96;
5454
5490
  }
5455
-
5491
+
5456
5492
  .uvf-controls-gradient {
5457
5493
  bottom: 0;
5458
5494
  height: 150px;
5459
5495
  background: linear-gradient(to top, var(--uvf-overlay-strong), var(--uvf-overlay-transparent));
5460
- z-index: 9;
5496
+ z-index: 97;
5461
5497
  }
5462
5498
 
5463
5499
  .uvf-player-wrapper:hover .uvf-top-gradient,
@@ -5511,7 +5547,7 @@ export class WebPlayer extends BasePlayer {
5511
5547
  align-items: center;
5512
5548
  justify-content: center;
5513
5549
  pointer-events: none;
5514
- z-index: 8;
5550
+ z-index: 99;
5515
5551
  }
5516
5552
 
5517
5553
  /* Center Play Button */
@@ -5581,7 +5617,7 @@ export class WebPlayer extends BasePlayer {
5581
5617
  left: 0;
5582
5618
  right: 0;
5583
5619
  padding: 20px;
5584
- z-index: 10;
5620
+ z-index: 100;
5585
5621
  opacity: 0;
5586
5622
  transform: translateY(10px);
5587
5623
  transition: all 0.3s ease;
@@ -6970,7 +7006,7 @@ export class WebPlayer extends BasePlayer {
6970
7006
  left: 0;
6971
7007
  right: 0;
6972
7008
  padding: 20px;
6973
- z-index: 7;
7009
+ z-index: 98;
6974
7010
  display: flex;
6975
7011
  justify-content: space-between;
6976
7012
  align-items: flex-start;