Skip to content

Instantly share code, notes, and snippets.

@MattyAyOh
Created December 25, 2020 23:11
Show Gist options
  • Save MattyAyOh/dc3be22060a875a464e0c024938e9285 to your computer and use it in GitHub Desktop.
Save MattyAyOh/dc3be22060a875a464e0c024938e9285 to your computer and use it in GitHub Desktop.
Web Audio Proxy Specs

Web Audio Proxy (Think like putting in Airpods, you will be opening the Proxy, and it takes over all audio) https://joinlockerroom.com/broadcast

Separate from joinlockerroom.com/room/{roomId}, which can be used to view a room's speakers and listen

Engineering Goals:

  1. Enable professional broadcasters to use their desktop recording equipment
  2. No WebSocket connection to web client
  3. Low development overhead, minimize custom messages for Web App that won't be used by client

Web Client:

  1. Authenticate (store session)
  2. When Proxy is loaded, check if user is a speaker in a room 2a) if not a speaker, tell user to refresh when they are a speaker 2b) if a speaker, show audio controls and connect to Agora (Proxy will hear all audio, and allow broadcasting audio)
  3. Need a button to close Proxy

iOS Client:

  1. If Audio Proxy connects, chat-service will emit a message to user
  2. When client receives message, client will Lock Mute button, and tell user they are muted because Audio Proxy has taken over microphone (maybe instead of a mute badge on self, it could be a red computer icon)
  3. Client will also silence the agora channel, user will not be able to hear anything on phone
  4. If client receives message that proxy was closed, then Agora channel will be re-opened, broadcasting enabled, and mute button can be toggled again

Server:

  1. Needs to send messages to client, for proxy connecting/disconnecting
  2. Needs to be able to receive mute state from web client via REST endpoint (so other users can see if broadcaster is muted)

Test case considerations:

  1. Closing the Audio Proxy tab on accident
  2. Room closes
  3. Speaker is demoted
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment