fix: remove setNativeProps
usage (#3605)
* fix: remove `setNativeProps` usage * code review
This commit is contained in:
@@ -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});
|
||||
},
|
||||
})();
|
||||
}, []);
|
||||
|
@@ -537,6 +537,7 @@ export type VideoSaveData = {
|
||||
|
||||
export interface VideoManagerType {
|
||||
save: (option: object, reactTag: number) => Promise<VideoSaveData>;
|
||||
seek: (option: Seek, reactTag: number) => Promise<void>;
|
||||
setPlayerPauseState: (paused: boolean, reactTag: number) => Promise<void>;
|
||||
setLicenseResult: (
|
||||
result: string,
|
||||
|
Reference in New Issue
Block a user