Developer Documentation

OdinMedia

export class OdinMedia

Class describing a single media stream inside an OdinRoom.

Properties

NameTypeDescription
activebooleanIndicates wether or not the media is currently sending/receiving data.
idnumberThe ID of the media.
pausedbooleanIndicates wether or not the media is paused.
peerIdnumberThe ID of the peer that owns the media.
remotebooleanIndicates wether or not the media belongs to a remote peer.
startedbooleanIndicates whether or not the media is registered in the audio service instance (e.g. started).
volumenumberThe individual playback volume of the media stream.

Public Methods

NameTypeDescription
addEventListenervoidRegisters to media events from IOdinMediaEvents.
changeVolumevoidChanges the playback volume of the media.
pausePromise<void>Paused the media stream on the server to stop receiving data on it.
resumePromise<void>Paused the media stream on the server to start receiving data on it.
startPromise<void>Starts the media stream by initiating the encoder/decoder and adding it to the room if it belongs to the local peer.
stopPromise<void>Stops the media stream by terminating the encoder/decoder and removing it from the room if it belongs to the local peer.