twilio-video 2.17.0 → 2.18.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +39 -2
- package/COMMON_ISSUES.md +130 -0
- package/README.md +24 -15
- package/dist/twilio-video.js +361 -220
- package/dist/twilio-video.min.js +22 -21
- package/es5/connect.js +13 -2
- package/es5/connect.js.map +1 -1
- package/es5/media/track/localmediatrack.js +2 -0
- package/es5/media/track/localmediatrack.js.map +1 -1
- package/es5/media/track/remotevideotrack.js +68 -14
- package/es5/media/track/remotevideotrack.js.map +1 -1
- package/es5/preflight/getCombinedConnectionStats.js +0 -1
- package/es5/preflight/getCombinedConnectionStats.js.map +1 -1
- package/es5/preflight/getturncredentials.js +2 -16
- package/es5/preflight/getturncredentials.js.map +1 -1
- package/es5/preflight/makestat.js +1 -1
- package/es5/preflight/makestat.js.map +1 -1
- package/es5/preflight/preflighttest.js +83 -11
- package/es5/preflight/preflighttest.js.map +1 -1
- package/es5/signaling/v2/cancelableroomsignalingpromise.js +2 -9
- package/es5/signaling/v2/cancelableroomsignalingpromise.js.map +1 -1
- package/es5/signaling/v2/mediasignaling.js +2 -4
- package/es5/signaling/v2/mediasignaling.js.map +1 -1
- package/es5/signaling/v2/peerconnection.js +4 -2
- package/es5/signaling/v2/peerconnection.js.map +1 -1
- package/es5/signaling/v2/twilioconnectiontransport.js +3 -27
- package/es5/signaling/v2/twilioconnectiontransport.js.map +1 -1
- package/es5/util/constants.js +3 -0
- package/es5/util/constants.js.map +1 -1
- package/es5/util/eventobserver.js +9 -19
- package/es5/util/eventobserver.js.map +1 -1
- package/es5/util/index.js +2 -0
- package/es5/util/index.js.map +1 -1
- package/es5/util/sid.js +18 -0
- package/es5/util/sid.js.map +1 -0
- package/es5/util/twilio-video-errors.js +38 -5
- package/es5/util/twilio-video-errors.js.map +1 -1
- package/lib/connect.js +21 -2
- package/lib/media/track/localmediatrack.js +2 -0
- package/lib/media/track/remotevideotrack.js +74 -14
- package/lib/preflight/getCombinedConnectionStats.ts +0 -1
- package/lib/preflight/getturncredentials.ts +2 -12
- package/lib/preflight/makestat.ts +2 -2
- package/lib/preflight/preflighttest.ts +107 -13
- package/lib/signaling/v2/cancelableroomsignalingpromise.js +1 -12
- package/lib/signaling/v2/mediasignaling.js +2 -5
- package/lib/signaling/v2/peerconnection.js +4 -2
- package/lib/signaling/v2/twilioconnectiontransport.js +1 -31
- package/lib/util/constants.js +3 -0
- package/lib/util/eventobserver.js +10 -22
- package/lib/util/index.js +3 -0
- package/lib/util/sid.js +20 -0
- package/lib/util/twilio-video-errors.js +37 -5
- package/package.json +4 -3
- package/tsconfig.json +1 -1
- package/tsdef/PreflightTypes.d.ts +1 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,44 @@
|
|
|
1
1
|
The Twilio Programmable Video SDKs use [Semantic Versioning](http://www.semver.org/). Twilio supports version N-1 for 12 months after the first GA release of version N. We recommend you upgrade to the latest version as soon as possible to avoid any breaking changes. Version 2.x is the lastest Video JavaScript SDK.
|
|
2
2
|
|
|
3
|
-
**Version 1.x
|
|
3
|
+
**Version 1.x reached End of Life on September 8th, 2021.** See the changelog entry [here](https://www.twilio.com/changelog/end-of-life-complete-for-unsupported-versions-of-the-programmable-video-sdk). Support for the 1.x version ended on December 4th, 2020.
|
|
4
|
+
|
|
5
|
+
2.18.2 (December 15, 2021)
|
|
6
|
+
==========================
|
|
7
|
+
|
|
8
|
+
Bug Fixes
|
|
9
|
+
---------
|
|
10
|
+
|
|
11
|
+
- Fixed a bug where setting `clientTrackSwitchOffControl` to `auto` caused the RemoteVideoTracks to get switched off while playing in picture-in-picture mode. Note that this fix does not apply to Firefox as it does not yet implement [picture-in-picture](https://developer.mozilla.org/en-US/docs/Web/API/Picture-in-Picture_API) APIs. (VIDEO-6677)
|
|
12
|
+
|
|
13
|
+
2.18.1 (October 29, 2021)
|
|
14
|
+
=========================
|
|
15
|
+
|
|
16
|
+
Changes
|
|
17
|
+
-------
|
|
18
|
+
|
|
19
|
+
- Added some metrics to track the usage of the **Preflight API Public Beta** (`runPreflight`). There are no changes to the public APIs in this release. (VIDEO-6891)
|
|
20
|
+
|
|
21
|
+
2.18.0 (October 13, 2021)
|
|
22
|
+
=========================
|
|
23
|
+
|
|
24
|
+
New Features
|
|
25
|
+
------------
|
|
26
|
+
|
|
27
|
+
- When a LocalParticipant tries to publish a LocalVideoTrack in an [Audio Only Group Room](https://www.twilio.com/docs/video/api/rooms-resource#example-4-create-an-audio-only-group-room),
|
|
28
|
+
it will fail with a [RoomTrackKindNotSupportedError](https://sdk.twilio.com/js/video/releases/2.18.0/docs/RoomTrackKindNotSupportedError.html). (VIDEO-7242)
|
|
29
|
+
|
|
30
|
+
Known Issue
|
|
31
|
+
------------
|
|
32
|
+
|
|
33
|
+
In Firefox, although the publishing of a LocalVideoTrack in an Audio Only Group Room fails,
|
|
34
|
+
the **RoomTrackKindNotSupportedError** is not raised. We are actively working on fixing this issue.
|
|
35
|
+
|
|
36
|
+
2.17.1 (September 21, 2021)
|
|
37
|
+
===========================
|
|
38
|
+
Bug Fixes
|
|
39
|
+
---------
|
|
40
|
+
|
|
41
|
+
- Fixed a regression in `2.17.0` which caused Chrome screen share tracks to be encoded at lower dimensions. (VIDEO-7000)
|
|
4
42
|
|
|
5
43
|
2.17.0 (September 14, 2021)
|
|
6
44
|
===========================
|
|
@@ -40,7 +78,6 @@ preflightTest.on('progress', (progress: string) => {
|
|
|
40
78
|
|
|
41
79
|
preflightTest.on('failed', (error: Error) => {
|
|
42
80
|
console.error('preflight error:', error);
|
|
43
|
-
deferred.reject && deferred.reject(error);
|
|
44
81
|
});
|
|
45
82
|
|
|
46
83
|
preflightTest.on('completed', (report: PreflightTestReport) => {
|
package/COMMON_ISSUES.md
CHANGED
|
@@ -36,6 +36,13 @@ before opening a new issue. We recommend regularly upgrading to the latest versi
|
|
|
36
36
|
|
|
37
37
|
### Chrome mobile
|
|
38
38
|
<details>
|
|
39
|
+
<summary>Android 12: Video distortion on Chrome when hardware acceleration is enabled</summary>
|
|
40
|
+
<p>
|
|
41
|
+
|
|
42
|
+
This is a VP8 encoder issue on Android 12. Please see this [github ticket](https://github.com/twilio/twilio-video.js/issues/1627) and this [Chrome bug](https://bugs.chromium.org/p/chromium/issues/detail?id=1237677) for more details.
|
|
43
|
+
</p>
|
|
44
|
+
</details>
|
|
45
|
+
<details>
|
|
39
46
|
<summary>Android Chrome on Pixel 3 receives corrupted video frames with codec VP8</summary>
|
|
40
47
|
<p>
|
|
41
48
|
|
|
@@ -53,6 +60,23 @@ before opening a new issue. We recommend regularly upgrading to the latest versi
|
|
|
53
60
|
</details>
|
|
54
61
|
|
|
55
62
|
### Safari desktop
|
|
63
|
+
<details>
|
|
64
|
+
<summary>Browser crashes when muting a VideoTrack that is using an H264 codec on Safari 15.1</summary>
|
|
65
|
+
<p>
|
|
66
|
+
|
|
67
|
+
Due to a regression on Safari 15.1, the browser crashes when a VideoTrack is muted that is using an H264 codec. Please use VP8 as a workaround for now. See more details [here](https://github.com/twilio/twilio-video.js/issues/1611).
|
|
68
|
+
</p>
|
|
69
|
+
</details>
|
|
70
|
+
<details>
|
|
71
|
+
<summary>Failures to publish tracks on Safari 15</summary>
|
|
72
|
+
<p>
|
|
73
|
+
|
|
74
|
+
If your applications uses [Webrtc-adapter](https://github.com/webrtcHacks/adapter) as a dependency, please note that older versions of webrtc-adapter have a bug which leads to an error ("Client is unable to apply a remote media description - Attempted to assign to readonly property…") on Safari 15.
|
|
75
|
+
|
|
76
|
+
To fix this issue, please update your adapter.js version to the newer one (^7.7.1) with the [fix](https://github.com/webrtcHacks/adapter/commit/de0348c756b7bda11a700bf7ea9e9393cab16421)
|
|
77
|
+
</p>
|
|
78
|
+
</details>
|
|
79
|
+
|
|
56
80
|
<details>
|
|
57
81
|
<summary>Echo issues in Safari when using external microphone</summary>
|
|
58
82
|
<p>
|
|
@@ -89,6 +113,111 @@ before opening a new issue. We recommend regularly upgrading to the latest versi
|
|
|
89
113
|
|
|
90
114
|
### Safari mobile
|
|
91
115
|
<details>
|
|
116
|
+
<summary>iOS 15: VideoTracks goes black and the page freezes on certain interruptions</summary>
|
|
117
|
+
<p>
|
|
118
|
+
|
|
119
|
+
Certain interruptions such as incoming calls, backgrounding the browser or switching between apps causes VideoTracks on Chrome and Safari on iOS 15.1 to go black. Sometimes, the whole page also freezes and become unresponsive causing audio and video to cut off. These issues are regressions on iOS 15.1. See the following bugs for more details.
|
|
120
|
+
|
|
121
|
+
* [Page freezing](https://bugs.webkit.org/show_bug.cgi?id=230922#c12)
|
|
122
|
+
* [VideoTrack going black](https://bugs.webkit.org/show_bug.cgi?id=232599)
|
|
123
|
+
|
|
124
|
+
A workaround can be implemented to prevent the VideoTrack from going black. This workaround however doesn't prevent the issue where sometimes the page freezes. It is recommended to apply this workaround on Chrome and Safari on iOS 15.1.
|
|
125
|
+
|
|
126
|
+
```js
|
|
127
|
+
// Keeps track of video elements and their event listeners
|
|
128
|
+
const videoElements = {};
|
|
129
|
+
|
|
130
|
+
// Listen to onPlay and onPause events and intelligently re-attach the video element
|
|
131
|
+
function shimVideoElement(track, el) {
|
|
132
|
+
let wasInterrupted = false;
|
|
133
|
+
|
|
134
|
+
const onPause = () => {
|
|
135
|
+
wasInterrupted = true;
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
const onPlay = () => {
|
|
139
|
+
if (wasInterrupted) {
|
|
140
|
+
track.detach(el);
|
|
141
|
+
track.attach(el);
|
|
142
|
+
wasInterrupted = false;
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
el.addEventListener('pause', onPause);
|
|
147
|
+
el.addEventListener('play', onPlay);
|
|
148
|
+
|
|
149
|
+
// Track this element so we can remove the listeners
|
|
150
|
+
videoElements[el] = { onPause, onPlay };
|
|
151
|
+
}
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
Apply the workaround after attaching the video element.
|
|
155
|
+
|
|
156
|
+
```js
|
|
157
|
+
videoTrack.attach(videoElement);
|
|
158
|
+
shimVideoElement(videoTrack, videoElement);
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
Remove the listeners before detaching the video element.
|
|
162
|
+
|
|
163
|
+
```js
|
|
164
|
+
const { onPause, onPlay } = videoElements[videoElement];
|
|
165
|
+
videoElement.removeEventListener('pause', onPause);
|
|
166
|
+
videoElement.removeEventListener('play', onPlay);
|
|
167
|
+
```
|
|
168
|
+
</p>
|
|
169
|
+
</details>
|
|
170
|
+
<details>
|
|
171
|
+
<summary>iOS 15: Browser crashes when publishing or muting a VideoTrack that is using an H264 codec</summary>
|
|
172
|
+
<p>
|
|
173
|
+
|
|
174
|
+
Chrome and Safari on iOS 15.1 crashes when a VideoTrack is muted or published using an H264 codec. This issue happens due to a regression on iOS 15.1. Please use VP8 as a workaround for now. See more details [here](https://github.com/twilio/twilio-video.js/issues/1611).
|
|
175
|
+
</p>
|
|
176
|
+
</details>
|
|
177
|
+
<details>
|
|
178
|
+
<summary>iOS 15: Low audio volume in Safari</summary>
|
|
179
|
+
<p>
|
|
180
|
+
|
|
181
|
+
Safari on iOS version 15, sometimes routes audio to the earpiece and not the speakers by default. Which customers some time perceive as low audio volume. Find more details [here](https://github.com/twilio/twilio-video.js/issues/1586) and in this [WebKit bug](https://bugs.webkit.org/show_bug.cgi?id=230902). As a workaround, you can pipe all remote audio tracks into a single audio context for iOS 15. Using a gain node, you can increase the gain value to increase the audio volume levels. See example below.
|
|
182
|
+
|
|
183
|
+
```js
|
|
184
|
+
// Make sure to reuse the audioContext object as browsers
|
|
185
|
+
// have limits to the number of AudioContext instances you can create.
|
|
186
|
+
const audioContext = new (window.AudioContext || window.webkitAudioContext)();
|
|
187
|
+
|
|
188
|
+
function attachAudioTrack(remoteAudioTrack) {
|
|
189
|
+
const audioNode = audioContext.createMediaStreamSource(new MediaStream([remoteAudioTrack.mediaStreamTrack]));
|
|
190
|
+
const gainNode = audioContext.createGain();
|
|
191
|
+
|
|
192
|
+
// Adjust this value depending on your customers' preference
|
|
193
|
+
gainNode.gain.value = 20;
|
|
194
|
+
|
|
195
|
+
audioNode.connect(gainNode);
|
|
196
|
+
gainNode.connect(audioContext.destination);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
// Attach the RemoteAudioTrack once received.
|
|
200
|
+
attachAudioTrack(remoteAudioTrack);
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
This workaround has the following potential side effects.
|
|
204
|
+
|
|
205
|
+
* There is a possibility of the introduction of echo. Please adjust the gain value and check for echo while testing the workaround.
|
|
206
|
+
* The output volume might end up really high if the user switches headsets.
|
|
207
|
+
* The default volume might end up really high once Apple rolls out the fix for this issue.
|
|
208
|
+
|
|
209
|
+
Keeping the side effects in mind, you might need to adjust your UI to improve the experience. For example, you can turn off this workaround by default and have a "call to action" in your UI that allows the user to turn the volume up if they cannot hear any audio. This button will then apply the workaround. Another option is to listen for `devicechange` events to determine if the user switches headsets. When this happens, you will have the ability to reset the gain value.
|
|
210
|
+
|
|
211
|
+
</p>
|
|
212
|
+
</details>
|
|
213
|
+
<details>
|
|
214
|
+
<summary>iOS 15: Audio is lost in a video call after an interruption with a phone call</summary>
|
|
215
|
+
<p>
|
|
216
|
+
|
|
217
|
+
Due to a regression on Safari on iOS 15, an incoming call causes local and sometimes remote media playback to stop. You can find more details in this [WebKit bug](https://bugs.webkit.org/show_bug.cgi?id=230537).
|
|
218
|
+
</p>
|
|
219
|
+
</details>
|
|
220
|
+
<details>
|
|
92
221
|
<summary>Mobile Safari Participants on iOS 13.1-13.3 sometimes fail to send audio</summary>
|
|
93
222
|
<p>
|
|
94
223
|
|
|
@@ -103,6 +232,7 @@ before opening a new issue. We recommend regularly upgrading to the latest versi
|
|
|
103
232
|
</p>
|
|
104
233
|
</details>
|
|
105
234
|
|
|
235
|
+
|
|
106
236
|
### Firefox desktop
|
|
107
237
|
<details>
|
|
108
238
|
<summary>Firefox Participants sometimes fail to subscribe to DataTracks on Peer-to-Peer Rooms</summary>
|
package/README.md
CHANGED
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
**NEW:** Please check out our [Best Practices Guide](https://www.twilio.com/docs/video/build-js-video-application-recommendations-and-best-practices)
|
|
2
|
-
for building video applications with twilio-video.js.
|
|
3
|
-
|
|
4
1
|
twilio-video.js
|
|
5
2
|
===============
|
|
6
3
|
|
|
7
4
|
[](https://www.npmjs.com/package/twilio-video) [](https://circleci.com/gh/twilio/twilio-video.js/tree/master)
|
|
8
5
|
|
|
9
|
-
For 1.x, go [here](https://github.com/twilio/twilio-video.js/tree/support-1.x/).
|
|
10
|
-
|
|
11
6
|
twilio-video.js allows you to add real-time voice and video to your web apps.
|
|
12
7
|
|
|
13
8
|
* [API Docs](//sdk.twilio.com/js/video/latest/docs)
|
|
@@ -18,6 +13,11 @@ twilio-video.js allows you to add real-time voice and video to your web apps.
|
|
|
18
13
|
|
|
19
14
|
**We want your feedback!** Please feel free to open a [GitHub issue](https://github.com/twilio/twilio-video.js/issues) for suggested improvements or feature requests. If you need technical support, contact [help@twilio.com](mailto:help@twilio.com).
|
|
20
15
|
|
|
16
|
+
Changelog
|
|
17
|
+
---------
|
|
18
|
+
|
|
19
|
+
View [CHANGELOG.md](https://github.com/twilio/twilio-video.js/blob/master/CHANGELOG.md) for details about our releases.
|
|
20
|
+
|
|
21
21
|
Browser Support
|
|
22
22
|
---------------
|
|
23
23
|
|
|
@@ -74,7 +74,7 @@ Releases of twilio-video.js are hosted on a CDN, and you can include these
|
|
|
74
74
|
directly in your web app using a <script> tag.
|
|
75
75
|
|
|
76
76
|
```html
|
|
77
|
-
<script src="//sdk.twilio.com/js/video/releases/2.
|
|
77
|
+
<script src="//sdk.twilio.com/js/video/releases/2.18.2/twilio-video.min.js"></script>
|
|
78
78
|
|
|
79
79
|
```
|
|
80
80
|
|
|
@@ -136,11 +136,6 @@ function trackUnsubscribed(track) {
|
|
|
136
136
|
}
|
|
137
137
|
```
|
|
138
138
|
|
|
139
|
-
Changelog
|
|
140
|
-
---------
|
|
141
|
-
|
|
142
|
-
See [CHANGELOG.md](https://github.com/twilio/twilio-video.js/blob/master/CHANGELOG.md).
|
|
143
|
-
|
|
144
139
|
Content Security Policy (CSP)
|
|
145
140
|
-----------------------------
|
|
146
141
|
|
|
@@ -162,10 +157,6 @@ script-src https://sdk.twilio.com
|
|
|
162
157
|
Keep in mind, you may need to merge these policy directives with your own if
|
|
163
158
|
you're using other services.
|
|
164
159
|
|
|
165
|
-
License
|
|
166
|
-
-------
|
|
167
|
-
|
|
168
|
-
See [LICENSE.md](https://github.com/twilio/twilio-video.js/blob/master/LICENSE.md).
|
|
169
160
|
|
|
170
161
|
Building
|
|
171
162
|
--------
|
|
@@ -221,9 +212,27 @@ Tips
|
|
|
221
212
|
ln -s ../../pre-commit.sh .git/hooks/pre-commit
|
|
222
213
|
```
|
|
223
214
|
|
|
215
|
+
Related
|
|
216
|
+
-------
|
|
217
|
+
### Applications using twilio-video.js
|
|
218
|
+
- [Twilio Video React App](https://github.com/twilio/twilio-video-app-react)
|
|
219
|
+
- [Twilio Video Javascript Quickstart](https://github.com/twilio/video-quickstart-js)
|
|
220
|
+
- [Twilio Video Diagnostics App](https://github.com/twilio/twilio-video-diagnostics-react-app/blob/main/README.md)
|
|
221
|
+
|
|
222
|
+
### Developer tools
|
|
223
|
+
- [Twilio Video Processors](https://twilio.github.io/twilio-video-processors.js/index.html)
|
|
224
|
+
- [Twilio Video Room Monitor](https://github.com/twilio/twilio-video-room-monitor.js)
|
|
225
|
+
- [Twilio RTC Diagnostics SDK](https://github.com/twilio/rtc-diagnostics)
|
|
226
|
+
|
|
224
227
|
Contributing
|
|
225
228
|
------------
|
|
226
229
|
|
|
227
230
|
Bug fixes welcome! If you're not familiar with the GitHub pull
|
|
228
231
|
request/contribution process,
|
|
229
232
|
[this is a nice tutorial](https://gun.io/blog/how-to-github-fork-branch-and-pull-request/).
|
|
233
|
+
|
|
234
|
+
License
|
|
235
|
+
-------
|
|
236
|
+
|
|
237
|
+
See [LICENSE.md](https://github.com/twilio/twilio-video.js/blob/master/LICENSE.md).
|
|
238
|
+
|