Class Room
Main Room
Properties
ConnectionState
ConnectionState of the Room that is set by ODIN
ConnectionRetry
The count of ConnectionState OdinNative.Core.Imports.NativeBindings.OdinRoomConnectionState.Connecting retry for reconnects. Reset on Connected
IsJoined
true on successful Join or false
Self
Client Peer
RoomUserData
Odin UserData helper for marshal byte arrays on Room level
RemotePeers
Conatiner of room peers
PlaybackMedias
Get all medias of room peers
MicrophoneMedia
Current room microphone data route
Fields
Config
Room configuration
Methods
GetRoomId()
Retrieves the room ID (e.g. the name of the room)
Returns
System.String
: room name### GetRoomCustomer()
Retrieves the identifier of the customer the room
Returns
System.String
: customer### GetRoomPeerId()
Retrieves your own peer ID
Returns
System.UInt64
: peer id### GetRoomConnectionStats()
Retrieves statistics for the underlying connection of this room
Returns
Global.OdinConnectionStats
: Statistics for the underlying connection of this room### SetApmConfig(OdinRoomConfig)
Set rooms new Apm config
Returns
System.Boolean
: true on successful set or false
Parameters
Type | Name | Description |
---|---|---|
Global.OdinRoomConfig | config | new Apm configuration |
Join(string, string, IUserData)
Join the room via Odin gateway
Returns
System.Boolean
: true on successful join or false
Parameters
Type | Name | Description |
---|---|---|
System.String | name | room name |
System.String | userId | user id |
OdinNative.Odin.IUserData | userData | custom userdata |
Join(string)
Join the room via Odin gateway
Returns
System.Boolean
: true on successful join or false
Parameters
Type | Name | Description |
---|---|---|
System.String | token | room token |
CreateMicrophoneMedia(OdinMediaConfig)
Try to add a OdinNative.Odin.Media.MicrophoneStream to the room and set it to OdinNative.Odin.Room.Room.MicrophoneMedia
Returns
System.Boolean
: true if media was added to the room or false
Parameters
Type | Name | Description |
---|---|---|
Global.OdinMediaConfig | config | Microphone device configuration |
UpdatePeerUserData(IUserData)
Updates the user data for our own peer. The server will populate this data to all other visible peers in the same room.
Returns
System.Boolean
: true if userdata was set for the peer or false
Parameters
Type | Name | Description |
---|---|---|
OdinNative.Odin.IUserData | userData | Userdata to send |
UpdatePeerUserDataAsync(IUserData)
Updates the user data for our own peer. The server will populate this data to all other visible peers in the same room.
Returns
Global.Task<System.Boolean>
: true if userdata was set for the peer or false
Parameters
Type | Name | Description |
---|---|---|
OdinNative.Odin.IUserData | userData | Userdata to send |
SendMessage(ulong[], byte[])
Sends arbitrary data to a array of target peerIds.
Returns
System.Boolean
: true if data was send or false
Parameters
Type | Name | Description |
---|---|---|
System.UInt64[] | peerIdList | array of ids(OdinNative.Odin.Peer.Peer.Id) |
System.Byte[] | data | arbitrary byte array |
SendMessageAsync(ulong[], byte[])
Sends arbitrary data to a array of target peerIds.
Returns
Global.Task<System.Boolean>
: true if data was send or false
Parameters
Type | Name | Description |
---|---|---|
System.UInt64[] | peerIdList | array of ids(OdinNative.Odin.Peer.Peer.Id) |
System.Byte[] | data | arbitrary byte array |
BroadcastMessage(byte[], bool)
Sends arbitrary data to a all remote peers in this room.
Returns
System.Boolean
: true if data was send or false
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | data | arbitrary byte array |
System.Boolean | includeSelf | idicates whether this current peer id |
BroadcastMessageAsync(byte[], bool)
Sends arbitrary data to a all remote peers in this room.
Returns
Global.Task<System.Boolean>
: true if data was send or false
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | data | arbitrary byte array |
System.Boolean | includeSelf | idicates whether this current peer get the message too |
GetRemotePeersIds(bool)
Get a copy of all PeerIds in this room
Returns
Global.List<System.UInt64>
: PeerIds
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | includeSelf | to add the own peer id from the Joined event |
GetRemotePeersMediaStreamIds()
All ids of OdinNative.Odin.Media.MediaStream from remote peers in this room
Returns
Global.ILookup<System.UInt64,IEnumerable<System.Int64>>
: Lookup of PeerId, MediaStreamIds### SetPositionScale(float)
Configures the allowed 'view' distance for proximity calculation of peers in the room
Returns
System.Boolean
: true if set or false
Parameters
Type | Name | Description |
---|---|---|
System.Single | scale | Per default, the room will use a distance of 1.0 fo proximity calculation |
UpdatePosition(float, float)
Updates the two-dimensional position of our own peer in the room
Returns
System.Boolean
: true if set or false
Parameters
Type | Name | Description |
---|---|---|
System.Single | x | x postition |
System.Single | y | y postition |
AudioProcessReverse(float[])
Processes the reverse audio stream, also known as the loopback data to be used in the ODIN echo
canceller.This should only be done if you are NOT using OdinNative.Core.Imports.NativeMethods.AudioMixStreams(RoomHandle,StreamHandle[],System.Single[])
.
Returns
System.Boolean
: false on error
Parameters
Type | Name | Description |
---|---|---|
System.Single[] | buffer | the audio buffer to process |
ToString()
Debug
Returns
System.String
: info### Leave()
Leave a room and free all remote peers and associated medias
Dispose(bool)
On dispose will free the room and token generator
Parameters
Type | Name |
---|---|
System.Boolean | disposing |
~Room()
Default deconstructor
Dispose()
On dispose will free the room and token generator
Events
OnPeerJoined
Passthrough event that identified a new PeerJoined event by Event-Tag.
Event Type
OdinNative.Odin.Room.RoomPeerJoinedEventHandler
OnPeerLeft
Passthrough event that identified a new PeerLeft event by Event-Tag.
Event Type
OdinNative.Odin.Room.RoomPeerLeftEventHandler
OnPeerUserDataChanged
Passthrough event that identified a new PeerUpdated event by Event-Tag.
Event Type
OdinNative.Odin.Room.RoomPeerUserDataChangedEventHandler
OnMediaAdded
Passthrough event that identified a new MediaAdded event by Event-Tag.
Event Type
OdinNative.Odin.Room.RoomMediaAddedEventHandler
OnMediaRemoved
Passthrough event that identified a new MediaRemoved event by Event-Tag.
Event Type
OdinNative.Odin.Room.RoomMediaRemovedEventHandler
OnMediaActiveStateChanged
Passthrough event that identified a new MediaActiveStateChanged event by Event-Tag.
Event Type
OdinNative.Odin.Room.MediaActiveStateChangedEventHandler
OnRoomUserDataChanged
Passthrough event that identified a new RoomUserDataChanged event by Event-Tag.
Event Type
OdinNative.Odin.Room.RoomUserDataChangedEventHandler
OnMessageReceived
Passthrough event that identified a new MessageReceived event by Event-Tag.
Event Type
OdinNative.Odin.Room.RoomMessageReceivedEventHandler
OnConnectionStateChanged
Passthrough event that identified a new ConnectionStateChanged event by Event-Tag.