Class: Peer
Class describing a single peer inside an OdinRoom
.
Extends
OdinEventTarget
<PeerEvents
>
Properties
audioActivityHandler()
readonly
audioActivityHandler: (event
) =>void
Parameters
• event: OdinEvent
<AudioActivityPayload
>
Returns
void
Defined in
Odin/odin-typescript/lib/api/peer/index.d.ts:22
id
readonly
id:number
Defined in
Odin/odin-typescript/lib/api/peer/index.d.ts:18
onAudioActivity()?
optional
onAudioActivity: (payload
) =>void
Parameters
• payload: AudioActivityPayload
Returns
void
Defined in
Odin/odin-typescript/lib/api/peer/index.d.ts:23
onAudioInputStarted()?
optional
onAudioInputStarted: (payload
) =>void
Parameters
• payload: AudioInputPayload
Returns
void
Defined in
Odin/odin-typescript/lib/api/peer/index.d.ts:27
onAudioInputStopped()?
optional
onAudioInputStopped: (payload
) =>void
Parameters
• payload: AudioInputPayload
Returns
void
Defined in
Odin/odin-typescript/lib/api/peer/index.d.ts:28
onAudioOutputStarted()?
optional
onAudioOutputStarted: (payload
) =>void
Parameters
• payload: AudioOutputPayload
Returns
void
Defined in
Odin/odin-typescript/lib/api/peer/index.d.ts:29
onAudioOutputStopped()?
optional
onAudioOutputStopped: (payload
) =>void
Parameters
• payload: AudioOutputPayload
Returns
void
Defined in
Odin/odin-typescript/lib/api/peer/index.d.ts:30
onMediaStarted()?
optional
onMediaStarted: (payload
) =>void
Parameters
• payload: MediaPayload
Returns
void
Defined in
Odin/odin-typescript/lib/api/peer/index.d.ts:25
onMediaStopped()?
optional
onMediaStopped: (payload
) =>void
Parameters
• payload: MediaPayload
Returns
void
Defined in
Odin/odin-typescript/lib/api/peer/index.d.ts:26
onPowerLevel()?
optional
onPowerLevel: (payload
) =>void
Parameters
• payload: AudioActivityPayload
Returns
void
Defined in
Odin/odin-typescript/lib/api/peer/index.d.ts:24
onUserDataChanged()?
optional
onUserDataChanged: (payload
) =>void
OnUserDataChanged gets called, whenever the data changed.
Parameters
• payload: UserDataChangedPayload
Returns
void
Defined in
Odin/odin-typescript/lib/api/peer/index.d.ts:44
onVideoInputStarted()?
optional
onVideoInputStarted: (payload
) =>void
OnVideoInputStarted gets called, whenever a new VideoInput was started.
Parameters
• payload: VideoInputPayload
Returns
void
Defined in
Odin/odin-typescript/lib/api/peer/index.d.ts:36
onVideoInputStopped()?
optional
onVideoInputStopped: (payload
) =>void
OnVideoInputStopped gets called, whenever a VideoInput was stopped.
Parameters
• payload: VideoInputPayload
Returns
void
Defined in
Odin/odin-typescript/lib/api/peer/index.d.ts:40
onVideoOutputStarted()?
optional
onVideoOutputStarted: (payload
) =>void
Parameters
• payload: VideoOutputPayload
Returns
void
Defined in
Odin/odin-typescript/lib/api/peer/index.d.ts:31
onVideoOutputStopped()?
optional
onVideoOutputStopped: (payload
) =>void
Parameters
• payload: VideoOutputPayload
Returns
void
Defined in
Odin/odin-typescript/lib/api/peer/index.d.ts:32
remote
readonly
remote:boolean
Defined in
Odin/odin-typescript/lib/api/peer/index.d.ts:16
rmsDBFSHandler()
readonly
rmsDBFSHandler: (event
) =>void
Parameters
• event: OdinEvent
<AudioActivityPayload
>
Returns
void
Defined in
Odin/odin-typescript/lib/api/peer/index.d.ts:21
room
readonly
room:Room
Defined in
Odin/odin-typescript/lib/api/peer/index.d.ts:15
userId
readonly
userId:string
Defined in
Odin/odin-typescript/lib/api/peer/index.d.ts:19
Accessors
audioInputs
get
audioInputs():AudioInput
[]
Returns all AudioInputs.
Returns
Defined in
Odin/odin-typescript/lib/api/peer/index.d.ts:69
audioMedias
get
audioMedias(): (AudioOutput
|AudioInput
)[]
Returns all AudioMedias which can be AudioInput or AudioOutputs.
Returns
(AudioOutput
| AudioInput
)[]
Defined in
Odin/odin-typescript/lib/api/peer/index.d.ts:77
audioOutputs
get
audioOutputs():AudioOutput
[]
Returns all AudioOutputs.
Returns
Defined in
Odin/odin-typescript/lib/api/peer/index.d.ts:65
data
get
data():Uint8Array
The arbitrary user data of the peer.
set
data(data
):void
Set updated user data for the peer.
Parameters
• data: Uint8Array
Returns
Uint8Array
Defined in
Odin/odin-typescript/lib/api/peer/index.d.ts:61
videoOutputs
get
videoOutputs():VideoOutput
[]
Returns all VideoOutputs.
Returns
Defined in
Odin/odin-typescript/lib/api/peer/index.d.ts:73
volume
get
volume():Volume
Get the volume of the peer.
Returns
Defined in
Odin/odin-typescript/lib/api/peer/index.d.ts:81
Methods
addEventListener()
addEventListener<
OdinEventType
>(eventName
,handler
,options
?):void
Type Parameters
• OdinEventType extends keyof PeerEvents
Parameters
• eventName: OdinEventType
• handler: PeerEvents
[OdinEventType
]
• options?: boolean
| AddEventListenerOptions
Returns
void
Inherited from
OdinEventTarget
.addEventListener
Defined in
Odin/odin-typescript/lib/utils/odin-event-target.d.ts:22
dispatchEvent()
dispatchEvent<
T
>(event
):void
Type Parameters
• T extends OdinEvent
<any
>
Parameters
• event: T
Returns
void
Inherited from
Defined in
Odin/odin-typescript/lib/utils/odin-event-target.d.ts:23
removeEventListener()
removeEventListener<
OdinEventType
>(type
,callback
):void
Type Parameters
• OdinEventType extends keyof PeerEvents
Parameters
• type: string
| OdinEventType
• callback: EventListenerOrEventListenerObject
| PeerEvents
[OdinEventType
]
Returns
void
Inherited from
OdinEventTarget
.removeEventListener
Defined in
Odin/odin-typescript/lib/utils/odin-event-target.d.ts:24
sendMessage()
sendMessage(
message
):Promise
<void
>
Sends a message with arbitrary data to this peer.
Parameters
• message: Uint8Array
Byte array of arbitrary data to send
Returns
Promise
<void
>
Defined in
Odin/odin-typescript/lib/api/peer/index.d.ts:92
setVolume()
setVolume(
value
):Promise
<void
>
Sets the volume of all AudioMedias (AudioInputs and AudioOutputs).
Parameters
• value: Volume
Returns
Promise
<void
>
Defined in
Odin/odin-typescript/lib/api/peer/index.d.ts:86
update()
update():
Promise
<void
>
Sends user data of the peer to the server.
Returns
Promise
<void
>
Defined in
Odin/odin-typescript/lib/api/peer/index.d.ts:96