mirror of
https://github.com/mediacms-io/mediacms.git
synced 2025-11-09 17:08:58 -05:00
Revert "Add dark background for embed video player"
This reverts commit 59cba4803b4600b609da611096f4747000673249.
This commit is contained in:
parent
a1479ac392
commit
67bc60066c
@ -3,30 +3,6 @@ import { createRoot } from 'react-dom/client';
|
|||||||
|
|
||||||
import VideoJS from './VideoJS.jsx';
|
import VideoJS from './VideoJS.jsx';
|
||||||
|
|
||||||
// Function to set dark background for embed contexts
|
|
||||||
const setEmbedBodyBackground = () => {
|
|
||||||
const embedContainer = document.getElementById('video-js-root-embed');
|
|
||||||
const pageEmbed = document.getElementById('page-embed');
|
|
||||||
|
|
||||||
// Check if we're in embed mode
|
|
||||||
if (embedContainer || pageEmbed) {
|
|
||||||
// Store original background to restore later if needed
|
|
||||||
if (!document.body.dataset.originalBackground) {
|
|
||||||
document.body.dataset.originalBackground = document.body.style.backgroundColor || '';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set dark background for embed
|
|
||||||
document.body.style.backgroundColor = '#000';
|
|
||||||
document.documentElement.style.backgroundColor = '#000';
|
|
||||||
|
|
||||||
// Also set margin and padding to 0 for seamless embed
|
|
||||||
document.body.style.margin = '0';
|
|
||||||
document.body.style.padding = '0';
|
|
||||||
document.documentElement.style.margin = '0';
|
|
||||||
document.documentElement.style.padding = '0';
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// Mount the components when the DOM is ready
|
// Mount the components when the DOM is ready
|
||||||
const mountComponents = () => {
|
const mountComponents = () => {
|
||||||
// Mount main video player
|
// Mount main video player
|
||||||
@ -49,18 +25,11 @@ const mountComponents = () => {
|
|||||||
<VideoJS videoId="video-embed" />
|
<VideoJS videoId="video-embed" />
|
||||||
</StrictMode>
|
</StrictMode>
|
||||||
);
|
);
|
||||||
|
|
||||||
// Set dark background when embed player is mounted
|
|
||||||
setEmbedBodyBackground();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Also check for embed context even without mounting
|
|
||||||
setEmbedBodyBackground();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Expose functions globally for manual triggering
|
// Expose the mounting function globally for manual triggering
|
||||||
window.triggerVideoJSMount = mountComponents;
|
window.triggerVideoJSMount = mountComponents;
|
||||||
window.setVideoJSEmbedBackground = setEmbedBodyBackground;
|
|
||||||
|
|
||||||
// Listen for custom events to trigger mounting
|
// Listen for custom events to trigger mounting
|
||||||
document.addEventListener('triggerVideoJSMount', () => {
|
document.addEventListener('triggerVideoJSMount', () => {
|
||||||
|
|||||||
@ -1,11 +1,6 @@
|
|||||||
/* ===== EMBED PLAYER STYLES ===== */
|
/* ===== EMBED PLAYER STYLES ===== */
|
||||||
/* YouTube-style embed player with fullscreen poster */
|
/* YouTube-style embed player with fullscreen poster */
|
||||||
|
|
||||||
/* Black background for embed page to eliminate white space */
|
|
||||||
#page-embed {
|
|
||||||
background-color: #000 !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Fullscreen poster image - fills entire iframe */
|
/* Fullscreen poster image - fills entire iframe */
|
||||||
#page-embed .video-js-root-embed .video-js .vjs-poster {
|
#page-embed .video-js-root-embed .video-js .vjs-poster {
|
||||||
position: absolute !important;
|
position: absolute !important;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user