My need is to get the duration OR time length of this video file. So I did console.log(videoFile.duration)
but its show undefined
& why does it show undefined? So how can I get video duration in React js...
const VideoList = ({ videoFile }) => {
console.log(videoFile.duration);
// output ==> undefined
return (
<div className="relative">
<video src={videoFile} className="w-full pb-2 sm:w-32 sm:pb-0 rounded mr-2" />
<span className="absolute bottom-1 right-3 bg-black/60 text-white rounded px-1.5">0:00</span>
</div>
);
}
export default VideoList;