twilio-video 2.22.2 → 3.0.0-preview.1

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