RELAY JS SDK 3.15.0 Release
We are happy to announce JavaScript SDK 3.15.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.
Today, we are releasing version 3.15 of the JavaScript SDK which includes RTMP outbound streaming, more metadata management methods, and a few miscellaneous fixes.
Highlights
Outbound Streaming
We are excited to offer RTMP streaming out of video rooms with the addition of several methods and events! f1102bb
New Methods
roomSession.startStream()
starts streaming the audio and video of the current room to an external service such as Facebook or YouTube. You can use the returnedRoomSessionStream
object to interact with the stream.
const stream = await roomSession.startStream({ url: "rtmp://example.com" });
// Stop the stream after 60 seconds
setTimeout(() => stream.stop(), 60000);
roomSessionStream.stop()
is a method on theRoomSessionStream
object returned from thestartStream
method and is used to stop the stream.
await stream.stop()
roomSession.getStreams()
obtains a list of active streams for the currentRoomSession
.
const s = await roomSession.getStreams();
for (const stream of s.streams) {
console.log(stream.id, stream.url);
}
New Events
stream.started
stream.ended
Emitted when a stream is started or stopped, respectively. Your event handler receives a stream object of the RoomSessionStream
type.
Getting Metadata
Our last release included methods to manage metadata on Video Room sessions and the members in the session. Today, we are introducing methods to retrieve the metadata for the room session and a member. 6cf01e1
getMeta
will return the metadata assigned to the current room session. For example:
const { meta } = await room.getMeta();
console.log(meta);
getMemberMeta
will return the metadata assigned to a specified member. If a member id is not passed, this method will return the metadata from the current member. For example:
const { meta } = await room.getMemberMeta({ memberId: 'ab123c0c-4fac-5def-b06f-d5b8614b8999' });
console.log(meta);