twilio-video 2.17.1 → 2.18.3
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 +40 -1
- package/COMMON_ISSUES.md +130 -0
- package/README.md +1 -1
- package/dist/twilio-video.js +412 -291
- 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 +3 -1
- 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/cancelablepromise.js +11 -0
- package/es5/util/cancelablepromise.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 +3 -1
- package/lib/signaling/v2/twilioconnectiontransport.js +1 -31
- package/lib/util/cancelablepromise.js +12 -0
- 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 +6 -5
- package/tsconfig.json +1 -1
- package/tsdef/PreflightTypes.d.ts +1 -2
- package/tsdef/index.d.ts +2 -2
- package/tsdef/twilio-video-tests.ts +13 -0
- package/tsdef/types.d.ts +3 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,46 @@ The Twilio Programmable Video SDKs use [Semantic Versioning](http://www.semver.o
|
|
|
2
2
|
|
|
3
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
4
|
|
|
5
|
+
2.18.3 (January 4, 2022)
|
|
6
|
+
========================
|
|
7
|
+
|
|
8
|
+
Bug Fixes
|
|
9
|
+
---------
|
|
10
|
+
|
|
11
|
+
- Fixed a bug where connect was returning a Promise type instead of a CancelablePromise. (VIDEO-7831)
|
|
12
|
+
- Fixed a bug where `audioLevel`, `frameRate`, and `captureDimensions` WebRTC stats are returning null on certain browsers. With this release, these stats are now populated whenever they are available. (VIDEO-3600)
|
|
13
|
+
|
|
14
|
+
2.18.2 (December 15, 2021)
|
|
15
|
+
==========================
|
|
16
|
+
|
|
17
|
+
Bug Fixes
|
|
18
|
+
---------
|
|
19
|
+
|
|
20
|
+
- 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)
|
|
21
|
+
|
|
22
|
+
2.18.1 (October 29, 2021)
|
|
23
|
+
=========================
|
|
24
|
+
|
|
25
|
+
Changes
|
|
26
|
+
-------
|
|
27
|
+
|
|
28
|
+
- 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)
|
|
29
|
+
|
|
30
|
+
2.18.0 (October 13, 2021)
|
|
31
|
+
=========================
|
|
32
|
+
|
|
33
|
+
New Features
|
|
34
|
+
------------
|
|
35
|
+
|
|
36
|
+
- 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),
|
|
37
|
+
it will fail with a [RoomTrackKindNotSupportedError](https://sdk.twilio.com/js/video/releases/2.18.0/docs/RoomTrackKindNotSupportedError.html). (VIDEO-7242)
|
|
38
|
+
|
|
39
|
+
Known Issue
|
|
40
|
+
------------
|
|
41
|
+
|
|
42
|
+
In Firefox, although the publishing of a LocalVideoTrack in an Audio Only Group Room fails,
|
|
43
|
+
the **RoomTrackKindNotSupportedError** is not raised. We are actively working on fixing this issue.
|
|
44
|
+
|
|
5
45
|
2.17.1 (September 21, 2021)
|
|
6
46
|
===========================
|
|
7
47
|
Bug Fixes
|
|
@@ -47,7 +87,6 @@ preflightTest.on('progress', (progress: string) => {
|
|
|
47
87
|
|
|
48
88
|
preflightTest.on('failed', (error: Error) => {
|
|
49
89
|
console.error('preflight error:', error);
|
|
50
|
-
deferred.reject && deferred.reject(error);
|
|
51
90
|
});
|
|
52
91
|
|
|
53
92
|
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
|
@@ -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.3/twilio-video.min.js"></script>
|
|
78
78
|
|
|
79
79
|
```
|
|
80
80
|
|