I’m working on what I believe may be a more suitable approach for incorporating UE builds into existing web architectures. First, I’m trying to remove any reference to any HTML UI other than a Canvas element, and rather establish an interface between the two platforms (HTML <-> UEWebGL):
<!DOCTYPE html> <html lang="en"> <head> <title>vsk</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> </head> <body onload="loadGameContent()"> <div> <canvas id="uecanvas" oncontextmenu="event.preventDefault()" style="display:none;"></canvas> </div> <script src="vskGameInterface.js"></script> </body> </html>
Then access the canvas element with the vskGameInterface.js:
var ueCanvasID = 'uecanvas'; : Module'canvas'] = document.getElementById(ueCanvasID);
An interface could be developed for setting what the canvas element is, or the requirement (as used above) is that the DOM ID is uecanvas.
After separating the code, I’m running into an error:
WebAssembly instantiation failed: TypeError: Unable to get property 'current' of underfined or null reference
The error appears to be due to that the then is null.
Anyway, I’m hoping whoever is maintaining the HTML code now sends me a PM so that I can go into more details.