browser-media-mime-type

mime type lookup for browser video and audio

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
browser-media-mime-type
601.0.07 years ago7 years agoMinified + gzip package size for browser-media-mime-type in KB

Readme

browser-media-mime-type
stable
A simple mime-type lookup for <video> and <audio> formats in modern browsers.
Please open a PR or issue if you feel something is missing from the list.
Sourced from:
  • http://www.leanbackplayer.com/test/h5mt.html
  • https://github.com/broofa/node-mime/blob/master/types.json

Example

var mime = require('brwoser-media-mime-type')

mime('.mp4')
//=> 'video/mp4'

mime('mp3')
//=> 'audio/mpeg'

Usage

NPM

type = lookup(extension)

Takes the case-insensitive extension string, with or without a leading dot, and returns a mime type that might be applicable for that extension.

require('browser-media-mime-type/mime-types.josn')

You can require the JSON for the raw mime types hash.

License

MIT, see LICENSE.md for details.