@webex/plugin-meetings 3.0.0-beta.4 → 3.0.0-beta.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webex/plugin-meetings",
3
- "version": "3.0.0-beta.4",
3
+ "version": "3.0.0-beta.6",
4
4
  "description": "",
5
5
  "license": "Cisco EULA (https://www.cisco.com/c/en/us/products/end-user-license-agreement.html)",
6
6
  "contributors": [
@@ -28,12 +28,12 @@
28
28
  ]
29
29
  },
30
30
  "devDependencies": {
31
- "@webex/plugin-meetings": "3.0.0-beta.4",
32
- "@webex/test-helper-chai": "3.0.0-beta.4",
33
- "@webex/test-helper-mocha": "3.0.0-beta.4",
34
- "@webex/test-helper-mock-webex": "3.0.0-beta.4",
35
- "@webex/test-helper-retry": "3.0.0-beta.4",
36
- "@webex/test-helper-test-users": "3.0.0-beta.4",
31
+ "@webex/plugin-meetings": "3.0.0-beta.6",
32
+ "@webex/test-helper-chai": "3.0.0-beta.6",
33
+ "@webex/test-helper-mocha": "3.0.0-beta.6",
34
+ "@webex/test-helper-mock-webex": "3.0.0-beta.6",
35
+ "@webex/test-helper-retry": "3.0.0-beta.6",
36
+ "@webex/test-helper-test-users": "3.0.0-beta.6",
37
37
  "chai": "^4.3.4",
38
38
  "chai-as-promised": "^7.1.1",
39
39
  "jsdom-global": "3.0.2",
@@ -41,18 +41,18 @@
41
41
  "typed-emitter": "^2.1.0"
42
42
  },
