render-media
Advanced tools
Comparing version 2.1.0 to 2.2.0
18
index.js
@@ -6,3 +6,3 @@ exports.render = render | ||
var debug = require('debug')('render-media') | ||
var MediaSourceStream = require('mediasource') | ||
var MediaElementWrapper = require('mediasource') | ||
var path = require('path') | ||
@@ -118,3 +118,6 @@ var streamToBlobURL = require('stream-to-blob-url') | ||
file.createReadStream().pipe(new MediaSourceStream(elem, { extname: extname })) | ||
var wrapper = new MediaElementWrapper(elem) | ||
var writable = wrapper.createWriteStream(getCodec(file.name)) | ||
file.createReadStream().pipe(writable) | ||
if (currentTime) elem.currentTime = currentTime | ||
@@ -227,1 +230,12 @@ } | ||
} | ||
function getCodec (name) { | ||
var ext = path.extname(name).toLowerCase() | ||
return { | ||
'.m4a': 'audio/mp4; codecs="mp4a.40.5"', | ||
'.m4v': 'video/mp4; codecs="avc1.640029, mp4a.40.5"', | ||
'.mp3': 'audio/mpeg', | ||
'.mp4': 'video/mp4; codecs="avc1.640029, mp4a.40.5"', | ||
'.webm': 'video/webm; codecs="vorbis, vp8"' | ||
}[ext] | ||
} |
{ | ||
"name": "render-media", | ||
"description": "Intelligently render media files in the browser", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"author": { | ||
@@ -15,3 +15,3 @@ "name": "Feross Aboukhadijeh", | ||
"debug": "^2.2.0", | ||
"mediasource": "^1.0.0", | ||
"mediasource": "^2.1.0", | ||
"stream-to-blob-url": "^2.0.0", | ||
@@ -18,0 +18,0 @@ "videostream": "^2.0.0" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
41656
324
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedstring_decoder@1.3.0(transitive)
- Removedmediasource@1.0.0(transitive)
Updatedmediasource@^2.1.0