get-media-duration
v1.0.1
Published
Get the duration of an media file (audio, video) from local storage or url
Downloads
9
Maintainers
Readme
get-media-duration
Install
pnpm add get-media-duration
Usage
import { getDuration, getDurationInMinutes } from 'get-media-duration'
getDuration('./audio.mp3')
.then(duration => console.log(duration))
.catch(console.log)
getDuration('https://samplelib.com/lib/preview/mp3/sample-3s.mp3')
.then(duration => console.log(duration))
.catch(console.log)
getDurationInMinutes('./audio.mp3')
.then(duration => console.log(duration))
.catch(console.log)
getDurationInMinutes('https://samplelib.com/lib/preview/mp3/sample-3s.mp3')
.then(duration => console.log(duration))
.catch(console.log)