Skip to content

Releases: twilio/twilio-video.js

2.7.3

22 Oct 03:55
Compare
Choose a tag to compare

2.7.3 (October 21, 2020)

Bug Fixes

  • Fixed a bug where an iOS 14 Safari Participant is not heard by others in a Room after handling an incoming phone call. (JSDK-3031)

2.8.0-beta.1

29 Sep 00:27
Compare
Choose a tag to compare

2.8.0-beta.1 (September 28, 2020)

New Features

  • This beta release adds a new experimental API testPreflight to help test the connectivity with twilio servers.
    The API connects two participants to the video room using supplied tokens. It publishes synthetic audio and video
    tracks from one participant. It also ensures that other participant receives media on those tracks.
    After successfully verifying the connectivity, it generates a report about statistics of the connection.

Few things to note:

  • The tokens used for the connection must specify the room for the test. This must be a unique test room
    and not to be used for regular operations.
  • Since the API connects participants to the room it would incur the typical cost for 2 mins of usage. The actual cost
    would depend on the room type used.
  • This function uses web audio API's.
    Browser's autoplay policies sometimes require user action before accessing these APIs. Please ensure that this API
    is called in response to user action like a button click.
  • preflightTest emits failed event to indicate test failures. Please refer to
    this guide
    for interpreting common errors.

Report generated by preflightTest on completed can be used to determine the quality of connection. Some of the useful stats and their optimal values are listed below.

Stat Explanation Optimal values
jitter Packets delay variation on audio tracks < 30ms
packetLoss Packet loss as a percent of total packets sent < 1%
networkQuality Network quality score (1 to 5), available only for group rooms > 3
rtt Round trip time in milliseconds. < 200ms

We encourage you to reach out to us with any feedback with the usage of the API.

const Video = require('twilio-video');
const tempRoomName = 'test-room-' + Date.now();
const publisherToken = getAccessToken('alice', tempRoomName);
const subscriberToken = getAccessToken('bob', tempRoomName);

const preflightTest = Video.testPreflight(publisherToken, subscriberToken);

preflightTest.on('completed', function(report) {
  console.log("Test completed in " + report.testTiming.duration + " milliseconds.");
  console.log(" It took " + report.networkTiming.connect.duration + " milliseconds to connect");
  console.log(" It took " + report.networkTiming.media.duration + " milliseconds to receive media");

  // network score is available only for group rooms.
  console.log(" Your network score was: " + report.stats.networkQuality);
});

preflightTest.on('failed', function(error) {
  console.log("Test failed:" + error);
});

preflightTest.on('progress', function(progressState) {
  console.log(progressState);
});

Bug Fixes

  • Fixed a bug where LocalTrack event listeners were not being cleaned up after disconnecting from a room. (JSDK-2985)

2.7.2

12 Aug 22:16
Compare
Choose a tag to compare

2.7.2 (August 12, 2020)

Bug Fixes

  • Fixed a bug where a Participant in a large Group Room sometimes gets inadvertently disconnected with a MediaServerRemoteDescFailedError. (JSDK-2893)

  • Fixed a bug where Room.getStats() returned stats for only one of the temporal layers of a VP8 simulcast VideoTrack. Now, you will have a LocalVideoTrackStats object for each temporal layer, which you can recognize by the trackId and trackSid properties. (JSDK-2920)

  async function getBytesSentOnLocalVideoTrack(room, trackSid) {
    const stats = await room.getStats();
    let totalBytesSent = 0;
    stats.forEach(stat => {
      totalBytesSent += stat.localVideoTrackStats
        .filter(localVideoTrackStats => trackSid === localVideoTrackStats.trackSid)
        .reduce((bytesSent, localVideoTrackStats) => bytesSent + localVideoTrackStats.bytesSent, 0);
    });
    return totalBytesSent;
  }

Changes

  • Added metrics about signaling server connections. This is internal change, and has no effect on the SDK API.

2.7.1

29 Jul 00:24
Compare
Choose a tag to compare

2.7.1 (July 28, 2020)

