Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including get-blob-duration with all npm packages installed. Try it out:

var getBlobDuration = require("get-blob-duration")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

get-blob-duration v1.0.0

Convenience method to patch Chromium bug when getting duration of HTML5 video or audio Blob.

get-blob-duration

Convenience method to patch Chromium bug when getting duration of HTML5 video or audio Blob.

Usage

Import the method however you like (browser, module, etc.). Once you have it in scope:

// Returns Promise<Number>
getBlobDuration(blob).then(function(duration) {
  console.log(duration + ' seconds');
});

Or use ECMAScript 6:

// yada yada async
const duration = await getBlobDuration(blob)
console.log(duration + ' seconds')
RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free