For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Log inSign up
Support
ReferenceGuidesClick-to-Call
ReferenceGuidesClick-to-Call
  • Core
    • Overview
  • SignalWire Client
    • Overview
    • Notifications
    • Client
    • Utility functions
  • Video
    • Overview
    • LocalOverlay
    • RoomSession
    • RoomSessionDevice
    • RoomSessionPlayback
    • RoomSessionRecording
    • RoomSessionScreenShare
    • RoomSessionStream
    • RoomDevice
    • RoomScreenShare
  • Chat
    • Overview
    • Client
    • ChatMember
    • ChatMemberEntity
    • ChatMessage
    • ChatMessageEntity
  • PubSub
    • Overview
    • Client
    • PubSubMessage
  • WebRTC
    • Overview
LogoLogoSignalWire Docs
Log inSign up
Support
On this page
  • Properties
  • Methods
  • forward
  • pause
  • resume
  • rewind
  • seek
  • setVolume
  • stop
Video

RoomSessionPlayback

|View as Markdown|Open in Claude|
Was this page helpful?
Edit this page
Previous

RoomSessionRecording

Next
Built with

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

endedAt
Date

End time, if available.

id
stringRequired

Unique id for this playback.

position
numberRequired

Current playback position, in milliseconds.

roomSessionId
stringRequired

Id of the room session associated to this playback.

seekable
booleanRequired

Whether the seek functions (seek, forward, rewind) can be used for this playback

startedAt
DateRequired

Start time, if available.

state
"paused" | "completed" | "playing"Required

Current state of the playback.

url
stringRequired

Url of the file reproduced by this playback.

volume
numberRequired

Audio volume at which the playback file is reproduced.

Methods

forward

▸ forward(offset): Promise<void>

Seeks the current playback forward by the specified offset.

Parameters

offset
number

Relative number of milliseconds to seek forward from the current position. Defaults to 5000 (5 seconds).

Returns

Promise<void>

Permissions

  • room.playback.seek or the more permissive room.playback

You need to specify the permissions when creating the Video Room Token on the server side.

Example

1const playback = await roomSession.play({ url: "rtmp://example.com/foo" });
2await playback.forward(5000); // 5 seconds

pause

▸ pause(): Promise<void>

Pauses the playback.

Returns

Promise<void>


resume

▸ resume(): Promise<void>

Resumes the playback.

Returns

Promise<void>


rewind

▸ rewind(offset): Promise<void>

Seeks the current playback backwards by the specified offset.

Parameters

offset
number

Relative number of milliseconds to seek backwards from the current position. Defaults to 5000 (5 seconds).

Returns

Promise<void>

Permissions

  • room.playback.seek or the more permissive room.playback

You need to specify the permissions when creating the Video Room Token on the server side.

Example

1const playback = await roomSession.play({ url: "rtmp://example.com/foo" });
2await playback.rewind(5000); // 5 seconds

seek

▸ seek(timecode): Promise<void>

Seeks the current playback to the specified absolute position.

Parameters

timecode
numberRequired

The absolute position in milliseconds to seek to in the playback.

Returns

Promise<void>

Permissions

  • room.playback.seek or the more permissive room.playback

You need to specify the permissions when creating the Video Room Token on the server side.

Example

1const playback = await roomSession.play({ url: "rtmp://example.com/foo" });
2await playback.seek(30_000); // 30th second

setVolume

▸ setVolume(volume): Promise<void>

Sets the audio volume for the playback.

Parameters

volume
numberRequired

The desired volume. Values range from -50 to 50, with a default of 0.

Returns

Promise<void>


stop

▸ stop(): Promise<void>

Stops the playback.

Returns

Promise<void>