@webex/plugin-meetings 3.0.0-beta.1 → 3.0.0-beta.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.
Files changed (111) hide show
  1. package/dist/common/errors/webex-errors.js +5 -29
  2. package/dist/common/errors/webex-errors.js.map +1 -1
  3. package/dist/constants.js +15 -74
  4. package/dist/constants.js.map +1 -1
  5. package/dist/media/index.js +68 -213
  6. package/dist/media/index.js.map +1 -1
  7. package/dist/media/internal-media-core-wrapper.js +22 -0
  8. package/dist/media/internal-media-core-wrapper.js.map +1 -0
  9. package/dist/media/properties.js +20 -25
  10. package/dist/media/properties.js.map +1 -1
  11. package/dist/media/util.js +0 -27
  12. package/dist/media/util.js.map +1 -1
  13. package/dist/meeting/index.js +694 -432
  14. package/dist/meeting/index.js.map +1 -1
  15. package/dist/meeting/request.js +1 -0
  16. package/dist/meeting/request.js.map +1 -1
  17. package/dist/meeting/util.js +3 -44
  18. package/dist/meeting/util.js.map +1 -1
  19. package/dist/meetings/index.js +64 -5
  20. package/dist/meetings/index.js.map +1 -1
  21. package/dist/meetings/util.js +24 -1
  22. package/dist/meetings/util.js.map +1 -1
  23. package/dist/members/index.js +68 -0
  24. package/dist/members/index.js.map +1 -1
  25. package/dist/multistream/mediaRequestManager.js +133 -0
  26. package/dist/multistream/mediaRequestManager.js.map +1 -0
  27. package/dist/multistream/multistreamMedia.js +116 -0
  28. package/dist/multistream/multistreamMedia.js.map +1 -0
  29. package/dist/multistream/receiveSlot.js +209 -0
  30. package/dist/multistream/receiveSlot.js.map +1 -0
  31. package/dist/multistream/receiveSlotManager.js +195 -0
  32. package/dist/multistream/receiveSlotManager.js.map +1 -0
  33. package/dist/multistream/remoteMedia.js +284 -0
  34. package/dist/multistream/remoteMedia.js.map +1 -0
  35. package/dist/multistream/remoteMediaGroup.js +243 -0
  36. package/dist/multistream/remoteMediaGroup.js.map +1 -0
  37. package/dist/multistream/remoteMediaManager.js +1113 -0
  38. package/dist/multistream/remoteMediaManager.js.map +1 -0
  39. package/dist/reconnection-manager/index.js +109 -130
  40. package/dist/reconnection-manager/index.js.map +1 -1
  41. package/dist/roap/index.js +57 -240
  42. package/dist/roap/index.js.map +1 -1
  43. package/dist/roap/request.js +2 -114
  44. package/dist/roap/request.js.map +1 -1
  45. package/dist/roap/turnDiscovery.js +11 -5
  46. package/dist/roap/turnDiscovery.js.map +1 -1
  47. package/dist/statsAnalyzer/global.js +2 -0
  48. package/dist/statsAnalyzer/global.js.map +1 -1
  49. package/dist/statsAnalyzer/index.js +39 -36
  50. package/dist/statsAnalyzer/index.js.map +1 -1
  51. package/package.json +20 -19
  52. package/src/common/errors/webex-errors.js +0 -18
  53. package/src/constants.ts +139 -180
  54. package/src/media/index.js +60 -194
  55. package/src/media/internal-media-core-wrapper.ts +9 -0
  56. package/src/media/properties.js +19 -25
  57. package/src/media/util.js +0 -22
  58. package/src/meeting/index.js +565 -320
  59. package/src/meeting/request.js +1 -0
  60. package/src/meeting/util.js +3 -46
  61. package/src/meetings/index.js +30 -1
  62. package/src/meetings/util.js +23 -2
  63. package/src/members/index.js +48 -0
  64. package/src/multistream/mediaRequestManager.ts +166 -0
  65. package/src/multistream/multistreamMedia.ts +92 -0
  66. package/src/multistream/receiveSlot.ts +141 -0
  67. package/src/multistream/receiveSlotManager.ts +142 -0
  68. package/src/multistream/remoteMedia.ts +219 -0
  69. package/src/multistream/remoteMediaGroup.ts +224 -0
  70. package/src/multistream/remoteMediaManager.ts +911 -0
  71. package/src/reconnection-manager/index.js +40 -53
  72. package/src/roap/index.js +47 -207
  73. package/src/roap/request.js +1 -72
  74. package/src/roap/turnDiscovery.ts +12 -6
  75. package/src/statsAnalyzer/global.js +2 -0
  76. package/src/statsAnalyzer/index.js +32 -46
  77. package/test/integration/spec/journey.js +1 -1
  78. package/test/unit/spec/media/index.ts +223 -0
  79. package/test/unit/spec/media/properties.ts +73 -82
  80. package/test/unit/spec/meeting/effectsState.js +1 -3
  81. package/test/unit/spec/meeting/index.js +420 -228
  82. package/test/unit/spec/meeting/muteState.js +7 -0
  83. package/test/unit/spec/meeting/utils.js +61 -2
  84. package/test/unit/spec/meetings/index.js +0 -4
  85. package/test/unit/spec/members/index.js +164 -2
  86. package/test/unit/spec/multistream/mediaRequestManager.ts +515 -0
  87. package/test/unit/spec/multistream/receiveSlot.ts +104 -0
  88. package/test/unit/spec/multistream/receiveSlotManager.ts +173 -0
  89. package/test/unit/spec/multistream/remoteMedia.ts +217 -0
  90. package/test/unit/spec/multistream/remoteMediaGroup.ts +396 -0
  91. package/test/unit/spec/multistream/remoteMediaManager.ts +1251 -0
  92. package/test/unit/spec/roap/index.ts +63 -35
  93. package/test/unit/spec/stats-analyzer/index.js +19 -22
  94. package/dist/peer-connection-manager/index.js +0 -794
  95. package/dist/peer-connection-manager/index.js.map +0 -1
  96. package/dist/roap/collection.js +0 -73
  97. package/dist/roap/collection.js.map +0 -1
  98. package/dist/roap/handler.js +0 -337
  99. package/dist/roap/handler.js.map +0 -1
  100. package/dist/roap/state.js +0 -164
  101. package/dist/roap/state.js.map +0 -1
  102. package/dist/roap/util.js +0 -102
  103. package/dist/roap/util.js.map +0 -1
  104. package/src/peer-connection-manager/index.js +0 -723
  105. package/src/roap/collection.js +0 -63
  106. package/src/roap/handler.js +0 -252
  107. package/src/roap/state.js +0 -149
  108. package/src/roap/util.js +0 -93
  109. package/test/unit/spec/peerconnection-manager/index.js +0 -188
  110. package/test/unit/spec/peerconnection-manager/utils.js +0 -48
  111. package/test/unit/spec/roap/util.js +0 -30
