Our new developer documentation is now available. Please check it out!
OdinMedia
On this page
export class OdinMedia
Class describing a single media stream inside an OdinRoom
.
Properties
Name | Type | Description |
---|---|---|
active | boolean | Indicates wether or not the media is currently sending/receiving data. |
id | number | The ID of the media. |
paused | boolean | Indicates wether or not the media is paused. |
peerId | number | The ID of the peer that owns the media. |
remote | boolean | Indicates wether or not the media belongs to a remote peer. |
started | boolean | Indicates whether or not the media is registered in the audio service instance (e.g. started). |
volume | number | The individual playback volume of the media stream. |
Public Methods
Name | Type | Description |
---|---|---|
addEventListener | void | Registers to media events from IOdinMediaEvents . |
changeVolume | void | Changes the playback volume of the media. |
pause | Promise<void> | Paused the media stream on the server to stop receiving data on it. |
resume | Promise<void> | Paused the media stream on the server to start receiving data on it. |
start | Promise<void> | Starts the media stream by initiating the encoder/decoder and adding it to the room if it belongs to the local peer. |
stop | Promise<void> | Stops the media stream by terminating the encoder/decoder and removing it from the room if it belongs to the local peer. |