Class OdinPeer
Wrapper class of OdinNative.Wrapper.PeerEntity for Unity
This convenient class provides dispatching of events to Unity with passthrough
Default Unity GameObject altering event callback functions:
OdinNative.Unity.OdinPeer.Peer_MediaAdded(System.Object,MediaAddedEventArgs)
Creates GameObject with OdinNative.Unity.OdinMedia component and attach mediaOdinNative.Unity.OdinPeer.Peer_MediaRemoved(System.Object,MediaRemovedEventArgs)
Destroy GameObject with OdinNative.Unity.OdinMedia component
Assembly: cs.temp.dll.dll
Implements:
Odin.IPeer
Properties
Parent
Id
UserId
UserData
Fields
OnMediaAdded
Additional event redirect from OdinNative.Unity.OdinRoom
OnMediaRemoved
Additional event redirect from OdinNative.Unity.OdinRoom
Methods
GetBasePeer()
Returns
Odin.PeerEntity
GetRoomApi()
Returns
Odin.Room
Peer_MediaAdded(object, MediaAddedEventArgs)
Event trigger to create a OdinNative.Unity.OdinMedia component
Parameters
Type | Name | Description |
---|---|---|
System.Object | sender | OdinRoom object |
Odin.MediaAddedEventArgs | args | started media data |
AddMediaComponent(GameObject, ushort, bool)
Create a OdinNative.Unity.OdinMedia component
Returns
OdinNative.Unity.OdinMedia: created component
Parameters
Type | Name | Description |
---|---|---|
Odin.GameObject | containerObject | gameobject where the component will be added |
System.UInt16 | mediaId | id of OdinNative.Wrapper.MediaDecoder |
System.Boolean | enable | flag if the new OdinNative.Unity.OdinMedia component is enabled |
AddMediaComponent(GameObject, ushort, uint, bool, bool)
Create a OdinNative.Unity.OdinMedia component
Returns
OdinNative.Unity.OdinMedia: created component
Parameters
Type | Name | Description |
---|---|---|
Odin.GameObject | containerObject | gameobject where the component will be added |
System.UInt16 | mediaId | id of OdinNative.Wrapper.MediaDecoder |
System.UInt32 | samplerate | decoder samplerate |
System.Boolean | stereo | decoder channel flag |
System.Boolean | enable | flag if the new OdinNative.Unity.OdinMedia component is enabled |
Peer_MediaRemoved(object, MediaRemovedEventArgs)
Event trigger to remove a OdinNative.Unity.OdinMedia component
Parameters
Type | Name | Description |
---|---|---|
System.Object | sender | OdinRoom object |
Odin.MediaRemovedEventArgs | args | stopped media data |
RemoveMediaComponent(GameObject, ushort, bool)
Removes all child components with the same media id
Returns
System.Boolean
: true on removed decoder or false
Parameters
Type | Name | Description |
---|---|---|
Odin.GameObject | containerObject | child components |
System.UInt16 | mediaId | decoder id |
System.Boolean | componentOnly | on false will destroy gameobject |
Implements
Odin.IPeer