43
43
  "dependencies": {
44
- "@webex/common": "3.0.0-beta.4",
44
+ "@webex/common": "3.0.0-beta.6",
45
45
  "@webex/internal-media-core": "^0.0.17-beta",
46
- "@webex/internal-plugin-conversation": "3.0.0-beta.4",
47
- "@webex/internal-plugin-device": "3.0.0-beta.4",
48
- "@webex/internal-plugin-mercury": "3.0.0-beta.4",
49
- "@webex/internal-plugin-metrics": "3.0.0-beta.4",
50
- "@webex/internal-plugin-support": "3.0.0-beta.4",
51
- "@webex/internal-plugin-user": "3.0.0-beta.4",
52
- "@webex/plugin-people": "3.0.0-beta.4",
53
- "@webex/plugin-rooms": "3.0.0-beta.4",
46
+ "@webex/internal-plugin-conversation": "3.0.0-beta.6",
47
+ "@webex/internal-plugin-device": "3.0.0-beta.6",
48
+ "@webex/internal-plugin-mercury": "3.0.0-beta.6",
49
+ "@webex/internal-plugin-metrics": "3.0.0-beta.6",
50
+ "@webex/internal-plugin-support": "3.0.0-beta.6",
51
+ "@webex/internal-plugin-user": "3.0.0-beta.6",
52
+ "@webex/plugin-people": "3.0.0-beta.6",
53
+ "@webex/plugin-rooms": "3.0.0-beta.6",
54
54
  "@webex/ts-sdp": "^1.0.1",
55
- "@webex/webex-core": "3.0.0-beta.4",
55
+ "@webex/webex-core": "3.0.0-beta.6",
56
56
  "bowser": "^2.11.0",
57
57
  "btoa": "^1.2.1",
58
58
  "dotenv": "^4.0.0",
@@ -118,29 +118,30 @@ Media.getLocalMedia = (options, config) => {
118
118
 
119
119
  /**
120
120
  * creates a webrtc media connection with provided tracks and mediaDirection configuration
121
- * @param {Object} mediaProperties only applicable to non-multistream connections, contains mediaDirection and local tracks:
122
- * audioTrack, videoTrack and shareTrack
121
+ *
122
+ * @param {boolean} isMultistream
123
+ * @param {string} debugId string useful for debugging (will appear in media connection logs)
123
124
  * @param {Object} options
124
- * @param {boolean} options.isMultistream
125
+ * @param {Object} [options.mediaProperties] only applicable to non-multistream connections, contains mediaDirection and local tracks:
126
+ * audioTrack, videoTrack and shareTrack
125
127
  * @param {string} [options.remoteQualityLevel] LOW|MEDIUM|HIGH applicable only to non-multistream connections
126
128
  * @param {boolean} [options.enableRtx] applicable only to non-multistream connections
127
129
  * @param {boolean} [options.enableExtmap] applicable only to non-multistream connections
128
130
  * @param {Object} [options.turnServerInfo]
129
131
  * @returns {RoapMediaConnection}
130
132
  */
131
- Media.createMediaConnection = (mediaProperties, {
133
+ Media.createMediaConnection = (
132
134
  isMultistream,
133
- remoteQualityLevel,
134
- enableRtx,
135
- enableExtmap,
136
- turnServerInfo
137
- }) => {
135
+ debugId,
136
+ options
137
+ ) => {
138
138
  const {
139
- mediaDirection,
140
- audioTrack,
141
- videoTrack,
142
- shareTrack
143
- } = mediaProperties;
139
+ mediaProperties,
140
+ remoteQualityLevel,
141
+ enableRtx,
142
+ enableExtmap,
143
+ turnServerInfo
144
+ } = options;
144
145
 
145
146
  const iceServers = [];
146
147
 
@@ -155,9 +156,21 @@ Media.createMediaConnection = (mediaProperties, {
155
156
  if (isMultistream) {
156
157
  return new MultistreamRoapMediaConnection({
157
158
  iceServers,
158
- }, 'mc');
159
+ }, debugId);
159
160
  }
160
161
 
162
+ if (!mediaProperties) {
163
+ throw new Error('mediaProperties have to be provided for non-multistream media connections');
164
+ }
165
+
166
+ const {
167
+ mediaDirection,
168
+ audioTrack,
169
+ videoTrack,
170
+ shareTrack
171
+ } = mediaProperties;
172
+
173
+
161
174
  return new RoapMediaConnection({
162
175
  iceServers,
163
176
  skipInactiveTransceivers: false,
@@ -186,7 +199,7 @@ Media.createMediaConnection = (mediaProperties, {
186
199
  screenShareVideo: mediaDirection.receiveShare,
187
200
  remoteQualityLevel
188
201
  }
189
- }, 'mc');
202
+ }, debugId);
190
203
  };
191
204
 
192
205
  /**
@@ -4435,15 +4435,22 @@ export default class Meeting extends StatelessWebexPlugin {
4435
4435
  });
4436
4436
  };
4437
4437
 
4438
+ getMediaConnectionDebugId() {
4439
+ return `MC-${this.id.substring(0, 4)}`;
4440
+ }
4441
+
4438
4442
  createMediaConnection(turnServerInfo) {
4439
- const mc = Media.createMediaConnection(this.mediaProperties, {
4440
- isMultistream: this.isMultistream,
4441
- meetingId: this.id,
4442
- remoteQualityLevel: this.mediaProperties.remoteQualityLevel,
4443
- enableRtx: this.config.enableRtx,
4444
- enableExtmap: this.config.enableExtmap,
4445
- turnServerInfo
4446
- });
4443
+ const mc = Media.createMediaConnection(
4444
+ this.isMultistream,
4445
+ this.getMediaConnectionDebugId(),
4446
+ {
4447
+ mediaProperties: this.mediaProperties,
4448
+ remoteQualityLevel: this.mediaProperties.remoteQualityLevel,
4449
+ enableRtx: this.config.enableRtx,
4450
+ enableExtmap: this.config.enableExtmap,
4451
+ turnServerInfo
4452
+ }
4453
+ );
4447
4454
 
4448
4455
  this.mediaProperties.setMediaPeerConnection(mc);
4449
4456
  this.setupMediaConnectionListeners();
@@ -29,8 +29,8 @@ describe('createMediaConnection', () => {
29
29
  const ENABLE_EXTMAP = false;
30
30
  const ENABLE_RTX = true;
31
31
 
32
- Media.createMediaConnection(
33
- {
32
+ Media.createMediaConnection(false, 'some debug id', {
33
+ mediaProperties: {
34
34
  mediaDirection: {
35
35
  sendAudio: true,
36
36
  sendVideo: true,
@@ -43,18 +43,15 @@ describe('createMediaConnection', () => {
43
43
  videoTrack: fakeVideoTrack,
44
44
  shareTrack: null,
45
45
  },
46
- {
47
- isMultistream: false,
48
- remoteQualityLevel: 'HIGH',
49
- enableRtx: ENABLE_RTX,
50
- enableExtmap: ENABLE_EXTMAP,
51
- turnServerInfo: {
52
- url: 'turn server url',
53
- username: 'turn username',
54
- password: 'turn password',
55
- },
56
- }
57
- );
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
+ });
58
55
  assert.calledOnce(roapMediaConnectionConstructorStub);
59
56
  assert.calledWith(
60
57
  roapMediaConnectionConstructorStub,
@@ -94,7 +91,7 @@ describe('createMediaConnection', () => {
94
91
  remoteQualityLevel: 'HIGH',
95
92
  },
96
93
  },
97
- 'mc'
94
+ 'some debug id'
98
95
  );
99
96
  });
100
97
 
@@ -103,17 +100,13 @@ describe('createMediaConnection', () => {
103
100
  .stub(internalMediaModule, 'MultistreamRoapMediaConnection')
104
101
  .returns(fakeRoapMediaConnection);
105
102
 
106
- Media.createMediaConnection(
107
- {},
108
- {
109
- isMultistream: true,
110
- turnServerInfo: {
111
- url: 'turn server url',
112
- username: 'turn username',
113
- password: 'turn password',
114
- },
115
- }
116
- );
103
+ Media.createMediaConnection(true, 'some debug id', {
104
+ turnServerInfo: {
105
+ url: 'turn server url',
106
+ username: 'turn username',
107
+ password: 'turn password',
108
+ },
109
+ });
117
110
  assert.calledOnce(multistreamRoapMediaConnectionConstructorStub);
118
111
  assert.calledWith(
119
112
  multistreamRoapMediaConnectionConstructorStub,
@@ -126,7 +119,7 @@ describe('createMediaConnection', () => {
126
119
  },
127
120
  ],
128
121
  },
129
- 'mc'
122
+ 'some debug id'
130
123
  );
131
124
  });
132
125
 
@@ -135,20 +128,14 @@ describe('createMediaConnection', () => {
135
128
  .stub(internalMediaModule, 'MultistreamRoapMediaConnection')
136
129
  .returns(fakeRoapMediaConnection);
137
130
 
138
- Media.createMediaConnection(
139
- {},
140
- {
141
- isMultistream: true,
142
- turnServerInfo: undefined,
143
- }
144
- );
131
+ Media.createMediaConnection(true, 'debug string', {});
145
132
  assert.calledOnce(multistreamRoapMediaConnectionConstructorStub);
146
133
  assert.calledWith(
147
134
  multistreamRoapMediaConnectionConstructorStub,
148
135
  {
149
136
  iceServers: [],
150
137
  },
151
- 'mc'
138
+ 'debug string'
152
139
  );
153
140
  });
154
141
 
@@ -162,8 +149,8 @@ describe('createMediaConnection', () => {
162
149
  const ENABLE_EXTMAP = false;
163
150
  const ENABLE_RTX = true;
164
151
 
165
- Media.createMediaConnection(
166
- {
152
+ Media.createMediaConnection(false, 'some debug id', {
153
+ mediaProperties: {
167
154
  mediaDirection: {
168
155
  sendAudio: true,
169
156
  sendVideo: true,
@@ -176,14 +163,11 @@ describe('createMediaConnection', () => {
176
163
  videoTrack: null,
177
164
  shareTrack: fakeVideoTrack,
178
165
  },
179
- {
180
- isMultistream: false,
181
- remoteQualityLevel: 'HIGH',
182
- enableRtx: ENABLE_RTX,
183
- enableExtmap: ENABLE_EXTMAP,
184
- turnServerInfo: undefined,
185
- }
186
- );
166
+ remoteQualityLevel: 'HIGH',
167
+ enableRtx: ENABLE_RTX,
168
+ enableExtmap: ENABLE_EXTMAP,
169
+ turnServerInfo: undefined,
170
+ });
187
171
  assert.calledOnce(roapMediaConnectionConstructorStub);
188
172
  assert.calledWith(
189
173
  roapMediaConnectionConstructorStub,
@@ -217,7 +201,7 @@ describe('createMediaConnection', () => {
217
201
  remoteQualityLevel: 'HIGH',
218
202
  },
219
203
  },
220
- 'mc'
204
+ 'some debug id'
221
205
  );
222
206
  });
223
207
  });
@@ -1105,7 +1105,7 @@ describe('plugin-meetings', () => {
1105
1105
  assert.calledWith(meeting.roap.doTurnDiscovery, meeting, false);
1106
1106
  assert.calledOnce(meeting.mediaProperties.setMediaDirection);
1107
1107
  assert.calledOnce(Media.createMediaConnection);
1108
- assert.calledWith(Media.createMediaConnection, sinon.match.any, sinon.match({turnServerInfo: undefined}));
1108
+ assert.calledWith(Media.createMediaConnection, false, meeting.getMediaConnectionDebugId(), sinon.match({turnServerInfo: undefined}));
1109
1109
  assert.calledOnce(meeting.setMercuryListener);
1110
1110
  assert.calledOnce(fakeMediaConnection.initiateOffer);
1111
1111
  /* statsAnalyzer is initiated inside of addMedia so there isn't
@@ -1139,7 +1139,7 @@ describe('plugin-meetings', () => {
1139
1139
  assert.calledOnce(meeting.roap.doTurnDiscovery);
1140
1140
  assert.calledWith(meeting.roap.doTurnDiscovery, meeting, false);
1141
1141
  assert.calledOnce(Media.createMediaConnection);
1142
- assert.calledWith(Media.createMediaConnection, sinon.match.any, sinon.match({
1142
+ assert.calledWith(Media.createMediaConnection, false, meeting.getMediaConnectionDebugId(), sinon.match({
1143
1143
  turnServerInfo: {
1144
1144
  url: FAKE_TURN_URL,
1145
1145
  username: FAKE_TURN_USER,