Skip to content

Getting video duration

Compare
Choose a tag to compare
@kalashnikovisme kalashnikovisme released this 15 Oct 14:40
· 24 commits to develop since this release

Now you can video duration with nano-metadata package

import { video } from 'nano-metadata'

change(e) {
  const file = e.target.files[0]
  
  video.duration(file).then((duration) => {
    console.log(duration) // will show you video duration in seconds
  })
}