Skip to content

Releases: signalwire/signalwire-js

@signalwire/realtime-api v3.0.0-beta.3

12 Oct 15:49
Compare
Choose a tag to compare

We are excited to announce the third beta release of the RealTime SDK. This is a small release that focuses on the Playback feature.

Highlights

You can use the Playback feature to play a video stream inside a room session. For example:

const url = 'rtmp://...'
const playback = await roomSession.play({ url, volume: 10 })

await playback.pause()
await playback.stop()

At the moment, the supported formats are:

  • RTMP (rtmp:// and rtmps://)
  • HLS (.m3u8, application/x-mpegurl)
  • MPEG-DASH (.mpd, application/dash+xml)

You can also subscribe to the following RoomSession events:

  • playback.started: a playback has started
  • playback.updated: a playback has been updated
  • playback.ended: a playback has ended

@signalwire/js v3.4.0

12 Oct 15:50
cf10b82
Compare
Choose a tag to compare

We are excited to announce the latest release of the JavaScript SDK. This is a small release that focuses on the Playback feature.

Highlights

You can use the Playback feature to play a video stream inside a room session. For example:

const url = 'rtmp://...'
const playback = await roomSession.play({ url, volume: 10 })

await playback.pause()
await playback.stop()

At the moment, the supported formats are:

  • RTMP (rtmp:// and rtmps://)
  • HLS (.m3u8, application/x-mpegurl)
  • MPEG-DASH (.mpd, application/dash+xml)

To use this feature, make sure to enable the room.playback permission when generating the Video Room Token. You will also receive the following RoomSession events:

  • playback.started: a playback has started
  • playback.updated: a playback has been updated
  • playback.ended: a playback has ended

@signalwire/realtime-api v3.0.0-beta.1

06 Oct 12:39
8445fc1
Compare
Choose a tag to compare

We are excited to announce the second beta release of our server-side realtime SDK!

New features

Get the full state of a room session

When you subscribe to a RoomSession to start receiving events, the subscribe method now asynchronously returns the full state of the session. This allows you, for example, to immediately know the current members in the room.

const client = ...  // get a client with createClient()

client.video.on('room.started', async (roomSession) => {
  // attach event listeners...
  // roomSession.on(...)

  // This gives you the full state of the room session!
  const roomSessionState = await roomSession.subscribe()

  console.log(
    'State:',
    roomSessionState.name,
    roomSessionState.id,
    roomSessionState.roomId,
    roomSessionState.members
  )
  roomSessionState.members.forEach((member: any) => {
    console.log('Room Member', member.id, member.name)
  })
}

Deprecations

setMicrophoneVolume and setSpeakerVolume have been deprecated

#302 2ac7f6d

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});

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)

Improvements

  • #296 685e0a2 We have improved the documentation of the SDK.

Fixes

  • #299 72eb91b We have fixed the signature of the setLayout method of a VideoRoomSession. You should now get proper type suggestions.

@signalwire/js v3.3.0

06 Oct 12:39
8445fc1
Compare
Choose a tag to compare

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

#302 2ac7f6d

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.

@signalwire/realtime-api v3.0.0-beta.0

15 Sep 16:22
b010594
Compare
Choose a tag to compare

We are excited to announce the first beta release of our server-side realtime SDK!

Highlights

With @signalwire/realtime-api you can listen for and react to events from SignalWire's RealTime APIs within your own node.js server. Get notified when room sessions start or stop, when members join or leave, when any device gets updated, control the recordings, and much more.

Installation

Install from npm:

npm install @signalwire/realtime-api

Getting started

Import the SDK:

import { createClient } from '@signalwire/realtime-api'

Obtain a realtime-api client:

const client = await createClient({
  project: '<project-id>',
  token: '<project-token>'
})

Obtain a handle to a room session whenever it starts, then mute the video of any participant that joins:

client.video.on('room.started', async (roomSession) => {
    console.log("Room started")

    roomSession.on('member.joined', async (member) => {
        await member.videoMute()
    })

    await roomSession.subscribe()
})

Finally, connect the client to start receiving the events:

await client.connect()

Resources

Learn more on our developers website:

@signalwire/js v3.2.0

09 Sep 18:16
e196102
Compare
Choose a tag to compare

Highlights

We are excited to announce the release of @signalwire/js v3.2.0.

With this new version of the JS SDK we have introduced the ability to record your rooms! As usual, this is a matter of a few lines of codes. For example:

