From cad63d465d0b47b542c1f510c48c67cfb096d9b9 Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Sun, 30 Jun 2024 11:38:52 +0000 Subject: [PATCH] Add most properties --- src/Video.web.tsx | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/Video.web.tsx b/src/Video.web.tsx index da8e2d9e..e2defb4b 100644 --- a/src/Video.web.tsx +++ b/src/Video.web.tsx @@ -14,7 +14,11 @@ const Video = forwardRef( paused, muted, volume, + rate, + repeat, + controls, showNotificationControls, + poster, onBuffer, onLoad, onProgress, @@ -126,6 +130,13 @@ const Video = forwardRef( }, 500); }, [onPlaybackStateChanged]); + useEffect(() => { + if (!nativeRef.current || rate === undefined) { + return; + } + nativeRef.current.playbackRate = rate; + }, [rate]); + return ( <> {showNotificationControls && ( @@ -136,8 +147,10 @@ const Video = forwardRef( src={source.uri as string | undefined} muted={muted} autoPlay={!paused} - controls={false} + controls={controls} + loop={repeat} playsInline + poster={poster} onCanPlay={() => onBuffer?.({isBuffering: false})} onWaiting={() => onBuffer?.({isBuffering: true})} onRateChange={() => { @@ -196,7 +209,7 @@ const Video = forwardRef( } }} onLoadedMetadata={() => { - if (source.startPosition) setProgress(source.startPosition / 1000); + if (source.startPosition) seek(source.startPosition / 1000); }} onPlay={() => onPlaybackStateChanged?.({isPlaying: true})} onPause={() => onPlaybackStateChanged?.({isPlaying: false})}