skip to Main Content

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