I want to get the duration of the video when the user uploads the video. I don't want to put the video tag in html. I want to get video duration code in php and javascript or jquery. Thanks
P粉2450036072024-01-30 00:29:06
In HTML5 you can simply get the duration of a video using the duration function in JavaScript. For example:
document.getElementById("video").duration();
Please use the following command to check if it has been loaded: (otherwise an error will occur)
document.getElementById("video").currentTime > 0;