Skip to content
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

Failed to execute 'postMessage' on 'Worker': An OffscreenCanvas could not be cloned because it was not transferred. #3090

Open
Madixin opened this issue May 15, 2024 · 1 comment

Comments

@Madixin
Copy link

Madixin commented May 15, 2024

I want to test use webworker to render lottie for canvas,but got error:
** Failed to execute 'postMessage' on 'Worker': An OffscreenCanvas could not be cloned because it was not transferred. **

I copy code from https://chromium.googlesource.com/chromium/src/+/refs/tags/78.0.3895.4/third_party/lottie/README.md

let offscreenCanvas = document.getElementById('a').transferControlToOffscreen();
let animationData = JSON_LOTTIE_ANIMATION_DATA;

let worker = new Worker('lottie_worker.min.js');
worker.postMessage({
  canvas: offscreenCanvas,
  animationData: animationData,
  drawSize: {
    width: 200,
    height: 100
  }
  params: {
    loop: true,
    autoplay: true
  }
})

Tell us about your environment
lottie-web-5.12.2 lottie-web-5.10.2

  • Browser and Browser Version:
    chrome 124.0.6367.202
    Microsoft Edge 124.0.2478.97
@Madixin
Copy link
Author

Madixin commented May 16, 2024

Is there any sample to show how to use lottie_worke?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant