twilio-video 2.24.2 → 2.25.0

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.
Files changed (41) hide show
  1. package/CHANGELOG.md +72 -0
  2. package/COMMON_ISSUES.md +4 -48
  3. package/README.md +1 -2
  4. package/dist/twilio-video.js +188 -71
  5. package/dist/twilio-video.min.js +21 -21
  6. package/es5/createlocaltrack.js +10 -2
  7. package/es5/createlocaltrack.js.map +1 -1
  8. package/es5/createlocaltracks.js +20 -8
  9. package/es5/createlocaltracks.js.map +1 -1
  10. package/es5/media/track/audiotrack.js +0 -11
  11. package/es5/media/track/audiotrack.js.map +1 -1
  12. package/es5/media/track/localaudiotrack.js +112 -0
  13. package/es5/media/track/localaudiotrack.js.map +1 -1
  14. package/es5/media/track/localmediatrack.js +3 -6
  15. package/es5/media/track/localmediatrack.js.map +1 -1
  16. package/es5/media/track/localvideotrack.js +2 -2
  17. package/es5/media/track/localvideotrack.js.map +1 -1
  18. package/es5/media/track/mediatrack.js +3 -3
  19. package/es5/media/track/mediatrack.js.map +1 -1
  20. package/es5/media/track/remoteaudiotrack.js +12 -0
  21. package/es5/media/track/remoteaudiotrack.js.map +1 -1
  22. package/es5/media/track/remotemediatrack.js +2 -2
  23. package/es5/media/track/remotemediatrack.js.map +1 -1
  24. package/es5/util/browserdetection.js +16 -15
  25. package/es5/util/browserdetection.js.map +1 -1
  26. package/es5/webrtc/rtcpeerconnection/firefox.js +0 -14
  27. package/es5/webrtc/rtcpeerconnection/firefox.js.map +1 -1
  28. package/lib/createlocaltrack.js +10 -2
  29. package/lib/createlocaltracks.ts +32 -11
  30. package/lib/media/track/audiotrack.js +0 -12
  31. package/lib/media/track/localaudiotrack.js +112 -0
  32. package/lib/media/track/localmediatrack.js +2 -5
  33. package/lib/media/track/localvideotrack.js +2 -3
  34. package/lib/media/track/mediatrack.js +2 -2
  35. package/lib/media/track/remoteaudiotrack.js +13 -0
  36. package/lib/media/track/remotemediatrack.js +2 -2
  37. package/lib/util/browserdetection.js +16 -15
  38. package/lib/webrtc/rtcpeerconnection/firefox.js +0 -16
  39. package/package.json +2 -2
  40. package/tsdef/index.d.ts +1 -0
  41. package/tsdef/types.d.ts +2 -0
package/CHANGELOG.md CHANGED
@@ -2,6 +2,78 @@ 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.25.0 (November 14, 2022)
6
+ ==========================
7
+
8
+ New Features
9
+ ------------
10
+
11
+ ### Auto-switch default audio input devices
12
+
13
+ This release adds a new feature that preserves audio continuity in situations where end-users change the default audio input device.
14
+ A LocalAudioTrack is said to be capturing audio from the default audio input device if:
15
+
16
+ - it was created using the MediaTrackConstraints `{ audio: true }`, or
17
+ - it was created using the MediaTrackConstraints `{ audio: { deviceId: 'foo' } }`, and "foo" is not available, or
18
+ - it was created using the MediaTrackConstraints `{ audio: { deviceId: { ideal: 'foo' } } }` and "foo" is not available
19
+
20
+ In previous versions of the SDK, if the default device changed (ex: a bluetooth headset is connected to a mac or windows laptop),
21
+ the LocalAudioTrack continued to capture audio from the old default device (ex: the laptop microphone). Now, a LocalAudioTrack
22
+ will switch automatically from the old default audio input device to the new default audio input device (ex: from the laptop microphone to the headset microphone).
23
+ This feature is controlled by a new [CreateLocalAudioTrackOptions](https://sdk.twilio.com/js/video/releases/2.25.0/docs/global.html#CreateLocalAudioTrackOptions)
24
+ property `defaultDeviceCaptureMode`, which defaults to `auto` (new behavior) or can be set to `manual` (old behavior).
25
+
26
+ The application can decide to capture audio from a specific audio input device by creating a LocalAudioTrack:
27
+
28
+ - using the MediaTrackConstraints `{ audio: { deviceId: 'foo' } }`, and "foo" is available, or
29
+ - using the MediaTrackConstraints `{ audio: { deviceId: { ideal: 'foo' } } }` and "foo" is available, or
30
+ - using the MediaTrackConstraints `{ audio: { deviceId: { exact: 'foo' } } }` and "foo" is available
31
+
32
+ In this case, the LocalAudioTrack DOES NOT switch to another audio input device if the current audio input device is no
33
+ longer available. See below for the behavior of this property based on how the LocalAudioTrack is created. (VIDEO-11701)
34
+
35
+ ```js
36
+ const { connect, createLocalAudioTrack, createLocalTracks } = require('twilio-video');
37
+
38
+ // Auto-switch default audio input devices: option 1
39
+ const audioTrack = await createLocalAudioTrack();
40
+
41
+ // Auto-switch default audio input devices: option 2
42
+ const audioTrack1 = await createLocalAudioTrack({ defaultDeviceCaptureMode: 'auto' });
43
+
44
+ // Auto-switch default audio input devices: option 3
45
+ const [audioTrack3] = await createLocalTracks({ audio: true });
46
+
47
+ // Auto-switch default audio input devices: option 4
48
+ const [audioTrack4] = await createLocalTracks({ audio: { defaultDeviceCaptureMode: 'auto' } });
49
+
50
+ // Auto-switch default audio input devices: option 5
51
+ const room1 = await connect({ audio: true });
52
+
53
+ // Auto-switch default audio input devices: option 6
54
+ const room2 = await connect({ audio: { defaultDeviceCaptureMode: 'auto' } });
55
+
56
+ // Disable auto-switch default audio input devices
57
+ const room = await createLocalAudioTrack({ defaultDeviceCaptureMode: 'manual' });
58
+ ```
59
+
60
+ **Limitations**
61
+
62
+ - This feature is not enabled on iOS as it is natively supported.
63
+ - Due to this [WebKit bug](https://bugs.webkit.org/show_bug.cgi?id=232835), MacOS Safari Participants may lose their local audio after switching between default audio input devices two-three times.
64
+ - This feature is not supported on Android Chrome, as it does not support the [MediaDevices.ondevicechange](https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/devicechange_event#browser_compatibility) event.
65
+
66
+ 2.24.3 (October 10, 2022)
67
+ =========================
68
+
69
+ Bug Fixes
70
+ ---------
71
+
72
+ - Fixed a bug where iOS Safari Participant could not hear or see others after switching back from YouTube picture-in-picture mode. (VIDEO-11352)
73
+ - Fixed a bug where iOS Safari Participant could not hear others after switching from recording an audio message in a messenger app. (VIDEO-11354)
74
+ - Fixed a bug where iOS Safari Participant could not hear or see others after watching a video in another browser tab. (VIDEO-11356)
75
+ - Fixed a bug where iOS Safari Participant sometimes could not hear or see others after finishing an incoming call in full screen mode. (VIDEO-11359)
76
+
5
77
  2.24.2 (September 29, 2022)
6
78
  ===========================
7
79
 
package/COMMON_ISSUES.md CHANGED
@@ -4,7 +4,6 @@ Common Issues
4
4
  Are you experiencing an issue with twilio-video.js? Please review this list of known issues and workarounds
5
5
  before opening a new issue. We recommend regularly upgrading to the latest version of the SDK, which includes new features, bug fixes and improvements (see [CHANGELOG.md](CHANGELOG.md)).
6
6
 
7
-
8
7
  ### Chrome desktop
9
8
  <details>
10
9
  <summary>Chrome memory leak might cause degraded experience in group rooms</summary>
@@ -32,8 +31,6 @@ before opening a new issue. We recommend regularly upgrading to the latest versi
32
31
  </p>
33
32
  </details>
34
33
 
35
-
36
-
37
34
  ### Chrome mobile
38
35
  <details>
39
36
  <summary>Android 11: Participants are unable to connect to a room due to ICE gathering failures on certain devices</summary>
@@ -42,29 +39,6 @@ before opening a new issue. We recommend regularly upgrading to the latest versi
42
39
  Participants are unable to connect to a room on certain Android 11 devices due to a [Chromium bug](https://bugs.chromium.org/p/chromium/issues/detail?id=1240237) where the browser is unable to gather ice candidates. Please see this [github issue](https://github.com/twilio/twilio-video.js/issues/1701#issuecomment-1067533348) for more details and a potential solution to mitigate the issue.
43
40
  </p>
44
41
  </details>
45
- <details>
46
- <summary>Android 12: Video distortion on Chrome when hardware acceleration is enabled</summary>
47
- <p>
48
-
49
- 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.
50
- </p>
51
- </details>
52
- <details>
53
- <summary>Android Chrome on Pixel 3 receives corrupted video frames with codec VP8</summary>
54
- <p>
55
-
56
- This is an issue in the hardware VP8 encoder on the Pixel 3 devices. See [WebRTC ticket](https://bugs.chromium.org/p/webrtc/issues/detail?id=11337). To work around this issue, please set H264 as the preferred video codec on Pixel 3. ([Example](https://github.com/twilio/video-quickstart-android/issues/470#issuecomment-623042880)).
57
- </p>
58
- </details>
59
- <details>
60
- <summary>Android Chrome 81+ Participants fail to subscribe to H264 VideoTracks in Group Rooms</summary>
61
- <p>
62
-
63
- This happens primarily due to this [Chromium Bug](https://bugs.chromium.org/p/chromium/issues/detail?id=1074421).
64
- We have added a workaround to the SDK in version 2.4.0. For earlier versions of the SDK,
65
- please apply the workaround discussed in this [GitHub Issue](https://github.com/twilio/twilio-video.js/issues/966#issuecomment-619212184).
66
- </p>
67
- </details>
68
42
 
69
43
  ### Safari desktop
70
44
  <details>
@@ -83,15 +57,6 @@ before opening a new issue. We recommend regularly upgrading to the latest versi
83
57
  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)
84
58
  </p>
85
59
  </details>
86
-
87
- <details>
88
- <summary>Echo issues in Safari when using external microphone</summary>
89
- <p>
90
-
91
- This is an echo cancellation bug in Safari's implementation of WebRTC. For more details, go [here](https://bugs.webkit.org/show_bug.cgi?id=213723).
92
- and [here](https://github.com/twilio/twilio-video.js/issues/1433)
93
- </p>
94
- </details>
95
60
  <details>
96
61
  <summary>Angular applications missing audio and/or video tracks</summary>
97
62
  <p>
@@ -110,14 +75,6 @@ before opening a new issue. We recommend regularly upgrading to the latest versi
110
75
  </p>
111
76
  </details>
112
77
  <details>
113
- <summary>After unpublishing a Track, Safari 12.1 Participants cannot publish Track(s) of the same kind</summary>
114
- <p>
115
-
116
- Because of this Safari 12.1 [bug](https://bugs.webkit.org/show_bug.cgi?id=195489),
117
- once a Participant unpublishes a MediaTrack of any kind (audio or video), it will not be able to publish another MediaTrack of the same kind. DataTracks are not affected. We have escalated this bug to the Safari Team and are keeping track of related developments.
118
- </p>
119
- </details>
120
- <details>
121
78
  <summary>Video elements may not be visible when applying a 3d transform</summary>
122
79
  <p>
123
80
 
@@ -263,16 +220,15 @@ transform: scaleX(-1)
263
220
  This issue happened due to regression in Safari's WebKit in iOS version 14.2, the fix got rolled out in iOS 14.3 beta3. Find more details [here](https://github.com/twilio/twilio-video.js/issues/1296) and in this [WebKit bug](https://bugs.webkit.org/show_bug.cgi?id=218762).
264
221
  </p>
265
222
  </details>
266
-
267
-
268
- ### Firefox desktop
269
223
  <details>
270
- <summary>Firefox Participants sometimes fail to subscribe to DataTracks on Peer-to-Peer Rooms</summary>
224
+ <summary>Participant is disconnected from the Room after being backgrounded for 30 seconds due to another audio/video app or incoming phone call</summary>
271
225
  <p>
272
226
 
273
- Because of this Firefox [bug](https://bugzilla.mozilla.org/show_bug.cgi?id=1603887) Participants that join a Peer-to-Peer Room after a DataTrack has been published by a Firefox Participant fail to subscribe to it. You can work around this issue by publishing a DataTrack while connecting to the Room.
227
+ This is due to iOS suspending browser sessions that are not capturing audio after 30 seconds, as mentioned in this [Webkit bug comment](https://bugs.webkit.org/show_bug.cgi?id=204681#c5). You can work around this by rejoining the Room once the browser is foregrounded.
274
228
  </p>
275
229
  </details>
230
+
231
+ ### Firefox desktop
276
232
  <details>
277
233
  <summary>Firefox Participants cannot constrain their audio bandwidth</summary>
278
234
  <p>
package/README.md CHANGED
@@ -74,8 +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 &lt;script&gt; tag.
75
75
 
76
76
  ```html
77
- <script src="//sdk.twilio.com/js/video/releases/2.24.2/twilio-video.min.js"></script>
78
-
77
+ <script src="//sdk.twilio.com/js/video/releases/2.25.0/twilio-video.min.js"></script>
79
78
  ```
80
79
 
81
80
  Using this method, twilio-video.js will set a browser global: