-
Notifications
You must be signed in to change notification settings - Fork 354
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Callback/event when the Chromakey effect has been applied to an image #161
Comments
Are you preloading the image? It should be drawn on the next frame. For that, you can do |
While a lot of threads on different websites say otherwise, toDataURL() is now asynchronous (at least on Chrome) : https://bugs.chromium.org/p/chromium/issues/detail?id=514206 You can fix this using a promise/callback instead of a timeout. For example :
|
I am having the exact same issue. The target canvas worked perfectly. I wrapped the method in an onload event as specified above but I still get a transparent image. Hoping you can help.Thanks in advance.
|
I figured it out. I had to put my final functions within the go(callback);
|
Right after
seriously.go()
I dotarget.toDataURL('image/png')
and get an empty image. But if IsetTimeout(function () { target.toDataURL('image/png') }, 1000)
the image is not empty and has the Chromakey effect applied successfully. (For the source I use an image not a video.) I think the effect is being applied asynchronously and that's why that happens.The text was updated successfully, but these errors were encountered: