twilio-video 2.22.2 → 3.0.0-preview.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.
Files changed (137) hide show
  1. package/CHANGELOG.md +106 -1
  2. package/README.md +1 -1
  3. package/dist/twilio-video.js +1751 -564
  4. package/dist/twilio-video.min.js +21 -20
  5. package/es5/connect.js +75 -13
  6. package/es5/connect.js.map +1 -1
  7. package/es5/createlocaltracks.js +0 -1
  8. package/es5/createlocaltracks.js.map +1 -1
  9. package/es5/localparticipant.js +20 -10
  10. package/es5/localparticipant.js.map +1 -1
  11. package/es5/media/track/audiotrack.js +6 -15
  12. package/es5/media/track/audiotrack.js.map +1 -1
  13. package/es5/media/track/index.js +2 -4
  14. package/es5/media/track/index.js.map +1 -1
  15. package/es5/media/track/localdatatrack.js +4 -1
  16. package/es5/media/track/localdatatrack.js.map +1 -1
  17. package/es5/media/track/localmediatrack.js +1 -0
  18. package/es5/media/track/localmediatrack.js.map +1 -1
  19. package/es5/media/track/mediatrack.js +63 -49
  20. package/es5/media/track/mediatrack.js.map +1 -1
  21. package/es5/media/track/receiver.js +3 -2
  22. package/es5/media/track/receiver.js.map +1 -1
  23. package/es5/media/track/remoteaudiotrack.js +27 -9
  24. package/es5/media/track/remoteaudiotrack.js.map +1 -1
  25. package/es5/media/track/remoteaudiotrackpublication.js +28 -2
  26. package/es5/media/track/remoteaudiotrackpublication.js.map +1 -1
  27. package/es5/media/track/remotedatatrack.js +1 -1
  28. package/es5/media/track/remotedatatrack.js.map +1 -1
  29. package/es5/media/track/remotemediatrack.js +93 -24
  30. package/es5/media/track/remotemediatrack.js.map +1 -1
  31. package/es5/media/track/remotetrackpublication.js +87 -15
  32. package/es5/media/track/remotetrackpublication.js.map +1 -1
  33. package/es5/media/track/remotevideotrack.js +39 -11
  34. package/es5/media/track/remotevideotrack.js.map +1 -1
  35. package/es5/media/track/remotevideotrackpublication.js +28 -2
  36. package/es5/media/track/remotevideotrackpublication.js.map +1 -1
  37. package/es5/media/track/sender.js +1 -1
  38. package/es5/media/track/sender.js.map +1 -1
  39. package/es5/media/track/transceiver.js +6 -1
  40. package/es5/media/track/transceiver.js.map +1 -1
  41. package/es5/media/track/videotrack.js +32 -16
  42. package/es5/media/track/videotrack.js.map +1 -1
  43. package/es5/participant.js +47 -76
  44. package/es5/participant.js.map +1 -1
  45. package/es5/remoteparticipant.js +18 -9
  46. package/es5/remoteparticipant.js.map +1 -1
  47. package/es5/room.js +22 -5
  48. package/es5/room.js.map +1 -1
  49. package/es5/signaling/remotetrackpublication.js +13 -8
  50. package/es5/signaling/remotetrackpublication.js.map +1 -1
  51. package/es5/signaling/track.js.map +1 -1
  52. package/es5/signaling/v2/cancelableroomsignalingpromise.js +6 -3
  53. package/es5/signaling/v2/cancelableroomsignalingpromise.js.map +1 -1
  54. package/es5/signaling/v2/localparticipant.js +3 -3
  55. package/es5/signaling/v2/peerconnection.js +16 -3
  56. package/es5/signaling/v2/peerconnection.js.map +1 -1
  57. package/es5/signaling/v2/peerconnectionmanager.js +12 -0
  58. package/es5/signaling/v2/peerconnectionmanager.js.map +1 -1
  59. package/es5/signaling/v2/remoteparticipant.js +13 -5
  60. package/es5/signaling/v2/remoteparticipant.js.map +1 -1
  61. package/es5/signaling/v2/remotetrackpublication.js +12 -1
  62. package/es5/signaling/v2/remotetrackpublication.js.map +1 -1
  63. package/es5/signaling/v2/room.js +183 -105
  64. package/es5/signaling/v2/room.js.map +1 -1
  65. package/es5/signaling/v2/twilioconnectiontransport.js +3 -1
  66. package/es5/signaling/v2/twilioconnectiontransport.js.map +1 -1
  67. package/es5/signaling/v3/remoteparticipant.js +70 -0
  68. package/es5/signaling/v3/remoteparticipant.js.map +1 -0
  69. package/es5/signaling/v3/remotetrackpublication.js +249 -0
  70. package/es5/signaling/v3/remotetrackpublication.js.map +1 -0
  71. package/es5/signaling/v3/room.js +237 -0
  72. package/es5/signaling/v3/room.js.map +1 -0
  73. package/es5/signaling/v3/tracksubscriptionssignaling.js +73 -0
  74. package/es5/signaling/v3/tracksubscriptionssignaling.js.map +1 -0
  75. package/es5/util/constants.js +7 -0
  76. package/es5/util/constants.js.map +1 -1
  77. package/es5/util/index.js +75 -13
  78. package/es5/util/index.js.map +1 -1
  79. package/es5/util/validate.js +10 -2
  80. package/es5/util/validate.js.map +1 -1
  81. package/es5/webrtc/getstats.js +11 -9
  82. package/es5/webrtc/getstats.js.map +1 -1
  83. package/es5/webrtc/index.js +6 -1
  84. package/es5/webrtc/index.js.map +1 -1
  85. package/lib/connect.js +82 -13
  86. package/lib/createlocaltracks.ts +1 -1
  87. package/lib/localparticipant.js +28 -10
  88. package/lib/media/track/audiotrack.js +6 -16
  89. package/lib/media/track/index.js +4 -6
  90. package/lib/media/track/localdatatrack.js +5 -1
  91. package/lib/media/track/localmediatrack.js +1 -0
  92. package/lib/media/track/mediatrack.js +64 -60
  93. package/lib/media/track/receiver.js +3 -2
  94. package/lib/media/track/remoteaudiotrack.js +27 -9
  95. package/lib/media/track/remoteaudiotrackpublication.js +30 -2
  96. package/lib/media/track/remotedatatrack.js +1 -1
  97. package/lib/media/track/remotemediatrack.js +97 -26
  98. package/lib/media/track/remotetrackpublication.js +70 -15
  99. package/lib/media/track/remotevideotrack.js +40 -11
  100. package/lib/media/track/remotevideotrackpublication.js +30 -2
  101. package/lib/media/track/sender.js +1 -1
  102. package/lib/media/track/transceiver.js +6 -1
  103. package/lib/media/track/videotrack.js +34 -22
  104. package/lib/participant.js +54 -74
  105. package/lib/remoteparticipant.js +18 -9
  106. package/lib/room.js +21 -5
  107. package/lib/signaling/remotetrackpublication.js +13 -8
  108. package/lib/signaling/track.js +0 -1
  109. package/lib/signaling/v2/cancelableroomsignalingpromise.js +6 -3
  110. package/lib/signaling/v2/localparticipant.js +3 -3
  111. package/lib/signaling/v2/peerconnection.js +14 -3
  112. package/lib/signaling/v2/peerconnectionmanager.js +13 -0
  113. package/lib/signaling/v2/remoteparticipant.js +12 -5
  114. package/lib/signaling/v2/remotetrackpublication.js +9 -1
  115. package/lib/signaling/v2/room.js +185 -122
  116. package/lib/signaling/v2/twilioconnectiontransport.js +3 -3
  117. package/lib/signaling/v3/remoteparticipant.js +76 -0
  118. package/lib/signaling/v3/remotetrackpublication.js +246 -0
  119. package/lib/signaling/v3/room.js +248 -0
  120. package/lib/signaling/v3/tracksubscriptionssignaling.js +61 -0
  121. package/lib/util/constants.js +8 -0
  122. package/lib/util/index.js +77 -13
  123. package/lib/util/validate.js +12 -2
  124. package/lib/webrtc/getstats.js +11 -9
  125. package/lib/webrtc/index.js +7 -1
  126. package/package.json +4 -2
  127. package/tsdef/RemoteAudioTrack.d.ts +11 -1
  128. package/tsdef/RemoteAudioTrackPublication.d.ts +8 -0
  129. package/tsdef/RemoteParticipant.d.ts +1 -1
  130. package/tsdef/RemoteTrackPublication.d.ts +4 -1
  131. package/tsdef/RemoteVideoTrack.d.ts +11 -1
  132. package/tsdef/RemoteVideoTrackPublication.d.ts +8 -0
  133. package/tsdef/Room.d.ts +1 -1
  134. package/tsdef/Track.d.ts +7 -0
  135. package/tsdef/index.d.ts +2 -2
  136. package/tsdef/twilio-video-tests.ts +4 -0
  137. package/tsdef/types.d.ts +18 -10
