mirror of
https://github.com/mediacms-io/mediacms.git
synced 2025-10-06 22:32:41 +07:00
feat: Add a method to support player in the same page (e.g. for the embed page)
This commit is contained in:
@@ -7,12 +7,24 @@ import VideoJS from './VideoJS.jsx';
|
||||
|
||||
// Mount the components when the DOM is ready
|
||||
const mountComponents = () => {
|
||||
const rootContainer = document.getElementById('video-js-root');
|
||||
if (rootContainer) {
|
||||
const root = createRoot(rootContainer);
|
||||
root.render(
|
||||
// Mount main video player
|
||||
const rootContainerMain = document.getElementById('video-js-root-main');
|
||||
if (rootContainerMain) {
|
||||
const rootMain = createRoot(rootContainerMain);
|
||||
rootMain.render(
|
||||
<StrictMode>
|
||||
<VideoJS />
|
||||
<VideoJS videoId="video-main" />
|
||||
</StrictMode>
|
||||
);
|
||||
}
|
||||
|
||||
// Mount embed video player
|
||||
const rootContainerEmbed = document.getElementById('video-js-root-embed');
|
||||
if (rootContainerEmbed) {
|
||||
const rootEmbed = createRoot(rootContainerEmbed);
|
||||
rootEmbed.render(
|
||||
<StrictMode>
|
||||
<VideoJS videoId="video-embed" />
|
||||
</StrictMode>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user