how to get video duration in javascript

Solutions on MaxInterview for how to get video duration in javascript by the best coders in the world

showing results for - "how to get video duration in javascript"
Lukas
13 Jul 2020
1const i = setInterval(function() {
2	if(video.readyState > 0) {
3		var minutes = parseInt(video.duration / 60, 10);
4		var seconds = video.duration % 60;
5		clearInterval(i);
6	}
7}, 200);