skip to Main Content

Reactjs – How to get elapsed time of expo video?

Im using the Expo-Video-Player package, and went to get the elapsed time of when a video is played. <ExpoVideoPlayer videoProps={{ resizeMode: Video.RESIZE_MODE_STRETCH, source: { uri: videoUrl, }, }} inFullscreen={false} showControlsOnLoad={true} videoBackground={"#fff"} height={200} videoRef={video} showFullscreenButton={false} playIcon={() => playIcon} replayIcon={() => replayIcon}…

VIEW QUESTION

React native video is not displaying total video time

this my code: export default function VideoPlayer() { const videoPlayerRef = useRef(null); const [status, setStatus] = useState({}); const [totalDuration, setTotalDuration] = useState(null); return ( <View style={styles.container}> <Video ref={videoPlayerRef} source={'https://samplelib.com/lib/preview/mp4/sample-5s.mp4'} onLoad={status => setTotalDuration(() => status)} /> <Text style={styles.timestamp}>{totalDuration.durationMillis}</Text> </View> ); }…

VIEW QUESTION
Back To Top
Search