rse / vingester

Ingest Web Contents as Video Streams
https://vingester.app
GNU General Public License v3.0
187 stars 16 forks source link

When the 'Story Teller' leaves a botc.app game inside Vingester, audio redirects to system default. #83

Open ryantheleach opened 1 day ago

ryantheleach commented 1 day ago

I haven't delved deep enough to work out the details yet, but Botc.app implements a voice chat over WebRTC.

When the head of the game leaves and rejoins, Vingester starts outputting audio to the system default device, instead of the configured devices for each browser.

I suspect that Vingester may be polling for changes too slow, to redirect the output.

This issue is specifically with the version posted by @steveseguin here: https://github.com/rse/vingester/pull/80

steveseguin commented 1 day ago

@ryantheleach Did the change I offer make things worse or better?

If I recall, vingester has a mutation observer set up on the body element, and changes to elements will trigger a configuration setup. This setup includes setting the setSinkId value, which sets the output audio device target.

If your RTC application makes changes to the audio element that either:

It might be also possible the configuration only runs once at all, despite a secondary mutation event.

My suggestion to address this might be to add code that listens for loadedmetadata and playing events, and re-run the logic on the video/audio events in this case. It would also make sense to have an interval timer run on top of this, just in case that doesn't work.

I can technically can make this change myself, and release a new build on my github, but I'll give Ralf a chance to respond first and to get confirmation from you.