MasterSplinter Posted March 8, 2016 Share Posted March 8, 2016 I've looked through various threads (I believe someone attempted to do this for peter jackson a few months ago). I'm trying to attach a live stream video to a texture. One would think if it's a video element it should attach. However, it doesn't appear to be viewable. I was hoping someone would have some idea why the element may or may not be appearing. http://codepen.io/wpdildine/pen/zqqrba Attached is a scene comment out line 65 and the plane will appear. Thanks in advance. -P Quote Link to comment Share on other sites More sharing options...
MasterSplinter Posted March 9, 2016 Author Share Posted March 9, 2016 This isn't really resolution to this issue. But, it appears safari in the way it's implemented won't render hls videos in a webgl context. I might try some other formats and see if I can get it to work. GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
MasterSplinter Posted March 9, 2016 Author Share Posted March 9, 2016 Okay, Any insight would help-- Any video I try to stream over the web does not work -- but if I download it it works fine.. http://www.babylonjs-playground.com/#256QWU#10 If I run this videoTexture locally no problem... Quote Link to comment Share on other sites More sharing options...
Dad72 Posted March 9, 2016 Share Posted March 9, 2016 It seems there is a bug with 'createTexture' Uncaught TypeError: Cannot read property 'createTexture' of null Quote Link to comment Share on other sites More sharing options...
Boz Posted March 9, 2016 Share Posted March 9, 2016 you talk about createTexture() method of Engine ? It could be a problem with the engine or WebGL initialization Quote Link to comment Share on other sites More sharing options...
MasterSplinter Posted March 9, 2016 Author Share Posted March 9, 2016 The issue is a CORS problem that was masquerading as a webGL issue. The solution is to add this line of code: videoTexture.video.setAttribute("crossorigin", "anonymous"); Quote Link to comment Share on other sites More sharing options...
Dad72 Posted March 9, 2016 Share Posted March 9, 2016 1 hour ago, Pouet said: you talk about createTexture() method of Engine ? Yes. Uncaught TypeError: Cannot read property 'createTexture' of null o.createDynamicTexture @ babylon.js:4 (anonymous function) @ babylon.js:13 40 minutes ago, MasterSplinter said: The solution is to add this line of code That didnt change anything for me. The sphere disappeared Quote Link to comment Share on other sites More sharing options...
RaananW Posted March 10, 2016 Share Posted March 10, 2016 The exception is rather straight forward - DOMException: Failed to execute 'texImage2D' on 'WebGLRenderingContext': The video element contains cross-origin data, and may not be loaded.(…) 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.