Skip to content

Releases: twilio/twilio-video.js

2.24.1

07 Sep 18:19
Compare
Choose a tag to compare

2.24.1 (September 6, 2022)

Bug Fixes

  • Fixed a bug where sometimes a runtime error was raised on iOS devices as shown below. (VIDEO-11263)
    Unhandled Runtime Error: TypeError: null is not an object (evaluating 'el.paused')
    
  • The LocalTrackOptions type definition now contains logLevel as an optional property. (VIDEO-10659)
  • Fixed an issue where the import keyword was causing problems in webpack and typescript projects. (VIDEO-11220)

3.0.0-preview.3

31 Aug 23:41
Compare
Choose a tag to compare

3.0.0-preview.3 (August 31, 2022)

Breaking Changes

  • The LocalTrack constructors that do not require the new operator have been removed. Please use the es6 classes that are exported in the Video namespace. (VIDEO-10893)
  • The deprecated ConnectOptions property dscpTagging has been removed. Use enableDscp instead. (VIDEO-10893)
  • The deprecated ConnectOptions property eventListener has been removed. You can listen for the signaling events by intercepting the Logger's messages as shown here. (VIDEO-10893)
  • The deprecated ConnectOptions properties abortOnIceServersTimeout and iceServersTimeout have been removed. (VIDEO-10893)
  • The deprecated VideoBandwidthProfile properties maxTracks and renderDimensions have been removed. (VIDEO-10893)
  • Fixed the RemoteAudioTrack and RemoteVideoTrack property mediaStreamTrack's type, which is supposed to be MediaStreamTrack | null. (VIDEO-10893)
  • The id property has been removed from the LocalTrack classes. Use the name property instead. (VIDEO-10893)
  • The trackId and ssrc properties have been removed from the TrackStats class. (VIDEO-10893)
  • The maxAudioBitrate and maxVideoBitrate properties in ConnectOptions and EncodingParameters now accept values in kiliobits per second (kbps), as opposed to bits per second (bps) earlier. (VIDEO-10893)
  • The maxSubscriptionBitrate property in VideoBandwidthProfile now accepts values in kiliobits per second (kbps), as opposed to bits per second (bps) earlier. (VIDEO-10893)
  • The deprecated ConnectOptions property logLevel has been removed. Use the Video.Logger interface instead as shown here. (VIDEO-10893)

Bug Fixes

  • Fixed a bug where sometimes Room.getStats() returned statistics for unsubscribed RemoteTracks. (VIDEO-11199)
  • Fixed a bug where sometimes the SDK generated a TypeError in the browser console. (VIDEO-11203)

2.24.0

23 Aug 00:56
Compare
Choose a tag to compare

2.24.0 (August 22, 2022)

New Features

  • The support for twilio approved 3rd party noise cancellation solutions is now generally available.

Bug Fixes

  • Fixed an issue where input media track was not stopped, after localAudioTrack.stop() when using noiseCancellation (VIDEO-11047)
  • Added versioning support for noise cancellation plugin. This SDK will require noise cancellation plugin to be version 1.0.0 or greater. (VIDEO-11087)

3.0.0-preview.2

18 Aug 18:36
Compare
Choose a tag to compare

3.0.0-preview.2 (August 18, 2022)

Changes

  • Room.getStats(), which was broken in 3.0.0-preview.1, has been fixed in this release. Note that the values reported are best-effort approximations based off of the raw WebRTC statistics. (VIDEO-8756)

2.23.0

29 Jul 00:39
Compare
Choose a tag to compare

2.23.0 (July 28, 2022)

New Features

  • This release adds private beta support for 3rd party noise cancellation solution. You need to host twilio approved 3rd party plugin on your web server to enable noise cancellation. Please fill out this form to request access to the 3rd party plugin.

Once you get the access to the plugin, You can install it from npm with:

npm install <noise_cancellation_plugin>

Once installed, you need to host the contents of ./node_modules/<noise_cancellation_plugin>/dist/ from your web server. We recommend that you add plugin version number to the hosted path to ensure that browser does not use stale version when its updated. You need to pass the path to the hosted files to twilio-video sdk when creating audio track as shown in the example below. The example below assumes that you have hosted the files at /noise_cancellation_plugin/1.0.0/dist on your web server.

