unified-video-framework 1.4.261 → 1.4.262
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.
|
@@ -1154,16 +1154,18 @@ export class WebPlayer extends BasePlayer {
|
|
|
1154
1154
|
this.video.style.display = 'none';
|
|
1155
1155
|
}
|
|
1156
1156
|
|
|
1157
|
-
// Create iframe container
|
|
1157
|
+
// Create iframe container with proper z-index based on controls configuration
|
|
1158
1158
|
const iframeContainer = document.createElement('div');
|
|
1159
1159
|
iframeContainer.id = `youtube-player-${videoId}`;
|
|
1160
|
+
const useNativeControls = this.config.youtubeNativeControls === true;
|
|
1160
1161
|
iframeContainer.style.cssText = `
|
|
1161
1162
|
position: absolute;
|
|
1162
1163
|
top: 0;
|
|
1163
1164
|
left: 0;
|
|
1164
1165
|
width: 100%;
|
|
1165
1166
|
height: 100%;
|
|
1166
|
-
z-index: 1;
|
|
1167
|
+
z-index: ${useNativeControls ? '1' : '0'};
|
|
1168
|
+
pointer-events: ${useNativeControls ? 'auto' : 'none'};
|
|
1167
1169
|
`;
|
|
1168
1170
|
|
|
1169
1171
|
// Remove existing YouTube player if any
|
|
@@ -1269,6 +1271,8 @@ export class WebPlayer extends BasePlayer {
|
|
|
1269
1271
|
setTimeout(() => {
|
|
1270
1272
|
this.updateMetadataUI();
|
|
1271
1273
|
this.updateControlsVisibility();
|
|
1274
|
+
// Ensure UI elements have correct z-index for YouTube integration
|
|
1275
|
+
this.ensureUILayering();
|
|
1272
1276
|
}, 500);
|
|
1273
1277
|
}
|
|
1274
1278
|
|
|
@@ -1436,6 +1440,26 @@ export class WebPlayer extends BasePlayer {
|
|
|
1436
1440
|
}
|
|
1437
1441
|
}
|
|
1438
1442
|
|
|
1443
|
+
/**
|
|
1444
|
+
* Ensure all UI elements have correct z-index for proper layering
|
|
1445
|
+
*/
|
|
1446
|
+
private ensureUILayering(): void {
|
|
1447
|
+
if (!this.youtubePlayer) return;
|
|
1448
|
+
|
|
1449
|
+
const videoContainer = this.playerWrapper?.querySelector('.uvf-video-container') as HTMLElement;
|
|
1450
|
+
if (!videoContainer) return;
|
|
1451
|
+
|
|
1452
|
+
// Ensure all custom UI elements are above the YouTube iframe
|
|
1453
|
+
const uiElements = videoContainer.querySelectorAll('.uvf-top-gradient, .uvf-controls-gradient, .uvf-top-bar, .uvf-center-play-container, .uvf-shortcut-indicator, .uvf-controls-bar');
|
|
1454
|
+
uiElements.forEach(el => {
|
|
1455
|
+
const element = el as HTMLElement;
|
|
1456
|
+
element.style.zIndex = '2';
|
|
1457
|
+
element.style.position = 'relative';
|
|
1458
|
+
});
|
|
1459
|
+
|
|
1460
|
+
this.debugLog('UI layering ensured for YouTube player');
|
|
1461
|
+
}
|
|
1462
|
+
|
|
1439
1463
|
/**
|
|
1440
1464
|
* Update controls visibility based on YouTube Live status and config
|
|
1441
1465
|
*/
|
|
@@ -1454,6 +1478,18 @@ export class WebPlayer extends BasePlayer {
|
|
|
1454
1478
|
if (this.youtubePlayer && this.useYouTubeNativeControls) {
|
|
1455
1479
|
// Hide custom controls
|
|
1456
1480
|
controlsContainerFallback.style.display = 'none';
|
|
1481
|
+
|
|
1482
|
+
// Lower YouTube wrapper z-index and pointer events appropriately
|
|
1483
|
+
const videoId = this.source?.metadata?.videoId;
|
|
1484
|
+
if (videoId) {
|
|
1485
|
+
const ytWrapper = this.playerWrapper?.querySelector(`#youtube-player-${videoId}`) as HTMLElement;
|
|
1486
|
+
if (ytWrapper) {
|
|
1487
|
+
ytWrapper.style.zIndex = '1';
|
|
1488
|
+
ytWrapper.style.pointerEvents = 'auto';
|
|
1489
|
+
ytWrapper.style.position = 'absolute';
|
|
1490
|
+
}
|
|
1491
|
+
}
|
|
1492
|
+
|
|
1457
1493
|
// Also hide any other control elements
|
|
1458
1494
|
const videoContainer = this.playerWrapper?.querySelector('.uvf-video-container') as HTMLElement;
|
|
1459
1495
|
if (videoContainer) {
|
|
@@ -1474,11 +1510,29 @@ export class WebPlayer extends BasePlayer {
|
|
|
1474
1510
|
} else {
|
|
1475
1511
|
// Show custom controls
|
|
1476
1512
|
controlsContainerFallback.style.display = 'flex';
|
|
1477
|
-
|
|
1513
|
+
controlsContainerFallback.style.zIndex = '2';
|
|
1514
|
+
|
|
1515
|
+
// Raise YouTube wrapper below UI and disable pointer events so UI is clickable
|
|
1516
|
+
const videoId = this.source?.metadata?.videoId;
|
|
1517
|
+
if (videoId) {
|
|
1518
|
+
const ytWrapper = this.playerWrapper?.querySelector(`#youtube-player-${videoId}`) as HTMLElement;
|
|
1519
|
+
if (ytWrapper) {
|
|
1520
|
+
ytWrapper.style.zIndex = '0';
|
|
1521
|
+
ytWrapper.style.pointerEvents = 'none';
|
|
1522
|
+
ytWrapper.style.position = 'absolute';
|
|
1523
|
+
}
|
|
1524
|
+
}
|
|
1525
|
+
|
|
1526
|
+
// Also show other control elements and ensure they are above the iframe
|
|
1478
1527
|
const videoContainer = this.playerWrapper?.querySelector('.uvf-video-container') as HTMLElement;
|
|
1479
1528
|
if (videoContainer) {
|
|
1480
1529
|
const allControls = videoContainer.querySelectorAll('.uvf-top-gradient, .uvf-controls-gradient, .uvf-top-bar, .uvf-center-play-container, .uvf-shortcut-indicator');
|
|
1481
|
-
allControls.forEach(el =>
|
|
1530
|
+
allControls.forEach(el => {
|
|
1531
|
+
const elh = el as HTMLElement;
|
|
1532
|
+
elh.style.display = '';
|
|
1533
|
+
elh.style.zIndex = '2';
|
|
1534
|
+
elh.style.position = 'relative';
|
|
1535
|
+
});
|
|
1482
1536
|
}
|
|
1483
1537
|
|
|
1484
1538
|
// Only recreate YouTube player if it currently has native controls
|
|
@@ -1496,6 +1550,17 @@ export class WebPlayer extends BasePlayer {
|
|
|
1496
1550
|
// Hide custom controls and show YouTube native controls
|
|
1497
1551
|
controlsContainer.style.display = 'none';
|
|
1498
1552
|
|
|
1553
|
+
// Lower YouTube wrapper z-index and enable pointer events
|
|
1554
|
+
const videoId = this.source?.metadata?.videoId;
|
|
1555
|
+
if (videoId) {
|
|
1556
|
+
const ytWrapper = this.playerWrapper?.querySelector(`#youtube-player-${videoId}`) as HTMLElement;
|
|
1557
|
+
if (ytWrapper) {
|
|
1558
|
+
ytWrapper.style.zIndex = '1';
|
|
1559
|
+
ytWrapper.style.pointerEvents = 'auto';
|
|
1560
|
+
ytWrapper.style.position = 'absolute';
|
|
1561
|
+
}
|
|
1562
|
+
}
|
|
1563
|
+
|
|
1499
1564
|
// Only recreate YouTube player if it doesn't currently have native controls
|
|
1500
1565
|
if (this.currentYouTubeControlsState !== true) {
|
|
1501
1566
|
this.recreateYouTubePlayerWithNativeControls();
|
|
@@ -1509,6 +1574,30 @@ export class WebPlayer extends BasePlayer {
|
|
|
1509
1574
|
} else {
|
|
1510
1575
|
// Show custom controls and ensure YouTube native controls are disabled
|
|
1511
1576
|
controlsContainer.style.display = 'flex';
|
|
1577
|
+
controlsContainer.style.zIndex = '2';
|
|
1578
|
+
controlsContainer.style.position = 'relative';
|
|
1579
|
+
|
|
1580
|
+
// Ensure YouTube iframe is behind controls and disable pointer events
|
|
1581
|
+
const videoId = this.source?.metadata?.videoId;
|
|
1582
|
+
if (videoId) {
|
|
1583
|
+
const ytWrapper = this.playerWrapper?.querySelector(`#youtube-player-${videoId}`) as HTMLElement;
|
|
1584
|
+
if (ytWrapper) {
|
|
1585
|
+
ytWrapper.style.zIndex = '0';
|
|
1586
|
+
ytWrapper.style.pointerEvents = 'none';
|
|
1587
|
+
ytWrapper.style.position = 'absolute';
|
|
1588
|
+
}
|
|
1589
|
+
}
|
|
1590
|
+
|
|
1591
|
+
// Ensure other UI elements are also above the iframe
|
|
1592
|
+
const videoContainer = this.playerWrapper?.querySelector('.uvf-video-container') as HTMLElement;
|
|
1593
|
+
if (videoContainer) {
|
|
1594
|
+
const allControls = videoContainer.querySelectorAll('.uvf-top-gradient, .uvf-controls-gradient, .uvf-top-bar, .uvf-center-play-container, .uvf-shortcut-indicator');
|
|
1595
|
+
allControls.forEach(el => {
|
|
1596
|
+
const elh = el as HTMLElement;
|
|
1597
|
+
elh.style.zIndex = '2';
|
|
1598
|
+
elh.style.position = 'relative';
|
|
1599
|
+
});
|
|
1600
|
+
}
|
|
1512
1601
|
|
|
1513
1602
|
// Only recreate YouTube player if it currently has native controls
|
|
1514
1603
|
if (this.currentYouTubeControlsState !== false) {
|
|
@@ -1617,7 +1706,8 @@ export class WebPlayer extends BasePlayer {
|
|
|
1617
1706
|
left: 0;
|
|
1618
1707
|
width: 100%;
|
|
1619
1708
|
height: 100%;
|
|
1620
|
-
z-index:
|
|
1709
|
+
z-index: 0;
|
|
1710
|
+
pointer-events: none;
|
|
1621
1711
|
`;
|
|
1622
1712
|
container.appendChild(iframeContainer);
|
|
1623
1713
|
|