Skip to main content

RELAY JS SDK 3.7.0 Release

· 2 min read
Daniele Di Sarli

We are happy to announce JavaScript SDK 3.7.0.

Upgrading is straightforward with our release process, which adheres to Semantic Versioning. Minor versions are guaranteed to not have breaking changes, so you can upgrade with confidence.

SignalWire Release Card

This release focuses on the room previews feature, which allows you to access a link to a temporary video stream displaying a preview of what is going on in a room.

Highlights

Room Previews

We now support displaying a video preview of a room to the users before joining the room. For this to work you need to specify a enable_room_previews: true flag when creating a room (either from your Signalwire Space, from the REST APIs, or from a Token).

For example, let's say we want to create a new room using the REST APIs. To enable room previews, you can add the enable_room_previews flag:

curl --request POST \
--url https://yourspace.signalwire.com/api/video/rooms \
--header 'Accept: application/json' \
--header 'Authorization: Basic <your auth info here>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "my_new_room",
"display_name": "My New Room",
"enable_room_previews": true
}
'

Then, from the JavaScript SDK you can obtain the URL of the recording after joining a room by calling

roomSession.previewUrl
// Returns a URL such as 'https://files.signalwire.com/.../video-room-previews/..3251e299741a.mp4'

(note that it may take a few seconds for the URL to be ready)

Or, to obtain it before joining a room, simply use the REST APIs to list room sessions: you'll find the URL in there too.

You can then download the video and use it however you need to. The video will be refreshed periodically: make sure to download it again when you want to display updated previews.