Hi, I am using BabylonJS to build 360 video player. And my player could work. However, recently I get an error which prevents my player from playing 360 videos. The error is:
Uncaught TypeError: n.getEngine(…).getInputElement is not a function
at new e (babylon.gui.min.js:16)
at Function.e.CreateFullScreenUI (babylon.gui.min.js:16)
at createScene (my javascript)
This error prevents the player from rendering video, but sound of the video can be played. Since when I used this function at the very beginning it could work, I think this babylon.gui.min.js must have been updated or modified. So please help me to solve this problem.
Thanks in advance!
Thanks. But I need those things for my own webpage. Also, there are more than one player in a page, so I need to parse those parameters to that function. Even though I change the line 42 from the original one to the new one, that problem still exists. So I decided to delete that line and not use 2D GUI currently.
I’m using TypeScript to write my code and Webpack to bundle it, and the webpage worked fine until I tried to add the babylonjs-gui package and use AdvancedDynamicTexture. Ever since then I get the same uncaught TypeError that you do.
I’m still looking for a solution so I’ll let you know if I find one
I fixed my issue! I wasn’t passing my scene to the constructor of AdvancedDynamicTexture.CreateFullscreenUI.
So my code used to say: AdvancedDynamicTexture.CreateFullscreenUI("help"); (which didn’t work)
And it now says: AdvancedDynamicTexture.CreateFullscreenUI("help", undefined, this.scene); (which works!)
For reference, the fixed file is on my GitHub. (I followed the BabylonJS/ReactJS guide, then converted it into TypeScript, added my own functionality, and changed the existing boilerplate code).
I have the same problem, even when I explicitly pass in the scene.
What worked for me is setting the input element for the engine (but it is a big hack so I’m not happy with it):
I had this issue, what worked for me was make sure both the babylonjs version and babylonjs gui version were up to date. I had an old version of babylonjs, and a newer version of babylonjs gui