Image load first then video when click
This commit is contained in:
@@ -17,6 +17,7 @@ const VideoPlayer = ({ videosFiles, videoId, poster }) => {
|
||||
|
||||
const onLoad = ()=>{
|
||||
if(!viewer.data[videoId]) return 0;
|
||||
console.log(videoId + " loaded")
|
||||
video.current.setPositionAsync(viewer.data[videoId].time*1000);
|
||||
};
|
||||
|
||||
@@ -25,16 +26,11 @@ const VideoPlayer = ({ videosFiles, videoId, poster }) => {
|
||||
ref={video}
|
||||
style={styles.video}
|
||||
source={{
|
||||
uri: chosenVideo[0].link,
|
||||
uri: chosenVideo[chosenVideo.length-1].link,
|
||||
}}
|
||||
usePoster={true}
|
||||
posterSource={poster ? {
|
||||
uri: poster
|
||||
} : ''}
|
||||
useNativeControls
|
||||
shouldPlay={true}
|
||||
resizeMode="contain"
|
||||
isLooping
|
||||
shouldPlay={false}
|
||||
onPlaybackStatusUpdate={status => setStatus(() => status)}
|
||||
onLoad={onLoad}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user