MCPcopy Create free account
hub / github.com/Moebytes/Frame-Player / rewind

Function rewind

components/VideoPlayer.tsx:1157–1171  ·  view source on GitHub ↗
(value?: number)

Source from the content-addressed store, hash-verified

1155 }
1156
1157 const rewind = (value?: number) => {
1158 if (!value) value = 10
1159 const current = videoRef.current ? videoRef.current.currentTime : progress
1160 const duration = getDuration()
1161
1162 let newTime = reverse ? current + value : current - value
1163 if (videoData && videoRef.current) newTime = reverse ? current - value : current + value
1164
1165 if (newTime < 0) newTime = 0
1166 if (newTime > duration) newTime = duration
1167 if (videoRef.current) videoRef.current!.currentTime = newTime
1168
1169 setProgress(newTime)
1170 setSeekTo(newTime)
1171 }
1172
1173 const fastforward = (value?: number) => {
1174 if (!value) value = 10

Callers 2

keyDownFunction · 0.85
VideoPlayerFunction · 0.85

Calls 1

getDurationFunction · 0.85

Tested by

no test coverage detected