trsh Posted May 27, 2020 Share Posted May 27, 2020 `Failed to execute 'texImage2D' on 'WebGL2RenderingContext': The video element contains cross-origin data, and may not be loaded.` How to fix this? The response header for my video delivered seems to be OK: Access-Control-Allow-Headers: DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range Access-Control-Allow-Methods: GET Access-Control-Allow-Origin: http://localhost:3000 Access-Control-Expose-Headers: Content-Length,Content-Range Quote Link to comment Share on other sites More sharing options...
trsh Posted May 27, 2020 Author Share Posted May 27, 2020 (edited) Seems like this bug is only when using : const videoResource = new PIXI.resources.VideoResource(videoEl, { autoPlay: false, autoLoad: true, crossorigin: true }); Edited May 27, 2020 by trsh Quote Link to comment Share on other sites More sharing options...
trsh Posted May 27, 2020 Author Share Posted May 27, 2020 I needed to add: const myLuckyVideoElTmp = document.createElement('video'); myLuckyVideoElTmp.preload = "auto"; myLuckyVideoElTmp.setAttribute('crossorigin', 'anonymous'); Now it works themoonrat and jonforum 2 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.