@webex/plugin-meetings 1.152.1 → 1.153.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.
- package/dist/common/errors/webex-errors.js +27 -3
- package/dist/common/errors/webex-errors.js.map +1 -1
- package/dist/constants.js +8 -6
- package/dist/constants.js.map +1 -1
- package/dist/meeting/index.js +3 -3
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting/state.js +8 -15
- package/dist/meeting/state.js.map +1 -1
- package/dist/meetings/index.js +22 -0
- package/dist/meetings/index.js.map +1 -1
- package/dist/peer-connection-manager/index.js +52 -44
- package/dist/peer-connection-manager/index.js.map +1 -1
- package/dist/peer-connection-manager/util.js +28 -0
- package/dist/peer-connection-manager/util.js.map +1 -0
- package/package.json +5 -5
- package/src/common/errors/webex-errors.js +21 -2
- package/src/constants.js +4 -5
- package/src/meeting/index.js +3 -3
- package/src/meeting/state.js +8 -17
- package/src/meetings/index.js +17 -0
- package/src/peer-connection-manager/index.js +46 -46
- package/src/peer-connection-manager/util.js +19 -0
- package/test/unit/spec/meeting/index.js +20 -1
- package/test/unit/spec/meetings/index.js +29 -0
- package/test/unit/spec/peerconnection-manager/index.js +69 -0
- package/test/unit/spec/peerconnection-manager/utils.js +25 -0
|
@@ -48,6 +48,7 @@ import WebExMeetingsErrors from '../../../../src/common/errors/webex-meetings-er
|
|
|
48
48
|
import ParameterError from '../../../../src/common/errors/parameter';
|
|
49
49
|
import PasswordError from '../../../../src/common/errors/password-error';
|
|
50
50
|
import CaptchaError from '../../../../src/common/errors/captcha-error';
|
|
51
|
+
import IntentToJoinError from '../../../../src/common/errors/intent-to-join';
|
|
51
52
|
import DefaultSDKConfig from '../../../../src/config';
|
|
52
53
|
import testUtils from '../../../utils/testUtils';
|
|
53
54
|
import {MeetingInfoV2CaptchaError, MeetingInfoV2PasswordError} from '../../../../src/meeting-info/meeting-info-v2';
|
|
@@ -642,7 +643,7 @@ describe('plugin-meetings', () => {
|
|
|
642
643
|
});
|
|
643
644
|
|
|
644
645
|
it('should create new correlation ID when already joined', async () => {
|
|
645
|
-
meeting.
|
|
646
|
+
meeting.hasJoinedOnce = true;
|
|
646
647
|
await meeting.join();
|
|
647
648
|
sinon.assert.called(meeting.setCorrelationId);
|
|
648
649
|
});
|
|
@@ -662,6 +663,24 @@ describe('plugin-meetings', () => {
|
|
|
662
663
|
assert.calledOnce(MeetingUtil.joinMeeting);
|
|
663
664
|
});
|
|
664
665
|
});
|
|
666
|
+
it('should succeed when called again after IntentToJoinError error', async () => {
|
|
667
|
+
let joinSucceeded = false;
|
|
668
|
+
|
|
669
|
+
try {
|
|
670
|
+
await meeting.join();
|
|
671
|
+
joinSucceeded = true;
|
|
672
|
+
}
|
|
673
|
+
catch (e) {
|
|
674
|
+
assert.instanceOf(e, IntentToJoinError);
|
|
675
|
+
}
|
|
676
|
+
assert.isFalse(joinSucceeded);
|
|
677
|
+
|
|
678
|
+
// IntentToJoinError means that client should call join() again
|
|
679
|
+
// with moderator and pin explicitly set
|
|
680
|
+
MeetingUtil.joinMeeting = sinon.stub().returns(Promise.resolve());
|
|
681
|
+
await meeting.join({pin: '1234', moderator: false});
|
|
682
|
+
assert.calledWith(MeetingUtil.joinMeeting, meeting, {moderator: false, pin: '1234'});
|
|
683
|
+
});
|
|
665
684
|
});
|
|
666
685
|
it('should fail if password is required', async () => {
|
|
667
686
|
meeting.passwordStatus = PASSWORD_STATUS.REQUIRED;
|
|
@@ -68,6 +68,12 @@ skipInBrowser(describe)('plugin-meetings', () => {
|
|
|
68
68
|
}
|
|
69
69
|
});
|
|
70
70
|
|
|
71
|
+
Object.assign(webex.meetings.config, {
|
|
72
|
+
experimental: {
|
|
73
|
+
enableUnifiedMeetings: true
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
|
|
71
77
|
Object.assign(webex.internal, {
|
|
72
78
|
device: {
|
|
73
79
|
deviceType: 'FAKE_DEVICE',
|
|
@@ -97,6 +103,29 @@ skipInBrowser(describe)('plugin-meetings', () => {
|
|
|
97
103
|
assert.calledOnce(MeetingsUtil.triggerH264Codec);
|
|
98
104
|
});
|
|
99
105
|
|
|
106
|
+
describe('#_toggleUnifiedMeetings', () => {
|
|
107
|
+
it('should have toggleUnifiedMeetings', () => {
|
|
108
|
+
assert.equal(typeof webex.meetings._toggleUnifiedMeetings, 'function');
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
describe('success', () => {
|
|
112
|
+
it('should update meeting info to v1', () => {
|
|
113
|
+
webex.meetings._toggleUnifiedMeetings(false);
|
|
114
|
+
assert.equal(webex.meetings.config.experimental.enableUnifiedMeetings, false);
|
|
115
|
+
assert.equal(webex.meetings.meetingInfo.constructor.name, 'MeetingInfo');
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
describe('failure', () => {
|
|
120
|
+
it('should not accept non boolean input', () => {
|
|
121
|
+
const currentEnableUnifiedMeetings = webex.meetings.config.experimental.enableUnifiedMeetings;
|
|
122
|
+
|
|
123
|
+
webex.meetings._toggleUnifiedMeetings('test');
|
|
124
|
+
assert.equal(webex.meetings.config.experimental.enableUnifiedMeetings, currentEnableUnifiedMeetings);
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
|
|
100
129
|
describe('Public API Contracts', () => {
|
|
101
130
|
describe('#register', () => {
|
|
102
131
|
it('emits an event and resolves when register succeeds', (done) => {
|
|
@@ -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
|
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
|
|
2
|
+
import {assert} from '@webex/test-helper-chai';
|
|
3
|
+
import PeerConnectionUtils from '@webex/plugin-meetings/src/peer-connection-manager/util';
|
|
4
|
+
|
|
5
|
+
describe('Peerconnection Manager', () => {
|
|
6
|
+
describe('Utils', () => {
|
|
7
|
+
describe('convertCLineToIpv4', () => {
|
|
8
|
+
it('changes ipv6 to ipv4 default', () => {
|
|
9
|
+
const localSdp = 'v=0\r\n' +
|
|
10
|
+
'm=video 5004 UDP/TLS/RTP/SAVPF 102 127 97 99\r\n' +
|
|
11
|
+
'c=IN IP6 2607:fb90:d27c:b314:211a:32dd:c47f:ffe\r\n' +
|
|
12
|
+
'a=rtpmap:127 H264/90000\r\n';
|
|
13
|
+
const resultSdp = 'v=0\r\n' +
|
|
14
|
+
'm=video 5004 UDP/TLS/RTP/SAVPF 102 127 97 99\r\n' +
|
|
15
|
+
'c=IN IP4 0.0.0.0\r\n' +
|
|
16
|
+
'a=rtpmap:127 H264/90000\r\n';
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
const temp = PeerConnectionUtils.convertCLineToIpv4(localSdp);
|
|
20
|
+
|
|
21
|
+
assert.equal(temp, resultSdp);
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
});
|