Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ryantheleach opened this issue Sep 18, 2024 · 1 comment

Comments

@ryantheleach
Copy link

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:
#80

@steveseguin
Copy link

steveseguin commented Sep 18, 2024

@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:

  • changes the setSinkId value
  • changes the media stream of that audio/video element
    then it might be possible no event triggers the mutation observer, so no re-configuration runs.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants