Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/webtorrent/webtorrent.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFeross Aboukhadijeh <feross@feross.org>2015-03-07 01:18:32 +0300
committerFeross Aboukhadijeh <feross@feross.org>2015-03-07 01:18:32 +0300
commitd769be82dd052a4d963321e7b6d592d15e5f1395 (patch)
treeff75d22c52344cd626a7430826eb499739a6d22f /lib/storage.js
parentd28fad14a5713acfcd6b3a4e85beccd51d4c7836 (diff)
file.getBlobURL requires window.URL window.Blob support
Diffstat (limited to 'lib/storage.js')
-rw-r--r--lib/storage.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/storage.js b/lib/storage.js
index 3721fe4..48d88a1 100644
--- a/lib/storage.js
+++ b/lib/storage.js
@@ -275,9 +275,12 @@ File.prototype.createReadStream = function (opts) {
*/
File.prototype.getBlobURL = function (cb) {
var self = this
+ if (global.URL === undefined || global.Blob === undefined) {
+ return cb(new Error('file.getBlobURL requires window.URL window.Blob support'))
+ }
self.getBuffer(function (err, buf) {
if (err) return cb(err)
- var url = URL.createObjectURL(new Blob([ buf ]))
+ var url = global.URL.createObjectURL(new global.Blob([ buf ]))
cb(null, url)
})
}