Releases: twilio/twilio-video.js
1.3.0
1.3.0 (September 11, 2017)
New Features
-
twilio-video.js now features an API for setting and updating bandwidth
constraints. When youconnect
to a Room, you can specify an optional
maxAudioBitrate
and an optionalmaxVideoBitrate
, both in bits per second
(bps). These values are set as hints for variable bitrate codecs, but will not
take effect for fixed bitrate codecs.For example, to connect with a maximum audio bitrate of 64 kilobits per
second and a maximum video bitrate of 500 kilobits per second:const room = await connect(token, { maxAudioBitrate: 64000, maxVideoBitrate: 500000 });
You can also update your
maxAudioBitrate
andmaxVideoBitrate
while
participating in a Room. For example, to reset your maximum bitrates for audio
and video, you could set each tonull
:room.localParticipant.setParameters({ maxAudioBitrate: null, maxVideoBitrate: null });
If you want to change only one value—for example, just the maximum video
bitrate—you can omit the other value. For example, to update only the maximum
video bitrate, leaving the maximum audio bitrate unchanged:room.localParticipant.setParameters({ maxVideoBitrate: 1000000 });
-
twilio-video.js now features an API for setting preferred codecs when
publishing Tracks. When youconnect
to a Room, you can specify an optional
preferredAudioCodecs
array and an optionalpreferredVideoCodecs
array.
These are codec "preferences" because they will only be applied if your
browser and the type of Room you are connected to support them. If a
preference cannot be satisfied, we will fallback to the next best codec.For example, to connect with a preferred video codec of H.264:
const room = await connect(token, { preferredVideoCodecs: ['H264'] });
You can also specify more than one preferred codec. For example, to connect
with a preferred audio codec of iSAC, falling back to Opus if iSAC is
unavailable:const room = await connect(token, { preferredAudioCodecs: ['isac', 'opus'] });
Please refer to the API docs for more information on both of these features.
Bug Fixes
- Track's
attach
method now sets theplaysInline
attribute on <audio>
and <video> elements. This is necessary to allow playback in Safari 11
on iOS.
1.2.2
1.2.2 (August 22, 2017)
This is primarily a bug fix release; however, we've also factored out two
dependencies (@twilio/sip.js and @twilio/webrtc) for easier management of the
project.
Bug Fixes
- In Chrome,
Room#getStats()
did not provide valid values for those Participants
with more than one Track of the same kind (audio or video). (JSDK-1329) - Fixed a rare scenario where the SDK could "get stuck" negotiating with the
server. We are evaluating whether or not to patch this behavior server-side
as well, so that older clients can receive the fix, too. (JSDK-1454)
1.2.1
1.2.1 (August 14, 2017)
In addition to the following bug fixes, this release introduces experimental
support for Safari 11 and newer. Support for Safari is "experimental" because,
at the time of writing, Safari does not support VP8. This means you may
experience codec issues in Group Rooms. You may also experience codec issues in
Peer-to-Peer (P2P) Rooms containing Android- or iOS-based Participants who do
not support H.264. However, P2P Rooms with browser-based Participants should
work.
We are also experimenting with the ability to specify the set of codecs a Group
Room supports. This would allow you to create an H.264-only Group Room, for
example. Please email [email protected]
if you would like to try this out.
twilio-video.js will log these same caveats as a warning if you call connect
in Safari 11. You can disable this warning by setting the logLevel
to "warn".
Bug Fixes
- In Firefox, we were raising a
peerIdentity
TypeError in the console.
(JSDK-1372)
1.2.0
1.2.0 (July 21, 2017)
New Features
- Video Insights can be enabled or disabled by setting
insights
totrue
or
false
in the ConnectOptions.insights
defaults totrue
. We recommend to
leave Video Insights enabled in order to aid troubleshooting.
Bug Fixes
- Added some missing documentation to ConnectOptions and
CreateLocalTracksOptions. Both options objects acceptaudio
andvideo
properties which may be set to a boolean or
MediaTrackConstraints.
We added this to the documentation. (JSDK-1365) - Fixed a bug where twilio-video.js would continue polling for configuration
data, despite being disconnected from a Room and despite the Access Token
having expired. (JSDK-1407)
1.1.0
1.1.0 (July 12, 2017)
New Features
-
You can now call the LocalParticipant's
removeTracks
method with an
optional second boolean argumentstop
to specify whether the removed
LocalTacks should be stopped. Ifstop
is not specified, then the removed
LocalTracks will be stopped. This mirrors the behavior of the LocalParticicipant's
removeTrack
method.// Stops the removed LocalTracks localParticipant.removeTracks(tracks); localParticipant.removeTracks(tracks, true);
// Does not stop the removed LocalTracks localParticipant.removeTracks(tracks, false);
Bug Fixes
- twilio-video.js can now be used alongside adapter.js. twilio-video.js checks
whether or not an RTCPeerConnection implementation supports the "track" event
by checking for anontrack
property on the RTCPeerConnection. adapter.js
sets this property; however it only dispatches "track" events if a function
is assigned to theontrack
property, meaning that event handlers attached
withaddEventListener
will never fire. We now work around this issue by
assigning a function toontrack
.
1.0.0
1.0.0 (April 25, 2017)
1.0.0-beta7 has been promoted to 1.0.0!
This library uses Semantic Versioning: We've removed the
pre-release identifier, and we're proud to share the first generally available
release of twilio-video.js.
1.0.0-beta7
1.0.0-beta7 (April 21, 2017)
Bug Fixes
- The first known issue in 1.0.0-beta6 stems from a behavior in Chrome: Chrome
will treat an SSRC change for a MediaStreamTrack as adding and removing the
MediaStreamTrack; this caused a problem in our SDK, as the first
MediaStreamTrack would be raised to the user wrapped in a Track object, but
would eventually become unusable due to the SSRC change. We workaround this
behavior by "fixing" the SSRCs announced in an SDP between calls to
createOffer
. Firefox does not exhibit this behavior. (CSDK-1206) - Calling
addTrack
,removeTrack
, or their plural variants in the same tick
could lead to sending more messages than necessary; we landed an optimization
to reduce these additional messages. (JSDK-1257)
1.0.0-beta6
1.0.0-beta6 (April 20, 2017)
New Features
-
You can now
connect
to a Room using an Array of MediaStreamTracks without
constructing LocalAudioTracks or LocalVideoTracks. For example, if you
already have a reference to a MediaStream,stream
, you can callconnect(token, { tracks: stream.getTracks() });
-
You can now call LocalParticipant's
addTrack
andremoveTrack
methods
with a MediaStreamTrack. If successful, these methods return the LocalTrack
added or removed; otherwise, they returnnull
. -
Added two new methods to LocalParticipant,
addTracks
andremoveTracks
, for
adding and removing multiple LocalTracks at a time. These methods accept
either an Array of LocalTracks or MediaStreamTracks, and return an Array of
the LocalTracks added or removed. For example, if you already have a reference
to a MediaStream,stream
, you can calllocalParticipant.addTracks(stream.getTracks()); localParticiapnt.removeTracks(stream.getTracks());
Bug Fixes
- Fixed a bug where attempting to remove a LocalTrack from the LocalParticipant
after disconnecting from a Room threw an Error (JSDK-1233) - Fixed a regression between 1.0.0-beta4 and 1.0.0-beta5 where
automatically-acquired LocalTracks were not stopped after disconnecting from
the Room - Fixed a bug that could lead to media- and Track-related failures that
resulting from the way we handle out-of-order SDP offers and answers; now,
all PeerConnections will wait until an initial round of negotiation is
complete before applying or creating subsequent offers (JSDK-1176) - Fixed a bug where calling
cancel
on the CancelablePromise returned by
connect
could throw an Error - Fixed a bug in the LocalAudioTrack and LocalVideoTrack constructors:
options
should have been optional (JSDK-1251) - Fixed a bug where Room's
getStats
method could reject if outbound statistics
were missing in Firefox - Fixed a bug where Room's
getStats
method could reject if called after
disconnecting from a Room in Firefox - Fixed a bug in our message retry logic that caused us to retry messages after
disconnecting from a Room
Known Issues
-
Despite the addition of
addTracks
, adding multiple LocalTracks in quick
succession is likely to cause media failures, and so it is recommended to
either- Stagger the addition or removal of LocalTracks, or
- Use the
enable
anddisable
functionality in lieu of adding and removing
LocalTracks.
A solution has been identified and will be included in the next release.
-
There exists an interoperability issue between Firefox and other WebRTC
implementations (including Chrome and Twilio's iOS and Android SDKs) that can
cause media failures if Firefox does not share a LocalAudioTrack. If you are
developing an application that will interoperate with Firefox, please ensure
you always share a LocalAudioTrack until this issue is resolved. You can
share a muted LocalAudioTrack by callingdisable
. For example,localAudioTrack.disable();
1.0.0-beta5
1.0.0-beta5 (March 20, 2017)
We are very close to releasing the 1.0.0 APIs. This release includes a number of
simplifications to the twilio-video APIs, namely
-
The Client class has been removed. Instead of constructing a Client using an
Access Token and then callingconnect
on it, you can simply callconnect
and pass it an Access Token directly. For example,const { connect } = require('twilio-video'); const room = await connect('your-token');
Or, if using browser globals,
const room = await Twilio.Video.connect('your-token');
-
The Media and LocalMedia classes have been removed. Although the Media and
LocalMedia classes provided some convenience methods for automatically
attaching and detaching Tracks from the DOM as they were added and removed,
these APIs got in the way whenever you wanted to do something more interesting
with the Tracks. Therefore, theaudioTracks
andvideoTracks
collections as
well as theaddTrack
andremoveTrack
methods have been moved up to the
Participant and LocalParticipant levels. You should update your code to use
the Track-levelattach
anddetach
APIs exclusively. For example,function handleParticipant(participant) { participant.tracks.forEach(addTrack); participant.on('trackAdded', addTrack); } function addTrack(track) { const element = track.attach(); document.body.appendChild(element); }
-
The
getLocalMedia
method has also been replaced with a new method,
createLocalTracks
. This method behaves likegetLocalMedia
did, except it
returns an Array of LocalTracks. -
The
addMicrophone
andaddCamera
methods from LocalMedia have been replaced
with two new top-level methods,createLocalAudioTrack
and
createLocalVideoTrack
.
Refer to the API docs for more information.
New Features
- LocalTracks now indicate whether or not they have stopped with the
isStopped
property. They also emit a new event, "stopped". LocalParticipant re-emits
this event as "trackStopped". - LocalAudioTracks and LocalVideoTracks can now be constructed directly from
MediaStreamTracks. - Updated the Track-level
attach
APIs to allow attaching both an AudioTrack
and a VideoTrack to the same HTMLMediaElement.
Bug Fixes
- Fixed a bug where twilio-video.js, when used in Firefox, would not raise a
"trackAdded" event on a remote Participant if they added, removed, and added
back the same Track - Fixed a bug where round-trip times reported by
getStats
were accidentally
multiplied by 1000 - Fixed a bug where certain identities with non-ASCII characters could not be
used (for example, multiple ":" characters were causing failures) - Fixed a bug where minified builds of twilio-video.js could not be used on web
pages that did not specify a charset - Fixed an EventEmitter leak in StateMachine that was warning in the console
1.0.0-beta4
1.0.0-beta4 (January 25, 2017)
New Features
- We've begun formalizing our error codes. They are divided up into Signaling
(530xx), Room (531xx), Participant (532xx), Track (533xx), Media (534xx), and
Configuration (535xx) subranges. Instances of TwilioError will now carry a
numericcode
belonging to one of these ranges.
Bug Fixes
- The way that twilio-video.js's dependencies, including some of
twilio-video.js's transitive dependencies, were declared caused problems with
bundlers like Webpack. This resulted in issues trying to use twilio-video.js
in certain configurations with Angular, Meteor, and React apps. This release
updates those dependencies.