Skip to content

Commit 8660e6f

Browse files
author
yusitnikov
committed
(fix) Use the original mime type for the fixed blob
1 parent 6646d54 commit 8660e6f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

fix-webm-duration.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -470,8 +470,8 @@
470470

471471
return true;
472472
};
473-
WebmFile.prototype.toBlob = function() {
474-
return new Blob([ this.source.buffer ], { type: 'video/webm' });
473+
WebmFile.prototype.toBlob = function(mimeType) {
474+
return new Blob([ this.source.buffer ], { type: mimeType || 'video/webm' });
475475
};
476476

477477
function fixWebmDuration(blob, duration, callback, options) {
@@ -493,7 +493,7 @@
493493
try {
494494
var file = new WebmFile(new Uint8Array(reader.result));
495495
if (file.fixDuration(duration, options)) {
496-
blob = file.toBlob();
496+
blob = file.toBlob(blob.type);
497497
}
498498
} catch (ex) {
499499
// ignore

0 commit comments

Comments
 (0)