Our new developer documentation is now available. Please check it out!
OnMediaAdded
On this page
Whenever a “user (in ODIN language it’s a peer) has joined a room and starts sending audio data (i.e. has activated the microphone) this event is triggered.
You need to respond to this event and call the AddPlaybackComponent function of the OdinHandler.Instance like shown in the example below.
Your callback function must have this structure. MediaAddedEventArgs contains information about the peer and the media added to the room:
public void OnMediaAdded(object sender, MediaAddedEventArgs eventArgs);
Whenever this callback is triggered, imagine a new player comes in the arena and the game master needs to give him a Walky Talky so that he can listen and talk to the other players.