0.1.7 • Published 4 years ago

vidvid-info v0.1.7

Weekly downloads
15
License
MIT
Repository
github
Last release
4 years ago

Fetch info of a video

Fetch the duration, height and width of a video.

Installing

vidvid-info is an ES module meant to be used in browsers.

vidvid = import('https://unpkg.com/vidvid-info?module')

Usage

vidvid = import('https://unpkg.com/vidvid-info?module')

const src =
  'https://archive.org/download/BigBuckBunny_124/Content/big_buck_bunny_720p_surround.mp4'

await vidvid.info(src)
//=> {duration: 596.503219, videoHeight: 360, videoWidth: 640}

await vidvid.info(src, { timeout: 10 })
//=> Timed out in 10ms.

API

# vidvid.info(src, options) · Source, Examples

Fetches the video metadata at the specified src URL. It returns a Promise that resolves an Object with the following fields:

  • duration: the video duration in seconds
  • videoHeight: the video height in px
  • videoWidth: the video width in px

It timeouts after options.timeout (in ms) or one day by default.

If options.crossOrigin is specified, CORS is used to fetch the video metadata. By default, no CORS is used.

Credits

Developed for the LIRIS M2i project by Sylvain Lesage

0.1.7

4 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago