3.0.0-preview.1 (July 25, 2022)
New Features
Large Rooms Pilot
twilio-video.js now allows you to create and join a Large Group Room, which supports a large number of Participants (> 50). This feature is in pilot, and requires that your account be enabled in order to use it. Note that the following API changes apply only for Large Rooms, and not for non-large Group Rooms and Peer-to-Peer Rooms.
- An audio and video RemoteTrack will now have an additional property called
switchOffReason
, which describes the reason for it being switched off. TheswitchedOff
event will also have this reason string as a second argument. (VIDEO-8670, VIDEO-8748) - An audio or video RemoteTrack's
mediaStreamTrack
is set tonull
whenever it is switched off. When it is switched on, it is set to a MediaStreamTrack. (VIDEO-8668, VIDEO-8745) - When the
switchOffReason
changes for an already switched off audio or video RemoteTrack, theswitchedOff
event is raised. (VIDEO-8668, VIDEO-8745) - A RemoteAudioTrack of a Participant that is not active in the Large Room will now be switched off. (VIDEO-8668)
- A RemoteVideoTrack will now be switched off if the number of switched on RemoteVideoTracks reached the limit set by the media server. (VIDEO-8745)
- Renamed BandwidthProfileOptions to BandwidthProfile. (VIDEO-8754)
- Renamed VideoBandwidthProfileOptions to VideoBandwidthProfile. (VIDEO-8753)
- The
isEnabled
property of the RemoteTrack is deprecated and scheduled for removal. Alternatively, you can determine if a RemoteTrack is enabled by using the following expression. (VIDEO-8742, VIDEO-8750)const isEnabled = remoteTrack.switchOffReason !== 'disabled-by-publisher';
- The
disabled
andenabled
events of the RemoteTrack are deprecated and scheduled for removal. Alternatively, you can handle theswitchedOff
andswitchedOn
events as shown below. (VIDEO-8742, VIDEO-8750)let recentSwitchOffReason = remoteTrack.switchOffReason; remoteTrack.on('switchedOff', switchOffReason => { recentSwitchOffReason = switchOffReason; if (switchOffReason === 'disabled-by-publisher') { /* The RemoteTrack is disabled. */ } }); remoteTrack.on('switchedOn', () => { if (recentSwitchOffReason === 'disabled-by-publisher') { /* The RemoteTrack is enabled. */ } recentSwitchOffReason = null; });
- The
isTrackEnabled
property of the RemoteTrackPublication is deprecated and scheduled for removal. Alternatively, you can determine if a RemoteTrackPublication is enabled by using the following expression. (VIDEO-8743, VIDEO-8751)const { track } = remoteTrackPublication; const isTrackEnabled = !(track && track.switchOffReason === 'disabled-by-publisher');
isTrackEnabled
is now only valid for RemoteTracks that are subscribed to, and defaults totrue
for unsubscribed
RemoteTracks. - The
trackDisabled
andtrackEnabled
events of the RemoteTrack are deprecated and scheduled for removal. Alternatively, you can handle thetrackSwitchedOff
andtrackSwitchedOn
events as shown below. (VIDEO-8743, VIDEO-8751)Theconst { track } = remoteTrackPublication; let recentSwitchOffReason = track ? track.switchOffReason : null; remoteTrackPublication.on('trackSwitchedOff', (track, switchOffReason) => { recentSwitchOffReason = switchOffReason; if (switchOffReason === 'disabled-by-publisher') { /* The RemoteTrack is disabled. */ } }); remoteTrackPublication.on('trackSwitchedOn', (track) => { if (recentSwitchOffReason === 'disabled-by-publisher') { /* The RemoteTrack is enabled. */ } recentSwitchOffReason = null; });
trackDisabled
andtrackEnabled
events are now only fired for subscribed RemoteTracks. - Any audio and video Tracks shared while joining the Room will no longer be guaranteed to be published by the time the CancelablePromise returned by
connect()
is resolved. The application will now have to listen to the "trackPublished" event on the LocalParticipant. (VIDEO-8817)const room = await connect('token', { audio: true, video: true, room: 'my-large-room' }); room.localParticipant.on('trackPublished', publication => { console.log(`Successfully published ${publication.kind} Track`); });
Room.getStats()
is broken, and will be fixed in an upcoming release. For now, the Track-level stats returned by this method will not be accurate.- PSTN Participants cannot connect to Large Rooms.