Files
ohif-viewer/platform/docs/src/pages/components/CinePlayerShowcase.tsx
T

45 lines
1.2 KiB
TypeScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import React, { useState } from 'react';
import useIsBrowser from '@docusaurus/useIsBrowser';
import ShowcaseRow from './ShowcaseRow';
/**
* CinePlayerShowcase displays a playable/pausable cine player with FPS control.
*/
export default function CinePlayerShowcase() {
const [isPlaying, setIsPlaying] = useState(false);
const [fps, setFps] = useState(24);
const isBrowser = useIsBrowser();
// If not browser, return null to avoid SSR parse errors
if (!isBrowser) {
return null;
}
const { default: CinePlayer } = require('../../../../ui-next/src/components/CinePlayer/CinePlayer');
return (
<ShowcaseRow
title="Cine Player"
description="Play, pause, scrub through dynamic image series and adjust FPS."
code={`
<CinePlayer
className="w-[300px]"
isPlaying={isPlaying}
frameRate={fps}
onPlayPauseChange={setIsPlaying}
onFrameRateChange={setFps}
onClose={() => console.log('close clicked')}
/>
`}
>
<CinePlayer
className="w-[300px]"
isPlaying={isPlaying}
frameRate={fps}
onPlayPauseChange={setIsPlaying}
onFrameRateChange={setFps}
onClose={() => console.log('close clicked')}
/>
</ShowcaseRow>
);
}