@stream-io/video-client 1.13.1 → 1.15.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 (99) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/index.browser.es.js +1704 -1762
  3. package/dist/index.browser.es.js.map +1 -1
  4. package/dist/index.cjs.js +1706 -1780
  5. package/dist/index.cjs.js.map +1 -1
  6. package/dist/index.es.js +1704 -1762
  7. package/dist/index.es.js.map +1 -1
  8. package/dist/src/Call.d.ts +61 -30
  9. package/dist/src/StreamSfuClient.d.ts +4 -5
  10. package/dist/src/devices/CameraManager.d.ts +5 -8
  11. package/dist/src/devices/InputMediaDeviceManager.d.ts +5 -5
  12. package/dist/src/devices/MicrophoneManager.d.ts +7 -2
  13. package/dist/src/devices/ScreenShareManager.d.ts +1 -2
  14. package/dist/src/gen/coordinator/index.d.ts +904 -515
  15. package/dist/src/gen/video/sfu/event/events.d.ts +38 -19
  16. package/dist/src/gen/video/sfu/models/models.d.ts +76 -9
  17. package/dist/src/helpers/array.d.ts +7 -0
  18. package/dist/src/permissions/PermissionsContext.d.ts +6 -0
  19. package/dist/src/rtc/BasePeerConnection.d.ts +90 -0
  20. package/dist/src/rtc/Dispatcher.d.ts +0 -1
  21. package/dist/src/rtc/IceTrickleBuffer.d.ts +3 -2
  22. package/dist/src/rtc/Publisher.d.ts +32 -86
  23. package/dist/src/rtc/Subscriber.d.ts +4 -56
  24. package/dist/src/rtc/TransceiverCache.d.ts +55 -0
  25. package/dist/src/rtc/codecs.d.ts +1 -15
  26. package/dist/src/rtc/helpers/sdp.d.ts +8 -0
  27. package/dist/src/rtc/helpers/tracks.d.ts +1 -0
  28. package/dist/src/rtc/index.d.ts +3 -0
  29. package/dist/src/rtc/videoLayers.d.ts +11 -25
  30. package/dist/src/stats/{stateStoreStatsReporter.d.ts → CallStateStatsReporter.d.ts} +5 -1
  31. package/dist/src/stats/SfuStatsReporter.d.ts +4 -2
  32. package/dist/src/stats/index.d.ts +1 -1
  33. package/dist/src/stats/types.d.ts +8 -0
  34. package/dist/src/store/CallState.d.ts +47 -5
  35. package/dist/src/store/rxUtils.d.ts +15 -1
  36. package/dist/src/types.d.ts +26 -22
  37. package/package.json +1 -1
  38. package/src/Call.ts +310 -271
  39. package/src/StreamSfuClient.ts +9 -14
  40. package/src/StreamVideoClient.ts +1 -1
  41. package/src/__tests__/Call.publishing.test.ts +306 -0
  42. package/src/devices/CameraManager.ts +33 -16
  43. package/src/devices/InputMediaDeviceManager.ts +36 -27
  44. package/src/devices/MicrophoneManager.ts +29 -8
  45. package/src/devices/ScreenShareManager.ts +6 -8
  46. package/src/devices/__tests__/CameraManager.test.ts +111 -14
  47. package/src/devices/__tests__/InputMediaDeviceManager.test.ts +4 -4
  48. package/src/devices/__tests__/MicrophoneManager.test.ts +59 -21
  49. package/src/devices/__tests__/ScreenShareManager.test.ts +5 -5
  50. package/src/devices/__tests__/mocks.ts +1 -0
  51. package/src/events/__tests__/internal.test.ts +132 -0
  52. package/src/events/__tests__/mutes.test.ts +0 -3
  53. package/src/events/__tests__/speaker.test.ts +92 -0
  54. package/src/events/participant.ts +3 -4
  55. package/src/gen/coordinator/index.ts +902 -514
  56. package/src/gen/video/sfu/event/events.ts +91 -30
  57. package/src/gen/video/sfu/models/models.ts +105 -13
  58. package/src/helpers/array.ts +14 -0
  59. package/src/permissions/PermissionsContext.ts +22 -0
  60. package/src/permissions/__tests__/PermissionsContext.test.ts +40 -0
  61. package/src/rpc/__tests__/createClient.test.ts +38 -0
  62. package/src/rpc/createClient.ts +11 -5
  63. package/src/rtc/BasePeerConnection.ts +240 -0
  64. package/src/rtc/Dispatcher.ts +0 -9
  65. package/src/rtc/IceTrickleBuffer.ts +24 -4
  66. package/src/rtc/Publisher.ts +210 -528
  67. package/src/rtc/Subscriber.ts +26 -200
  68. package/src/rtc/TransceiverCache.ts +120 -0
  69. package/src/rtc/__tests__/Publisher.test.ts +407 -210
  70. package/src/rtc/__tests__/Subscriber.test.ts +88 -36
  71. package/src/rtc/__tests__/mocks/webrtc.mocks.ts +22 -2
  72. package/src/rtc/__tests__/videoLayers.test.ts +161 -54
  73. package/src/rtc/codecs.ts +1 -131
  74. package/src/rtc/helpers/__tests__/rtcConfiguration.test.ts +34 -0
  75. package/src/rtc/helpers/__tests__/sdp.test.ts +59 -0
  76. package/src/rtc/helpers/sdp.ts +30 -0
  77. package/src/rtc/helpers/tracks.ts +3 -0
  78. package/src/rtc/index.ts +4 -0
  79. package/src/rtc/videoLayers.ts +68 -76
  80. package/src/stats/{stateStoreStatsReporter.ts → CallStateStatsReporter.ts} +58 -27
  81. package/src/stats/SfuStatsReporter.ts +31 -3
  82. package/src/stats/index.ts +1 -1
  83. package/src/stats/types.ts +12 -0
  84. package/src/store/CallState.ts +115 -5
  85. package/src/store/__tests__/CallState.test.ts +101 -0
  86. package/src/store/rxUtils.ts +23 -1
  87. package/src/types.ts +27 -22
  88. package/dist/src/helpers/sdp-munging.d.ts +0 -24
  89. package/dist/src/rtc/bitrateLookup.d.ts +0 -2
  90. package/dist/src/rtc/helpers/iceCandidate.d.ts +0 -2
  91. package/src/helpers/__tests__/hq-audio-sdp.ts +0 -332
  92. package/src/helpers/__tests__/sdp-munging.test.ts +0 -283
  93. package/src/helpers/sdp-munging.ts +0 -265
  94. package/src/rtc/__tests__/bitrateLookup.test.ts +0 -12
  95. package/src/rtc/__tests__/codecs.test.ts +0 -145
  96. package/src/rtc/bitrateLookup.ts +0 -61
  97. package/src/rtc/helpers/iceCandidate.ts +0 -16
  98. /package/dist/src/{compatibility.d.ts → helpers/compatibility.d.ts} +0 -0
  99. /package/src/{compatibility.ts → helpers/compatibility.ts} +0 -0
