fix: remove setNativeProps usage (#3605)

* fix: remove `setNativeProps` usage

* code review
This commit is contained in:
Krzysztof Moch
2024-03-28 11:22:04 +01:00
committed by GitHub
parent 38746ff2ba
commit 0312afc8ea
7 changed files with 118 additions and 105 deletions

View File

@@ -227,19 +227,22 @@ const Video = forwardRef<VideoRef, ReactVideoProps>(
return;
}
const callSeekFunction = () => {
VideoManager.seek(
{
time,
tolerance: tolerance || 0,
},
getReactTag(nativeRef),
);
};
Platform.select({
ios: () => {
nativeRef.current?.setNativeProps({
seek: {
time,
tolerance: tolerance || 0,
},
});
},
ios: callSeekFunction,
android: callSeekFunction,
default: () => {
nativeRef.current?.setNativeProps({
seek: time,
});
// TODO: Implement VideoManager.seek for windows
nativeRef.current?.setNativeProps({seek: time});
},
})();
}, []);