package/CHANGELOG.md CHANGED
@@ -1,7 +1,112 @@
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.
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 latest Video JavaScript SDK.
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
+ 3.0.0-preview.2 (August 18, 2022)
6
+ =================================
7
+
8
+ Changes
9
+ -------
10
+
11
+ - `Room.getStats()`, which was broken in `3.0.0-preview.1`, has been fixed in this release. Note that the values reported
12
+ are best-effort approximations based off of the raw WebRTC statistics. (VIDEO-8756)
13
+
14
+ 3.0.0-preview.1 (July 25, 2022)
15
+ ===============================
16
+
17
+ New Features
18
+ ------------
19
+
20
+ **Large Rooms Pilot**
21
+
22
+ twilio-video.js now allows you to create and join a [Large Group Room](https://www.twilio.com/docs/video/large-group-rooms),
23
+ which supports a large number of Participants (> 50). This feature is in pilot, and requires that your account be enabled
24
+ in order to use it. **Note that the following API changes apply only for Large Rooms, and not for non-large Group Rooms and
25
+ Peer-to-Peer Rooms**.
26
+
27
+ - An audio and video RemoteTrack will now have an additional property called `switchOffReason`, which describes the
28
+ [reason](https://sdk.stage.twilio.com/js/video/releases/3.0.0-preview.1/docs/global.html#TrackSwitchOffReason) for
29
+ it being switched off. The `switchedOff` event will also have this reason string as a second argument. (VIDEO-8670, VIDEO-8748)
30
+ - An audio or video RemoteTrack's `mediaStreamTrack` is set to `null` whenever it is switched off. When it is switched
31
+ on, it is set to a MediaStreamTrack. (VIDEO-8668, VIDEO-8745)
32
+ - When the `switchOffReason` changes for an already switched off audio or video RemoteTrack, the `switchedOff` event is
33
+ raised. (VIDEO-8668, VIDEO-8745)
34
+ - A RemoteAudioTrack of a Participant that is not active in the Large Room will now be switched off. (VIDEO-8668)
35
+ - A RemoteVideoTrack will now be switched off if the number of switched on RemoteVideoTracks reached the limit set by the media server. (VIDEO-8745)
36
+ - Renamed BandwidthProfileOptions to BandwidthProfile. (VIDEO-8754)
37
+ - Renamed VideoBandwidthProfileOptions to VideoBandwidthProfile. (VIDEO-8753)
38
+ - The `isEnabled` property of the RemoteTrack is deprecated and scheduled for removal. Alternatively, you can determine if
39
+ a RemoteTrack is enabled by using the following expression. (VIDEO-8742, VIDEO-8750)
40
+ ```js
41
+ const isEnabled = remoteTrack.switchOffReason !== 'disabled-by-publisher';
42
+ ```
43
+ - The `disabled` and `enabled` events of the RemoteTrack are deprecated and scheduled for removal. Alternatively, you can
44
+ handle the `switchedOff` and `switchedOn` events as shown below. (VIDEO-8742, VIDEO-8750)
45
+ ```js
46
+ let recentSwitchOffReason = remoteTrack.switchOffReason;
47
+
48
+ remoteTrack.on('switchedOff', switchOffReason => {
49
+ recentSwitchOffReason = switchOffReason;
50
+ if (switchOffReason === 'disabled-by-publisher') {
51
+ /* The RemoteTrack is disabled. */
52
+ }
53
+ });
54
+
55
+ remoteTrack.on('switchedOn', () => {
56
+ if (recentSwitchOffReason === 'disabled-by-publisher') {
57
+ /* The RemoteTrack is enabled. */
58
+ }
59
+ recentSwitchOffReason = null;
60
+ });
61
+ ```
62
+ - The `isTrackEnabled` property of the RemoteTrackPublication is deprecated and scheduled for removal. Alternatively, you
63
+ can determine if a RemoteTrackPublication is enabled by using the following expression. (VIDEO-8743, VIDEO-8751)
64
+ ```js
65
+ const { track } = remoteTrackPublication;
66
+ const isTrackEnabled = !(track && track.switchOffReason === 'disabled-by-publisher');
67
+ ```
68
+ `isTrackEnabled` is now only valid for RemoteTracks that are subscribed to, and defaults to `true` for unsubscribed
69
+ RemoteTracks.
70
+ - The `trackDisabled` and `trackEnabled` events of the RemoteTrack are deprecated and scheduled for removal. Alternatively,
71
+ you can handle the `trackSwitchedOff` and `trackSwitchedOn` events as shown below. (VIDEO-8743, VIDEO-8751)
72
+ ```js
73
+ const { track } = remoteTrackPublication;
74
+ let recentSwitchOffReason = track ? track.switchOffReason : null;
75
+
76
+ remoteTrackPublication.on('trackSwitchedOff', (track, switchOffReason) => {
77
+ recentSwitchOffReason = switchOffReason;
78
+ if (switchOffReason === 'disabled-by-publisher') {
79
+ /* The RemoteTrack is disabled. */
80
+ }
81
+ });
82
+
83
+ remoteTrackPublication.on('trackSwitchedOn', (track) => {
84
+ if (recentSwitchOffReason === 'disabled-by-publisher') {
85
+ /* The RemoteTrack is enabled. */
86
+ }
87
+ recentSwitchOffReason = null;
88
+ });
89
+ ```
90
+ The `trackDisabled` and `trackEnabled` events are now only fired for subscribed RemoteTracks.
91
+ - Any audio and video Tracks shared while joining the Room will **no longer** be guaranteed to be published by the time
92
+ the CancelablePromise returned by `connect()` is resolved. The application will now have to listen to the "trackPublished"
93
+ event on the LocalParticipant. (VIDEO-8817)
94
+ ```js
95
+ const room = await connect('token', {
96
+ audio: true,
97
+ video: true,
98
+ room: 'my-large-room'
99
+ });
100
+
101
+ room.localParticipant.on('trackPublished', publication => {
102
+ console.log(`Successfully published ${publication.kind} Track`);
103
+ });
104
+ ```
105
+ - `Room.getStats()` is broken, and will be fixed in an upcoming release. For now, the Track-level stats returned by this
106
+ method will not be accurate.
107
+ - [PSTN Participants](https://www.twilio.com/docs/video/adding-programmable-voice-participants-video-rooms) cannot connect
108
+ to Large Rooms.
109
+
5
110
  2.22.2 (July 25, 2022)
6
111
  ======================
7
112
 
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.22.2/twilio-video.min.js"></script>
77
+ <script src="//sdk.twilio.com/js/video/releases/3.0.0-preview.2/twilio-video.min.js"></script>
78
78
 
79
79
  ```
80
80