mirror of
https://github.com/mediacms-io/mediacms.git
synced 2025-11-12 18:38:52 -05:00
40 lines
871 B
TypeScript
40 lines
871 B
TypeScript
import { createRoot } from "react-dom/client";
|
|
import App from "./App";
|
|
import "./index.css";
|
|
|
|
if (typeof window !== "undefined") {
|
|
window.MEDIA_DATA = {
|
|
videoUrl: "",
|
|
mediaId: "",
|
|
posterUrl: ""
|
|
};
|
|
window.lastSeekedPosition = 0;
|
|
}
|
|
|
|
declare global {
|
|
interface Window {
|
|
MEDIA_DATA: {
|
|
videoUrl: string;
|
|
mediaId: string;
|
|
posterUrl?: string;
|
|
};
|
|
seekToFunction?: (time: number) => void;
|
|
lastSeekedPosition: number;
|
|
}
|
|
}
|
|
|
|
// Mount the components when the DOM is ready
|
|
const mountComponents = () => {
|
|
const trimContainer = document.getElementById("video-editor-trim-root");
|
|
if (trimContainer) {
|
|
const trimRoot = createRoot(trimContainer);
|
|
trimRoot.render(<App />);
|
|
}
|
|
};
|
|
|
|
if (document.readyState === "loading") {
|
|
document.addEventListener("DOMContentLoaded", mountComponents);
|
|
} else {
|
|
mountComponents();
|
|
}
|