Video as gl texture setup?

Trying to get a video as a gl texture:

Any suggestions what steps I missed to get the video to appear as a texture?
Much appreciated, thanks!

Got it -


Thank you for sharing your solution!

B/c CodePen uses the “https://” scheme, any loadings have to use it as well in order to avert CORS access exceptions:



Also, you can delete the 2nd sk.texture(sk.vid); statement.

1 Like

A note on documentation -

Loading images for texturing inside the preload() method is generally a best practice, but it is especially helpful when working with video since video files are generally larger than static images and can take therefore extra time to load.

But, as my first attempt demonstrates, I was not able to use preload. Is the documentation out of date or is there a different way to use preload for video effectively in this situation? Thanks!