@@ -1,188 +0,0 @@
1
- import 'jsdom-global/register';
2
- import {assert} from '@webex/test-helper-chai';
3
- import sinon from 'sinon';
4
-
5
- import PeerConnectionManager from '@webex/plugin-meetings/src/peer-connection-manager/index';
6
- import StaticConfig from '@webex/plugin-meetings/src/common/config';
7
- import {InvalidSdpError} from '@webex/plugin-meetings/src/common/errors/webex-errors';
8
-
9
- describe('Peerconnection Manager', () => {
10
- describe('Methods', () => {
11
- let peerConnection = null;
12
- let sdp = null;
13
-
14
- beforeEach(() => {
15
- sdp = 'v=0\r\no=- 1026633665396855335 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=group:BUNDLE 0 1 2\r\nr\na=msid-semantic: WMS\r\nm=audio 40903 UDP/TLS/RTP/SAVPF 111 63 103 104 9 0 8 106 105 13 110 112 113 126\r\nb=TIAS:64000\r\nc=IN IP4 0.0.0.0\r\na=rtcp:9 IN IP4 0.0.0.0\r\na=candidate:602151403 1 udp 2122262783 2401:4900:2301:c2cb:5ea9:46d5:7321:2531 47974 typ host generation 0 network-id 2 network-cost 900\r\na=candidate:675071982 1 udp 2122197247 2401:4900:33fc:314c:ad57:3e1d:befe:34b7 41234 typ host generation 0 network-id 3 network-cost 900\r\na=candidate:1835525403 1 tcp 1518283007 2401:4900:2301:c2cb:5ea9:46d5:7321:2531 9 typ host tcptype active generation 0 network-id 2 network-cost 900\r\na=candidate:1723808542 1 tcp 1518217471 2401:4900:33fc:314c:ad57:3e1d:befe:34b7 9 typ host tcptype active generation 0 network-id 3 network-cost 900\r\na=ice-ufrag:zK3G\r\na=ice-pwd:e9xgQIGnRsJvaFpvTAenr5JQ\r\na=ice-options:trickle\r\nm=video 43875 UDP/TLS/RTP/SAVPF 96 97 98 99 100 101 122 121 127\r\nb=TIAS:4000000\r\nc=IN IP4 0.0.0.0\r\na=periodic-keyframes:20\r\na=rtcp:9 IN IP4 0.0.0.0\r\na=candidate:602151403 1 udp 2122262783 2401:4900:2301:c2cb:5ea9:46d5:7321:2531 41619 typ host generation 0 network-id 2 network-cost 900\r\na=candidate:675071982 1 udp 2122197247 2401:4900:33fc:314c:ad57:3e1d:befe:34b7 47098 typ host generation 0 network-id 3 network-cost 900\r\na=candidate:1835525403 1 tcp 1518283007 2401:4900:2301:c2cb:5ea9:46d5:7321:2531 9 typ host tcptype active generation 0 network-id 2 network-cost 900\r\na=candidate:1723808542 1 tcp 1518217471 2401:4900:33fc:314c:ad57:3e1d:befe:34b7 9 typ host tcptype active generation 0 network-id 3 network-cost 900\r\na=ice-ufrag:zK3G\r\na=ice-pwd:e9xgQIGnRsJvaFpvTAenr5JQ\r\na=ice-options:trickle\r\na=fmtp:100 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f\r\nm=video 49298 UDP/TLS/RTP/SAVPF 96 97 98 99 100 101 122 121 127\r\nb=TIAS:4000000\r\nc=IN IP4 0.0.0.0\r\na=periodic-keyframes:20\r\na=rtcp:9 IN IP4 0.0.0.0\r\na=candidate:602151403 1 udp 2122262783 2401:4900:2301:c2cb:5ea9:46d5:7321:2531 37670 typ host generation 0 network-id 2 network-cost 900\r\na=candidate:675071982 1 udp 2122197247 2401:4900:33fc:314c:ad57:3e1d:befe:34b7 37790 typ host generation 0 network-id 3 network-cost 900\r\na=candidate:1835525403 1 tcp 1518283007 2401:4900:2301:c2cb:5ea9:46d5:7321:2531 9 typ host tcptype active generation 0 network-id 2 network-cost 900\r\na=candidate:1723808542 1 tcp 1518217471 2401:4900:33fc:314c:ad57:3e1d:befe:34b7 9 typ host tcptype active generation 0 network-id 3 network-cost 900\r\na=ice-ufrag:zK3G\r\na=ice-pwd:e9xgQIGnRsJvaFpvTAenr5JQ\r\na=ice-options:trickle\r\na=fmtp:100 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f;\r\na=content:slides\r\n';
16
-
17
- peerConnection = {
18
- iceGatheringState: 'new',
19
- onicecandidate: null,
20
- onicecandidateerror: null,
21
- localDescription: {sdp}
22
- };
23
-
24
- Object.defineProperty(global.window, 'RTCSessionDescription', {
25
- writable: true,
26
- value: class {
27
- constructor(options) {
28
- this.type = options.type;
29
- this.sdp = options.sdp;
30
- }
31
- }
32
- });
33
- });
34
- describe('setRemoteSessionDetails', () => {
35
- it('change the start bitrate on remoteSDP and remove extmap', async () => {
36
- StaticConfig.set({bandwidth: {audio: 50, video: 500, startBitrate: 2000}});
37
- let result = null;
38
- const setRemoteDescription = sinon.stub().callsFake((args) => {
39
- result = args;
40
-
41
- return Promise.resolve();
42
- });
43
- const remoteSdp = 'v=0\r\n' +
44
- 'm=video 5004 UDP/TLS/RTP/SAVPF 102 127 97 99\r\n' +
45
- 'a=fmtp:102 profile-level-id=42e016;packetization-mode=1;max-mbps=244800;max-fs=8160;max-fps=3000;max-dpb=12240;max-rcmd-nalu-size=196608;level-asymmetry-allowed=1\r\n' +
46
- 'a=rtpmap:127 H264/90000\r\n' +
47
- 'a=extmap:3 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01\r\n' +
48
- 'a=fmtp:127 profile-level-id=42e016;max-mbps=244800;max-fs=8160;max-fps=3000;max-dpb=12240;max-rcmd-nalu-size=196608;level-asymmetry-allowed=1\r\n';
49
-
50
- const resultSdp = 'v=0\r\n' +
51
- 'm=video 5004 UDP/TLS/RTP/SAVPF 102 127 97 99\r\n' +
52
- 'a=fmtp:102 profile-level-id=42e016;packetization-mode=1;max-mbps=244800;max-fs=8160;max-fps=3000;max-dpb=12240;max-rcmd-nalu-size=196608;level-asymmetry-allowed=1;x-google-start-bitrate=2000\r\n' +
53
- 'a=rtpmap:127 H264/90000\r\r\n' +
54
- 'a=fmtp:127 profile-level-id=42e016;max-mbps=244800;max-fs=8160;max-fps=3000;max-dpb=12240;max-rcmd-nalu-size=196608;level-asymmetry-allowed=1;x-google-start-bitrate=2000\r\n';
55
- const peerConnection = {
56
- signalingState: 'have-local-offer',
57
- setRemoteDescription,
58
- enableExtmap: false
59
- };
60
-
61
- await PeerConnectionManager.setRemoteSessionDetails(peerConnection, 'answer', remoteSdp, {});
62
-
63
- assert.equal(result.sdp, resultSdp);
64
- });
65
-
66
- it('dont change the start bitrate on remoteSDP if default value is 0', async () => {
67
- StaticConfig.set({bandwidth: {audio: 50, video: 500, startBitrate: 0}});
68
- let result = null;
69
- const setRemoteDescription = sinon.stub().callsFake((args) => {
70
- result = args;
71
-
72
- return Promise.resolve();
73
- });
74
- const remoteSdp = 'v=0\r\n' +
75
- 'm=video 5004 UDP/TLS/RTP/SAVPF 102 127 97 99\r\n' +
76
- 'a=fmtp:102 profile-level-id=42e016;packetization-mode=1;max-mbps=244800;max-fs=8160;max-fps=3000;max-dpb=12240;max-rcmd-nalu-size=196608;level-asymmetry-allowed=1\r\n' +
77
- 'a=rtpmap:127 H264/90000\r\n' +
78
- 'a=fmtp:127 profile-level-id=42e016;max-mbps=244800;max-fs=8160;max-fps=3000;max-dpb=12240;max-rcmd-nalu-size=196608;level-asymmetry-allowed=1\r\n';
79
-
80
- const peerConnection = {
81
- signalingState: 'have-local-offer',
82
- setRemoteDescription
83
- };
84
-
85
- await PeerConnectionManager.setRemoteSessionDetails(peerConnection, 'answer', remoteSdp, {});
86
-
87
- assert.equal(result.sdp, remoteSdp);
88
- });
89
-
90
- it('removes xTLS candidates from the remote sdp', async () => {
91
- StaticConfig.set({bandwidth: {}});
92
-
93
- const remoteSdpWithXtlsCandidates = 'v=0\r\n' +
94
- 'm=video 5004 UDP/TLS/RTP/SAVPF 102 127 97 99\r\n' +
95
- 'a=candidate:1 1 UDP 2130706175 18.206.82.54 9000 typ host\r\n' +
96
- 'a=candidate:2 1 TCP 1962934271 18.206.82.54 5004 typ host tcptype passive\r\n' +
97
- 'a=candidate:3 1 TCP 1962934015 18.206.82.54 9000 typ host tcptype passive\r\n' +
98
- 'a=candidate:4 1 xTLS 1795162111 external-media2.aintm-a-6.int.infra.webex.com 443 typ host tcptype passive fingerprint sha-1;55:B8:1D:94:BC:9D:B2:A5:5E:82:E7:84:C6:C8:10:AC:D3:FD:96:26\r\n' +
99
- 'a=rtpmap:127 H264/90000\r\n' +
100
- 'a=extmap:3 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01\r\n' +
101
- 'm=video 9000 UDP/TLS/RTP/SAVPF 102 127 97 99\r\n' +
102
- 'a=candidate:1 1 xTLS 1795162111 external-media2.aintm-a-6.int.infra.webex.com 443 typ host tcptype passive fingerprint sha-1;55:B8:1D:94:BC:9D:B2:A5:5E:82:E7:84:C6:C8:10:AC:D3:FD:96:26\r\n' +
103
- 'a=candidate:2 1 TCP 1962934271 18.206.82.54 5004 typ host tcptype passive\r\n' +
104
- 'a=fmtp:127 profile-level-id=42e016;max-mbps=244800;max-fs=8160;max-fps=3000;max-dpb=12240;max-rcmd-nalu-size=196608;level-asymmetry-allowed=1\r\n';
105
-
106
- // same as remoteSdpWithXtlsCandidates but without the xtls candidates
107
- const resultSdp = 'v=0\r\n' +
108
- 'm=video 5004 UDP/TLS/RTP/SAVPF 102 127 97 99\r\n' +
109
- 'a=candidate:1 1 UDP 2130706175 18.206.82.54 9000 typ host\r\n' +
110
- 'a=candidate:2 1 TCP 1962934271 18.206.82.54 5004 typ host tcptype passive\r\n' +
111
- 'a=candidate:3 1 TCP 1962934015 18.206.82.54 9000 typ host tcptype passive\r\n' +
112
- 'a=rtpmap:127 H264/90000\r\n' +
113
- 'a=extmap:3 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01\r\n' +
114
- 'm=video 9000 UDP/TLS/RTP/SAVPF 102 127 97 99\r\n' +
115
- 'a=candidate:2 1 TCP 1962934271 18.206.82.54 5004 typ host tcptype passive\r\n' +
116
- 'a=fmtp:127 profile-level-id=42e016;max-mbps=244800;max-fs=8160;max-fps=3000;max-dpb=12240;max-rcmd-nalu-size=196608;level-asymmetry-allowed=1\r\n';
117
-
118
- const peerConnection = {
119
- signalingState: 'have-local-offer',
120
- setRemoteDescription: sinon.stub().resolves(),
121
- enableExtmap: true
122
- };
123
-
124
- await PeerConnectionManager.setRemoteSessionDetails(peerConnection, 'answer', remoteSdpWithXtlsCandidates, '');
125
-
126
- assert.calledWith(peerConnection.setRemoteDescription, new global.window.RTCSessionDescription({sdp: resultSdp, type: 'answer'}));
127
- });
128
- });
129
-
130
- describe('iceCandidate', () => {
131
- beforeEach(() => {
132
- StaticConfig.set({bandwidth: {audio: 50, video: 500, startBitrate: 0}});
133
- peerConnection.sdp = null;
134
- });
135
- it('ice gathering already completed', async () => {
136
- peerConnection.iceGatheringState = 'complete';
137
-
138
- await PeerConnectionManager.iceCandidate(peerConnection, {remoteQualityLevel: 'HIGH'});
139
- console.error('Came her with sdp resolved');
140
- assert(peerConnection.sdp.search('max-fs:8192'), true);
141
- });
142
-
143
- it('listen onIceCandidate,onicecandidateerror and onIceGatheringStateChange', async () => {
144
- peerConnection.iceGatheringState = 'none';
145
- setTimeout(() => {
146
- peerConnection.onicecandidate({candidate: null});
147
- }, 1000);
148
- await PeerConnectionManager.iceCandidate(peerConnection, {remoteQualityLevel: 'HIGH'});
149
- assert.isFunction(peerConnection.onIceGatheringStateChange);
150
- assert.isFunction(peerConnection.onicecandidate);
151
- assert.isFunction(peerConnection.onicecandidateerror);
152
- });
153
-
154
- it('generate sdp with iceGatheringstate is `complet`', async () => {
155
- peerConnection.iceGatheringState = 'none';
156
- setTimeout(() => {
157
- peerConnection.iceGatheringState = 'complete';
158
- peerConnection.onIceGatheringStateChange();
159
- }, 1000);
160
- await PeerConnectionManager.iceCandidate(peerConnection, {remoteQualityLevel: 'HIGH'})
161
- .then(() => {
162
- assert(peerConnection.sdp.search('max-fs:8192'), true);
163
- });
164
- });
165
-
166
- it('should still generate sdp even if onicecandidateerror is called ', async () => {
167
- peerConnection.iceGatheringState = 'none';
168
- setTimeout(() => {
169
- peerConnection.onicecandidateerror();
170
- peerConnection.onicecandidate({candidate: null});
171
- }, 1000);
172
- await PeerConnectionManager.iceCandidate(peerConnection, {remoteQualityLevel: 'HIGH'})
173
- .then(() => {
174
- assert(peerConnection.sdp.search('max-fs:8192'), true);
175
- });
176
- });
177
-
178
- it('should throw generated SDP does not have candidates ', async () => {
179
- peerConnection.iceGatheringState = 'none';
180
- peerConnection.localDescription.sdp = 'v=0\r\no=- 1026633665396855335 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=group:BUNDLE 0 1 2\r\nr\na=msid-semantic: WMS\r\nm=audio 40903 UDP/TLS/RTP/SAVPF 111 63 103 104 9 0 8 106 105 13 110 112 113 126\r\nb=TIAS:64000\r\nc=IN IP4 0.0.0.0\r\na=rtcp:9 IN IP4 0.0.0.0\r\na=ice-ufrag:zK3G\r\na=ice-pwd:e9xgQIGnRsJvaFpvTAenr5JQ\r\na=ice-options:trickle\r\nm=video 43875 UDP/TLS/RTP/SAVPF 96 97 98 99 100 101 122 121 127\r\nb=TIAS:4000000\r\nc=IN IP4 0.0.0.0\r\na=periodic-keyframes:20\r\na=rtcp:9 IN IP4 0.0.0.0\r\na=ice-ufrag:zK3G\r\na=ice-pwd:e9xgQIGnRsJvaFpvTAenr5JQ\r\na=ice-options:trickle\r\na=fmtp:100 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f\r\nm=video 49298 UDP/TLS/RTP/SAVPF 96 97 98 99 100 101 122 121 127\r\nb=TIAS:4000000\r\nc=IN IP4 0.0.0.0\r\na=periodic-keyframes:20\r\na=rtcp:9 IN IP4 0.0.0.0\r\na=ice-ufrag:zK3G\r\na=ice-pwd:e9xgQIGnRsJvaFpvTAenr5JQ\r\na=ice-options:trickle\r\na=fmtp:100 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f;\r\na=content:slides\r\n';
181
- setTimeout(() => {
182
- peerConnection.onicecandidate({candidate: null});
183
- }, 1000);
184
- await assert.isRejected(PeerConnectionManager.iceCandidate(peerConnection, {remoteQualityLevel: 'HIGH'}), InvalidSdpError);
185
- });
186
- });
187
- });
188
- });
@@ -1,48 +0,0 @@
1
- import {assert} from '@webex/test-helper-chai';
2
- import PeerConnectionUtils from '@webex/plugin-meetings/src/peer-connection-manager/util';
3
-
4
- import {
5
- SDP_MULTIPLE_VIDEO_CODECS,
6
- SDP_MULTIPLE_VIDEO_CODECS_WITH_LOWERED_H264_PROFILE_LEVEL,
7
- SDP_MULTIPLE_VIDEO_CODECS_WITH_MAX_FS
8
- } from './utils.test-fixtures';
9
-
10
- describe('Peerconnection Manager', () => {
11
- describe('Utils', () => {
12
- describe('convertCLineToIpv4', () => {
13
- it('changes ipv6 to ipv4 default', () => {
14
- const localSdp = 'v=0\r\n' +
15
- 'm=video 5004 UDP/TLS/RTP/SAVPF 102 127 97 99\r\n' +
16
- 'c=IN IP6 2607:fb90:d27c:b314:211a:32dd:c47f:ffe\r\n' +
17
- 'a=rtpmap:127 H264/90000\r\n';
18
- const resultSdp = 'v=0\r\n' +
19
- 'm=video 5004 UDP/TLS/RTP/SAVPF 102 127 97 99\r\n' +
20
- 'c=IN IP4 0.0.0.0\r\n' +
21
- 'a=rtpmap:127 H264/90000\r\n';
22
-
23
-
24
- const temp = PeerConnectionUtils.convertCLineToIpv4(localSdp);
25
-
26
- assert.equal(temp, resultSdp);
27
- });
28
- });
29
-
30
- describe('adjustH264Profile', () => {
31
- it('appends max-fs and max-mbps to h264 fmtp lines when h264MaxFs value is higher than the value from the profile', () => {
32
- const modifiedSdp = PeerConnectionUtils.adjustH264Profile(SDP_MULTIPLE_VIDEO_CODECS, 8192);
33
-
34
- assert.equal(modifiedSdp, SDP_MULTIPLE_VIDEO_CODECS_WITH_MAX_FS);
35
- });
36
- it('keeps fmtp lines the same when h264MaxFs value matches the value from the profile', () => {
37
- const modifiedSdp = PeerConnectionUtils.adjustH264Profile(SDP_MULTIPLE_VIDEO_CODECS, 3600);
38
-
39
- assert.equal(modifiedSdp, SDP_MULTIPLE_VIDEO_CODECS);
40
- });
41
- it('changes the profile level in h264 fmtp lines when h264MaxFs value is lower than the value from the profile', () => {
42
- const modifiedSdp = PeerConnectionUtils.adjustH264Profile(SDP_MULTIPLE_VIDEO_CODECS, 1620);
43
-
44
- assert.equal(modifiedSdp, SDP_MULTIPLE_VIDEO_CODECS_WITH_LOWERED_H264_PROFILE_LEVEL);
45
- });
46
- });
47
- });
48
- });
@@ -1,30 +0,0 @@
1
- import 'jsdom-global/register';
2
- import {assert} from '@webex/test-helper-chai';
3
- import RoapUtil from '@webex/plugin-meetings/src/roap/util';
4
- import PeerConnectionManager from '@webex/plugin-meetings/src/peer-connection-manager/index.js';
5
- import sinon from 'sinon';
6
-
7
- describe('RoapUtil', () => {
8
- describe('updatePeerConnection', () => {
9
- let meeting, session;
10
-
11
- beforeEach('stub PeerConnectionManager', () => {
12
- meeting = {
13
- mediaProperties: {
14
- peerConnection: {name: 'peer-connection'}
15
- },
16
- roap: {
17
- lastRoapOffer: 'lastRoapOffer'
18
- }
19
- };
20
- session = {OFFER: {sdps: ['sdp1', 'sdp2']}};
21
-
22
- PeerConnectionManager.updatePeerConnection = sinon.stub().returns(Promise.resolve());
23
- });
24
-
25
- it('should just call PeerConnection.updatePeerConnection', async () => {
26
- await RoapUtil.updatePeerConnection(meeting, session);
27
- assert.calledOnce(PeerConnectionManager.updatePeerConnection);
28
- });
29
- });
30
- });