@webex/plugin-meetings 1.153.1 → 1.154.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.
- package/dist/common/errors/webex-errors.js +27 -3
- package/dist/common/errors/webex-errors.js.map +1 -1
- package/dist/constants.js +20 -13
- package/dist/constants.js.map +1 -1
- package/dist/meeting/index.js +54 -41
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting/request.js +24 -20
- package/dist/meeting/request.js.map +1 -1
- package/dist/meeting/state.js +8 -15
- package/dist/meeting/state.js.map +1 -1
- package/dist/meeting/util.js +2 -1
- package/dist/meeting/util.js.map +1 -1
- package/dist/meetings/index.js +8 -1
- package/dist/meetings/index.js.map +1 -1
- package/dist/metrics/config.js +3 -1
- package/dist/metrics/config.js.map +1 -1
- package/dist/metrics/index.js +23 -9
- package/dist/metrics/index.js.map +1 -1
- package/dist/peer-connection-manager/index.js +63 -56
- package/dist/peer-connection-manager/index.js.map +1 -1
- package/dist/reconnection-manager/index.js +1 -1
- package/dist/reconnection-manager/index.js.map +1 -1
- package/dist/roap/handler.js +4 -4
- package/dist/roap/handler.js.map +1 -1
- package/package.json +5 -5
- package/src/common/errors/webex-errors.js +21 -2
- package/src/constants.js +16 -11
- package/src/meeting/index.js +85 -68
- package/src/meeting/request.js +10 -5
- package/src/meeting/state.js +8 -17
- package/src/meeting/util.js +2 -1
- package/src/meetings/index.js +14 -3
- package/src/metrics/config.js +1 -0
- package/src/metrics/index.js +23 -9
- package/src/peer-connection-manager/index.js +61 -60
- package/src/reconnection-manager/index.js +3 -3
- package/src/roap/handler.js +5 -5
- package/test/unit/spec/meeting/index.js +39 -7
- package/test/unit/spec/meeting/request.js +53 -1
- package/test/unit/spec/meeting/utils.js +41 -0
- package/test/unit/spec/meetings/index.js +3 -1
- package/test/unit/spec/metrics/index.js +6 -6
- package/test/unit/spec/peerconnection-manager/index.js +69 -0
|
@@ -3,9 +3,23 @@ import {assert} from '@webex/test-helper-chai';
|
|
|
3
3
|
import sinon from 'sinon';
|
|
4
4
|
import PeerConnectionManager from '@webex/plugin-meetings/src/peer-connection-manager/index';
|
|
5
5
|
import StaticConfig from '@webex/plugin-meetings/src/common/config';
|
|
6
|
+
import {IceGatheringFailed, InvalidSdpError} from '@webex/plugin-meetings/src/common/errors/webex-errors';
|
|
6
7
|
|
|
7
8
|
describe('Peerconnection Manager', () => {
|
|
8
9
|
describe('Methods', () => {
|
|
10
|
+
let peerConnection = null;
|
|
11
|
+
let sdp = null;
|
|
12
|
+
|
|
13
|
+
beforeEach(() => {
|
|
14
|
+
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';
|
|
15
|
+
|
|
16
|
+
peerConnection = {
|
|
17
|
+
iceGatheringState: 'new',
|
|
18
|
+
onicecandidate: null,
|
|
19
|
+
onicecandidateerror: null,
|
|
20
|
+
localDescription: {sdp}
|
|
21
|
+
};
|
|
22
|
+
});
|
|
9
23
|
describe('setRemoteSessionDetails', () => {
|
|
10
24
|
it('change the start bitrate on remoteSDP', async () => {
|
|
11
25
|
StaticConfig.set({bandwidth: {audio: 50, video: 500, startBitrate: 2000}});
|
|
@@ -62,5 +76,60 @@ describe('Peerconnection Manager', () => {
|
|
|
62
76
|
assert.equal(result.sdp, remoteSdp);
|
|
63
77
|
});
|
|
64
78
|
});
|
|
79
|
+
|
|
80
|
+
describe('iceCandidate', () => {
|
|
81
|
+
beforeEach(() => {
|
|
82
|
+
StaticConfig.set({bandwidth: {audio: 50, video: 500, startBitrate: 0}});
|
|
83
|
+
peerConnection.sdp = null;
|
|
84
|
+
});
|
|
85
|
+
it('ice gathering already completed', async () => {
|
|
86
|
+
peerConnection.iceGatheringState = 'complete';
|
|
87
|
+
|
|
88
|
+
await PeerConnectionManager.iceCandidate(peerConnection, {remoteQualityLevel: 'HIGH'});
|
|
89
|
+
console.error('Came her with sdp resolved');
|
|
90
|
+
assert(peerConnection.sdp.search('max-fs:8192'), true);
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
it('listen onIceCandidate,onicecandidateerror and onIceGatheringStateChange', async () => {
|
|
94
|
+
peerConnection.iceGatheringState = 'none';
|
|
95
|
+
setTimeout(() => {
|
|
96
|
+
peerConnection.onicecandidate({candidate: null});
|
|
97
|
+
}, 1000);
|
|
98
|
+
await PeerConnectionManager.iceCandidate(peerConnection, {remoteQualityLevel: 'HIGH'});
|
|
99
|
+
assert.isFunction(peerConnection.onIceGatheringStateChange);
|
|
100
|
+
assert.isFunction(peerConnection.onicecandidate);
|
|
101
|
+
assert.isFunction(peerConnection.onicecandidateerror);
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
it('generate sdp with iceGatheringstate is `complet`', async () => {
|
|
105
|
+
peerConnection.iceGatheringState = 'none';
|
|
106
|
+
setTimeout(() => {
|
|
107
|
+
peerConnection.iceGatheringState = 'complete';
|
|
108
|
+
peerConnection.onIceGatheringStateChange();
|
|
109
|
+
}, 1000);
|
|
110
|
+
await PeerConnectionManager.iceCandidate(peerConnection, {remoteQualityLevel: 'HIGH'})
|
|
111
|
+
.then(() => {
|
|
112
|
+
assert(peerConnection.sdp.search('max-fs:8192'), true);
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
it('should not generate sdp if onicecandidateerror errors out ', async () => {
|
|
117
|
+
peerConnection.iceGatheringState = 'none';
|
|
118
|
+
setTimeout(() => {
|
|
119
|
+
peerConnection.onicecandidateerror();
|
|
120
|
+
}, 1000);
|
|
121
|
+
await assert.isRejected(PeerConnectionManager.iceCandidate(peerConnection, {remoteQualityLevel: 'HIGH'}), IceGatheringFailed);
|
|
122
|
+
assert.equal(peerConnection.sdp, null);
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
it('should throw generated SDP does not have candidates ', async () => {
|
|
126
|
+
peerConnection.iceGatheringState = 'none';
|
|
127
|
+
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';
|
|
128
|
+
setTimeout(() => {
|
|
129
|
+
peerConnection.onicecandidate({candidate: null});
|
|
130
|
+
}, 1000);
|
|
131
|
+
await assert.isRejected(PeerConnectionManager.iceCandidate(peerConnection, {remoteQualityLevel: 'HIGH'}), InvalidSdpError);
|
|
132
|
+
});
|
|
133
|
+
});
|
|
65
134
|
});
|
|
66
135
|
});
|