How to get duration of video in php and javascript?
P粉604669414
P粉604669414 2024-01-29 14:23:20
0
1
340

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粉604669414
P粉604669414

reply all(1)
P粉245003607

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;
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!