const rec = await room.startRecording()
await rec.stop()
await room.getRecordings()
/*
{
  "recordings": [
    {
      "id": "94ec917c-ff9c-4d57-9111-7d93a8f6e3e8",
      "state": "completed",
      "duration": 4.66,
      "started_at": 1630681129.936,
      "ended_at": 1630681133.7655
    }
  ]
}
*/

After a room has been recorded, you can download the mp4 file from SignalWire's servers to obtain your video recording. You can do that by using the REST API:

curl --request GET \
     --url https://<yourspace>.signalwire.com/api/video/room_recordings/94ec917c-ff9c-4d57-9111-7d93a8f6e3e8 \
     --header 'Accept: application/json' \
     --header 'Authorization: Basic <your API token>'

The above GET request will return a recording object with a uri field that you can follow to obtain the mp4 file.

New Features

Improvements

  • #257 7380582 We have improved the TypeScript documentation for the WebRTC methods. Enjoy the rich method descriptions and examples from IntelliSense, without leaving your editor:

intellisense

Deprecations

  • #273 249facf For consistency, we have renamed the old events member.talking.start and member.talking.stop into, respectively, member.talking.started and member.talking.ended. The old event names have been deprecated and will be removed in future releases.

Fixes

  • We have included minor bug fixes

For the detailed changelog, see CHANGELOG.md.

@signalwire/js v3.1.0

13 Aug 17:57
d0f396a
Compare
Choose a tag to compare

This is a minor release of the SignalWire JavaScript SDK.

Highlights

Allow a speaker to be set when creating a room object

You can now select which speaker (or, generically, output device) to use as soon as you connect to the room. You can do this by specifying the speakerId key in the parameters of SignalWire.Video.createRoomObject or SignalWire.Video.joinRoom. For example:

  const roomObj = await Video.joinRoom({
    token: '<YourJWT>',
    rootElementId: 'root',
    speakerId: '... your speaker id ...'
  })

Introduced functions for checking the media methods supported in the current environment

We provide two new functions, supportsGetUserMedia and supportsGetDisplayMedia, that you can use to check whether the corresponding media methods are available in the current environment.

Better audio by default in screen sharings

When you create a screen sharing object via createScreenShareObject, if you specify {audio: true} we will create for you an audio constraints object that will ensure superior audio quality.

New Features

  • #240 b5d2a72 - Allow speakerId to be set when creating a room object to set the audio output device before join.
  • #239 5c2eb71 - Exports methods to check if the environment supports getUserMedia or getDisplayMedia

Improved

  • #236 b967c89 - Apply audio and video constraints sent from the backend consuming the mediaParams event.

  • #237 6d36287 - Set parent memberId for screenShare and additionalDevice sessions. Add default audio constraints for screenShareObjects.

@signalwire/js v3.0.0

10 Aug 10:50
1e2b8a0
Compare
Choose a tag to compare

This release marks the first stable version of the JavaScript SDK v3!
With respect to the previous major release of the JavaScript SDK, version 3 allows you to manage an environment with multiple rooms and participants for building full-fledged video-conferencing applications and much more. Take a look at the Getting Started information on our developers website.

Please note that some of the features that were present in the old SDK are still missing, and will be included in the upcoming updates to version 3. For more information on the differences between the functionalities offered by the old and the new SDK, refer to our Getting Started guide.

If you have been an early user of version 3 by following our beta releases, here's what changed since the latest preliminary release (beta 6). For the complete changelog with respect to the previous major release, see CHANGELOG.md.

Highlights

New helper methods to create device watchers

Previously, if you wanted to create a device watcher for a single device, you had to manually specify the device category, as in:

h = await SignalWire.WebRTC.createDeviceWatcher({targets: ['microphone']})

You can still use createDeviceWatcher to listen to the events of one or more devices, but we have introduced the methods createCameraDeviceWatcher, createMicrophoneDeviceWatcher and createSpeakerDeviceWatcher which can help make your code cleaner. The previous example would become:

h = await SignalWire.WebRTC.createMicrophoneDeviceWatcher()

Fixed behavior of setMicrophoneVolume() and setSpeakerVolume()

If you were using our beta SDK, you may have run into a bug in which setMicrophoneVolume() actually controlled the volume of the speaker, and vice versa. We have fixed that, so you may need to update your code accordingly.

New Features

  • #224 447460c: Export createCameraDeviceWatcher, createMicrophoneDeviceWatcher and createSpeakerDeviceWatcher helper methods

Bug Fixes

  • d017a99: Update the filtering logic for the device list where Firefox could return a device with deviceId but with empty label.
  • 2bdd043: Fix setMicrophoneVolume() behavior on Room, RoomDevice and RoomScreenShare objects. Fix setSpeakerVolume() behavior on Room object.