-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Fix: p5 reference error in p5.MediaElement.loadPixels (ES module context) #8164
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
base: main
Are you sure you want to change the base?
Conversation
🎉 Thanks for opening this pull request! For guidance on contributing, check out our contributor guidelines and other resources for contributors! Thank You! |
Hii @ksen0 @perminder-17 This PR fixes the p5 reference error in p5.MediaElement.loadPixels (#7968). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Homaid , I think the tests aren't passing, can you please have a look once?
hey @perminder-17 Linting is passing, but the tests are still failing locally I’m investigating that part. |
f91f1b2
to
c4dcb8f
Compare
hey @perminder-17 i have updated the pr and fixed the linting issues can you recheck thank you |
and about the issue it was unrelated test failures (should work with tint() and should work with updatePixels) occur in the p5.prototype.createVideo suite. |
renderer = this._pInst._renderer; | ||
} else if (typeof p5 !== 'undefined' && p5.instance && p5.instance._renderer) { | ||
// Fallback for global mode | ||
renderer = p5.instance._renderer; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think in a WebGL main canvas, loadPixels
will exist but won't work on a MediaElement
; we need the 2D renderer version specifically. I had to deal with a similar issue in #8176 where the class was referencing a global p5
, and was updated to use p5
from an addon function instead where it's explicitly passed in, maybe we can try that same approach here too?
Resolves #7968
Changes:
Testing: