Description
Please avoid duplicates
- I checked all open issues and discussions and none of them matched my problem.
Language and Compiler
Vanilla JavaScript
What environment are you using?
Local Development Server
When does your problem occur?
When the Unity App is running
What does your problem relate to?
The problem seems Browser related
React-Unity-WebGL Version
9.4.0
React Version
18.2.0
Unity Version
2022.1.19f1
What happened?
I am using react-unity-webgl
in collaboration with another asset for streaming data: FMETP_STREAM 3.0
.
Link to FMETP_STREAM 3.0
asset: https://assetstore.unity.com/packages/tools/video/fmetp-stream-3-0-221362
I have an existing Node.js server running on AWS which should relay messages between my clients. I have two versions: a mobile app built with Unity and a Unity WebGL version hosted within a React app.
When I run the build output of the Unity WebGL within the Unity generated local server, everything works as expected. Although, when I embed the Unity app within a React app using react-unity-webgl
my WebGL app doesn't decode the byte data being relayed back from the Node.js server (sent from the mobile app).
Is this an issue with how react-unity-webgl
handles the WebGL embedding within my React app?
I have noticed that building via the Unity "Build and Run" method while using the Minimal template does not work either. Only the Default or PWA templates work correctly.
Reproducible test case
- Download
FMETP_STREAM 3.0
asset and follow the simple instructions to create a test scene - Run the local Node.js server provided with the asset
- Build one version of your scene to embed within a React app
- Run the second version within Editor or a mobile device (doesn't matter which you choose)
- View the logs in the browser as it shows data being retrieved but not decoded by the app
Would you be interested in contributing a fix?
- yes, I would like to contribute a fix