@@ -1,332 +0,0 @@
1
- export const initialSdp = `
2
- v=0
3
- o=- 898697271686242868 5 IN IP4 127.0.0.1
4
- s=-
5
- t=0 0
6
- a=group:BUNDLE 0 1 2 3
7
- a=extmap-allow-mixed
8
- a=msid-semantic: WMS e893e3ad-d9e8-4b56-998f-0d89213dd857
9
- m=video 60017 UDP/TLS/RTP/SAVPF 96 97 102 103 104 105 106 107 108 109 127 125 39 40 45 46 98 99 100 101 112 113 116 117 118
10
- c=IN IP4 79.125.240.146
11
- a=rtcp:9 IN IP4 0.0.0.0
12
- a=candidate:2824354870 1 udp 2122260223 192.168.1.102 60017 typ host generation 0 network-id 2
13
- a=candidate:427386432 1 udp 2122194687 192.168.1.244 63221 typ host generation 0 network-id 1 network-cost 10
14
- a=candidate:2841136656 1 udp 1686052607 79.125.240.146 60017 typ srflx raddr 192.168.1.102 rport 60017 generation 0 network-id 2
15
- a=candidate:410588262 1 udp 1685987071 79.125.240.146 63221 typ srflx raddr 192.168.1.244 rport 63221 generation 0 network-id 1 network-cost 10
16
- a=candidate:3600277166 1 tcp 1518280447 192.168.1.102 9 typ host tcptype active generation 0 network-id 2
17
- a=candidate:1740014808 1 tcp 1518214911 192.168.1.244 9 typ host tcptype active generation 0 network-id 1 network-cost 10
18
- a=ice-ufrag:GM64
19
- a=ice-pwd:ANZFilRRlZJ3bg9AD40eRu7n
20
- a=ice-options:trickle
21
- a=fingerprint:sha-256 38:1F:02:E5:2A:49:9A:2A:D9:8E:B9:9B:4C:40:21:B7:F1:C4:27:8E:B5:68:D6:E0:91:08:D9:CB:2B:AC:B3:87
22
- a=setup:actpass
23
- a=mid:0
24
- a=extmap:1 urn:ietf:params:rtp-hdrext:toffset
25
- a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
26
- a=extmap:3 urn:3gpp:video-orientation
27
- a=extmap:4 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
28
- a=extmap:5 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay
29
- a=extmap:6 http://www.webrtc.org/experiments/rtp-hdrext/video-content-type
30
- a=extmap:7 http://www.webrtc.org/experiments/rtp-hdrext/video-timing
31
- a=extmap:8 http://www.webrtc.org/experiments/rtp-hdrext/color-space
32
- a=extmap:9 urn:ietf:params:rtp-hdrext:sdes:mid
33
- a=extmap:10 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id
34
- a=extmap:11 urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id
35
- a=sendonly
36
- a=msid:e893e3ad-d9e8-4b56-998f-0d89213dd857 44e5d53f-ce6a-4bf4-824a-335113d86e6e
37
- a=rtcp-mux
38
- a=rtcp-rsize
39
- a=rtpmap:96 VP8/90000
40
- a=rtcp-fb:96 goog-remb
41
- a=rtcp-fb:96 transport-cc
42
- a=rtcp-fb:96 ccm fir
43
- a=rtcp-fb:96 nack
44
- a=rtcp-fb:96 nack pli
45
- a=rtpmap:97 rtx/90000
46
- a=fmtp:97 apt=96
47
- a=rtpmap:102 H264/90000
48
- a=rtcp-fb:102 goog-remb
49
- a=rtcp-fb:102 transport-cc
50
- a=rtcp-fb:102 ccm fir
51
- a=rtcp-fb:102 nack
52
- a=rtcp-fb:102 nack pli
53
- a=fmtp:102 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42001f
54
- a=rtpmap:103 rtx/90000
55
- a=fmtp:103 apt=102
56
- a=rtpmap:104 H264/90000
57
- a=rtcp-fb:104 goog-remb
58
- a=rtcp-fb:104 transport-cc
59
- a=rtcp-fb:104 ccm fir
60
- a=rtcp-fb:104 nack
61
- a=rtcp-fb:104 nack pli
62
- a=fmtp:104 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=42001f
63
- a=rtpmap:105 rtx/90000
64
- a=fmtp:105 apt=104
65
- a=rtpmap:106 H264/90000
66
- a=rtcp-fb:106 goog-remb
67
- a=rtcp-fb:106 transport-cc
68
- a=rtcp-fb:106 ccm fir
69
- a=rtcp-fb:106 nack
70
- a=rtcp-fb:106 nack pli
71
- a=fmtp:106 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f
72
- a=rtpmap:107 rtx/90000
73
- a=fmtp:107 apt=106
74
- a=rtpmap:108 H264/90000
75
- a=rtcp-fb:108 goog-remb
76
- a=rtcp-fb:108 transport-cc
77
- a=rtcp-fb:108 ccm fir
78
- a=rtcp-fb:108 nack
79
- a=rtcp-fb:108 nack pli
80
- a=fmtp:108 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=42e01f
81
- a=rtpmap:109 rtx/90000
82
- a=fmtp:109 apt=108
83
- a=rtpmap:127 H264/90000
84
- a=rtcp-fb:127 goog-remb
85
- a=rtcp-fb:127 transport-cc
86
- a=rtcp-fb:127 ccm fir
87
- a=rtcp-fb:127 nack
88
- a=rtcp-fb:127 nack pli
89
- a=fmtp:127 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=4d001f
90
- a=rtpmap:125 rtx/90000
91
- a=fmtp:125 apt=127
92
- a=rtpmap:39 H264/90000
93
- a=rtcp-fb:39 goog-remb
94
- a=rtcp-fb:39 transport-cc
95
- a=rtcp-fb:39 ccm fir
96
- a=rtcp-fb:39 nack
97
- a=rtcp-fb:39 nack pli
98
- a=fmtp:39 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=4d001f
99
- a=rtpmap:40 rtx/90000
100
- a=fmtp:40 apt=39
101
- a=rtpmap:45 AV1/90000
102
- a=rtcp-fb:45 goog-remb
103
- a=rtcp-fb:45 transport-cc
104
- a=rtcp-fb:45 ccm fir
105
- a=rtcp-fb:45 nack
106
- a=rtcp-fb:45 nack pli
107
- a=rtpmap:46 rtx/90000
108
- a=fmtp:46 apt=45
109
- a=rtpmap:98 VP9/90000
110
- a=rtcp-fb:98 goog-remb
111
- a=rtcp-fb:98 transport-cc
112
- a=rtcp-fb:98 ccm fir
113
- a=rtcp-fb:98 nack
114
- a=rtcp-fb:98 nack pli
115
- a=fmtp:98 profile-id=0
116
- a=rtpmap:99 rtx/90000
117
- a=fmtp:99 apt=98
118
- a=rtpmap:100 VP9/90000
119
- a=rtcp-fb:100 goog-remb
120
- a=rtcp-fb:100 transport-cc
121
- a=rtcp-fb:100 ccm fir
122
- a=rtcp-fb:100 nack
123
- a=rtcp-fb:100 nack pli
124
- a=fmtp:100 profile-id=2
125
- a=rtpmap:101 rtx/90000
126
- a=fmtp:101 apt=100
127
- a=rtpmap:112 H264/90000
128
- a=rtcp-fb:112 goog-remb
129
- a=rtcp-fb:112 transport-cc
130
- a=rtcp-fb:112 ccm fir
131
- a=rtcp-fb:112 nack
132
- a=rtcp-fb:112 nack pli
133
- a=fmtp:112 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=64001f
134
- a=rtpmap:113 rtx/90000
135
- a=fmtp:113 apt=112
136
- a=rtpmap:116 red/90000
137
- a=rtpmap:117 rtx/90000
138
- a=fmtp:117 apt=116
139
- a=rtpmap:118 ulpfec/90000
140
- a=rid:q send
141
- a=rid:h send
142
- a=rid:f send
143
- a=simulcast:send q;h;f
144
- m=audio 9 UDP/TLS/RTP/SAVPF 63 111 9 0 8 13 110 126
145
- c=IN IP4 0.0.0.0
146
- a=rtcp:9 IN IP4 0.0.0.0
147
- a=ice-ufrag:GM64
148
- a=ice-pwd:ANZFilRRlZJ3bg9AD40eRu7n
149
- a=ice-options:trickle
150
- a=fingerprint:sha-256 38:1F:02:E5:2A:49:9A:2A:D9:8E:B9:9B:4C:40:21:B7:F1:C4:27:8E:B5:68:D6:E0:91:08:D9:CB:2B:AC:B3:87
151
- a=setup:actpass
152
- a=mid:1
153
- a=extmap:14 urn:ietf:params:rtp-hdrext:ssrc-audio-level
154
- a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
155
- a=extmap:4 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
156
- a=extmap:9 urn:ietf:params:rtp-hdrext:sdes:mid
157
- a=sendonly
158
- a=msid:- cb02416c-8035-4e80-8b7e-becd6b7f600f
159
- a=rtcp-mux
160
- a=rtpmap:63 red/48000/2
161
- a=fmtp:63 111/111
162
- a=rtpmap:111 opus/48000/2
163
- a=rtcp-fb:111 transport-cc
164
- a=fmtp:111 minptime=10;usedtx=1;useinbandfec=1
165
- a=rtpmap:9 G722/8000
166
- a=rtpmap:0 PCMU/8000
167
- a=rtpmap:8 PCMA/8000
168
- a=rtpmap:13 CN/8000
169
- a=rtpmap:110 telephone-event/48000
170
- a=rtpmap:126 telephone-event/8000
171
- a=ssrc:743121750 cname:mbGW+aeWMLFhPbBC
172
- a=ssrc:743121750 msid:- cb02416c-8035-4e80-8b7e-becd6b7f600f
173
- m=video 9 UDP/TLS/RTP/SAVPF 96 97 102 103 104 105 106 107 108 109 127 125 39 40 45 46 98 99 100 101 112 113 116 117 118
174
- c=IN IP4 0.0.0.0
175
- a=rtcp:9 IN IP4 0.0.0.0
176
- a=ice-ufrag:GM64
177
- a=ice-pwd:ANZFilRRlZJ3bg9AD40eRu7n
178
- a=ice-options:trickle
179
- a=fingerprint:sha-256 38:1F:02:E5:2A:49:9A:2A:D9:8E:B9:9B:4C:40:21:B7:F1:C4:27:8E:B5:68:D6:E0:91:08:D9:CB:2B:AC:B3:87
180
- a=setup:actpass
181
- a=mid:2
182
- a=extmap:1 urn:ietf:params:rtp-hdrext:toffset
183
- a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
184
- a=extmap:3 urn:3gpp:video-orientation
185
- a=extmap:4 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
186
- a=extmap:5 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay
187
- a=extmap:6 http://www.webrtc.org/experiments/rtp-hdrext/video-content-type
188
- a=extmap:7 http://www.webrtc.org/experiments/rtp-hdrext/video-timing
189
- a=extmap:8 http://www.webrtc.org/experiments/rtp-hdrext/color-space
190
- a=extmap:9 urn:ietf:params:rtp-hdrext:sdes:mid
191
- a=extmap:10 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id
192
- a=extmap:11 urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id
193
- a=sendonly
194
- a=msid:04f96a2a-d107-4a12-b545-cfe1dc2c4d37 4a1ae8a7-6c89-44d3-a9a1-02abce0012c7
195
- a=rtcp-mux
196
- a=rtcp-rsize
197
- a=rtpmap:96 VP8/90000
198
- a=rtcp-fb:96 goog-remb
199
- a=rtcp-fb:96 transport-cc
200
- a=rtcp-fb:96 ccm fir
201
- a=rtcp-fb:96 nack
202
- a=rtcp-fb:96 nack pli
203
- a=rtpmap:97 rtx/90000
204
- a=fmtp:97 apt=96
205
- a=rtpmap:102 H264/90000
206
- a=rtcp-fb:102 goog-remb
207
- a=rtcp-fb:102 transport-cc
208
- a=rtcp-fb:102 ccm fir
209
- a=rtcp-fb:102 nack
210
- a=rtcp-fb:102 nack pli
211
- a=fmtp:102 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42001f
212
- a=rtpmap:103 rtx/90000
213
- a=fmtp:103 apt=102
214
- a=rtpmap:104 H264/90000
215
- a=rtcp-fb:104 goog-remb
216
- a=rtcp-fb:104 transport-cc
217
- a=rtcp-fb:104 ccm fir
218
- a=rtcp-fb:104 nack
219
- a=rtcp-fb:104 nack pli
220
- a=fmtp:104 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=42001f
221
- a=rtpmap:105 rtx/90000
222
- a=fmtp:105 apt=104
223
- a=rtpmap:106 H264/90000
224
- a=rtcp-fb:106 goog-remb
225
- a=rtcp-fb:106 transport-cc
226
- a=rtcp-fb:106 ccm fir
227
- a=rtcp-fb:106 nack
228
- a=rtcp-fb:106 nack pli
229
- a=fmtp:106 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f
230
- a=rtpmap:107 rtx/90000
231
- a=fmtp:107 apt=106
232
- a=rtpmap:108 H264/90000
233
- a=rtcp-fb:108 goog-remb
234
- a=rtcp-fb:108 transport-cc
235
- a=rtcp-fb:108 ccm fir
236
- a=rtcp-fb:108 nack
237
- a=rtcp-fb:108 nack pli
238
- a=fmtp:108 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=42e01f
239
- a=rtpmap:109 rtx/90000
240
- a=fmtp:109 apt=108
241
- a=rtpmap:127 H264/90000
242
- a=rtcp-fb:127 goog-remb
243
- a=rtcp-fb:127 transport-cc
244
- a=rtcp-fb:127 ccm fir
245
- a=rtcp-fb:127 nack
246
- a=rtcp-fb:127 nack pli
247
- a=fmtp:127 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=4d001f
248
- a=rtpmap:125 rtx/90000
249
- a=fmtp:125 apt=127
250
- a=rtpmap:39 H264/90000
251
- a=rtcp-fb:39 goog-remb
252
- a=rtcp-fb:39 transport-cc
253
- a=rtcp-fb:39 ccm fir
254
- a=rtcp-fb:39 nack
255
- a=rtcp-fb:39 nack pli
256
- a=fmtp:39 level-asymmetry-allowed=1;packetization-mode=0;profile-level-id=4d001f
257
- a=rtpmap:40 rtx/90000
258
- a=fmtp:40 apt=39
259
- a=rtpmap:45 AV1/90000
260
- a=rtcp-fb:45 goog-remb
261
- a=rtcp-fb:45 transport-cc
262
- a=rtcp-fb:45 ccm fir
263
- a=rtcp-fb:45 nack
264
- a=rtcp-fb:45 nack pli
265
- a=rtpmap:46 rtx/90000
266
- a=fmtp:46 apt=45
267
- a=rtpmap:98 VP9/90000
268
- a=rtcp-fb:98 goog-remb
269
- a=rtcp-fb:98 transport-cc
270
- a=rtcp-fb:98 ccm fir
271
- a=rtcp-fb:98 nack
272
- a=rtcp-fb:98 nack pli
273
- a=fmtp:98 profile-id=0
274
- a=rtpmap:99 rtx/90000
275
- a=fmtp:99 apt=98
276
- a=rtpmap:100 VP9/90000
277
- a=rtcp-fb:100 goog-remb
278
- a=rtcp-fb:100 transport-cc
279
- a=rtcp-fb:100 ccm fir
280
- a=rtcp-fb:100 nack
281
- a=rtcp-fb:100 nack pli
282
- a=fmtp:100 profile-id=2
283
- a=rtpmap:101 rtx/90000
284
- a=fmtp:101 apt=100
285
- a=rtpmap:112 H264/90000
286
- a=rtcp-fb:112 goog-remb
287
- a=rtcp-fb:112 transport-cc
288
- a=rtcp-fb:112 ccm fir
289
- a=rtcp-fb:112 nack
290
- a=rtcp-fb:112 nack pli
291
- a=fmtp:112 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=64001f
292
- a=rtpmap:113 rtx/90000
293
- a=fmtp:113 apt=112
294
- a=rtpmap:116 red/90000
295
- a=rtpmap:117 rtx/90000
296
- a=fmtp:117 apt=116
297
- a=rtpmap:118 ulpfec/90000
298
- a=ssrc-group:FID 4072017687 3466187747
299
- a=ssrc:4072017687 cname:mbGW+aeWMLFhPbBC
300
- a=ssrc:4072017687 msid:04f96a2a-d107-4a12-b545-cfe1dc2c4d37 4a1ae8a7-6c89-44d3-a9a1-02abce0012c7
301
- a=ssrc:3466187747 cname:mbGW+aeWMLFhPbBC
302
- a=ssrc:3466187747 msid:04f96a2a-d107-4a12-b545-cfe1dc2c4d37 4a1ae8a7-6c89-44d3-a9a1-02abce0012c7
303
- m=audio 9 UDP/TLS/RTP/SAVPF 111 63 9 0 8 13 110 126
304
- c=IN IP4 0.0.0.0
305
- a=rtcp:9 IN IP4 0.0.0.0
306
- a=ice-ufrag:GM64
307
- a=ice-pwd:ANZFilRRlZJ3bg9AD40eRu7n
308
- a=ice-options:trickle
309
- a=fingerprint:sha-256 38:1F:02:E5:2A:49:9A:2A:D9:8E:B9:9B:4C:40:21:B7:F1:C4:27:8E:B5:68:D6:E0:91:08:D9:CB:2B:AC:B3:87
310
- a=setup:actpass
311
- a=mid:3
312
- a=extmap:14 urn:ietf:params:rtp-hdrext:ssrc-audio-level
313
- a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
314
- a=extmap:4 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
315
- a=extmap:9 urn:ietf:params:rtp-hdrext:sdes:mid
316
- a=sendonly
317
- a=msid:- 75b8c290-1f46-464c-8dc5-a4a3bced313a
318
- a=rtcp-mux
319
- a=rtpmap:111 opus/48000/2
320
- a=rtcp-fb:111 transport-cc
321
- a=fmtp:111 minptime=10;usedtx=1;useinbandfec=1
322
- a=rtpmap:63 red/48000/2
323
- a=fmtp:63 111/111
324
- a=rtpmap:9 G722/8000
325
- a=rtpmap:0 PCMU/8000
326
- a=rtpmap:8 PCMA/8000
327
- a=rtpmap:13 CN/8000
328
- a=rtpmap:110 telephone-event/48000
329
- a=rtpmap:126 telephone-event/8000
330
- a=ssrc:1281279951 cname:mbGW+aeWMLFhPbBC
331
- a=ssrc:1281279951 msid:- 75b8c290-1f46-464c-8dc5-a4a3bced313a
332
- `.trim();
@@ -1,283 +0,0 @@
1
- import { describe, expect, it } from 'vitest';
2
- import {
3
- enableHighQualityAudio,
4
- preserveCodec,
5
- toggleDtx,
6
- } from '../sdp-munging';
7
- import { initialSdp as HQAudioSDP } from './hq-audio-sdp';
8
-
9
- describe('sdp-munging', () => {
10
- it('Supporting the enabling and disabling of DTX audio codec', () => {
11
- const sdp = `m=audio 54312 RTP/AVP 101
12
- a=rtpmap:101 opus/48000/2
13
- a=fmtp:101 maxplaybackrate=16000; sprop-maxcapturerate=16000;
14
- maxaveragebitrate=20000; stereo=1; useinbandfec=1; usedtx=0
15
- a=ptime:40
16
- a=maxptime:40`;
17
- const dtxEnabledSdp = toggleDtx(sdp, true);
18
- expect(dtxEnabledSdp.search('usedtx=1') !== -1).toBeTruthy();
19
- const dtxDisabledSdp = toggleDtx(dtxEnabledSdp, false);
20
- expect(dtxDisabledSdp.search('usedtx=0') !== -1).toBeTruthy();
21
- });
22
-
23
- it('enables HighQuality audio for Opus', () => {
24
- const sdpWithHighQualityAudio = enableHighQualityAudio(HQAudioSDP, '3');
25
- expect(sdpWithHighQualityAudio).toContain('maxaveragebitrate=510000');
26
- expect(sdpWithHighQualityAudio).toContain('stereo=1');
27
- });
28
-
29
- it('preserves the preferred codec', () => {
30
- const sdp = `v=0
31
- o=- 8608371809202407637 2 IN IP4 127.0.0.1
32
- s=-
33
- t=0 0
34
- a=extmap-allow-mixed
35
- a=msid-semantic: WMS 52fafc21-b8bb-4f4f-8072-86a29cb6590e
36
- a=group:BUNDLE 0
37
- m=video 9 UDP/TLS/RTP/SAVPF 98 100 99 101
38
- c=IN IP4 0.0.0.0
39
- a=rtpmap:98 VP9/90000
40
- a=rtpmap:99 rtx/90000
41
- a=rtpmap:100 VP9/90000
42
- a=rtpmap:101 rtx/90000
43
- a=fmtp:98 profile-id=0
44
- a=fmtp:99 apt=98
45
- a=fmtp:100 profile-id=2
46
- a=fmtp:101 apt=100
47
- a=rtcp:9 IN IP4 0.0.0.0
48
- a=rtcp-fb:98 goog-remb
49
- a=rtcp-fb:98 transport-cc
50
- a=rtcp-fb:98 ccm fir
51
- a=rtcp-fb:98 nack
52
- a=rtcp-fb:98 nack pli
53
- a=rtcp-fb:100 goog-remb
54
- a=rtcp-fb:100 transport-cc
55
- a=rtcp-fb:100 ccm fir
56
- a=rtcp-fb:100 nack
57
- a=rtcp-fb:100 nack pli
58
- a=extmap:1 urn:ietf:params:rtp-hdrext:toffset
59
- a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
60
- a=extmap:3 urn:3gpp:video-orientation
61
- a=extmap:4 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
62
- a=extmap:5 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay
63
- a=extmap:6 http://www.webrtc.org/experiments/rtp-hdrext/video-content-type
64
- a=extmap:7 http://www.webrtc.org/experiments/rtp-hdrext/video-timing
65
- a=extmap:8 http://www.webrtc.org/experiments/rtp-hdrext/color-space
66
- a=extmap:9 urn:ietf:params:rtp-hdrext:sdes:mid
67
- a=extmap:10 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id
68
- a=extmap:11 urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id
69
- a=extmap:12 https://aomediacodec.github.io/av1-rtp-spec/#dependency-descriptor-rtp-header-extension
70
- a=extmap:14 http://www.webrtc.org/experiments/rtp-hdrext/video-layers-allocation00
71
- a=setup:actpass
72
- a=mid:0
73
- a=msid:52fafc21-b8bb-4f4f-8072-86a29cb6590e 1bd1c5c2-d3cc-4490-ac0c-70b187242232
74
- a=sendonly
75
- a=ice-ufrag:LvRk
76
- a=ice-pwd:IpBRr2Rrg9TkOgayjYqALhPY
77
- a=fingerprint:sha-256 18:DE:8F:ED:E6:A2:0C:99:A8:25:AB:C9:F8:3D:91:4C:3E:9F:B4:1F:22:87:A7:3C:85:8F:F3:51:09:A7:E3:FA
78
- a=ice-options:trickle
79
- a=ssrc:3192778601 cname:yYSN5R+RG2j3luO7
80
- a=ssrc:3192778601 msid:52fafc21-b8bb-4f4f-8072-86a29cb6590e 1bd1c5c2-d3cc-4490-ac0c-70b187242232
81
- a=ssrc:283365205 cname:yYSN5R+RG2j3luO7
82
- a=ssrc:283365205 msid:52fafc21-b8bb-4f4f-8072-86a29cb6590e 1bd1c5c2-d3cc-4490-ac0c-70b187242232
83
- a=ssrc-group:FID 3192778601 283365205
84
- a=rtcp-mux
85
- a=rtcp-rsize`;
86
- const target = preserveCodec(sdp, '0', {
87
- mimeType: 'video/VP9',
88
- clockRate: 90000,
89
- sdpFmtpLine: 'profile-id=0',
90
- });
91
- expect(target).toContain('VP9');
92
- expect(target).not.toContain('profile-id=2');
93
- });
94
-
95
- it('handles ios munging', () => {
96
- const sdp = `v=0
97
- o=- 525780719364332676 2 IN IP4 127.0.0.1
98
- s=-
99
- t=0 0
100
- a=group:BUNDLE 0
101
- a=extmap-allow-mixed
102
- a=msid-semantic: WMS BF3AFE62-88F8-4189-99D7-7CAE159205E3
103
- m=video 9 UDP/TLS/RTP/SAVPF 96 97 98 99 100 101 127 103 35 36 104 105 106
104
- c=IN IP4 0.0.0.0
105
- a=rtcp:9 IN IP4 0.0.0.0
106
- a=ice-ufrag:SAkq
107
- a=ice-pwd:FYHHro0VWRO8CjI/M1VG5vRw
108
- a=ice-options:trickle renomination
109
- a=fingerprint:sha-256 03:5B:16:0E:E1:7B:FE:4F:9A:5C:AC:CF:08:21:4B:49:CE:53:79:E6:97:AE:4E:73:F8:43:34:C3:11:F7:6D:E7
110
- a=setup:actpass
111
- a=mid:0
112
- a=extmap:1 urn:ietf:params:rtp-hdrext:toffset
113
- a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
114
- a=extmap:3 urn:3gpp:video-orientation
115
- a=extmap:4 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
116
- a=extmap:5 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay
117
- a=extmap:6 http://www.webrtc.org/experiments/rtp-hdrext/video-content-type
118
- a=extmap:7 http://www.webrtc.org/experiments/rtp-hdrext/video-timing
119
- a=extmap:8 http://www.webrtc.org/experiments/rtp-hdrext/color-space
120
- a=extmap:9 urn:ietf:params:rtp-hdrext:sdes:mid
121
- a=extmap:10 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id
122
- a=extmap:11 urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id
123
- a=extmap:12 https://aomediacodec.github.io/av1-rtp-spec/#dependency-descriptor-rtp-header-extension
124
- a=extmap:14 http://www.webrtc.org/experiments/rtp-hdrext/video-layers-allocation00
125
- a=sendonly
126
- a=msid:BF3AFE62-88F8-4189-99D7-7CAE159205E3 6013DC02-A0A5-43A9-9D41-9D4A89648A42
127
- a=rtcp-mux
128
- a=rtcp-rsize
129
- a=rtpmap:96 H264/90000
130
- a=rtcp-fb:96 goog-remb
131
- a=rtcp-fb:96 transport-cc
132
- a=rtcp-fb:96 ccm fir
133
- a=rtcp-fb:96 nack
134
- a=rtcp-fb:96 nack pli
135
- a=fmtp:96 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=640c29
136
- a=rtpmap:97 rtx/90000
137
- a=fmtp:97 apt=96
138
- a=rtpmap:98 H264/90000
139
- a=rtcp-fb:98 goog-remb
140
- a=rtcp-fb:98 transport-cc
141
- a=rtcp-fb:98 ccm fir
142
- a=rtcp-fb:98 nack
143
- a=rtcp-fb:98 nack pli
144
- a=fmtp:98 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e029
145
- a=rtpmap:99 rtx/90000
146
- a=fmtp:99 apt=98
147
- a=rtpmap:100 VP8/90000
148
- a=rtcp-fb:100 goog-remb
149
- a=rtcp-fb:100 transport-cc
150
- a=rtcp-fb:100 ccm fir
151
- a=rtcp-fb:100 nack
152
- a=rtcp-fb:100 nack pli
153
- a=rtpmap:101 rtx/90000
154
- a=fmtp:101 apt=100
155
- a=rtpmap:127 VP9/90000
156
- a=rtcp-fb:127 goog-remb
157
- a=rtcp-fb:127 transport-cc
158
- a=rtcp-fb:127 ccm fir
159
- a=rtcp-fb:127 nack
160
- a=rtcp-fb:127 nack pli
161
- a=rtpmap:103 rtx/90000
162
- a=fmtp:103 apt=127
163
- a=rtpmap:35 AV1/90000
164
- a=rtcp-fb:35 goog-remb
165
- a=rtcp-fb:35 transport-cc
166
- a=rtcp-fb:35 ccm fir
167
- a=rtcp-fb:35 nack
168
- a=rtcp-fb:35 nack pli
169
- a=rtpmap:36 rtx/90000
170
- a=fmtp:36 apt=35
171
- a=rtpmap:104 red/90000
172
- a=rtpmap:105 rtx/90000
173
- a=fmtp:105 apt=104
174
- a=rtpmap:106 ulpfec/90000
175
- a=rid:q send
176
- a=rid:h send
177
- a=rid:f send
178
- a=simulcast:send q;h;f`;
179
- const target = preserveCodec(sdp, '0', {
180
- mimeType: 'video/H264',
181
- clockRate: 90000,
182
- sdpFmtpLine:
183
- 'profile-level-id=42e029;packetization-mode=1;level-asymmetry-allowed=1',
184
- });
185
- expect(target).toContain('H264');
186
- expect(target).toContain('profile-level-id=42e029');
187
- expect(target).not.toContain('profile-level-id=640c29');
188
- expect(target).not.toContain('VP9');
189
- expect(target).not.toContain('AV1');
190
- });
191
-
192
- it('works with iOS RN vp8', () => {
193
- const sdp = `v=0
194
- o=- 2055959380019004946 2 IN IP4 127.0.0.1
195
- s=-
196
- t=0 0
197
- a=group:BUNDLE 0
198
- a=extmap-allow-mixed
199
- a=msid-semantic: WMS FE2B3B06-61D7-4ACC-A4EF-76441C116E47
200
- m=video 9 UDP/TLS/RTP/SAVPF 96 97 98 99 100 101 127 103 35 36 104 105 106
201
- c=IN IP4 0.0.0.0
202
- a=rtcp:9 IN IP4 0.0.0.0
203
- a=ice-ufrag:gCgh
204
- a=ice-pwd:bz18EOLBL9+kSJfLiVOyU4RP
205
- a=ice-options:trickle renomination
206
- a=fingerprint:sha-256 6B:04:36:6D:E6:92:B5:68:DA:30:CF:53:46:14:49:5B:48:3E:B9:F7:06:B4:E8:85:B1:8C:B3:1C:EB:E8:F8:16
207
- a=setup:actpass
208
- a=mid:0
209
- a=extmap:1 urn:ietf:params:rtp-hdrext:toffset
210
- a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
211
- a=extmap:3 urn:3gpp:video-orientation
212
- a=extmap:4 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
213
- a=extmap:5 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay
214
- a=extmap:6 http://www.webrtc.org/experiments/rtp-hdrext/video-content-type
215
- a=extmap:7 http://www.webrtc.org/experiments/rtp-hdrext/video-timing
216
- a=extmap:8 http://www.webrtc.org/experiments/rtp-hdrext/color-space
217
- a=extmap:9 urn:ietf:params:rtp-hdrext:sdes:mid
218
- a=extmap:10 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id
219
- a=extmap:11 urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id
220
- a=extmap:12 https://aomediacodec.github.io/av1-rtp-spec/#dependency-descriptor-rtp-header-extension
221
- a=extmap:14 http://www.webrtc.org/experiments/rtp-hdrext/video-layers-allocation00
222
- a=sendonly
223
- a=msid:FE2B3B06-61D7-4ACC-A4EF-76441C116E47 93FCE555-1DA2-4721-901C-5D263E11DF23
224
- a=rtcp-mux
225
- a=rtcp-rsize
226
- a=rtpmap:96 H264/90000
227
- a=rtcp-fb:96 goog-remb
228
- a=rtcp-fb:96 transport-cc
229
- a=rtcp-fb:96 ccm fir
230
- a=rtcp-fb:96 nack
231
- a=rtcp-fb:96 nack pli
232
- a=fmtp:96 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=640c29
233
- a=rtpmap:97 rtx/90000
234
- a=fmtp:97 apt=96
235
- a=rtpmap:98 H264/90000
236
- a=rtcp-fb:98 goog-remb
237
- a=rtcp-fb:98 transport-cc
238
- a=rtcp-fb:98 ccm fir
239
- a=rtcp-fb:98 nack
240
- a=rtcp-fb:98 nack pli
241
- a=fmtp:98 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e029
242
- a=rtpmap:99 rtx/90000
243
- a=fmtp:99 apt=98
244
- a=rtpmap:100 VP8/90000
245
- a=rtcp-fb:100 goog-remb
246
- a=rtcp-fb:100 transport-cc
247
- a=rtcp-fb:100 ccm fir
248
- a=rtcp-fb:100 nack
249
- a=rtcp-fb:100 nack pli
250
- a=rtpmap:101 rtx/90000
251
- a=fmtp:101 apt=100
252
- a=rtpmap:127 VP9/90000
253
- a=rtcp-fb:127 goog-remb
254
- a=rtcp-fb:127 transport-cc
255
- a=rtcp-fb:127 ccm fir
256
- a=rtcp-fb:127 nack
257
- a=rtcp-fb:127 nack pli
258
- a=rtpmap:103 rtx/90000
259
- a=fmtp:103 apt=127
260
- a=rtpmap:35 AV1/90000
261
- a=rtcp-fb:35 goog-remb
262
- a=rtcp-fb:35 transport-cc
263
- a=rtcp-fb:35 ccm fir
264
- a=rtcp-fb:35 nack
265
- a=rtcp-fb:35 nack pli
266
- a=rtpmap:36 rtx/90000
267
- a=fmtp:36 apt=35
268
- a=rtpmap:104 red/90000
269
- a=rtpmap:105 rtx/90000
270
- a=fmtp:105 apt=104
271
- a=rtpmap:106 ulpfec/90000
272
- a=rid:q send
273
- a=rid:h send
274
- a=rid:f send
275
- a=simulcast:send q;h;f`;
276
- const target = preserveCodec(sdp, '0', {
277
- clockRate: 90000,
278
- mimeType: 'video/VP8',
279
- });
280
- expect(target).toContain('VP8');
281
- expect(target).not.toContain('VP9');
282
- });
283
- });