const { connect, createLocalAudioTrack } = require('twilio-video');

// create a local audio track and have it use
// @twilio/krisp-audio-plugin for noise cancellation processing.
const localAudioTrack = await Video.createLocalAudioTrack({
  noiseCancellationOptions: {
    vendor: 'krisp',
    sdkAssetsPath: '/noise_cancellation_plugin/1.0.0/dist'
  }
});

// publish the track to a room
const room = await connect( token, {
  tracks: [localAudioTrack]
  // ... any other connect options
});

// you can enable/disable noise cancellation at runtime
// using noiseCancellation interface exposed by localAudioTrack
function updateNoiseCancellation(enable: boolean) {
  const noiseCancellation = localAudioTrack.noiseCancellation;

  if (noiseCancellation) {
    enable ? noiseCancellation.enable() : noiseCancellation.disable();
  }
}

3.0.0-preview.1

25 Jul 23:18
Compare
Choose a tag to compare
3.0.0-preview.1 Pre-release
Pre-release

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.

2.22.2

25 Jul 20:12
Compare
Choose a tag to compare

2.22.2 (July 25, 2022)

Changes

  • isSupported flag now returns false if the browser does not support the Unified Plan SDP format. (VIDEO-10307)

    The following is a list of browsers with Unified Plan as the default SDP format.

    • Chrome 72+
    • Safari 12.1+
    • Firefox 38+

2.22.1

12 Jul 19:03
Compare
Choose a tag to compare

2.22.1 (July 11, 2022)

Bug Fixes

  • The encoding of audio and screen share Tracks are prioritized in Chrome and Safari, thereby more gracefully degrading their quality in limited network conditions. (VIDEO-10212)

2.22.0

05 Jul 21:29
Compare
Choose a tag to compare

2.22.0 (July 5, 2022)

New Features

This release include the Media Warnings API (Beta) to help surface media related warning events on the SDK whenever the media server is not able to detect media from a published audio or video track.

Example

const room = await connect('token', {
  notifyWarnings: [ 'recording-media-lost' ]
  // Other connect options
});

Array.from(room.localParticipant.tracks.values()).forEach(publication => {
  publication.on('warning', name => {
    if (name === 'recording-media-lost') {
      console.log(`LocalTrack ${publication.track.name} is not recording media.`);

      // Wait a reasonable amount of time to clear the warning.
      const timer = setTimeout(() => {
        // If the warning is not cleared, you can manually
        // reconnect to the room, or show a dialog to the user
      }, 5000);

      publication.once('warningsCleared', () => {
        console.log(`LocalTrack ${publication.track.name} warnings have cleared!`);
        clearTimeout(timer);
      });
    }
  });
});

API Definitions

ConnectOptions

  • notifyWarnings - An array of warnings to listen to. By default, this array is empty and no warning events will be raised. Possible warning values include:

    • recording-media-lost - Raised when the media server has not detected any media on the published track that is being recorded in the past 30 seconds. This usually happens when there are network interruptions or when the track has stopped.

Events

The SDK raises warning events when it detects certain conditions. You can implement callbacks on these events to act on them, or to alert the user of an issue. Subsequently, "warningsCleared" event is raised when conditions have returned to normal.

  • LocalTrackPublication.on('warning', callback(name)) - Raised when the published Track encounters a warning.

  • LocalTrackPublication.on('warningsCleared', callback()) - Raised when the published Track cleared all warning.

  • LocalParticipant.on('trackWarning', callback(name, publication)) - Raised when one of the LocalParticipant's published tracks encounters a warning.

  • LocalParticipant.on('trackWarningsCleared', callback(publication)) - Raised when one of the LocalParticipant's published tracks cleared all warning.

  • Room.on('trackWarning', callback(name, publication, participant)) - Raised when one of the LocalParticipant's published tracks in the Room encounters a warning.

  • Room.on('trackWarningsCleared', callback(publication, participant)) - Raised when one of the LocalParticipant's published tracks in the Room cleared all warning.

2.21.3

07 Jun 23:57
Compare
Choose a tag to compare

2.21.3 (June 7, 2022)

Bug Fixes

  • Fixed an issue where the generated API documentation has a missing search bar. (VIDEO-10199)