Releases: signalwire/signalwire-js
@signalwire/js v3.11.0
Today we are releasing version 3.11 of the JavaScript SDK. It includes fixes and minor improvements.
Fixes
- Fix to allow the JS SDK to be used in the Shadow DOM. (#497) 5560cbb
- Fix regression on
createRoomObject
method. (#494) 40d41da - Disconnect the underlay client in case of signaling and/or media errors. (#490) 53ffb3b
- Improve typings of the public interface for the Chat namespace (#532) to clarify that methods return nothing. d1073d4
- Expose all the active recordings on the
room.joined
event (#501) 5c96bf8 - Force video elements to play when paused by UA (#509) 3671a64
Improvements
@signalwire/realtime-api v3.0.0-beta.8
Beta 8 of the Realtime SDK is out! Here are the highlights for this version.
Highlights
Positions
We have introduced the concept of positions. Every video layout now has a set of predetermined positions (e.g. reserved-1, standard-1, off-cavas), to which you can assign members. For example:
await roomSession.setMemberPosition({
memberId: "1bf4d4fb-a3e4-4d46-80a8-3ebfdceb2a60",
position: "off-canvas"
})
Other methods have been updated to support positions. For example, to play a video content while setting its position:
await roomSession.play({
url: 'rtmp://example.com/foo',
positions: {
"self": "reserved-1"
}
})
Chat
You can now instantiate a Chat Client to send and receive messages to and from chat channels. You can use the same familiar interface that you may already be using in the browser SDK:
const chatClient = new Chat.Client({
project: '<project-id>',
token: '<api-token>'
})
chatClient.on('message', m => console.log(m))
await chatClient.subscribe("welcome")
New
- Exposed
setMeta
andsetMemberMeta
methods on theRoomSession
(#452)
@signalwire/js v3.10.0
Version 3.10 of the JavaScript SDK is out! Here are the main highlights.
Highlights
Positions
We have introduced the concept of positions. Every video layout now has a set of predetermined positions (e.g. reserved-1, standard-1, off-cavas), to which you can assign members. For example:
await roomSession.setMemberPosition({
memberId: "1bf4d4fb-a3e4-4d46-80a8-3ebfdceb2a60",
position: "off-canvas"
})
Other methods have been updated to support positions. For example, to share the screen while changing layout:
await roomSession.startScreenShare({
audio: true,
video: true,
layout: "screen-share",
positions: {
"self": "reserved-1"
}
})
New
- Exposed
setMeta
andsetMemberMeta
methods on theRoomSession
(#452)
Improvements
- Updated default screenShare audio constraints (#457)
Bug fixes
@signalwire/realtime-api v3.0.0-beta.7
Today we are releasing version 3.9 of the Realtime SDK.
Highlights
We have changed the way in which you instantiate a Client. Before, you would call the createClient
function, which is now deprecated. This is how you do it in the new version:
import { Video } from '@signalwire/realtime-api'
const video = new Video.Client({
project: '<project-id>',
token: '<project-token>'
})
video.on('room.started', async (roomSession) => {
console.log("Room started")
roomSession.on('member.joined', async (member) => {
console.log(member)
})
});
New features
- We now expose a
removeAllListeners
method from all our event-emitting objects. - Calling RoomSession.subscribe() is now optional. This means that you will start receiving RoomSession events as soon as you subscribe to them.
@signalwire/js v3.9.0
Today we are releasing version 3.9 of the JavaScript SDK.
Highlights
We have added a helper function for measuring the volume of the audio from the microphones. You can use this to allow the user to check that the devices are working properly. For example:
const micAnalyzer = await createMicrophoneAnalyzer('device-id')
micAnalyzer.on('volumeChanged', (vol) => {
console.log("Volume: ", vol)
})
micAnalyzer.on('destroyed', (reason) => {
console.log('Microphone analyzer destroyed', reason)
})
micAnalyzer.destroy()
New features
- We now expose a
removeAllListeners
method from all our event-emitting objects.
Fixes
- We removed an obsolete console warning which was triggered for the previously experimental Chat feature.
@signalwire/js v3.8.0
This release of the JavaScript SDK marks the introduction of Chat APIs. We have also made some additional improvements to our Video APIs to make it easier to use.
Highlights
Chat
You can now use our JavaScript SDK to create chat applications, or to add chat functionalities to your existing video applications. To get started, include the SDK as usual, for example from unpkg:
<script src="https://unpkg.com/@signalwire/js@3"></script>
You will now be able to access the SignalWire.Chat
namespace. Joining a chat is similar to how you join Room Sessions:
const chatClient = new SignalWire.Chat.Client({
token: token // Get this from our REST APIs
});
// Subscribe to events
chatClient.on("message", message => { })
// Start receiving messages
await chatClient.subscribe(['channel1', 'channel2']);
// Publish a message
await chatClient.publish({
channel: 'channel1',
content: 'Hello!'
});
Please explore the following resources for more information:
List of members in a video room
We have introduced an additional event for RoomSession objects: memberList.updated
. You will find this event handy if you're aiming to build a dynamically updated list of members in a room. You can use it like this:
roomSession.on('memberList.updated', (e) => {
// e.members contains the full list of members currently in the room.
updateMyListOfMembers(e.members)
})
In this way, you don't need to manually keep track of member.joined
, member.updated
, and member.left
events to keep your UI updated.
@signalwire/js v3.7.0
Today we are announcing the latest release of the JavaScript SDK.
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.
@signalwire/js v3.6.0
This is a maintenance release that contains several minor fixes and improvements.
Notes
If you were relying on the DOM id of the internal video overlay element, please note that the id is now prefixed with the string sw-sdk-
to avoid clashing with user-code ids. Since this is an undocumented internal detail, the vast majority of users will be unaffected. See #370.
Fixes
- Hide the local video overlay element when the user's video is not in the layout 2b1e970
- Add prefix to the DOM elements created by the SDK to make them unique. ba0647b
- RoomSession: Improve TypeScript signature for member methods with optional properties dd41aba
- Fix definition types f494e05
- Fix logic to handle the
redirectDestination
case where the SDK should resend the invite to a specific node. 499f62a
@signalwire/realtime-api v3.0.0-beta.4
This is a minor maintenance release.
@signalwire/js v3.5.0
We are excited to announce the latest release of the JavaScript SDK. This is a small maintenance release.
Highlights
We have deprecated the methods RoomSession.hideVideoMuted
and RoomSession.showVideoMuted
. You should now prefer the use of RoomSession.setHideVideoMuted
, which is consistent with our realtime-api package.
Before (now deprecated):
await roomSession.hideVideoMuted()
await roomSession.showVideoMuted()
From now on:
await roomSession.setHideVideoMuted(true)
await roomSession.setHideVideoMuted(false)
Improvements
- If you are joining an audio-only room session, you do not need to specify a
rootElement
anymore - You will now get documentation in your IDE for all SDK methods and objects
Fixes
- Fixed a possible race condition when applying the localVideo overlay
- Fixed a possible race condition on RoomSession.join() method.
- Fixed an issue with the connection not being able to be established when video/audio permissions were not granted.