unified-video-framework 1.4.449 → 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
@@ -1842,12 +1878,15 @@ export class WebPlayer extends BasePlayer {
1842
1878
  const loading = document.getElementById('uvf-loading');
1843
1879
  if (loading) loading.classList.remove('active');
1844
1880
 
1845
- // If YouTube native controls are enabled, hide custom controls
1846
- if (this.youtubeNativeControls && this.playerWrapper) {
1847
- this.debugLog('[YouTube] Native controls enabled - hiding custom controls');
1881
+ // If YouTube native controls are enabled AND custom controls are disabled, hide custom controls
1882
+ // This allows hybrid mode where both YouTube native controls and custom controls can be shown
1883
+ if (this.youtubeNativeControls && !this.useCustomControls && this.playerWrapper) {
1884
+ this.debugLog('[YouTube] Native controls enabled & custom controls disabled - hiding custom controls');
1848
1885
  this.playerWrapper.classList.add('youtube-native-controls-mode');
1849
1886
  // Also hide center play button and custom controls
1850
1887
  this.hideCustomControls();
1888
+ } else if (this.youtubeNativeControls && this.useCustomControls) {
1889
+ this.debugLog('[YouTube] Hybrid mode - both YouTube native controls and custom controls enabled');
1851
1890
  }
1852
1891
 
1853
1892
  // Set initial volume
@@ -5447,14 +5486,14 @@ export class WebPlayer extends BasePlayer {
5447
5486
  top: 0;
5448
5487
  height: 120px;
5449
5488
  background: linear-gradient(to bottom, var(--uvf-overlay-medium), var(--uvf-overlay-transparent));
5450
- z-index: 6;
5489
+ z-index: 96;
5451
5490
  }
5452
-
5491
+
5453
5492
  .uvf-controls-gradient {
5454
5493
  bottom: 0;
5455
5494
  height: 150px;
5456
5495
  background: linear-gradient(to top, var(--uvf-overlay-strong), var(--uvf-overlay-transparent));
5457
- z-index: 9;
5496
+ z-index: 97;
5458
5497
  }
5459
5498
 
5460
5499
  .uvf-player-wrapper:hover .uvf-top-gradient,
@@ -5508,7 +5547,7 @@ export class WebPlayer extends BasePlayer {
5508
5547
  align-items: center;
5509
5548
  justify-content: center;
5510
5549
  pointer-events: none;
5511
- z-index: 8;
5550
+ z-index: 99;
5512
5551
  }
5513
5552
 
5514
5553
  /* Center Play Button */
@@ -5578,7 +5617,7 @@ export class WebPlayer extends BasePlayer {
5578
5617
  left: 0;
5579
5618
  right: 0;
5580
5619
  padding: 20px;
5581
- z-index: 10;
5620
+ z-index: 100;
5582
5621
  opacity: 0;
5583
5622
  transform: translateY(10px);
5584
5623
  transition: all 0.3s ease;
@@ -6967,7 +7006,7 @@ export class WebPlayer extends BasePlayer {
6967
7006
  left: 0;
6968
7007
  right: 0;
6969
7008
  padding: 20px;
6970
- z-index: 7;
7009
+ z-index: 98;
6971
7010
  display: flex;
6972
7011
  justify-content: space-between;
6973
7012
  align-items: flex-start;