@webex/plugin-meetings 3.0.0-beta.0 → 3.0.0-beta.10
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/browser-detection.js.map +1 -1
- package/dist/common/collection.js.map +1 -1
- package/dist/common/config.js.map +1 -1
- package/dist/common/errors/captcha-error.js +7 -0
- package/dist/common/errors/captcha-error.js.map +1 -1
- package/dist/common/errors/intent-to-join.js +8 -0
- package/dist/common/errors/intent-to-join.js.map +1 -1
- package/dist/common/errors/join-meeting.js +8 -0
- package/dist/common/errors/join-meeting.js.map +1 -1
- package/dist/common/errors/media.js +7 -0
- package/dist/common/errors/media.js.map +1 -1
- package/dist/common/errors/parameter.js.map +1 -1
- package/dist/common/errors/password-error.js +7 -0
- package/dist/common/errors/password-error.js.map +1 -1
- package/dist/common/errors/permission.js +7 -0
- package/dist/common/errors/permission.js.map +1 -1
- package/dist/common/errors/reconnection-in-progress.js.map +1 -1
- package/dist/common/errors/reconnection.js +7 -0
- package/dist/common/errors/reconnection.js.map +1 -1
- package/dist/common/errors/stats.js +7 -0
- package/dist/common/errors/stats.js.map +1 -1
- package/dist/common/errors/webex-errors.js +5 -29
- package/dist/common/errors/webex-errors.js.map +1 -1
- package/dist/common/errors/webex-meetings-error.js +5 -2
- package/dist/common/errors/webex-meetings-error.js.map +1 -1
- package/dist/common/events/events-scope.js.map +1 -1
- package/dist/common/events/events.js.map +1 -1
- package/dist/common/events/trigger-proxy.js.map +1 -1
- package/dist/common/events/util.js.map +1 -1
- package/dist/common/logs/logger-config.js.map +1 -1
- package/dist/common/logs/logger-proxy.js.map +1 -1
- package/dist/common/logs/request.js +3 -0
- package/dist/common/logs/request.js.map +1 -1
- package/dist/common/queue.js.map +1 -1
- package/dist/config.js +1 -0
- package/dist/config.js.map +1 -1
- package/dist/constants.js +15 -74
- package/dist/constants.js.map +1 -1
- package/dist/locus-info/controlsUtils.js.map +1 -1
- package/dist/locus-info/embeddedAppsUtils.js.map +1 -1
- package/dist/locus-info/fullState.js.map +1 -1
- package/dist/locus-info/hostUtils.js.map +1 -1
- package/dist/locus-info/index.js +43 -5
- package/dist/locus-info/index.js.map +1 -1
- package/dist/locus-info/infoUtils.js +4 -0
- package/dist/locus-info/infoUtils.js.map +1 -1
- package/dist/locus-info/mediaSharesUtils.js.map +1 -1
- package/dist/locus-info/parser.js +12 -3
- package/dist/locus-info/parser.js.map +1 -1
- package/dist/locus-info/selfUtils.js.map +1 -1
- package/dist/media/index.js +71 -210
- package/dist/media/index.js.map +1 -1
- package/dist/media/internal-media-core-wrapper.js +22 -0
- package/dist/media/internal-media-core-wrapper.js.map +1 -0
- package/dist/media/properties.js +32 -25
- package/dist/media/properties.js.map +1 -1
- package/dist/media/util.js +0 -27
- package/dist/media/util.js.map +1 -1
- package/dist/mediaQualityMetrics/config.js.map +1 -1
- package/dist/meeting/effectsState.js +8 -1
- package/dist/meeting/effectsState.js.map +1 -1
- package/dist/meeting/index.js +1130 -647
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting/muteState.js +6 -0
- package/dist/meeting/muteState.js.map +1 -1
- package/dist/meeting/request.js +55 -24
- package/dist/meeting/request.js.map +1 -1
- package/dist/meeting/state.js.map +1 -1
- package/dist/meeting/util.js +5 -44
- package/dist/meeting/util.js.map +1 -1
- package/dist/meeting-info/collection.js +4 -1
- package/dist/meeting-info/collection.js.map +1 -1
- package/dist/meeting-info/index.js +5 -0
- package/dist/meeting-info/index.js.map +1 -1
- package/dist/meeting-info/meeting-info-v2.js +14 -2
- package/dist/meeting-info/meeting-info-v2.js.map +1 -1
- package/dist/meeting-info/request.js +3 -0
- package/dist/meeting-info/request.js.map +1 -1
- package/dist/meeting-info/util.js.map +1 -1
- package/dist/meeting-info/utilv2.js.map +1 -1
- package/dist/meetings/collection.js +4 -1
- package/dist/meetings/collection.js.map +1 -1
- package/dist/meetings/index.js +136 -25
- package/dist/meetings/index.js.map +1 -1
- package/dist/meetings/request.js +4 -0
- package/dist/meetings/request.js.map +1 -1
- package/dist/meetings/util.js +24 -1
- package/dist/meetings/util.js.map +1 -1
- package/dist/member/index.js +30 -7
- package/dist/member/index.js.map +1 -1
- package/dist/member/util.js +2 -1
- package/dist/member/util.js.map +1 -1
- package/dist/members/collection.js +1 -0
- package/dist/members/collection.js.map +1 -1
- package/dist/members/index.js +82 -1
- package/dist/members/index.js.map +1 -1
- package/dist/members/request.js +19 -9
- package/dist/members/request.js.map +1 -1
- package/dist/members/util.js.map +1 -1
- package/dist/metrics/config.js.map +1 -1
- package/dist/metrics/constants.js.map +1 -1
- package/dist/metrics/index.js +8 -0
- package/dist/metrics/index.js.map +1 -1
- package/dist/multistream/mediaRequestManager.js +133 -0
- package/dist/multistream/mediaRequestManager.js.map +1 -0
- package/dist/multistream/multistreamMedia.js +116 -0
- package/dist/multistream/multistreamMedia.js.map +1 -0
- package/dist/multistream/receiveSlot.js +209 -0
- package/dist/multistream/receiveSlot.js.map +1 -0
- package/dist/multistream/receiveSlotManager.js +195 -0
- package/dist/multistream/receiveSlotManager.js.map +1 -0
- package/dist/multistream/remoteMedia.js +289 -0
- package/dist/multistream/remoteMedia.js.map +1 -0
- package/dist/multistream/remoteMediaGroup.js +243 -0
- package/dist/multistream/remoteMediaGroup.js.map +1 -0
- package/dist/multistream/remoteMediaManager.js +1113 -0
- package/dist/multistream/remoteMediaManager.js.map +1 -0
- package/dist/networkQualityMonitor/index.js +10 -2
- package/dist/networkQualityMonitor/index.js.map +1 -1
- package/dist/personal-meeting-room/index.js +11 -0
- package/dist/personal-meeting-room/index.js.map +1 -1
- package/dist/personal-meeting-room/request.js +2 -1
- package/dist/personal-meeting-room/request.js.map +1 -1
- package/dist/personal-meeting-room/util.js.map +1 -1
- package/dist/reachability/index.js +17 -7
- package/dist/reachability/index.js.map +1 -1
- package/dist/reachability/request.js +1 -0
- package/dist/reachability/request.js.map +1 -1
- package/dist/reconnection-manager/index.js +130 -132
- package/dist/reconnection-manager/index.js.map +1 -1
- package/dist/roap/index.js +58 -231
- package/dist/roap/index.js.map +1 -1
- package/dist/roap/request.js +7 -116
- package/dist/roap/request.js.map +1 -1
- package/dist/roap/turnDiscovery.js +20 -6
- package/dist/roap/turnDiscovery.js.map +1 -1
- package/dist/statsAnalyzer/global.js +2 -0
- package/dist/statsAnalyzer/global.js.map +1 -1
- package/dist/statsAnalyzer/index.js +58 -37
- package/dist/statsAnalyzer/index.js.map +1 -1
- package/dist/statsAnalyzer/mqaUtil.js +9 -3
- package/dist/statsAnalyzer/mqaUtil.js.map +1 -1
- package/dist/transcription/index.js +10 -3
- package/dist/transcription/index.js.map +1 -1
- package/package.json +21 -20
- package/src/common/{browser-detection.js → browser-detection.ts} +1 -1
- package/src/common/collection.ts +6 -6
- package/src/common/{config.js → config.ts} +1 -1
- package/src/common/errors/{captcha-error.js → captcha-error.ts} +5 -1
- package/src/common/errors/{intent-to-join.js → intent-to-join.ts} +6 -1
- package/src/common/errors/{join-meeting.js → join-meeting.ts} +6 -1
- package/src/common/errors/{media.js → media.ts} +5 -1
- package/src/common/errors/parameter.ts +3 -2
- package/src/common/errors/{password-error.js → password-error.ts} +5 -1
- package/src/common/errors/{permission.js → permission.ts} +5 -1
- package/src/common/errors/{reconnection-in-progress.js → reconnection-in-progress.ts} +0 -0
- package/src/common/errors/{reconnection.js → reconnection.ts} +5 -1
- package/src/common/errors/{stats.js → stats.ts} +5 -1
- package/src/common/errors/{webex-errors.js → webex-errors.ts} +1 -20
- package/src/common/errors/{webex-meetings-error.js → webex-meetings-error.ts} +3 -1
- package/src/common/events/{events-scope.js → events-scope.ts} +1 -1
- package/src/common/events/{events.js → events.ts} +0 -0
- package/src/common/events/{trigger-proxy.js → trigger-proxy.ts} +1 -2
- package/src/common/events/{util.js → util.ts} +1 -1
- package/src/common/logs/{logger-config.js → logger-config.ts} +1 -2
- package/src/common/logs/{logger-proxy.js → logger-proxy.ts} +1 -1
- package/src/common/logs/{request.js → request.ts} +12 -2
- package/src/common/queue.ts +1 -2
- package/src/{config.js → config.ts} +2 -0
- package/src/constants.ts +139 -179
- package/src/locus-info/{controlsUtils.js → controlsUtils.ts} +4 -4
- package/src/locus-info/{embeddedAppsUtils.js → embeddedAppsUtils.ts} +5 -6
- package/src/locus-info/{fullState.js → fullState.ts} +1 -1
- package/src/locus-info/{hostUtils.js → hostUtils.ts} +5 -5
- package/src/locus-info/{index.js → index.ts} +67 -32
- package/src/locus-info/{infoUtils.js → infoUtils.ts} +7 -4
- package/src/locus-info/{mediaSharesUtils.js → mediaSharesUtils.ts} +13 -13
- package/src/locus-info/{parser.js → parser.ts} +22 -12
- package/src/locus-info/{selfUtils.js → selfUtils.ts} +17 -19
- package/src/media/{index.js → index.ts} +130 -205
- package/src/media/internal-media-core-wrapper.ts +9 -0
- package/src/media/{properties.js → properties.ts} +35 -29
- package/src/media/util.ts +16 -0
- package/src/mediaQualityMetrics/{config.js → config.ts} +1 -1
- package/src/meeting/{effectsState.js → effectsState.ts} +12 -6
- package/src/meeting/{index.js → index.ts} +1016 -550
- package/src/meeting/{muteState.js → muteState.ts} +16 -11
- package/src/meeting/{request.js → request.ts} +125 -36
- package/src/meeting/{state.js → state.ts} +6 -6
- package/src/meeting/{util.js → util.ts} +9 -51
- package/src/meeting-info/{collection.js → collection.ts} +4 -1
- package/src/meeting-info/{index.js → index.ts} +10 -6
- package/src/meeting-info/{meeting-info-v2.js → meeting-info-v2.ts} +28 -10
- package/src/meeting-info/{request.js → request.ts} +6 -2
- package/src/meeting-info/{util.js → util.ts} +6 -5
- package/src/meeting-info/{utilv2.js → utilv2.ts} +8 -7
- package/src/meetings/{collection.js → collection.ts} +5 -2
- package/src/meetings/{index.js → index.ts} +118 -22
- package/src/meetings/{request.js → request.ts} +6 -1
- package/src/meetings/{util.js → util.ts} +28 -5
- package/src/member/{index.js → index.ts} +46 -15
- package/src/member/{util.js → util.ts} +17 -16
- package/src/members/{collection.js → collection.ts} +2 -1
- package/src/members/{index.js → index.ts} +94 -26
- package/src/members/{request.js → request.ts} +16 -5
- package/src/members/{util.js → util.ts} +7 -7
- package/src/metrics/{config.js → config.ts} +0 -2
- package/src/metrics/{constants.js → constants.ts} +0 -0
- package/src/metrics/{index.js → index.ts} +27 -8
- package/src/multistream/mediaRequestManager.ts +166 -0
- package/src/multistream/multistreamMedia.ts +92 -0
- package/src/multistream/receiveSlot.ts +141 -0
- package/src/multistream/receiveSlotManager.ts +142 -0
- package/src/multistream/remoteMedia.ts +228 -0
- package/src/multistream/remoteMediaGroup.ts +224 -0
- package/src/multistream/remoteMediaManager.ts +911 -0
- package/src/networkQualityMonitor/{index.js → index.ts} +18 -3
- package/src/personal-meeting-room/{index.js → index.ts} +17 -4
- package/src/personal-meeting-room/{request.js → request.ts} +3 -1
- package/src/personal-meeting-room/{util.js → util.ts} +1 -1
- package/src/reachability/{index.js → index.ts} +28 -17
- package/src/reachability/request.ts +4 -2
- package/src/reconnection-manager/{index.js → index.ts} +81 -65
- package/src/roap/index.ts +229 -0
- package/src/roap/{request.js → request.ts} +15 -74
- package/src/roap/turnDiscovery.ts +26 -11
- package/src/statsAnalyzer/{global.js → global.ts} +2 -0
- package/src/statsAnalyzer/{index.js → index.ts} +66 -61
- package/src/statsAnalyzer/{mqaUtil.js → mqaUtil.ts} +6 -1
- package/src/transcription/{index.js → index.ts} +16 -11
- package/test/integration/spec/journey.js +1 -1
- package/test/integration/spec/space-meeting.js +1 -2
- package/test/unit/spec/locus-info/infoUtils.js +17 -1
- package/test/unit/spec/media/index.ts +207 -0
- package/test/unit/spec/media/properties.ts +73 -82
- package/test/unit/spec/meeting/effectsState.js +1 -3
- package/test/unit/spec/meeting/index.js +585 -245
- package/test/unit/spec/meeting/muteState.js +7 -0
- package/test/unit/spec/meeting/utils.js +63 -2
- package/test/unit/spec/meetings/index.js +0 -4
- package/test/unit/spec/members/index.js +164 -2
- package/test/unit/spec/multistream/mediaRequestManager.ts +515 -0
- package/test/unit/spec/multistream/receiveSlot.ts +104 -0
- package/test/unit/spec/multistream/receiveSlotManager.ts +173 -0
- package/test/unit/spec/multistream/remoteMedia.ts +225 -0
- package/test/unit/spec/multistream/remoteMediaGroup.ts +396 -0
- package/test/unit/spec/multistream/remoteMediaManager.ts +1309 -0
- package/test/unit/spec/reconnection-manager/index.js +68 -2
- package/test/unit/spec/roap/index.ts +63 -35
- package/test/unit/spec/stats-analyzer/index.js +19 -22
- package/dist/peer-connection-manager/index.js +0 -794
- package/dist/peer-connection-manager/index.js.map +0 -1
- package/dist/peer-connection-manager/util.js +0 -124
- package/dist/peer-connection-manager/util.js.map +0 -1
- package/dist/roap/collection.js +0 -73
- package/dist/roap/collection.js.map +0 -1
- package/dist/roap/handler.js +0 -337
- package/dist/roap/handler.js.map +0 -1
- package/dist/roap/state.js +0 -164
- package/dist/roap/state.js.map +0 -1
- package/dist/roap/util.js +0 -102
- package/dist/roap/util.js.map +0 -1
- package/src/media/util.js +0 -38
- package/src/peer-connection-manager/index.js +0 -723
- package/src/peer-connection-manager/util.ts +0 -117
- package/src/roap/collection.js +0 -63
- package/src/roap/handler.js +0 -252
- package/src/roap/index.js +0 -380
- package/src/roap/state.js +0 -149
- package/src/roap/util.js +0 -93
- package/test/unit/spec/peerconnection-manager/index.js +0 -188
- package/test/unit/spec/peerconnection-manager/utils.js +0 -48
- package/test/unit/spec/peerconnection-manager/utils.test-fixtures.ts +0 -389
- package/test/unit/spec/roap/util.js +0 -30
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
import * as internalMediaModule from '@webex/plugin-meetings/src/media/internal-media-core-wrapper';
|
|
2
|
+
import Media from '@webex/plugin-meetings/src/media/index';
|
|
3
|
+
import {assert} from '@webex/test-helper-chai';
|
|
4
|
+
import sinon from 'sinon';
|
|
5
|
+
import StaticConfig from '@webex/plugin-meetings/src/common/config';
|
|
6
|
+
|
|
7
|
+
describe('createMediaConnection', () => {
|
|
8
|
+
const fakeRoapMediaConnection = {
|
|
9
|
+
id: 'roap media connection',
|
|
10
|
+
};
|
|
11
|
+
const fakeAudioTrack = {
|
|
12
|
+
id: 'audio track',
|
|
13
|
+
};
|
|
14
|
+
const fakeVideoTrack = {
|
|
15
|
+
id: 'video track',
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
afterEach(() => {
|
|
19
|
+
sinon.restore();
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it('creates a RoapMediaConnection when multistream is disabled', () => {
|
|
23
|
+
const roapMediaConnectionConstructorStub = sinon
|
|
24
|
+
.stub(internalMediaModule, 'RoapMediaConnection')
|
|
25
|
+
.returns(fakeRoapMediaConnection);
|
|
26
|
+
|
|
27
|
+
StaticConfig.set({bandwidth: {audio: 123, video: 456, startBitrate: 999}});
|
|
28
|
+
|
|
29
|
+
const ENABLE_EXTMAP = false;
|
|
30
|
+
const ENABLE_RTX = true;
|
|
31
|
+
|
|
32
|
+
Media.createMediaConnection(false, 'some debug id', {
|
|
33
|
+
mediaProperties: {
|
|
34
|
+
mediaDirection: {
|
|
35
|
+
sendAudio: true,
|
|
36
|
+
sendVideo: true,
|
|
37
|
+
sendShare: false,
|
|
38
|
+
receiveAudio: true,
|
|
39
|
+
receiveVideo: true,
|
|
40
|
+
receiveShare: true,
|
|
41
|
+
},
|
|
42
|
+
audioTrack: fakeAudioTrack,
|
|
43
|
+
videoTrack: fakeVideoTrack,
|
|
44
|
+
shareTrack: null,
|
|
45
|
+
},
|
|
46
|
+
remoteQualityLevel: 'HIGH',
|
|
47
|
+
enableRtx: ENABLE_RTX,
|
|
48
|
+
enableExtmap: ENABLE_EXTMAP,
|
|
49
|
+
turnServerInfo: {
|
|
50
|
+
url: 'turn server url',
|
|
51
|
+
username: 'turn username',
|
|
52
|
+
password: 'turn password',
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
assert.calledOnce(roapMediaConnectionConstructorStub);
|
|
56
|
+
assert.calledWith(
|
|
57
|
+
roapMediaConnectionConstructorStub,
|
|
58
|
+
{
|
|
59
|
+
iceServers: [
|
|
60
|
+
{
|
|
61
|
+
urls: 'turn server url',
|
|
62
|
+
username: 'turn username',
|
|
63
|
+
credential: 'turn password',
|
|
64
|
+
},
|
|
65
|
+
],
|
|
66
|
+
skipInactiveTransceivers: false,
|
|
67
|
+
requireH264: true,
|
|
68
|
+
sdpMunging: {
|
|
69
|
+
convertPort9to0: false,
|
|
70
|
+
addContentSlides: true,
|
|
71
|
+
bandwidthLimits: {
|
|
72
|
+
audio: 123,
|
|
73
|
+
video: 456,
|
|
74
|
+
},
|
|
75
|
+
startBitrate: 999,
|
|
76
|
+
periodicKeyframes: 20,
|
|
77
|
+
disableExtmap: !ENABLE_EXTMAP,
|
|
78
|
+
disableRtx: !ENABLE_RTX,
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
send: {
|
|
83
|
+
audio: fakeAudioTrack,
|
|
84
|
+
video: fakeVideoTrack,
|
|
85
|
+
screenShareVideo: null,
|
|
86
|
+
},
|
|
87
|
+
receive: {
|
|
88
|
+
audio: true,
|
|
89
|
+
video: true,
|
|
90
|
+
screenShareVideo: true,
|
|
91
|
+
remoteQualityLevel: 'HIGH',
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
'some debug id'
|
|
95
|
+
);
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
it('creates a MultistreamRoapMediaConnection when multistream is enabled', () => {
|
|
99
|
+
const multistreamRoapMediaConnectionConstructorStub = sinon
|
|
100
|
+
.stub(internalMediaModule, 'MultistreamRoapMediaConnection')
|
|
101
|
+
.returns(fakeRoapMediaConnection);
|
|
102
|
+
|
|
103
|
+
Media.createMediaConnection(true, 'some debug id', {
|
|
104
|
+
turnServerInfo: {
|
|
105
|
+
url: 'turn server url',
|
|
106
|
+
username: 'turn username',
|
|
107
|
+
password: 'turn password',
|
|
108
|
+
},
|
|
109
|
+
});
|
|
110
|
+
assert.calledOnce(multistreamRoapMediaConnectionConstructorStub);
|
|
111
|
+
assert.calledWith(
|
|
112
|
+
multistreamRoapMediaConnectionConstructorStub,
|
|
113
|
+
{
|
|
114
|
+
iceServers: [
|
|
115
|
+
{
|
|
116
|
+
urls: 'turn server url',
|
|
117
|
+
username: 'turn username',
|
|
118
|
+
credential: 'turn password',
|
|
119
|
+
},
|
|
120
|
+
],
|
|
121
|
+
},
|
|
122
|
+
'some debug id'
|
|
123
|
+
);
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
it('passes empty ICE servers array to MultistreamRoapMediaConnection if turnServerInfo is undefined (multistream enabled)', () => {
|
|
127
|
+
const multistreamRoapMediaConnectionConstructorStub = sinon
|
|
128
|
+
.stub(internalMediaModule, 'MultistreamRoapMediaConnection')
|
|
129
|
+
.returns(fakeRoapMediaConnection);
|
|
130
|
+
|
|
131
|
+
Media.createMediaConnection(true, 'debug string', {});
|
|
132
|
+
assert.calledOnce(multistreamRoapMediaConnectionConstructorStub);
|
|
133
|
+
assert.calledWith(
|
|
134
|
+
multistreamRoapMediaConnectionConstructorStub,
|
|
135
|
+
{
|
|
136
|
+
iceServers: [],
|
|
137
|
+
},
|
|
138
|
+
'debug string'
|
|
139
|
+
);
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
it('passes empty ICE servers array to RoapMediaConnection if turnServerInfo is undefined (multistream disabled)', () => {
|
|
143
|
+
const roapMediaConnectionConstructorStub = sinon
|
|
144
|
+
.stub(internalMediaModule, 'RoapMediaConnection')
|
|
145
|
+
.returns(fakeRoapMediaConnection);
|
|
146
|
+
|
|
147
|
+
StaticConfig.set({bandwidth: {audio: 123, video: 456, startBitrate: 999}});
|
|
148
|
+
|
|
149
|
+
const ENABLE_EXTMAP = false;
|
|
150
|
+
const ENABLE_RTX = true;
|
|
151
|
+
|
|
152
|
+
Media.createMediaConnection(false, 'some debug id', {
|
|
153
|
+
mediaProperties: {
|
|
154
|
+
mediaDirection: {
|
|
155
|
+
sendAudio: true,
|
|
156
|
+
sendVideo: true,
|
|
157
|
+
sendShare: true,
|
|
158
|
+
receiveAudio: true,
|
|
159
|
+
receiveVideo: true,
|
|
160
|
+
receiveShare: true,
|
|
161
|
+
},
|
|
162
|
+
audioTrack: fakeAudioTrack,
|
|
163
|
+
videoTrack: null,
|
|
164
|
+
shareTrack: fakeVideoTrack,
|
|
165
|
+
},
|
|
166
|
+
remoteQualityLevel: 'HIGH',
|
|
167
|
+
enableRtx: ENABLE_RTX,
|
|
168
|
+
enableExtmap: ENABLE_EXTMAP,
|
|
169
|
+
turnServerInfo: undefined,
|
|
170
|
+
});
|
|
171
|
+
assert.calledOnce(roapMediaConnectionConstructorStub);
|
|
172
|
+
assert.calledWith(
|
|
173
|
+
roapMediaConnectionConstructorStub,
|
|
174
|
+
{
|
|
175
|
+
iceServers: [],
|
|
176
|
+
skipInactiveTransceivers: false,
|
|
177
|
+
requireH264: true,
|
|
178
|
+
sdpMunging: {
|
|
179
|
+
convertPort9to0: false,
|
|
180
|
+
addContentSlides: true,
|
|
181
|
+
bandwidthLimits: {
|
|
182
|
+
audio: 123,
|
|
183
|
+
video: 456,
|
|
184
|
+
},
|
|
185
|
+
startBitrate: 999,
|
|
186
|
+
periodicKeyframes: 20,
|
|
187
|
+
disableExtmap: !ENABLE_EXTMAP,
|
|
188
|
+
disableRtx: !ENABLE_RTX,
|
|
189
|
+
},
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
send: {
|
|
193
|
+
audio: fakeAudioTrack,
|
|
194
|
+
video: null,
|
|
195
|
+
screenShareVideo: fakeVideoTrack,
|
|
196
|
+
},
|
|
197
|
+
receive: {
|
|
198
|
+
audio: true,
|
|
199
|
+
video: true,
|
|
200
|
+
screenShareVideo: true,
|
|
201
|
+
remoteQualityLevel: 'HIGH',
|
|
202
|
+
},
|
|
203
|
+
},
|
|
204
|
+
'some debug id'
|
|
205
|
+
);
|
|
206
|
+
});
|
|
207
|
+
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {assert} from '@webex/test-helper-chai';
|
|
2
2
|
import sinon from 'sinon';
|
|
3
|
+
import {MediaConnection as MC} from '@webex/internal-media-core';
|
|
3
4
|
import MediaProperties from '@webex/plugin-meetings/src/media/properties';
|
|
4
5
|
import MediaUtil from '@webex/plugin-meetings/src/media/util';
|
|
5
6
|
import testUtils from '../../../utils/testUtils';
|
|
@@ -8,47 +9,39 @@ import {Defer} from '@webex/common';
|
|
|
8
9
|
|
|
9
10
|
describe('MediaProperties', () => {
|
|
10
11
|
let mediaProperties;
|
|
11
|
-
let
|
|
12
|
+
let mockMC;
|
|
12
13
|
let clock;
|
|
13
14
|
|
|
14
15
|
beforeEach(() => {
|
|
15
16
|
clock = sinon.useFakeTimers();
|
|
16
17
|
|
|
17
|
-
|
|
18
|
+
mockMC = {
|
|
18
19
|
getStats: sinon.stub().resolves([]),
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
on: sinon.stub(),
|
|
21
|
+
off: sinon.stub(),
|
|
22
|
+
getConnectionState: sinon.stub().returns(MC.ConnectionState.Connected),
|
|
22
23
|
};
|
|
23
24
|
|
|
24
|
-
sinon.stub(MediaUtil, 'createPeerConnection').returns(mockPc);
|
|
25
|
-
|
|
26
25
|
mediaProperties = new MediaProperties();
|
|
26
|
+
mediaProperties.setMediaPeerConnection(mockMC);
|
|
27
27
|
});
|
|
28
28
|
|
|
29
29
|
afterEach(() => {
|
|
30
30
|
clock.restore();
|
|
31
31
|
sinon.restore();
|
|
32
32
|
});
|
|
33
|
-
describe('
|
|
33
|
+
describe('waitForMediaConnectionConnected', () => {
|
|
34
34
|
it('resolves immediately if ice state is connected', async () => {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
await mediaProperties.waitForIceConnectedState();
|
|
38
|
-
});
|
|
39
|
-
it('resolves immediately if ice state is completed', async () => {
|
|
40
|
-
mockPc.iceConnectionState = 'completed';
|
|
41
|
-
|
|
42
|
-
await mediaProperties.waitForIceConnectedState();
|
|
35
|
+
await mediaProperties.waitForMediaConnectionConnected();
|
|
43
36
|
});
|
|
44
37
|
it('rejects after timeout if ice state does not reach connected/completed', async () => {
|
|
45
|
-
|
|
38
|
+
mockMC.getConnectionState.returns(MC.ConnectionState.Connecting);
|
|
46
39
|
|
|
47
40
|
let promiseResolved = false;
|
|
48
41
|
let promiseRejected = false;
|
|
49
42
|
|
|
50
43
|
mediaProperties
|
|
51
|
-
.
|
|
44
|
+
.waitForMediaConnectionConnected()
|
|
52
45
|
.then(() => {
|
|
53
46
|
promiseResolved = true;
|
|
54
47
|
})
|
|
@@ -66,128 +59,126 @@ describe('MediaProperties', () => {
|
|
|
66
59
|
assert.equal(promiseRejected, true);
|
|
67
60
|
|
|
68
61
|
// check that listener was registered and removed
|
|
69
|
-
assert.calledOnce(
|
|
70
|
-
assert.equal(
|
|
71
|
-
const listener =
|
|
62
|
+
assert.calledOnce(mockMC.on);
|
|
63
|
+
assert.equal(mockMC.on.getCall(0).args[0], MC.Event.CONNECTION_STATE_CHANGED);
|
|
64
|
+
const listener = mockMC.on.getCall(0).args[1];
|
|
72
65
|
|
|
73
|
-
assert.calledOnce(
|
|
74
|
-
assert.calledWith(
|
|
66
|
+
assert.calledOnce(mockMC.off);
|
|
67
|
+
assert.calledWith(mockMC.off, MC.Event.CONNECTION_STATE_CHANGED, listener);
|
|
75
68
|
});
|
|
76
69
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
mockPc.iceConnectionState = 'connecting';
|
|
70
|
+
it(`resolves when media connection reaches "connected" state`, async () => {
|
|
71
|
+
mockMC.getConnectionState.returns(MC.ConnectionState.Connecting);
|
|
80
72
|
|
|
81
|
-
|
|
73
|
+
const clearTimeoutSpy = sinon.spy(clock, 'clearTimeout');
|
|
82
74
|
|
|
83
|
-
|
|
84
|
-
|
|
75
|
+
let promiseResolved = false;
|
|
76
|
+
let promiseRejected = false;
|
|
85
77
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
78
|
+
mediaProperties
|
|
79
|
+
.waitForMediaConnectionConnected()
|
|
80
|
+
.then(() => {
|
|
81
|
+
promiseResolved = true;
|
|
82
|
+
})
|
|
83
|
+
.catch(() => {
|
|
84
|
+
promiseRejected = true;
|
|
85
|
+
});
|
|
94
86
|
|
|
95
|
-
|
|
96
|
-
|
|
87
|
+
assert.equal(promiseResolved, false);
|
|
88
|
+
assert.equal(promiseRejected, false);
|
|
97
89
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
90
|
+
// check the right listener was registered
|
|
91
|
+
assert.calledOnce(mockMC.on);
|
|
92
|
+
assert.equal(mockMC.on.getCall(0).args[0], MC.Event.CONNECTION_STATE_CHANGED);
|
|
93
|
+
const listener = mockMC.on.getCall(0).args[1];
|
|
102
94
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
95
|
+
// call the listener and pretend we are now connected
|
|
96
|
+
mockMC.getConnectionState.returns(MC.ConnectionState.Connected);
|
|
97
|
+
listener();
|
|
98
|
+
await testUtils.flushPromises();
|
|
107
99
|
|
|
108
|
-
|
|
109
|
-
|
|
100
|
+
assert.equal(promiseResolved, true);
|
|
101
|
+
assert.equal(promiseRejected, false);
|
|
110
102
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
103
|
+
// check that listener was removed
|
|
104
|
+
assert.calledOnce(mockMC.off);
|
|
105
|
+
assert.calledWith(mockMC.off, MC.Event.CONNECTION_STATE_CHANGED, listener);
|
|
114
106
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
);
|
|
107
|
+
assert.calledOnce(clearTimeoutSpy);
|
|
108
|
+
});
|
|
118
109
|
});
|
|
119
110
|
|
|
120
111
|
describe('getCurrentConnectionType', () => {
|
|
121
|
-
it('calls
|
|
122
|
-
const spy = sinon.stub(mediaProperties, '
|
|
112
|
+
it('calls waitForMediaConnectionConnected', async () => {
|
|
113
|
+
const spy = sinon.stub(mediaProperties, 'waitForMediaConnectionConnected');
|
|
123
114
|
|
|
124
115
|
await mediaProperties.getCurrentConnectionType();
|
|
125
116
|
|
|
126
117
|
assert.calledOnce(spy);
|
|
127
118
|
});
|
|
128
|
-
it('calls getStats() only after
|
|
129
|
-
const
|
|
119
|
+
it('calls getStats() only after waitForMediaConnectionConnected resolves', async () => {
|
|
120
|
+
const waitForMediaConnectionConnectedResult = new Defer();
|
|
130
121
|
|
|
131
|
-
const
|
|
132
|
-
.stub(mediaProperties, '
|
|
133
|
-
.returns(
|
|
122
|
+
const waitForMediaConnectionConnectedStub = sinon
|
|
123
|
+
.stub(mediaProperties, 'waitForMediaConnectionConnected')
|
|
124
|
+
.returns(waitForMediaConnectionConnectedResult.promise);
|
|
134
125
|
|
|
135
126
|
const result = mediaProperties.getCurrentConnectionType();
|
|
136
127
|
|
|
137
128
|
await testUtils.flushPromises();
|
|
138
129
|
|
|
139
|
-
assert.called(
|
|
140
|
-
assert.notCalled(
|
|
130
|
+
assert.called(waitForMediaConnectionConnectedStub);
|
|
131
|
+
assert.notCalled(mockMC.getStats);
|
|
141
132
|
|
|
142
|
-
|
|
133
|
+
waitForMediaConnectionConnectedResult.resolve();
|
|
143
134
|
await testUtils.flushPromises();
|
|
144
135
|
|
|
145
|
-
assert.called(
|
|
136
|
+
assert.called(mockMC.getStats);
|
|
146
137
|
await result;
|
|
147
138
|
});
|
|
148
|
-
it('rejects if
|
|
149
|
-
const
|
|
139
|
+
it('rejects if waitForMediaConnectionConnected rejects', async () => {
|
|
140
|
+
const waitForMediaConnectionConnectedResult = new Defer();
|
|
150
141
|
|
|
151
|
-
const
|
|
152
|
-
.stub(mediaProperties, '
|
|
153
|
-
.returns(
|
|
142
|
+
const waitForMediaConnectionConnectedStub = sinon
|
|
143
|
+
.stub(mediaProperties, 'waitForMediaConnectionConnected')
|
|
144
|
+
.returns(waitForMediaConnectionConnectedResult.promise);
|
|
154
145
|
|
|
155
146
|
const result = mediaProperties.getCurrentConnectionType();
|
|
156
147
|
|
|
157
148
|
await testUtils.flushPromises();
|
|
158
149
|
|
|
159
|
-
assert.called(
|
|
150
|
+
assert.called(waitForMediaConnectionConnectedStub);
|
|
160
151
|
|
|
161
|
-
|
|
152
|
+
waitForMediaConnectionConnectedResult.reject(new Error('fake error'));
|
|
162
153
|
await testUtils.flushPromises();
|
|
163
154
|
|
|
164
|
-
assert.notCalled(
|
|
155
|
+
assert.notCalled(mockMC.getStats);
|
|
165
156
|
|
|
166
157
|
await assert.isRejected(result);
|
|
167
158
|
});
|
|
168
159
|
it('returns "unknown" if getStats() fails', async () => {
|
|
169
|
-
|
|
160
|
+
mockMC.getStats.rejects(new Error());
|
|
170
161
|
|
|
171
162
|
const connectionType = await mediaProperties.getCurrentConnectionType();
|
|
172
163
|
assert.equal(connectionType, 'unknown');
|
|
173
164
|
});
|
|
174
165
|
|
|
175
166
|
it('returns "unknown" if getStats() returns no candidate pairs', async () => {
|
|
176
|
-
|
|
167
|
+
mockMC.getStats.resolves([{type: 'something', id: '1234'}]);
|
|
177
168
|
|
|
178
169
|
const connectionType = await mediaProperties.getCurrentConnectionType();
|
|
179
170
|
assert.equal(connectionType, 'unknown');
|
|
180
171
|
});
|
|
181
172
|
|
|
182
173
|
it('returns "unknown" if getStats() returns no successful candidate pair', async () => {
|
|
183
|
-
|
|
174
|
+
mockMC.getStats.resolves([{type: 'candidate-pair', id: '1234', state: 'inprogress'}]);
|
|
184
175
|
|
|
185
176
|
const connectionType = await mediaProperties.getCurrentConnectionType();
|
|
186
177
|
assert.equal(connectionType, 'unknown');
|
|
187
178
|
});
|
|
188
179
|
|
|
189
180
|
it('returns "unknown" if getStats() returns a successful candidate pair but local candidate is missing', async () => {
|
|
190
|
-
|
|
181
|
+
mockMC.getStats.resolves([
|
|
191
182
|
{type: 'candidate-pair', id: '1234', state: 'succeeded', localCandidateId: 'wrong id'},
|
|
192
183
|
]);
|
|
193
184
|
|
|
@@ -196,7 +187,7 @@ describe('MediaProperties', () => {
|
|
|
196
187
|
});
|
|
197
188
|
|
|
198
189
|
it('returns "UDP" if getStats() returns a successful candidate pair with udp local candidate', async () => {
|
|
199
|
-
|
|
190
|
+
mockMC.getStats.resolves([
|
|
200
191
|
{
|
|
201
192
|
type: 'candidate-pair',
|
|
202
193
|
id: 'some candidate pair id',
|
|
@@ -212,7 +203,7 @@ describe('MediaProperties', () => {
|
|
|
212
203
|
});
|
|
213
204
|
|
|
214
205
|
it('returns "TCP" if getStats() returns a successful candidate pair with tcp local candidate', async () => {
|
|
215
|
-
|
|
206
|
+
mockMC.getStats.resolves([
|
|
216
207
|
{
|
|
217
208
|
type: 'candidate-pair',
|
|
218
209
|
id: 'some candidate pair id',
|
|
@@ -233,7 +224,7 @@ describe('MediaProperties', () => {
|
|
|
233
224
|
{relayProtocol: 'udp', expectedConnectionType: 'TURN-UDP'},
|
|
234
225
|
].forEach(({relayProtocol, expectedConnectionType}) =>
|
|
235
226
|
it(`returns "${expectedConnectionType}" if getStats() returns a successful candidate pair with a local candidate with relayProtocol=${relayProtocol}`, async () => {
|
|
236
|
-
|
|
227
|
+
mockMC.getStats.resolves([
|
|
237
228
|
{
|
|
238
229
|
type: 'candidate-pair',
|
|
239
230
|
id: 'some candidate pair id',
|
|
@@ -265,7 +256,7 @@ describe('MediaProperties', () => {
|
|
|
265
256
|
// in real life this will never happen and all active candidate pairs will have same transport,
|
|
266
257
|
// but here we're simulating a situation where they have different transports and just checking
|
|
267
258
|
// that the code still works and just returns the first one
|
|
268
|
-
|
|
259
|
+
mockMC.getStats.resolves([
|
|
269
260
|
{
|
|
270
261
|
type: 'inbound-rtp',
|
|
271
262
|
id: 'whatever',
|
|
@@ -3,7 +3,6 @@ import {assert} from '@webex/test-helper-chai';
|
|
|
3
3
|
import sinon from 'sinon';
|
|
4
4
|
import MockWebex from '@webex/test-helper-mock-webex';
|
|
5
5
|
import {BNR_STATUS} from '@webex/plugin-meetings/src/constants';
|
|
6
|
-
|
|
7
6
|
import BEHAVIORAL_METRICS from '@webex/plugin-meetings/src/metrics/constants';
|
|
8
7
|
import Meeting from '@webex/plugin-meetings/src/meeting';
|
|
9
8
|
import Meetings from '@webex/plugin-meetings';
|
|
@@ -161,7 +160,6 @@ describe('plugin-meetings', () => {
|
|
|
161
160
|
meetings: Meetings
|
|
162
161
|
}
|
|
163
162
|
});
|
|
164
|
-
MediaUtil.createPeerConnection = sinon.stub().returns({});
|
|
165
163
|
meeting = new Meeting(
|
|
166
164
|
{
|
|
167
165
|
userId: uuid1
|
|
@@ -174,7 +172,6 @@ describe('plugin-meetings', () => {
|
|
|
174
172
|
effects = createEffectsState('BNR');
|
|
175
173
|
meeting.canUpdateMedia = sinon.stub().returns(true);
|
|
176
174
|
MeetingUtil.validateOptions = sinon.stub().returns(Promise.resolve());
|
|
177
|
-
MeetingUtil.updateTransceiver = sinon.stub();
|
|
178
175
|
|
|
179
176
|
meeting.addMedia = sinon.stub().returns(Promise.resolve());
|
|
180
177
|
meeting.getMediaStreams = sinon.stub().returns(Promise.resolve());
|
|
@@ -184,6 +181,7 @@ describe('plugin-meetings', () => {
|
|
|
184
181
|
sinon.stub(meeting.mediaProperties, 'mediaDirection').value({
|
|
185
182
|
receiveAudio: true
|
|
186
183
|
});
|
|
184
|
+
sinon.stub(meeting.mediaProperties, 'webrtcMediaConnection').value({updateSendReceiveOptions: sinon.stub()});
|
|
187
185
|
});
|
|
188
186
|
});
|
|
189
187
|
|