简体   繁体   中英

Get video duration when input a video file avi , wmv

I get video duration file in the following way:

 let video = document.createElement('video');

                    video.preload = 'metadata';
                    video.src = URL.createObjectURL(item);
let time = video.duration;

This works with formats: mov, mkv, mp4 but how can you get the duration of files in the format: avi, wmv?

I would be glad for any help!

You can't get the duration of these files cause your browser doesn't support playback of such formats.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM