Skip to main content
Version: 2.x

Interface IRoom

Declaration
public interface IRoom

Derived:
OdinNative.Unity.OdinRoom, OdinNative.Wrapper.Room.Room

Properties​

Id​

Room id

Declaration
ulong Id { get; }

Handle​

Declaration
OdinRoomHandle Handle { get; }

Parent​

Default value null indicates root or not set

Declaration
object Parent { get; }

IsJoined​

Indicates whether the room is currently joined

Declaration
bool IsJoined { get; }

Self​

The local peer for this client in this room. Null until the room is joined. Allows SDK components to reference the local peer through the same OdinNative.Wrapper.IPeer abstraction used for remote peers, enabling the native wrapper to be replaced by a web bridge without changing SDK code.

Declaration
IPeer Self { get; }

CryptoCipher​

Encryption handle container

Declaration
Crypto CryptoCipher { get; }

Samplerate​

Default encoder/decoder samplerate for this room.

Declaration
uint Samplerate { get; }

Stereo​

Default encoder/decoder stereo flag for this room.

Declaration
bool Stereo { get; }

Name​

Room name as reported by the server. Empty until joined.

Declaration
string Name { get; }

Methods​

Join(string, OdinCipherHandle)​

Join a room with encryption

Declaration
bool Join(string token, OdinCipherHandle cipher = null)
Returns​

System.Boolean: true on success

Parameters​
TypeNameDescription
System.Stringtokenjwt to send
OdinNative.Core.Imports.OdinCipherHandleciphercrypto cipher

SendAudio(float[], MediaEncoder)​

Push audio samples to the room via a specific encoder.

Declaration
bool SendAudio(float[] samples, MediaEncoder encoder)
Returns​

System.Boolean

Parameters​
TypeName
System.Single[]samples
OdinNative.Wrapper.MediaEncoderencoder

GetOrCreateDecoder(uint, ulong, uint, bool, out MediaDecoder)​

Get or create a decoder for the given peer and media, using the supplied samplerate and stereo flag. On create calls through peer: OdinNative.Wrapper.PeerEntity.CreateDecoder(System.UInt32,System.Boolean)

Declaration
bool GetOrCreateDecoder(uint peerId, ulong mediaId, uint samplerate, bool stereo, out MediaDecoder decoder)
Returns​

System.Boolean

Parameters​
TypeName
System.UInt32peerId
System.UInt64mediaId
System.UInt32samplerate
System.Booleanstereo
OdinNative.Wrapper.MediaDecoderdecoder

CreateMediaDecoder(uint)​

Create a decoder for the given peer, using the room supplied samplerate and stereo.

Declaration
MediaDecoder CreateMediaDecoder(uint peerId)
Returns​

OdinNative.Wrapper.MediaDecoder

Parameters​
TypeName
System.UInt32peerId

RemoveMediaDecoder(uint, ulong)​

Remove the decoder for the given peer and media and dispose media.

Declaration
void RemoveMediaDecoder(uint peerId, ulong mediaId)
Parameters​
TypeName
System.UInt32peerId
System.UInt64mediaId

RemoveDecoder(uint, ulong, out MediaDecoder)​

Remove the decoder for the given peer and media from room.

Declaration
bool RemoveDecoder(uint peerId, ulong mediaId, out MediaDecoder decoder)
Returns​

System.Boolean

Parameters​
TypeName
System.UInt32peerId
System.UInt64mediaId
OdinNative.Wrapper.MediaDecoderdecoder

Events​

OnRoomStatusChanged​

Odin connection status

Declaration
event OnRoomStatusChangedDelegate OnRoomStatusChanged
Event Type​

OdinNative.Wrapper.OnRoomStatusChangedDelegate

OnRoomJoined​

Odin room joined

Declaration
event OnRoomJoinedDelegate OnRoomJoined
Event Type​

OdinNative.Wrapper.OnRoomJoinedDelegate

OnRoomLeft​

Odin room left

Declaration
event OnRoomLeftDelegate OnRoomLeft
Event Type​

OdinNative.Wrapper.OnRoomLeftDelegate

OnPeerJoined​

Odin peer joined

Declaration
event OnPeerJoinedDelegate OnPeerJoined
Event Type​

OdinNative.Wrapper.OnPeerJoinedDelegate

OnPeerLeft​

A remote peer left, or was removed locally when this session ended.

Declaration
event OnPeerLeftDelegate OnPeerLeft
Event Type​

OdinNative.Wrapper.OnPeerLeftDelegate

OnPeerChanged​

Odin peer changed userdata

Declaration
event OnPeerChangedDelegate OnPeerChanged
Event Type​

OdinNative.Wrapper.OnPeerChangedDelegate

OnMessageReceived​

Odin room received message

Declaration
event OnMessageReceivedDelegate OnMessageReceived
Event Type​

OdinNative.Wrapper.OnMessageReceivedDelegate