mirror of
https://github.com/mediacms-io/mediacms.git
synced 2025-11-06 23:48:54 -05:00
Add custom wrapper for volume panel
This commit is contained in:
parent
0f135e61bb
commit
73ea56c79b
@ -143,9 +143,26 @@ html {
|
||||
background: rgba(0, 0, 0, 0.2) !important;
|
||||
}
|
||||
|
||||
/* Volume panel wrapper styling */
|
||||
.video-js .vjs-volume-wrapper {
|
||||
order: 2 !important;
|
||||
display: flex !important;
|
||||
align-items: center !important;
|
||||
justify-content: center !important;
|
||||
position: relative !important;
|
||||
background: rgba(0, 0, 0, 0.1) !important;
|
||||
border-radius: 6px !important;
|
||||
padding: 2px !important;
|
||||
margin: 0 2px !important;
|
||||
transition: background-color 0.3s ease !important;
|
||||
}
|
||||
|
||||
.video-js .vjs-volume-wrapper:hover {
|
||||
background: rgba(0, 0, 0, 0.2) !important;
|
||||
}
|
||||
|
||||
.video-js .vjs-control {
|
||||
height: auto !important;
|
||||
|
||||
}
|
||||
.video-js .vjs-next-video-control {
|
||||
order: 1 !important;
|
||||
@ -190,7 +207,7 @@ html {
|
||||
|
||||
/* YouTube-style bottom gradient overlay - covers entire video bottom when controls active */
|
||||
.video-js-root-main .video-js.video-js-rounded-corners::after {
|
||||
content: '';
|
||||
content: "";
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
@ -227,7 +244,7 @@ html {
|
||||
/* Dark background overlay when controls are visible to improve readability on bright videos */
|
||||
.video-js.vjs-user-active::before,
|
||||
.video-js.vjs-paused::before {
|
||||
content: '';
|
||||
content: "";
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
@ -306,7 +323,6 @@ html {
|
||||
}
|
||||
.vjs-progress-holder {
|
||||
background: rgba(255, 255, 255, 0.5) !important;
|
||||
|
||||
}
|
||||
|
||||
.video-js .vjs-progress-control {
|
||||
@ -329,7 +345,7 @@ html {
|
||||
|
||||
.video-js .vjs-control-bar .vjs-icon-placeholder,
|
||||
.video-js .vjs-control-bar .vjs-button .vjs-icon-placeholder,
|
||||
.video-js .vjs-control-bar [class*='vjs-icon-'] {
|
||||
.video-js .vjs-control-bar [class*="vjs-icon-"] {
|
||||
font-size: 1.5em !important;
|
||||
}
|
||||
|
||||
|
||||
@ -2296,7 +2296,8 @@ function VideoJSPlayer({ videoId = 'default-video' }) {
|
||||
// BEGIN: Wrap play button in custom div container
|
||||
const playButtonEl = playToggle.el();
|
||||
const playButtonWrapper = document.createElement('div');
|
||||
playButtonWrapper.className = 'vjs-play-wrapper vjs-menu-button vjs-menu-button-popup vjs-control vjs-button';
|
||||
playButtonWrapper.className =
|
||||
'vjs-play-wrapper vjs-menu-button vjs-menu-button-popup vjs-control vjs-button';
|
||||
|
||||
// Insert wrapper before the play button and move play button inside
|
||||
playButtonEl.parentNode.insertBefore(playButtonWrapper, playButtonEl);
|
||||
@ -2332,7 +2333,8 @@ function VideoJSPlayer({ videoId = 'default-video' }) {
|
||||
const nextVideoButtonEl = nextVideoButton.el();
|
||||
if (nextVideoButtonEl) {
|
||||
const nextVideoWrapper = document.createElement('div');
|
||||
nextVideoWrapper.className = 'vjs-next-video-wrapper vjs-menu-button vjs-menu-button-popup vjs-control vjs-button';
|
||||
nextVideoWrapper.className =
|
||||
'vjs-next-video-wrapper vjs-menu-button vjs-menu-button-popup vjs-control vjs-button';
|
||||
|
||||
// Insert wrapper before the next video button and move button inside
|
||||
nextVideoButtonEl.parentNode.insertBefore(nextVideoWrapper, nextVideoButtonEl);
|
||||
@ -2342,6 +2344,24 @@ function VideoJSPlayer({ videoId = 'default-video' }) {
|
||||
}
|
||||
// END: Implement custom next video button
|
||||
|
||||
// BEGIN: Wrap volume panel in custom div container
|
||||
setTimeout(() => {
|
||||
const volumePanel = controlBar.getChild('volumePanel');
|
||||
if (volumePanel) {
|
||||
const volumePanelEl = volumePanel.el();
|
||||
if (volumePanelEl) {
|
||||
const volumeWrapper = document.createElement('div');
|
||||
volumeWrapper.className =
|
||||
'vjs-volume-wrapper vjs-menu-button vjs-menu-button-popup vjs-control vjs-button';
|
||||
|
||||
// Insert wrapper before the volume panel and move panel inside
|
||||
volumePanelEl.parentNode.insertBefore(volumeWrapper, volumePanelEl);
|
||||
volumeWrapper.appendChild(volumePanelEl);
|
||||
}
|
||||
}
|
||||
}, 100); // Small delay to ensure volume panel is fully rendered
|
||||
// END: Wrap volume panel in custom div container
|
||||
|
||||
// BEGIN: Implement autoplay toggle button - simplified
|
||||
if (!isEmbedPlayer) {
|
||||
try {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user