Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix audio engine init issue (#15922)
* Fix audio engine init issue When the `Engine` constructor is called with a `WebGLRenderingContext` or `WebGL2RenderingContext`, the audio engine does not get initialized. This change fixes the issue by calling `Engine._sharedInit` with the WebGL rendering context's canvas. Note that the WebGL rendering context's canvas may be an `OffscreenCanvas` and its type is cast to `HTMLCanvasElement` for the call to `Engine._sharedInit` because it would be a large change to make `AbstractEngine.__renderingCanvas` support both types. This is done the same way in the `WebGPUEngine` constructor, with the only consequence for the audio engine being that the mute button stays at the top-left of the document instead of automatically repositioning to the top-left of the canvas. * Call `_sharedInit` from `ThinEngine` instead of `Engine`
- Loading branch information