Developer Documentation
Our new developer documentation is now available. Please check it out!

OdinHandler.AddPlaybackComponent

public PlaybackComponent AddPlaybackComponent(string gameObjectTag, string roomName, ulong peerId, long mediaStreamId, bool autoDestroySource = true)
public PlaybackComponent AddPlaybackComponent(GameObject peerContainer, string roomName, ulong peerId, long mediaStreamId, bool autoDestroySource = true)

Tries to identifiy a gameobject by tag to assign the PlaybackComponent

Parameters

NameTypeDescription
gameObjectTagStringTag string to find with FindGameObjectsWithTag
roomNameStringPlaybackComponent room
peerIdUInt64PlaybackComponent peer
mediaStreamIdInt64PlaybackComponent media
autoDestroySourceBooleanoptionally enable or disable on destroy of PlaybackComponent the destroy of the linked AudioSource
peerContainerGameObjectGameObject to attach to

Returns

TypeDescription
PlaybackComponentScriptReference of from the GameObject or null

Variants

AddPlaybackComponent(gameObjectTag, roomName, peerId, mediaStreamId, autoDestroySource)

public PlaybackComponent AddPlaybackComponent(string gameObjectTag, string roomName, ulong peerId, long mediaStreamId, bool autoDestroySource = true)

Tries to identifiy a gameobject by tag to assign the PlaybackComponent

Parameters

NameTypeDescription
gameObjectTagStringTag string to find with FindGameObjectsWithTag
roomNameStringPlaybackComponent room
peerIdUInt64PlaybackComponent peer
mediaStreamIdInt64PlaybackComponent media
autoDestroySourceBooleanoptionally enable or disable on destroy of PlaybackComponent the destroy of the linked AudioSource

Returns

TypeDescription
PlaybackComponentScriptReference of from the GameObject or null

AddPlaybackComponent(peerContainer, roomName, peerId, mediaStreamId, autoDestroySource)

public PlaybackComponent AddPlaybackComponent(GameObject peerContainer, string roomName, ulong peerId, long mediaStreamId, bool autoDestroySource = true)

Adds a new PlaybackComponent to the specified GameObject

Parameters

NameTypeDescription
peerContainerGameObjectGameObject to attach to
roomNameStringPlaybackComponent room
peerIdUInt64PlaybackComponent peer
mediaStreamIdInt64PlaybackComponent media
autoDestroySourceBooleanoptionally enable or disable on destroy of PlaybackComponent the destroy of the linked AudioSource

Returns

TypeDescription
PlaybackComponentScriptReference of from the GameObject or null