Bug Fixes

  • Fixed a bug where, sometimes an iOS Safari Participant is not heard by others in a Room after handling an incoming phone call. (JSDK-2932)
  • In version 2.6.0, we had introduced a workaround for this iOS Safari bug which causes your application to lose the microphone when another application (Siri, YouTube, FaceTime, etc.) reserves the microphone. This release refactors the workaround to work for iOS versions 13.6 and above. (JSDK-2928)
  • Fixed a bug where, sometimes an iOS Safari Participant's <audio> and <video> elements were paused after handling an incoming phone call. Because of this, RemoteParticipants could not be seen and/or heard. (JSDK-2899)
  • Fixed a bug where iOS Safari Participants stopped sending video frames after an incoming phone call. (JSDK-2915)
  • Fixed a bug where audio only Firefox 79+ and Chrome Participants could not hear each other in a Peer to Peer Room due to this Chromium bug. (JSDK-2914)
  • Fixed a bug where isSupported returned false for Android Chrome browser on Motorola phones. (JSDK-2878)

2.7.0

09 Jul 02:04
Compare
Choose a tag to compare

2.7.0 (July 8, 2020)

New Features

  • Previously, if you wanted to change the MediaTrackConstraints of an audio or video LocalTrack that is published to a Room, you would have to unpublish it, create a new LocalTrack with the desired MediaTrackConstraints and publish it to the Room. Now, you can just restart the LocalTrack with the desired MediaTrackConstraints. For details, please refer to the LocaAudioTrack.restart() and LocalVideoTrack.restart() documentation. (JSDK-2870)

Bug Fixes

  • Restored es5 support which was broken in 2.5.0. (JSDK-2913)

2.6.0

26 Jun 23:49
Compare
Choose a tag to compare

2.6.0 (June 26, 2020)

Changes

  • Worked around this iOS Safari bug which causes your
    application to lose the microphone when another application (Siri, YouTube, FaceTime, etc.) reserves the
    microphone. Now your application will regain the microphone after foregrounding. As a result of this, the
    LocalAudioTrack's mediaStreamTrack property will now point to the newly acquired MediaStreamTrack, and
    the started event is fired again on the LocalAudioTrack. The id of the LocalAudioTrack is now no longer
    guaranteed to be equal to the id of the MediaStreamTrack. Also, if you want to listen to events on the
    MediaStreamTrack, we recommend that you do so in the started event handler, since it guarantees that you
    are always listening to events on the most recently acquired MediaStreamTrack. (JSDK-2828)
const { createLocalAudioTrack } = require('twilio-video');

const localAudioTrack = await createLocalAudioTrack();

function onMute() {
  console.log('MediaStreamTrack muted!');
}

function onUnmute() {
  console.log('MediaStreamTrack unmuted!');
}

localAudioTrack.on('started', () => {
  const { mediaStreamTrack } = localAudioTrack;
  mediaStreamTrack.addEventListener('mute', onMute);
  mediaStreamTrack.addEventListener('unmute', onUnmute);
});

localAudioTrack.on('stopped', () => {
  const { mediaStreamTrack } = localAudioTrack;
  mediaStreamTrack.removeEventListener('mute', onMute);
  mediaStreamTrack.removeEventListener('unmute', onUnmute);
});
  • Worked around iOS Safari bug where, when the application is foregrounded,
    it sometimes does not resume playback of the HTMLMediaElements attached to RemoteTracks that are paused when the application
    was backgrounded (JSDK-2879).

2.5.1

06 Jun 01:08
Compare
Choose a tag to compare

2.5.1 (June 5, 2020)

Changes

  • Removed support for versions of Chrome (23 - 55) and Firefox (22 - 43) that support prefixed versions of the WebRTC APIs that have been deprecated. isSupported will now return false for these browser versions. (JSDK-2832)

Bug Fixes

  • Moved npm dependencies chromedriver and puppeteer to devDependencies from optionalDependencies. (JSDK-2848)

2.5.0

28 May 01:38
Compare
Choose a tag to compare

2.5.0 (May 27, 2020)

