I don’t think I can, I don’t even think it’s doable. I.e. in order to reproduce it I need a way to open some WebRTC stream from some (same?) server.
In my case, I’m running OpenVidu locally, like described here:
Is there an existing playground example playing WebRTC stream I could build upon?
Well that’s the catch, it’s not WebRTC. Remote media has to conform to totally different set of rules. One would think that same set of rules apply for streaming remote mp3/4 and WebRTC, but that’s not the case.
And the fact that I got this working does not mean that I understand these rules. But I found out that nothing plays unless there’s a html element playing the stream. In Chrome and Edge that is, Mozilla just works.
And to make that html element play the stream in the first place, user has to explicitly click on something. I’ve seen hacks like scripts sending click events, didn’t try them myself yet.
I don’t think any of the above is related to a babylon bug, seems like google messed it up.
Best we can do at the moment is document a workaround.
Unrelated to WebRTC, I may have encountered another bug related to remote streams. I was streaming that mp3, it was stereo and spatial and everything, until I entered VR. In Edge, sound suddenly became non-spatial. That was months ago though. I assumed something’s wrong with camera tracking.
While working on this, I’ve encountered similar effect, before I connected GainNode to the destination. I.e. I had PannerNode connected to the destination, like it seems to me that Sound implementation does. But once I connected panner to gain and then gain to destination, everything was fine.
So in case there’s some sound issue like that, I might have stumbled on a fix.