mirror of
https://github.com/zoriya/v10.git
synced 2026-08-05 05:37:21 +00:00
31 lines
1.0 KiB
TypeScript
31 lines
1.0 KiB
TypeScript
import '@app/styles.css';
|
|
import { VideoProvider } from '@app/shared/react/providers';
|
|
import { VideoSkinComponent } from '@app/shared/react/skins';
|
|
import { useSkin } from '@app/shared/react/use-skin';
|
|
import { useSource } from '@app/shared/react/use-source';
|
|
import { SOURCES } from '@app/shared/sources';
|
|
import type { Styling } from '@app/types';
|
|
import { DashVideo } from '@videojs/react/media/dash-video';
|
|
import { useMemo } from 'react';
|
|
import { createRoot } from 'react-dom/client';
|
|
|
|
function readStyling(): Styling {
|
|
return new URLSearchParams(location.search).get('styling') === 'tailwind' ? 'tailwind' : 'css';
|
|
}
|
|
|
|
function App() {
|
|
const skin = useSkin();
|
|
const source = useSource();
|
|
const styling = useMemo(readStyling, []);
|
|
|
|
return (
|
|
<VideoProvider>
|
|
<VideoSkinComponent skin={skin} styling={styling} className="aspect-video max-w-4xl mx-auto">
|
|
<DashVideo src={SOURCES[source].url} playsInline />
|
|
</VideoSkinComponent>
|
|
</VideoProvider>
|
|
);
|
|
}
|
|
|
|
createRoot(document.getElementById('root')!).render(<App />);
|