Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Commit 1d0b3c8

Browse files
committed
Fix worker origin issue
1 parent 9496717 commit 1d0b3c8

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

javascript/prepend.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@ var logger = function(){}
33
Module['setLogger'] = function(_logger) { logger = _logger; };
44
Module['print'] = function(message) { logger({ message, type: 'ffmpeg-stdout' }); };
55
Module['printErr'] = function(message) { logger({ message, type: 'ffmpeg-stderr' }); };
6+
Module['locateFile'] = function(path, prefix) {
7+
if (typeof window !== 'undefined'
8+
&& typeof window.FFMPEG_CORE_WORKER_SCRIPT !== 'undefined'
9+
&& path.endsWith('ffmpeg-core.worker.js')) {
10+
return window.FFMPEG_CORE_WORKER_SCRIPT;
11+
}
12+
return prefix + path;
13+
}
614
/*
715
Module['preRun'] = [
816
function() {

0 commit comments

Comments
 (0)