RoomSessionPlayback
Instances of this class allow you to control (e.g., pause, resume, stop) the playback inside a room session. You can obtain instances of this class by starting a playback from the desired RoomSession (see RoomSession.play)
Properties
Unique id for this playback.
Id of the room associated to this playback.
Id of the room session associated to this playback.
Url of the file reproduced by this playback.
Current state of the playback.
Current playback position, in milliseconds.
Audio volume at which the playback file is reproduced.
Start time, if available.
End time, if available.
Whether the playback has ended. Returns true if the state is "completed".
Methods
forward
▸ forward(offset): Promise<void>
Seeks the current playback forward by the specified offset.
Parameters
Relative number of milliseconds to seek forward from the current position.
Returns
Promise<void>
Example
In this example, we wait for the RoomSession to start,
then we start a playback and forward it by 10 seconds after 5 seconds.
This example assumes that a RoomSession is active and
members are joining the room.
pause
▸ pause(): Promise<void>
Pauses the playback.
Returns
Promise<void>
Example
In this example, we wait for the RoomSession to start,
then we start a playback.
After 5 seconds, we pause the playback.
This example assumes that a RoomSession is active and
members are joining the room.
resume
▸ resume(): Promise<void>
Resumes the playback.
Returns
Promise<void>
Example
In this example, we wait for the RoomSession to start,
then we start a playback and pause it.
After 5 seconds, we resume the playback.
This example assumes that a RoomSession is active and
members are joining the room.
rewind
▸ rewind(offset): Promise<void>
Seeks the current playback backwards by the specified offset.
Parameters
Relative number of milliseconds to seek backwards from the current position.
Returns
Promise<void>
Example
In this example, we wait for the RoomSession to start,
then we start a playback. After 10 seconds, we rewind the playback by 5 seconds.
This example assumes that a RoomSession is active and
members are joining the room.
seek
▸ seek(timecode): Promise<void>
Seeks the current playback to the specified absolute position.
Parameters
The absolute position in milliseconds to seek to in the playback.
Returns
Promise<void>
Example
In this example, we wait for the RoomSession to start,
then we start a playback. We then seek the playback to the 30th second.
This example assumes that a RoomSession is active and
members are joining the room.
setVolume
▸ setVolume(volume): Promise<void>
Sets the audio volume for the playback.
Parameters
The desired volume. Values range from -50 to 50.
Returns
Promise<void>
Example
In this example, we wait for the RoomSession to start,
then we start a playback. After 5 seconds, we set the volume to -50dB.
This example assumes that a RoomSession is active and
members are joining the room.
stop
▸ stop(): Promise<void>
Stops the playback.
Returns
Promise<void>
Example
In this example, we wait for the RoomSession to start,
then we start a playback. After 5 seconds, we stop the playback.
This example assumes that a RoomSession is active and
members are joining the room.
Events
onStarted
▸ RoomSessionPlayback(listen: {onStarted: Callback })
Emitted when the playback starts.
Parameters
The playback that started. See RoomSessionPlayback.
onUpdated
▸ RoomSessionPlayback(listen: {onUpdated: Callback })
Emitted when the playback is updated.
Parameters
The playback that updated. See RoomSessionPlayback.
onEnded
▸ RoomSessionPlayback(listen: {onEnded: Callback })
Emitted when the playback ends.
Parameters
The playback that ended. See RoomSessionPlayback.