Skip to content

Commit

Permalink
Support M4B and M4P files
Browse files Browse the repository at this point in the history
  • Loading branch information
feross committed Jul 30, 2019
1 parent d0a6688 commit d82280f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 6 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ var videostream = require('videostream')

var VIDEOSTREAM_EXTS = [
'.m4a',
'.m4b',
'.m4p',
'.m4v',
'.mp4'
]
Expand All @@ -24,6 +26,8 @@ var MEDIASOURCE_VIDEO_EXTS = [

var MEDIASOURCE_AUDIO_EXTS = [
'.m4a',
'.m4b',
'.m4p',
'.mp3'
]

Expand Down Expand Up @@ -348,6 +352,8 @@ function getCodec (name) {
var extname = path.extname(name).toLowerCase()
return {
'.m4a': 'audio/mp4; codecs="mp4a.40.5"',
'.m4b': 'audio/mp4; codecs="mp4a.40.5"',
'.m4p': 'audio/mp4; codecs="mp4a.40.5"',
'.m4v': 'video/mp4; codecs="avc1.640029, mp4a.40.5"',
'.mkv': 'video/webm; codecs="avc1.640029, mp4a.40.5"',
'.mp3': 'audio/mpeg',
Expand Down
6 changes: 4 additions & 2 deletions lib/mime.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@
".less": "text/css",
".log": "text/plain",
".m3u": "audio/x-mpegurl",
".m4a": "audio/mp4",
".m4v": "video/mp4",
".m4a": "audio/x-m4a",
".m4b": "audio/mp4",
".m4p": "audio/mp4",
".m4v": "video/x-m4v",
".manifest": "text/cache-manifest",
".markdown": "text/x-markdown",
".mathml": "application/mathml+xml",
Expand Down

0 comments on commit d82280f

Please sign in to comment.