Skip to content

Commit

Permalink
code review
Browse files Browse the repository at this point in the history
  • Loading branch information
KrzysztofMoch committed Mar 28, 2024
1 parent 6f9eff6 commit 02bfb65
Showing 1 changed file with 12 additions and 17 deletions.
29 changes: 12 additions & 17 deletions src/Video.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -227,24 +227,19 @@ const Video = forwardRef<VideoRef, ReactVideoProps>(
return;
}

const callSeekFunction = () => {
VideoManager.seek(
{
time,
tolerance: tolerance || 0,
},
getReactTag(nativeRef),
);
};

Platform.select({
ios: () => {
VideoManager.seek(
{
time,
tolerance: tolerance || 0,
},
getReactTag(nativeRef),
);
},
android: () => {
VideoManager.seek(
{
time,
},
getReactTag(nativeRef),
);
},
ios: callSeekFunction,
android: callSeekFunction,
default: () => {
// TODO: Implement VideoManager.seek for windows
nativeRef.current?.setNativeProps({seek: time});
Expand Down

0 comments on commit 02bfb65

Please sign in to comment.