Update and fix browser example
This commit is contained in:
@@ -86,7 +86,7 @@ module.exports = (_options = {}) => {
|
||||
log(`[${workerId}]: Complete ${jobId}`);
|
||||
let d = data;
|
||||
if (action === 'transcode') {
|
||||
d = Array.from({ ...data, length: Object.keys(data).length });
|
||||
d = Uint8Array.from({ ...data, length: Object.keys(data).length });
|
||||
}
|
||||
resolves[action]({ jobId, data: d });
|
||||
} else if (status === 'reject') {
|
||||
|
||||
@@ -49,7 +49,7 @@ const transcode = ({
|
||||
const data = Uint8Array.from({ ...media, length: Object.keys(media).length });
|
||||
const iPath = 'media';
|
||||
const oPath = `media.${outputExt}`;
|
||||
const args = [...defaultArgs, ...`${options} -i ${iPath} ${oPath}`.trim().split(' ')];
|
||||
const args = [...defaultArgs, ...`${options} -i file:${iPath} ${oPath}`.trim().split(' ')];
|
||||
Module.FS.writeFile(iPath, data);
|
||||
ffmpeg(args.length, strList2ptr(args));
|
||||
res.resolve(Module.FS.readFile(oPath));
|
||||
|
||||
Reference in New Issue
Block a user