Open ZigGreen opened 9 years ago
What exactly is your environment?
if(!Worker)
condition.It's kind of browser extension for the website. I can not spawn worker due to cross domain access control. However I still could instantiate WebWorker passing Blob object so I did. My solution:
var workerStr = "..." // worker code as a string.
var blob;
try {
blob = new Blob([workerStr], {
type: 'application/javascript'
});
} catch(e) { // Backwards-compatibility
window.BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder;
blob = new BlobBuilder();
blob.append(response);
blob = blob.getBlob();
}
var gif = new GIF({
workers: 2,
workerScript: URL.createObjectURL(blob),
quality: 10
});
@ZigGreen thanks a lot!!
I haven't access to webworkers in my environment. How can i run gif.js entirely in main process?