OdinPeer
export class OdinPeer
Class describing a single peer inside an OdinRoom
.
Properties#
Name | Type | Description |
---|
data | Uint8Array | The arbitrary user data of the peer. |
id | number | The ID of the peer. |
medias | Map<number><OdinMedia> | A list of media instances owned by the peer. |
remote | boolean | Indicates, whether the peer is a remote peer or not. |
userId | string | The identifier of the peer. |
Public Methods#
Name | Type | Description |
---|
addEventListener | void | Registers to peer events from IOdinPeerEvents . |
addMedia | void | Adds a media to the list of active medias and starts decoding. |
createMedia | OdinMedia | Creates a local media, configures audio capture/playback and returns the new OdinMedia instance. |
removeMedia | void | Removes a media from the list of active medias and stops decoding. |
removeMediaById | void | Removes a media from the list of active medias by the given ID and stops decoding. |
sendMessage | Promise<void> | Sends a message with arbitrary data to this peer. |
startMedias | Promise<void> | Starts all active medias or a list of specific active medias. |
stopMedias | Promise<void> | Stops all active medias or a list of specific active medias. |
update | Promise<void> | Sends user data of the peer to the server. |