diff options
author | mathiasvr <mathiasvr@gmail.com> | 2015-01-16 04:32:20 +0300 |
---|---|---|
committer | mathiasvr <mathiasvr@gmail.com> | 2015-01-16 04:32:20 +0300 |
commit | 891373f485e3d13167ca925ea8ad4c5d7da952a8 (patch) | |
tree | 699ec787f76a406291a6a8f021bc5b414d735db2 | |
parent | 6cbfa8c68a7222494426df0f560506ac0aff1a3d (diff) |
Add <audio> tag streaming support for mp3 files
-rw-r--r-- | lib/file-stream.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/file-stream.js b/lib/file-stream.js index cbf1319..9ca77ce 100644 --- a/lib/file-stream.js +++ b/lib/file-stream.js @@ -99,12 +99,15 @@ FileStream.prototype.pipe = function (dst) { var self = this var pipe = stream.Readable.prototype.pipe - if (dst && dst.nodeName === 'VIDEO') { // <video> tag + if (dst && dst.nodeName === 'VIDEO' || dst.nodeName === 'AUDIO') { // <video> and <audio> tag var type = self._extname === '.webm' ? 'video/webm; codecs="vorbis,vp8"' : self._extname === '.mp4' ? 'video/mp4; codecs="avc1.42c01e,mp4a.40.2"' - : undefined + : self._extname === '.mp3' + ? 'audio/mpeg' + : undefined + // TODO: consider renaming VideoStream to MediaStream, since it supports audio as well. return pipe.call(self, new VideoStream(dst, { type: type })) } else return pipe.call(self, dst) |