mirror of
https://github.com/mediacms-io/mediacms.git
synced 2025-11-11 09:58:53 -05:00
Add custom wrapper for settings button in VideoJS
This commit is contained in:
parent
b70e8267ac
commit
37464e5a86
@ -215,6 +215,24 @@ html {
|
|||||||
background: rgba(0, 0, 0, 0.2) !important;
|
background: rgba(0, 0, 0, 0.2) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Settings button wrapper styling */
|
||||||
|
.video-js .vjs-settings-wrapper {
|
||||||
|
order: 8 !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-settings-wrapper:hover {
|
||||||
|
background: rgba(0, 0, 0, 0.2) !important;
|
||||||
|
}
|
||||||
|
|
||||||
.video-js .vjs-control {
|
.video-js .vjs-control {
|
||||||
height: auto !important;
|
height: auto !important;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2716,6 +2716,27 @@ function VideoJSPlayer({ videoId = 'default-video' }) {
|
|||||||
});
|
});
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
|
|
||||||
|
// Wrap settings button in custom div container
|
||||||
|
setTimeout(() => {
|
||||||
|
const controlBar = playerRef.current.getChild('controlBar');
|
||||||
|
if (
|
||||||
|
controlBar &&
|
||||||
|
customComponents.current.settingsMenu &&
|
||||||
|
customComponents.current.settingsMenu.settingsButton
|
||||||
|
) {
|
||||||
|
const settingsButtonEl = customComponents.current.settingsMenu.settingsButton.el();
|
||||||
|
if (settingsButtonEl) {
|
||||||
|
const settingsWrapper = document.createElement('div');
|
||||||
|
settingsWrapper.className =
|
||||||
|
'vjs-settings-wrapper vjs-menu-button vjs-menu-button-popup vjs-control vjs-button';
|
||||||
|
|
||||||
|
// Insert wrapper before the settings button and move button inside
|
||||||
|
settingsButtonEl.parentNode.insertBefore(settingsWrapper, settingsButtonEl);
|
||||||
|
settingsWrapper.appendChild(settingsButtonEl);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, 200); // Longer delay to ensure settings button is fully created
|
||||||
|
|
||||||
// END: Add Settings Menu Component
|
// END: Add Settings Menu Component
|
||||||
|
|
||||||
// BEGIN: Add Seek Indicator Component
|
// BEGIN: Add Seek Indicator Component
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user