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

"InvalidStateError: Canvas has no frame" when rendering in Safari #62

Open
billnye2 opened this issue Jan 3, 2025 · 1 comment
Open
Labels
bug Something isn't working

Comments

@billnye2
Copy link

billnye2 commented Jan 3, 2025

Hello,

First off really great library. I'm sure this took a load of time to make and it's super cool to render videos in the browser. I've run into an issue when running the render function in Safari 17.3.1 macOS 14.3.1.

The error is: export error InvalidStateError: Canvas has no frame and it appears to occur from a VideoFrame object.

Any idea what could be causing the issue? Does it only work in super up-to-date versions of Safari or macOS?

Thank you for your time.

EDIT: I believe it's this line of code where the error stems from

const videoFrame = new VideoFrame(renderer.canvas, {

@k9p5
Copy link
Contributor

k9p5 commented Feb 4, 2025

Hey, thanks for the kind words! Glad you’re enjoying the library.

The InvalidStateError: Canvas has no frame error likely stems from an issue with VideoFrame, which might be caused by an unsupported codec in Safari. Safari has stricter codec support compared to Chrome, so certain video formats may not work as expected.

Can you try rendering with different video files (e.g., H.264-encoded MP4s) and see if the issue persists?

Let me know what you find, and we can dig deeper if needed.

@k9p5 k9p5 added the bug Something isn't working label Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants