Function
The video to measure, as a blob or a URL. URLs are fetched anonymously, so a remote server must allow cross-origin reads.
The duration in seconds. Rejects if the metadata cannot be loaded.
Read how long a video is without displaying it, by loading just its metadata into a detached element. Streams whose duration is not known upfront are handled by seeking to the end to force the browser to resolve it. The element and any temporary object URL are cleaned up before the promise settles.
getVideoDuration