github twilio/twilio-video.js 3.0.0-preview.1

latest releases: 2.28.2-rc2, 2.29.0-rc.1, 2.29.0-preview.1...
pre-release2 years ago

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. The switchedOff event will also have this reason string as a second argument. (VIDEO-8670, VIDEO-8748)
  • An audio or video RemoteTrack's mediaStreamTrack is set to null 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, the switchedOff 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 and enabled events of the RemoteTrack are deprecated and scheduled for removal. Alternatively, you can handle the switchedOff and switchedOn 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 to true for unsubscribed
    RemoteTracks.
  • The trackDisabled and trackEnabled events of the RemoteTrack are deprecated and scheduled for removal. Alternatively, you can handle the trackSwitchedOff and trackSwitchedOn events as shown below. (VIDEO-8743, VIDEO-8751)
    const { 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;
    });
    The trackDisabled and trackEnabled 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.

Don't miss a new twilio-video.js release

NewReleases is sending notifications on new releases.