@webex/plugin-meetings 3.0.0-beta.35 → 3.0.0-beta.36
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/breakouts/breakout.js +1 -1
- package/dist/breakouts/edit-lock-error.js +52 -0
- package/dist/breakouts/edit-lock-error.js.map +1 -0
- package/dist/breakouts/index.js +86 -2
- package/dist/breakouts/index.js.map +1 -1
- package/dist/constants.js +12 -1
- package/dist/constants.js.map +1 -1
- package/dist/media/index.js +4 -18
- package/dist/media/index.js.map +1 -1
- package/dist/media/properties.js +3 -3
- package/dist/media/properties.js.map +1 -1
- package/dist/meeting/index.js +194 -306
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting/muteState.js +7 -2
- package/dist/meeting/muteState.js.map +1 -1
- package/dist/meeting/util.js +2 -2
- package/dist/meeting/util.js.map +1 -1
- package/dist/metrics/constants.js +0 -4
- package/dist/metrics/constants.js.map +1 -1
- package/dist/reconnection-manager/index.js +1 -2
- package/dist/reconnection-manager/index.js.map +1 -1
- package/dist/types/breakouts/edit-lock-error.d.ts +15 -0
- package/dist/types/constants.d.ts +11 -0
- package/dist/types/media/properties.d.ts +7 -6
- package/dist/types/meeting/index.d.ts +11 -36
- package/dist/types/metrics/constants.d.ts +0 -4
- package/package.json +19 -19
- package/src/breakouts/README.md +8 -2
- package/src/breakouts/edit-lock-error.ts +25 -0
- package/src/breakouts/index.ts +73 -0
- package/src/constants.ts +11 -0
- package/src/media/index.ts +14 -24
- package/src/media/properties.ts +16 -10
- package/src/meeting/index.ts +122 -204
- package/src/meeting/muteState.ts +5 -5
- package/src/meeting/util.ts +5 -4
- package/src/metrics/constants.ts +0 -4
- package/src/reconnection-manager/index.ts +1 -1
- package/test/integration/spec/converged-space-meetings.js +3 -3
- package/test/integration/spec/journey.js +3 -3
- package/test/unit/spec/breakouts/edit-lock-error.ts +30 -0
- package/test/unit/spec/breakouts/index.ts +92 -1
- package/test/unit/spec/media/index.ts +8 -6
- package/test/unit/spec/meeting/index.js +87 -114
- package/test/unit/spec/meeting/muteState.js +21 -22
- package/test/unit/spec/meeting/utils.js +3 -1
- package/test/utils/testUtils.js +30 -25
- package/dist/meeting/effectsState.js +0 -262
- package/dist/meeting/effectsState.js.map +0 -1
- package/dist/types/meeting/effectsState.d.ts +0 -42
- package/src/meeting/effectsState.ts +0 -211
- package/test/unit/spec/meeting/effectsState.js +0 -285
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { LocalCameraTrack, LocalMicrophoneTrack, LocalDisplayTrack } from '@webex/internal-media-core';
|
|
1
2
|
/**
|
|
2
3
|
* @class MediaProperties
|
|
3
4
|
*/
|
|
4
5
|
export default class MediaProperties {
|
|
5
|
-
audioTrack:
|
|
6
|
+
audioTrack: LocalMicrophoneTrack | null;
|
|
6
7
|
localQualityLevel: any;
|
|
7
8
|
mediaDirection: any;
|
|
8
9
|
mediaSettings: any;
|
|
@@ -11,9 +12,9 @@ export default class MediaProperties {
|
|
|
11
12
|
remoteQualityLevel: any;
|
|
12
13
|
remoteShare: any;
|
|
13
14
|
remoteVideoTrack: any;
|
|
14
|
-
shareTrack:
|
|
15
|
+
shareTrack: LocalDisplayTrack | null;
|
|
15
16
|
videoDeviceId: any;
|
|
16
|
-
videoTrack:
|
|
17
|
+
videoTrack: LocalCameraTrack | null;
|
|
17
18
|
namespace: string;
|
|
18
19
|
/**
|
|
19
20
|
* @param {Object} [options] -- to auto construct
|
|
@@ -28,10 +29,10 @@ export default class MediaProperties {
|
|
|
28
29
|
setMediaDirection(mediaDirection: any): void;
|
|
29
30
|
setMediaSettings(type: any, values: any): void;
|
|
30
31
|
setMediaPeerConnection(mediaPeerConnection: any): void;
|
|
31
|
-
setLocalVideoTrack(videoTrack:
|
|
32
|
-
setLocalAudioTrack(audioTrack:
|
|
32
|
+
setLocalVideoTrack(videoTrack: LocalCameraTrack | null): void;
|
|
33
|
+
setLocalAudioTrack(audioTrack: LocalMicrophoneTrack | null): void;
|
|
33
34
|
setLocalQualityLevel(localQualityLevel: any): void;
|
|
34
|
-
setLocalShareTrack(shareTrack:
|
|
35
|
+
setLocalShareTrack(shareTrack: LocalDisplayTrack | null): void;
|
|
35
36
|
setRemoteQualityLevel(remoteQualityLevel: any): void;
|
|
36
37
|
setRemoteShare(remoteShare: any): void;
|
|
37
38
|
/**
|
|
@@ -290,7 +290,6 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
290
290
|
destination: string;
|
|
291
291
|
destinationType: string;
|
|
292
292
|
deviceUrl: string;
|
|
293
|
-
effects: any;
|
|
294
293
|
hostId: string;
|
|
295
294
|
id: string;
|
|
296
295
|
isMultistream: boolean;
|
|
@@ -838,7 +837,7 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
838
837
|
private sendLocalMediaReadyEvent;
|
|
839
838
|
/**
|
|
840
839
|
* Sets the local audio track on the class and emits an event to the developer
|
|
841
|
-
* @param {MediaStreamTrack}
|
|
840
|
+
* @param {MediaStreamTrack} rawAudioTrack
|
|
842
841
|
* @param {Boolean} emitEvent if true, a media ready event is emitted to the developer
|
|
843
842
|
* @returns {undefined}
|
|
844
843
|
* @private
|
|
@@ -847,7 +846,7 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
847
846
|
private setLocalAudioTrack;
|
|
848
847
|
/**
|
|
849
848
|
* Sets the local video track on the class and emits an event to the developer
|
|
850
|
-
* @param {MediaStreamTrack}
|
|
849
|
+
* @param {MediaStreamTrack} rawVideoTrack
|
|
851
850
|
* @param {Boolean} emitEvent if true, a media ready event is emitted to the developer
|
|
852
851
|
* @returns {undefined}
|
|
853
852
|
* @private
|
|
@@ -864,12 +863,12 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
864
863
|
setLocalTracks(localStream: any): void;
|
|
865
864
|
/**
|
|
866
865
|
* Sets the local media stream on the class and emits an event to the developer
|
|
867
|
-
* @param {MediaStreamTrack}
|
|
866
|
+
* @param {MediaStreamTrack} rawLocalShareTrack the local share media track
|
|
868
867
|
* @returns {undefined}
|
|
869
868
|
* @public
|
|
870
869
|
* @memberof Meeting
|
|
871
870
|
*/
|
|
872
|
-
setLocalShareTrack(
|
|
871
|
+
setLocalShareTrack(rawLocalShareTrack: MediaStreamTrack | null): void;
|
|
873
872
|
/**
|
|
874
873
|
* Closes the local stream from the class and emits an event to the developer
|
|
875
874
|
* @returns {undefined}
|
|
@@ -1165,6 +1164,12 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
1165
1164
|
*/
|
|
1166
1165
|
setupStatsAnalyzerEventHandlers: () => void;
|
|
1167
1166
|
getMediaConnectionDebugId(): string;
|
|
1167
|
+
/**
|
|
1168
|
+
* Creates a webrtc media connection
|
|
1169
|
+
*
|
|
1170
|
+
* @param {Object} turnServerInfo TURN server information
|
|
1171
|
+
* @returns {RoapMediaConnection | MultistreamRoapMediaConnection}
|
|
1172
|
+
*/
|
|
1168
1173
|
createMediaConnection(turnServerInfo: any): any;
|
|
1169
1174
|
/**
|
|
1170
1175
|
* Listens for an event emitted by eventEmitter and emits it from the meeting object
|
|
@@ -1532,8 +1537,7 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
1532
1537
|
private sendNetworkQualityEvent;
|
|
1533
1538
|
/**
|
|
1534
1539
|
* Handle logging the media
|
|
1535
|
-
* @param {Object}
|
|
1536
|
-
* @param {Object} videoTrack The video track
|
|
1540
|
+
* @param {Object} mediaProperties
|
|
1537
1541
|
* @private
|
|
1538
1542
|
* @returns {undefined}
|
|
1539
1543
|
*/
|
|
@@ -1632,35 +1636,6 @@ export default class Meeting extends StatelessWebexPlugin {
|
|
|
1632
1636
|
* @memberof Meeting
|
|
1633
1637
|
*/
|
|
1634
1638
|
clearMeetingData: () => void;
|
|
1635
|
-
/**
|
|
1636
|
-
* Internal API to return status of BNR
|
|
1637
|
-
* @returns {Boolean}
|
|
1638
|
-
* @public
|
|
1639
|
-
* @memberof Meeting
|
|
1640
|
-
*/
|
|
1641
|
-
isBnrEnabled(): any;
|
|
1642
|
-
/**
|
|
1643
|
-
* Internal API to obtain BNR enabled MediaStream
|
|
1644
|
-
* @returns {Promise<MediaStreamTrack>}
|
|
1645
|
-
* @private
|
|
1646
|
-
* @param {MedaiStreamTrack} audioTrack from updateAudio
|
|
1647
|
-
* @memberof Meeting
|
|
1648
|
-
*/
|
|
1649
|
-
private internal_enableBNR;
|
|
1650
|
-
/**
|
|
1651
|
-
* Enable the audio track with BNR for a meeting
|
|
1652
|
-
* @returns {Promise} resolves the data from enable bnr or rejects if there is no audio or audio is muted
|
|
1653
|
-
* @public
|
|
1654
|
-
* @memberof Meeting
|
|
1655
|
-
*/
|
|
1656
|
-
enableBNR(): any;
|
|
1657
|
-
/**
|
|
1658
|
-
* Disable the BNR for an audio track
|
|
1659
|
-
* @returns {Promise} resolves the data from disable bnr or rejects if there is no audio set
|
|
1660
|
-
* @public
|
|
1661
|
-
* @memberof Meeting
|
|
1662
|
-
*/
|
|
1663
|
-
disableBNR(): any;
|
|
1664
1639
|
/**
|
|
1665
1640
|
* starts keepAlives being sent
|
|
1666
1641
|
* @returns {void}
|
|
@@ -37,10 +37,6 @@ declare const BEHAVIORAL_METRICS: {
|
|
|
37
37
|
INVALID_ICE_CANDIDATE: string;
|
|
38
38
|
UPLOAD_LOGS_FAILURE: string;
|
|
39
39
|
RECEIVE_TRANSCRIPTION_FAILURE: string;
|
|
40
|
-
ENABLE_BNR_SUCCESS: string;
|
|
41
|
-
ENABLE_BNR_FAILURE: string;
|
|
42
|
-
DISABLE_BNR_SUCCESS: string;
|
|
43
|
-
DISABLE_BNR_FAILURE: string;
|
|
44
40
|
FETCH_MEETING_INFO_V1_SUCCESS: string;
|
|
45
41
|
FETCH_MEETING_INFO_V1_FAILURE: string;
|
|
46
42
|
ADHOC_MEETING_SUCCESS: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webex/plugin-meetings",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.36",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "Cisco EULA (https://www.cisco.com/c/en/us/products/end-user-license-agreement.html)",
|
|
6
6
|
"contributors": [
|
|
@@ -32,12 +32,12 @@
|
|
|
32
32
|
"build": "yarn run -T tsc --declaration true --declarationDir ./dist/types"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@webex/plugin-meetings": "3.0.0-beta.
|
|
36
|
-
"@webex/test-helper-chai": "3.0.0-beta.
|
|
37
|
-
"@webex/test-helper-mocha": "3.0.0-beta.
|
|
38
|
-
"@webex/test-helper-mock-webex": "3.0.0-beta.
|
|
39
|
-
"@webex/test-helper-retry": "3.0.0-beta.
|
|
40
|
-
"@webex/test-helper-test-users": "3.0.0-beta.
|
|
35
|
+
"@webex/plugin-meetings": "3.0.0-beta.36",
|
|
36
|
+
"@webex/test-helper-chai": "3.0.0-beta.36",
|
|
37
|
+
"@webex/test-helper-mocha": "3.0.0-beta.36",
|
|
38
|
+
"@webex/test-helper-mock-webex": "3.0.0-beta.36",
|
|
39
|
+
"@webex/test-helper-retry": "3.0.0-beta.36",
|
|
40
|
+
"@webex/test-helper-test-users": "3.0.0-beta.36",
|
|
41
41
|
"chai": "^4.3.4",
|
|
42
42
|
"chai-as-promised": "^7.1.1",
|
|
43
43
|
"jsdom-global": "3.0.2",
|
|
@@ -46,18 +46,18 @@
|
|
|
46
46
|
"typescript": "^4.7.4"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@webex/common": "3.0.0-beta.
|
|
50
|
-
"@webex/internal-media-core": "1.35.
|
|
51
|
-
"@webex/internal-plugin-conversation": "3.0.0-beta.
|
|
52
|
-
"@webex/internal-plugin-device": "3.0.0-beta.
|
|
53
|
-
"@webex/internal-plugin-llm": "3.0.0-beta.
|
|
54
|
-
"@webex/internal-plugin-mercury": "3.0.0-beta.
|
|
55
|
-
"@webex/internal-plugin-metrics": "3.0.0-beta.
|
|
56
|
-
"@webex/internal-plugin-support": "3.0.0-beta.
|
|
57
|
-
"@webex/internal-plugin-user": "3.0.0-beta.
|
|
58
|
-
"@webex/plugin-people": "3.0.0-beta.
|
|
59
|
-
"@webex/plugin-rooms": "3.0.0-beta.
|
|
60
|
-
"@webex/webex-core": "3.0.0-beta.
|
|
49
|
+
"@webex/common": "3.0.0-beta.36",
|
|
50
|
+
"@webex/internal-media-core": "1.35.1",
|
|
51
|
+
"@webex/internal-plugin-conversation": "3.0.0-beta.36",
|
|
52
|
+
"@webex/internal-plugin-device": "3.0.0-beta.36",
|
|
53
|
+
"@webex/internal-plugin-llm": "3.0.0-beta.36",
|
|
54
|
+
"@webex/internal-plugin-mercury": "3.0.0-beta.36",
|
|
55
|
+
"@webex/internal-plugin-metrics": "3.0.0-beta.36",
|
|
56
|
+
"@webex/internal-plugin-support": "3.0.0-beta.36",
|
|
57
|
+
"@webex/internal-plugin-user": "3.0.0-beta.36",
|
|
58
|
+
"@webex/plugin-people": "3.0.0-beta.36",
|
|
59
|
+
"@webex/plugin-rooms": "3.0.0-beta.36",
|
|
60
|
+
"@webex/webex-core": "3.0.0-beta.36",
|
|
61
61
|
"ampersand-collection": "^2.0.2",
|
|
62
62
|
"bowser": "^2.11.0",
|
|
63
63
|
"btoa": "^1.2.1",
|
package/src/breakouts/README.md
CHANGED
|
@@ -119,8 +119,14 @@ breakout.remove(participant)
|
|
|
119
119
|
// This can only be done when breakouts are inactive
|
|
120
120
|
breakout.delete()
|
|
121
121
|
|
|
122
|
-
|
|
123
|
-
|
|
122
|
+
/*
|
|
123
|
+
Create breakout sessions, Type is array
|
|
124
|
+
Format: [{'name':'session1', "anyoneCanJoin" : true}]
|
|
125
|
+
*/
|
|
126
|
+
breakouts.create(sessions)
|
|
127
|
+
|
|
128
|
+
// Delete all breakout sessions
|
|
129
|
+
breakouts.clearSessions()
|
|
124
130
|
|
|
125
131
|
// Rename an existing breakout session
|
|
126
132
|
breakout.rename(newSessionName)
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import {ERROR_DICTIONARY} from '../constants';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Extended Error object to signify breakout related errors
|
|
5
|
+
*/
|
|
6
|
+
export default class BreakoutEditLockedError extends Error {
|
|
7
|
+
code: any;
|
|
8
|
+
error: any;
|
|
9
|
+
sdkMessage: any;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
*
|
|
13
|
+
* @constructor
|
|
14
|
+
* @param {String} [message]
|
|
15
|
+
* @param {Object} [error]
|
|
16
|
+
*/
|
|
17
|
+
constructor(message: string = ERROR_DICTIONARY.BREAKOUT_EDIT.MESSAGE, error: any = null) {
|
|
18
|
+
super(message);
|
|
19
|
+
this.name = ERROR_DICTIONARY.BREAKOUT_EDIT.NAME;
|
|
20
|
+
this.sdkMessage = ERROR_DICTIONARY.BREAKOUT_EDIT.MESSAGE;
|
|
21
|
+
this.error = error;
|
|
22
|
+
this.stack = error ? error.stack : new Error().stack;
|
|
23
|
+
this.code = ERROR_DICTIONARY.BREAKOUT_EDIT.CODE;
|
|
24
|
+
}
|
|
25
|
+
}
|
package/src/breakouts/index.ts
CHANGED
|
@@ -10,6 +10,7 @@ import {BREAKOUTS, HTTP_VERBS, MEETINGS} from '../constants';
|
|
|
10
10
|
import Breakout from './breakout';
|
|
11
11
|
import BreakoutCollection from './collection';
|
|
12
12
|
import BreakoutRequest from './request';
|
|
13
|
+
import BreakoutEditLockedError from './edit-lock-error';
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
16
|
* @class Breakouts
|
|
@@ -34,6 +35,7 @@ const Breakouts = WebexPlugin.extend({
|
|
|
34
35
|
url: 'string', // appears from the moment you enable breakouts
|
|
35
36
|
locusUrl: 'string', // the current locus url
|
|
36
37
|
breakoutServiceUrl: 'string', // the current breakout resouce url
|
|
38
|
+
groups: 'array', // appears when create breakouts
|
|
37
39
|
},
|
|
38
40
|
|
|
39
41
|
children: {
|
|
@@ -348,6 +350,77 @@ const Breakouts = WebexPlugin.extend({
|
|
|
348
350
|
},
|
|
349
351
|
});
|
|
350
352
|
},
|
|
353
|
+
|
|
354
|
+
/**
|
|
355
|
+
* Create new breakout sessions
|
|
356
|
+
* @param {object} sessions -- breakout session group
|
|
357
|
+
* @returns {Promise}
|
|
358
|
+
*/
|
|
359
|
+
async create(sessions) {
|
|
360
|
+
// @ts-ignore
|
|
361
|
+
const breakInfo = await this.webex
|
|
362
|
+
.request({
|
|
363
|
+
method: HTTP_VERBS.PUT,
|
|
364
|
+
uri: this.url,
|
|
365
|
+
body: {
|
|
366
|
+
groups: [
|
|
367
|
+
{
|
|
368
|
+
sessions,
|
|
369
|
+
},
|
|
370
|
+
],
|
|
371
|
+
},
|
|
372
|
+
})
|
|
373
|
+
.catch((error) => {
|
|
374
|
+
if (error.body && error.body.errorCode === BREAKOUTS.ERROR_CODE.EDIT_LOCK_TOKEN_MISMATCH) {
|
|
375
|
+
LoggerProxy.logger.info(`Breakouts#create --> Edit lock token mismatch`);
|
|
376
|
+
|
|
377
|
+
return Promise.reject(new BreakoutEditLockedError('Edit lock token mismatch', error));
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
return Promise.reject(error);
|
|
381
|
+
});
|
|
382
|
+
|
|
383
|
+
if (breakInfo.body && breakInfo.body.groups && breakInfo.body.groups) {
|
|
384
|
+
this.set('groups', breakInfo.body.groups);
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
return Promise.resolve(breakInfo);
|
|
388
|
+
},
|
|
389
|
+
|
|
390
|
+
/**
|
|
391
|
+
* Delete all breakout sessions
|
|
392
|
+
* @returns {Promise}
|
|
393
|
+
*/
|
|
394
|
+
async clearSessions() {
|
|
395
|
+
// @ts-ignore
|
|
396
|
+
const breakInfo = await this.webex
|
|
397
|
+
.request({
|
|
398
|
+
method: HTTP_VERBS.PUT,
|
|
399
|
+
uri: this.url,
|
|
400
|
+
body: {
|
|
401
|
+
groups: [
|
|
402
|
+
{
|
|
403
|
+
action: BREAKOUTS.ACTION_TYPES.DELETE,
|
|
404
|
+
},
|
|
405
|
+
],
|
|
406
|
+
},
|
|
407
|
+
})
|
|
408
|
+
.catch((error) => {
|
|
409
|
+
if (error.body && error.body.errorCode === BREAKOUTS.ERROR_CODE.EDIT_LOCK_TOKEN_MISMATCH) {
|
|
410
|
+
LoggerProxy.logger.info(`Breakouts#clearSessions --> Edit lock token mismatch`);
|
|
411
|
+
|
|
412
|
+
return Promise.reject(new BreakoutEditLockedError('Edit lock token mismatch', error));
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
return Promise.reject(error);
|
|
416
|
+
});
|
|
417
|
+
|
|
418
|
+
if (breakInfo.body && breakInfo.body.groups && breakInfo.body.groups) {
|
|
419
|
+
this.set('groups', breakInfo.body.groups);
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
return Promise.resolve(breakInfo);
|
|
423
|
+
},
|
|
351
424
|
});
|
|
352
425
|
|
|
353
426
|
export default Breakouts;
|
package/src/constants.ts
CHANGED
|
@@ -452,6 +452,11 @@ export const ERROR_DICTIONARY = {
|
|
|
452
452
|
MESSAGE: 'Captcha is required.',
|
|
453
453
|
CODE: 8,
|
|
454
454
|
},
|
|
455
|
+
BREAKOUT_EDIT: {
|
|
456
|
+
NAME: 'BreakoutEditLockedError',
|
|
457
|
+
MESSAGE: 'Edit lock token mismatch',
|
|
458
|
+
CODE: 9,
|
|
459
|
+
},
|
|
455
460
|
};
|
|
456
461
|
|
|
457
462
|
export const FLOOR_ACTION = {
|
|
@@ -538,6 +543,12 @@ export const BREAKOUTS = {
|
|
|
538
543
|
REQUESTED: 'requested',
|
|
539
544
|
},
|
|
540
545
|
BREAKOUTS_SUPPORTED: 'BREAKOUTS_SUPPORTED',
|
|
546
|
+
ACTION_TYPES: {
|
|
547
|
+
DELETE: 'DELETE',
|
|
548
|
+
},
|
|
549
|
+
ERROR_CODE: {
|
|
550
|
+
EDIT_LOCK_TOKEN_MISMATCH: 201409024,
|
|
551
|
+
},
|
|
541
552
|
};
|
|
542
553
|
|
|
543
554
|
export const LOCUSINFO = {
|
package/src/media/index.ts
CHANGED
|
@@ -3,7 +3,13 @@
|
|
|
3
3
|
*/
|
|
4
4
|
/* globals navigator */
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
LocalCameraTrack,
|
|
8
|
+
LocalDisplayTrack,
|
|
9
|
+
LocalMicrophoneTrack,
|
|
10
|
+
RoapMediaConnection,
|
|
11
|
+
MultistreamRoapMediaConnection,
|
|
12
|
+
} from '@webex/internal-media-core';
|
|
7
13
|
import LoggerProxy from '../common/logs/logger-proxy';
|
|
8
14
|
import {AUDIO_INPUT, VIDEO_INPUT, MEDIA_TRACK_CONSTRAINT} from '../constants';
|
|
9
15
|
import Config from '../config';
|
|
@@ -43,22 +49,6 @@ const {isBrowser} = BrowserDetection();
|
|
|
43
49
|
*/
|
|
44
50
|
const Media: any = {};
|
|
45
51
|
|
|
46
|
-
/**
|
|
47
|
-
* @param {boolean} enabled
|
|
48
|
-
* @param {MediaStreamTrack} track
|
|
49
|
-
* @returns {Boolean}
|
|
50
|
-
* @public
|
|
51
|
-
*/
|
|
52
|
-
Media.setLocalTrack = (enabled: boolean, track: MediaStreamTrack) => {
|
|
53
|
-
if (track) {
|
|
54
|
-
track.enabled = enabled;
|
|
55
|
-
|
|
56
|
-
return true;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
return false;
|
|
60
|
-
};
|
|
61
|
-
|
|
62
52
|
/**
|
|
63
53
|
* format the media array for send
|
|
64
54
|
* @param {String} mediaId
|
|
@@ -121,7 +111,7 @@ Media.getLocalMedia = (options: any, config: object) => {
|
|
|
121
111
|
* @param {boolean} [options.enableRtx] applicable only to non-multistream connections
|
|
122
112
|
* @param {boolean} [options.enableExtmap] applicable only to non-multistream connections
|
|
123
113
|
* @param {Object} [options.turnServerInfo]
|
|
124
|
-
* @returns {RoapMediaConnection}
|
|
114
|
+
* @returns {RoapMediaConnection | MultistreamRoapMediaConnection}
|
|
125
115
|
*/
|
|
126
116
|
Media.createMediaConnection = (
|
|
127
117
|
isMultistream: boolean,
|
|
@@ -133,9 +123,9 @@ Media.createMediaConnection = (
|
|
|
133
123
|
receiveVideo: boolean;
|
|
134
124
|
receiveShare: boolean;
|
|
135
125
|
};
|
|
136
|
-
audioTrack?:
|
|
137
|
-
videoTrack?:
|
|
138
|
-
shareTrack?:
|
|
126
|
+
audioTrack?: LocalMicrophoneTrack;
|
|
127
|
+
videoTrack?: LocalCameraTrack;
|
|
128
|
+
shareTrack?: LocalDisplayTrack;
|
|
139
129
|
};
|
|
140
130
|
remoteQualityLevel?: 'LOW' | 'MEDIUM' | 'HIGH';
|
|
141
131
|
enableRtx?: boolean;
|
|
@@ -194,9 +184,9 @@ Media.createMediaConnection = (
|
|
|
194
184
|
},
|
|
195
185
|
{
|
|
196
186
|
send: {
|
|
197
|
-
audio: audioTrack,
|
|
198
|
-
video: videoTrack,
|
|
199
|
-
screenShareVideo: shareTrack,
|
|
187
|
+
audio: audioTrack?.underlyingTrack,
|
|
188
|
+
video: videoTrack?.underlyingTrack,
|
|
189
|
+
screenShareVideo: shareTrack?.underlyingTrack,
|
|
200
190
|
},
|
|
201
191
|
receive: {
|
|
202
192
|
audio: mediaDirection.receiveAudio,
|
package/src/media/properties.ts
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
ConnectionState,
|
|
3
|
+
Event,
|
|
4
|
+
LocalCameraTrack,
|
|
5
|
+
LocalMicrophoneTrack,
|
|
6
|
+
LocalDisplayTrack,
|
|
7
|
+
} from '@webex/internal-media-core';
|
|
2
8
|
|
|
3
9
|
import {MEETINGS, PC_BAIL_TIMEOUT, QUALITY_LEVELS} from '../constants';
|
|
4
10
|
import LoggerProxy from '../common/logs/logger-proxy';
|
|
@@ -7,7 +13,7 @@ import LoggerProxy from '../common/logs/logger-proxy';
|
|
|
7
13
|
* @class MediaProperties
|
|
8
14
|
*/
|
|
9
15
|
export default class MediaProperties {
|
|
10
|
-
audioTrack:
|
|
16
|
+
audioTrack: LocalMicrophoneTrack | null;
|
|
11
17
|
localQualityLevel: any;
|
|
12
18
|
mediaDirection: any;
|
|
13
19
|
mediaSettings: any;
|
|
@@ -16,9 +22,9 @@ export default class MediaProperties {
|
|
|
16
22
|
remoteQualityLevel: any;
|
|
17
23
|
remoteShare: any;
|
|
18
24
|
remoteVideoTrack: any;
|
|
19
|
-
shareTrack:
|
|
25
|
+
shareTrack: LocalDisplayTrack | null;
|
|
20
26
|
videoDeviceId: any;
|
|
21
|
-
videoTrack:
|
|
27
|
+
videoTrack: LocalCameraTrack | null;
|
|
22
28
|
namespace = MEETINGS;
|
|
23
29
|
|
|
24
30
|
/**
|
|
@@ -28,9 +34,9 @@ export default class MediaProperties {
|
|
|
28
34
|
constructor(options: any = {}) {
|
|
29
35
|
this.webrtcMediaConnection = null;
|
|
30
36
|
this.mediaDirection = options.mediaDirection;
|
|
31
|
-
this.videoTrack = options.videoTrack;
|
|
32
|
-
this.audioTrack = options.audioTrack;
|
|
33
|
-
this.shareTrack = options.shareTrack;
|
|
37
|
+
this.videoTrack = options.videoTrack || null;
|
|
38
|
+
this.audioTrack = options.audioTrack || null;
|
|
39
|
+
this.shareTrack = options.shareTrack || null;
|
|
34
40
|
this.remoteShare = options.remoteShare;
|
|
35
41
|
this.remoteAudioTrack = options.remoteAudioTrack;
|
|
36
42
|
this.remoteVideoTrack = options.remoteVideoTrack;
|
|
@@ -60,11 +66,11 @@ export default class MediaProperties {
|
|
|
60
66
|
this.webrtcMediaConnection = mediaPeerConnection;
|
|
61
67
|
}
|
|
62
68
|
|
|
63
|
-
setLocalVideoTrack(videoTrack) {
|
|
69
|
+
setLocalVideoTrack(videoTrack: LocalCameraTrack | null) {
|
|
64
70
|
this.videoTrack = videoTrack;
|
|
65
71
|
}
|
|
66
72
|
|
|
67
|
-
setLocalAudioTrack(audioTrack) {
|
|
73
|
+
setLocalAudioTrack(audioTrack: LocalMicrophoneTrack | null) {
|
|
68
74
|
this.audioTrack = audioTrack;
|
|
69
75
|
}
|
|
70
76
|
|
|
@@ -72,7 +78,7 @@ export default class MediaProperties {
|
|
|
72
78
|
this.localQualityLevel = localQualityLevel;
|
|
73
79
|
}
|
|
74
80
|
|
|
75
|
-
setLocalShareTrack(shareTrack) {
|
|
81
|
+
setLocalShareTrack(shareTrack: LocalDisplayTrack | null) {
|
|
76
82
|
this.shareTrack = shareTrack;
|
|
77
83
|
}
|
|
78
84
|
|