New Features

  • The client now retries connection attempts when connect() is called and the signaling server is busy. The client may attempt one or more connection attempts with a server specified backoff period. If the client exceeds all attempts the CancelablePromise is rejected with a SignalingServerBusyError. The status of the signaling connection can now be monitored by passing an EventListener in ConnectOptions as shown in the code snippet below. Each event is documented here. (JSDK-2777)

    const { EventEmitter } = require('events');
    const { connect } = require('twilio-video');
    
    const sdkEvents = new EventEmitter();
    
    // Listen to events on the EventListener in order to monitor the status
     // of the connection to Twilio's signaling server.
    sdkEvents.on('event', event => {
      const { level, name } = event;
      if (name === 'waiting') {
        assert.equal(level, 'warning');
        console.warn('Twilio\'s signaling server is busy, so we wait a little while before trying again.');
      } else if (name === 'connecting') {
        assert.equal(level, 'info');
        console.log('Connecting to Twilio\'s signaling server.');
      } else if (name === 'open') {
        assert.equal(level, 'info');
        console.log('Connected to Twilio\'s signaling server, joining the Room now.');
      } else if (name === 'closed') {
        if (level === 'error') {
          const { payload: { reason } } = event;
          console.error('Connection to Twilio\'s signaling server abruptly closed:', reason);
        } else {
          console.log('Connection to Twilio\'s signaling server closed.');
        }
      }
    });
    
    connect('token', { eventListener: sdkEvents }).then(room => {
      console.log('Joined the Room:', room.name);
    }, error => {
      if (error.code === 53006) {
        console.error('Twilio\'s signaling server cannot accept connection requests at this time.');
      }
    });
  • Reduced connection times by acquiring RTCIceServers during the initial handshake with Twilio's signaling server rather than sending a HTTP POST request to a different endpoint. Because of this, the ConnectOptions properties abortOnIceServersTimeout and iceServersTimeout are no longer applicable, and they will be ignored. (JSDK-2676)

  • Reduced connection times by removing a round trip during the initial handshake with Twilio's signaling server. (JSDK-2777)

  • The CancelablePromise returned by connect() will now be rejected with a SignalingConnectionError if the underlying WebSocket connection to Twilio's signaling server is not open in 15 seconds. (JSDK-2684)

Bug Fixes

  • Fixed a bug where isSupported was throwing an exception in a server-side rendering application. (JSDK-2818)
  • Fixed a bug where sometimes the publishing of a LocalTrack very quickly after another LocalTrack was unpublished never completed. (JSDK-2769)
  • Fixed a bug in Room.getStats() where it did not return correct values for packetsLost, roundTripTime for LocalTracks. (JSDK-2755, JSDK-2780, JSDK-2787)

2.4.0

04 May 20:50
Compare
Choose a tag to compare

2.4.0 (May 4, 2020)

New Features

  • twilio-video.js now supports faster signaling reconnections due to network disruption or handoff. (JSDK-2739)
  • twilio-video.js now supports faster media reconnections due to network disruption or handoff. (JSDK-2742)

Bug Fixes

  • Worked around this Chromium bug,
    which causes Android Chrome 81+ Participants to not be able to subscribe to H264 RemoteVideoTracks
    in a Group or Small Group Room. (JSDK-2779)
  • Fixed a bug where Video.isSupported was returning true for some browsers that
    are not officially supported by twilio-video.js. (JSDK-2756)

2.3.0

19 Mar 18:54
Compare
Choose a tag to compare

New Features

  • reconnecting and reconnected events on Room and LocalParticipant are now fired asynchronously. (JSDK-2696)
  • twilio-video.js now raises connect() errors due to network disruptions quicker by not retrying after the first connection attempt fails. (JSDK-2682)
  • twilio-video.js attempts to reconnect to a Room only while the Participant's session is valid (typically 30 seconds after the reconnecting event) instead of using a fixed number of retries. (JSDK-2683)
  • A LocalParticipant will now have an additional signalingRegion property which contains the geographical region of the signaling edge LocalParticipant is connected to. (JSDK-2687)
  • A Room will now have an additional mediaRegion property which is where media is being processed. This property is not set for Peer-to-Peer Rooms because they do not use a central media server for routing and/or recording. (JSDK-2685)

Bug Fixes

  • Fixed a bug where calling setPriority on RemoteVideoTracks of RemoteParticipants that joined after the LocalParticipant had no effect. (JSDK-2707)