@@ -64,7 +64,7 @@ graph TD
6464 - ` ImageObjectProps ` : ` {src: string, alt?: string, disableCompress?: boolean, hide?: boolean | Partial<Record<'desktop' | 'mobile' | 'tablet', boolean>>, fetchPriority?: 'high' | 'low' | 'auto', loading?: 'eager' | 'lazy', 'aria-describedby'?: string} `
6565 - ` ImageDeviceProps ` : ` {desktop: string, mobile: string, tablet?: string, alt?: string, disableCompress?: boolean, hide?: boolean | Partial<Record<'desktop' | 'mobile' | 'tablet', boolean>>, fetchPriority?: 'high' | 'low' | 'auto', loading?: 'eager' | 'lazy', 'aria-describedby'?: string} `
6666 - ` video ` : MediaVideoProps - video configuration
67- - ` {src: string[], type?: 'default' | 'player', loop?: boolean | {start: number, end?: number}, muted?: boolean, autoplay?: boolean, elapsedTime?: number, playButton?: PlayButtonProps, controls?: 'default' | 'custom', customControlsOptions?: CustomControlsOptions, ariaLabel?: string, contain?: boolean, onVideoEnd?: () => void} `
67+ - ` {src: string[], type?: 'default' | 'player', loop?: boolean | {start: number, end?: number}, muted?: boolean, autoplay?: boolean, elapsedTime?: number, playButton?: PlayButtonProps, controls?: 'default' | 'custom', customControlsOptions?: CustomControlsOptions, ariaLabel?: string, contain?: boolean, onVideoEnd?: () => void, ref?: React.Ref<HTMLVideoElement | null> } `
6868 - ` PlayButtonProps ` : ` {type?: 'default' | 'text', theme?: 'blue' | 'grey', text?: string, className?: string} `
6969 - ` CustomControlsOptions ` : ` {type?: 'with-mute-button' | 'with-play-pause-button', muteButtonShown?: boolean, positioning?: 'left' | 'right' | 'center'} `
7070 - ` youtube ` : string - YouTube video ID
@@ -593,6 +593,39 @@ The Media component integrates seamlessly with the page-constructor theme system
593593/>
594594```
595595
596+ ### Video with Ref for Programmatic Control
597+
598+ ``` tsx
599+ const videoRef = React .useRef <HTMLVideoElement >(null );
600+
601+ const handlePlay = () => {
602+ if (videoRef .current ) {
603+ videoRef .current .play ();
604+ }
605+ };
606+
607+ const handlePause = () => {
608+ if (videoRef .current ) {
609+ videoRef .current .pause ();
610+ }
611+ };
612+
613+ const handleSeek = () => {
614+ if (videoRef .current ) {
615+ videoRef .current .currentTime = 10 ; // Seek to 10 seconds
616+ }
617+ };
618+
619+ <Media
620+ video = { {
621+ src: [' /path/to/video.mp4' ],
622+ controls: MediaVideoControlsType .Default ,
623+ ref: videoRef ,
624+ }}
625+ height = { 400 }
626+ />;
627+ ```
628+
596629### Background Media with Parallax
597630
598631``` tsx
0 commit comments