Developer Documentation

OdinPeer

export class OdinPeer

Class describing a single peer inside an OdinRoom.

Properties

NameTypeDescription
dataUint8ArrayThe arbitrary user data of the peer.
idnumberThe ID of the peer.
mediasMap<number><OdinMedia>A list of media instances owned by the peer.
remotebooleanIndicates, whether the peer is a remote peer or not.
userIdstringThe identifier of the peer.

Public Methods

NameTypeDescription
addEventListenervoidRegisters to peer events from IOdinPeerEvents.
addMediavoidAdds a media to the list of active medias and starts decoding.
createMediaOdinMediaCreates a local media, configures audio capture/playback and returns the new OdinMedia instance.
removeMediavoidRemoves a media from the list of active medias and stops decoding.
removeMediaByIdvoidRemoves a media from the list of active medias by the given ID and stops decoding.
sendMessagePromise<void>Sends a message with arbitrary data to this peer.
startMediasPromise<void>Starts all active medias or a list of specific active medias.
stopMediasPromise<void>Stops all active medias or a list of specific active medias.
updatePromise<void>Sends user data of the peer to the server.