Skip to main content

RELAY JS SDK 3.3.0 Release

ยท 3 min read
Daniele Di Sarli

We are happy to announce JavaScript SDK 3.3.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.

We are excited to announce the latest version of our JavaScript SDK! This release mainly focuses on a number of improvements on the side of API usability.

Highlightsโ€‹

A new way to join roomsโ€‹

To simplify our API we have introduced a new way to join rooms. The most important entry point for the API is now the RoomSession object, which is flexible enough to support all the use cases that were covered by the old createRoomObject and joinRoom. Take a look down below to know how to update your code.

Deprecationsโ€‹

setMicrophoneVolume and setSpeakerVolume have been deprecatedโ€‹

To make our API more consistent, we have renamed the methods setMicrophoneVolume and setSpeakerVolume to, respectively, setInputVolume and setOutputVolume. Please update your code to use the new names, as the deprecated methods will be removed in a future version of the SDK.

Before (deprecated):

roomSession.setMicrophoneVolume({memberId: id, volume: -10});
roomSession.setSpeakerVolume({memberId: id, volume: -10});
member.setMicrophoneVolume({volume: -10});
member.setSpeakerVolume({volume: -10});

After:

roomSession.setInputVolume({memberId: id, volume: -10});
roomSession.setOutputVolume({memberId: id, volume: -10});
member.setInputVolume({volume: -10});
member.setOutputVolume({volume: -10});

createRoomObject and joinRoom have been deprecatedโ€‹

#313 5c35910

The functions createRoomObject and joinRoom have been deprecated. Their functionality has been replaced by the new RoomSession class. Please update your code to use the RoomSession class, as the deprecated methods will be removed in a future version of the SDK.

Before (deprecated):

SignalWire.Video.createRoomObject({
token: "...",
rootElementId: "stream",
video: true,
}).then(roomObject => {
roomObject.on('room.started', (e) => { console.log(e) })
roomObject.join()
}

// or:

SignalWire.Video.joinRoom({
token: "...",
rootElementId: "stream",
video: true,
}).then(roomObject => {
// here, handlers were attached *after* joining
roomObject.on('room.started', (e) => { console.log(e) })
}

After:

const roomSession = new SignalWire.Video.RoomSession({
token: "...",
rootElement: document.getElementById("stream"), // NOTE: you should now pass an HTMLElement
video: true,
})

roomSession.on('room.started', (e) => { console.log(e) })

roomSession.join()

createScreenShareObject has been deprecatedโ€‹

#318 cc5fd62

We have deprecated the createScreenShareObject in favor of the new startScreenShare. The new method is fully compatible: you can update your code by replacing roomSession.createScreenShareObject() invocations with roomSession.startScreenShare().

Breaking changesโ€‹

Timestamp properties now are Date objectsโ€‹

#305 cec54bd

To make our API easier to use, we have converted the timestamp properties within the SDK to Date object. This breaking change only affects you if you are using the Recording features.

Assume rec is a RoomSessionRecording object of which you use the fields startedAt and endedAt. It may look like this:

myFunction(rec.startedAt)
myFunction(rec.endedAt)

If you upgrade to this version of the SDK, make sure to convert them back to a number to make the rest of your code compatible:

myFunction(+rec.startedAt)
myFunction(+rec.endedAt)

Fixesโ€‹

We have included some minor bug fixes.