@webex/plugin-meetings 3.0.0-beta.13 → 3.0.0-beta.15
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/UPGRADING.md +9 -9
- package/browsers.js +19 -24
- package/dist/common/browser-detection.js +1 -0
- package/dist/common/browser-detection.js.map +1 -1
- package/dist/common/collection.js.map +1 -1
- package/dist/common/errors/captcha-error.js +5 -5
- package/dist/common/errors/captcha-error.js.map +1 -1
- package/dist/common/errors/intent-to-join.js +5 -5
- package/dist/common/errors/intent-to-join.js.map +1 -1
- package/dist/common/errors/join-meeting.js +6 -6
- package/dist/common/errors/join-meeting.js.map +1 -1
- package/dist/common/errors/media.js +5 -5
- package/dist/common/errors/media.js.map +1 -1
- package/dist/common/errors/parameter.js +5 -5
- package/dist/common/errors/parameter.js.map +1 -1
- package/dist/common/errors/password-error.js +5 -5
- package/dist/common/errors/password-error.js.map +1 -1
- package/dist/common/errors/permission.js +4 -4
- package/dist/common/errors/permission.js.map +1 -1
- package/dist/common/errors/reconnection.js +5 -5
- package/dist/common/errors/reconnection.js.map +1 -1
- package/dist/common/errors/stats.js +5 -5
- package/dist/common/errors/stats.js.map +1 -1
- package/dist/common/errors/webex-errors.js.map +1 -1
- 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-proxy.js.map +1 -1
- package/dist/common/logs/request.js.map +1 -1
- package/dist/config.js.map +1 -1
- package/dist/constants.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/locus-info/controlsUtils.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 +11 -8
- package/dist/locus-info/index.js.map +1 -1
- package/dist/locus-info/infoUtils.js.map +1 -1
- package/dist/locus-info/mediaSharesUtils.js.map +1 -1
- package/dist/locus-info/parser.js +2 -1
- package/dist/locus-info/parser.js.map +1 -1
- package/dist/locus-info/selfUtils.js +2 -1
- package/dist/locus-info/selfUtils.js.map +1 -1
- package/dist/media/index.js.map +1 -1
- package/dist/media/internal-media-core-wrapper.js.map +1 -1
- package/dist/media/properties.js.map +1 -1
- package/dist/media/util.js +1 -1
- package/dist/media/util.js.map +1 -1
- package/dist/mediaQualityMetrics/config.js.map +1 -1
- package/dist/meeting/effectsState.js +1 -1
- package/dist/meeting/effectsState.js.map +1 -1
- package/dist/meeting/in-meeting-actions.js.map +1 -1
- package/dist/meeting/index.js +118 -89
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting/muteState.js +1 -1
- package/dist/meeting/muteState.js.map +1 -1
- package/dist/meeting/request.js +25 -0
- package/dist/meeting/request.js.map +1 -1
- package/dist/meeting/request.type.js +8 -0
- package/dist/meeting/request.type.js.map +1 -0
- package/dist/meeting/state.js +5 -5
- package/dist/meeting/state.js.map +1 -1
- package/dist/meeting/util.js.map +1 -1
- package/dist/meeting-info/collection.js.map +1 -1
- package/dist/meeting-info/index.js +2 -2
- package/dist/meeting-info/index.js.map +1 -1
- package/dist/meeting-info/meeting-info-v2.js +48 -48
- package/dist/meeting-info/meeting-info-v2.js.map +1 -1
- package/dist/meeting-info/request.js.map +1 -1
- package/dist/meeting-info/util.js.map +1 -1
- package/dist/meeting-info/utilv2.js +1 -1
- package/dist/meeting-info/utilv2.js.map +1 -1
- package/dist/meetings/collection.js.map +1 -1
- package/dist/meetings/index.js +251 -250
- package/dist/meetings/index.js.map +1 -1
- package/dist/meetings/request.js +2 -2
- package/dist/meetings/request.js.map +1 -1
- package/dist/meetings/util.js +14 -14
- package/dist/meetings/util.js.map +1 -1
- package/dist/member/index.js +31 -31
- package/dist/member/index.js.map +1 -1
- package/dist/member/util.js.map +1 -1
- package/dist/members/collection.js.map +1 -1
- package/dist/members/index.js +43 -43
- package/dist/members/index.js.map +1 -1
- 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 +23 -20
- package/dist/metrics/index.js.map +1 -1
- package/dist/multistream/multistreamMedia.js +2 -1
- package/dist/multistream/multistreamMedia.js.map +1 -1
- package/dist/multistream/receiveSlot.js.map +1 -1
- package/dist/multistream/receiveSlotManager.js +2 -0
- package/dist/multistream/receiveSlotManager.js.map +1 -1
- package/dist/multistream/remoteMedia.js.map +1 -1
- package/dist/multistream/remoteMediaGroup.js.map +1 -1
- package/dist/multistream/remoteMediaManager.js.map +1 -1
- package/dist/networkQualityMonitor/index.js +8 -8
- package/dist/networkQualityMonitor/index.js.map +1 -1
- package/dist/personal-meeting-room/index.js +7 -7
- package/dist/personal-meeting-room/index.js.map +1 -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.map +1 -1
- package/dist/reachability/request.js.map +1 -1
- package/dist/reactions/reactions.js.map +1 -1
- package/dist/reactions/reactions.type.js +3 -1
- package/dist/reactions/reactions.type.js.map +1 -1
- package/dist/reconnection-manager/index.js +4 -4
- package/dist/reconnection-manager/index.js.map +1 -1
- package/dist/roap/index.js +5 -5
- package/dist/roap/index.js.map +1 -1
- package/dist/roap/request.js.map +1 -1
- package/dist/roap/turnDiscovery.js.map +1 -1
- package/dist/statsAnalyzer/global.js.map +1 -1
- package/dist/statsAnalyzer/index.js.map +1 -1
- package/dist/statsAnalyzer/mqaUtil.js.map +1 -1
- package/dist/transcription/index.js +4 -1
- package/dist/transcription/index.js.map +1 -1
- package/internal-README.md +7 -6
- package/package.json +18 -18
- package/src/common/browser-detection.ts +9 -6
- package/src/common/collection.ts +3 -1
- package/src/common/errors/captcha-error.ts +6 -6
- package/src/common/errors/intent-to-join.ts +6 -6
- package/src/common/errors/join-meeting.ts +12 -8
- package/src/common/errors/media.ts +6 -6
- package/src/common/errors/parameter.ts +9 -6
- package/src/common/errors/password-error.ts +6 -6
- package/src/common/errors/permission.ts +5 -5
- package/src/common/errors/reconnection.ts +6 -6
- package/src/common/errors/stats.ts +6 -6
- package/src/common/errors/webex-errors.ts +7 -5
- package/src/common/errors/webex-meetings-error.ts +1 -1
- package/src/common/events/events-scope.ts +5 -1
- package/src/common/events/events.ts +5 -1
- package/src/common/events/trigger-proxy.ts +8 -3
- package/src/common/events/util.ts +1 -2
- package/src/common/logs/logger-proxy.ts +21 -10
- package/src/common/logs/request.ts +11 -8
- package/src/config.ts +11 -11
- package/src/constants.ts +1 -1
- package/src/index.js +1 -1
- package/src/locus-info/controlsUtils.ts +34 -24
- package/src/locus-info/fullState.ts +15 -11
- package/src/locus-info/hostUtils.ts +4 -3
- package/src/locus-info/index.ts +25 -34
- package/src/locus-info/infoUtils.ts +12 -4
- package/src/locus-info/mediaSharesUtils.ts +4 -4
- package/src/locus-info/parser.ts +45 -68
- package/src/locus-info/selfUtils.ts +106 -57
- package/src/media/index.ts +123 -135
- package/src/media/internal-media-core-wrapper.ts +2 -2
- package/src/media/properties.ts +30 -20
- package/src/media/util.ts +1 -1
- package/src/mediaQualityMetrics/config.ts +46 -46
- package/src/meeting/effectsState.ts +35 -35
- package/src/meeting/in-meeting-actions.ts +7 -3
- package/src/meeting/index.ts +1576 -1291
- package/src/meeting/muteState.ts +62 -31
- package/src/meeting/request.ts +174 -113
- package/src/meeting/request.type.ts +11 -0
- package/src/meeting/state.ts +45 -30
- package/src/meeting/util.ts +101 -70
- package/src/meeting-info/collection.ts +2 -1
- package/src/meeting-info/index.ts +32 -30
- package/src/meeting-info/meeting-info-v2.ts +106 -108
- package/src/meeting-info/request.ts +9 -3
- package/src/meeting-info/util.ts +54 -46
- package/src/meeting-info/utilv2.ts +59 -53
- package/src/meetings/collection.ts +1 -1
- package/src/meetings/index.ts +512 -440
- package/src/meetings/request.ts +26 -24
- package/src/meetings/util.ts +29 -29
- package/src/member/index.ts +55 -49
- package/src/member/util.ts +26 -13
- package/src/members/collection.ts +0 -1
- package/src/members/index.ts +182 -126
- package/src/members/request.ts +46 -14
- package/src/members/util.ts +44 -42
- package/src/metrics/config.ts +254 -81
- package/src/metrics/constants.ts +0 -2
- package/src/metrics/index.ts +84 -71
- package/src/multistream/multistreamMedia.ts +1 -0
- package/src/multistream/receiveSlot.ts +1 -0
- package/src/multistream/receiveSlotManager.ts +1 -0
- package/src/multistream/remoteMedia.ts +1 -1
- package/src/multistream/remoteMediaGroup.ts +2 -1
- package/src/multistream/remoteMediaManager.ts +3 -0
- package/src/networkQualityMonitor/index.ts +20 -23
- package/src/personal-meeting-room/index.ts +12 -16
- package/src/personal-meeting-room/request.ts +10 -3
- package/src/personal-meeting-room/util.ts +3 -3
- package/src/reachability/index.ts +61 -59
- package/src/reachability/request.ts +36 -32
- package/src/reactions/reactions.ts +4 -4
- package/src/reactions/reactions.type.ts +4 -3
- package/src/reconnection-manager/index.ts +139 -84
- package/src/roap/index.ts +46 -38
- package/src/roap/request.ts +44 -31
- package/src/roap/turnDiscovery.ts +59 -30
- package/src/statsAnalyzer/global.ts +30 -33
- package/src/statsAnalyzer/index.ts +432 -175
- package/src/statsAnalyzer/mqaUtil.ts +178 -72
- package/src/transcription/index.ts +34 -32
- package/test/integration/spec/journey.js +663 -462
- package/test/integration/spec/space-meeting.js +318 -203
- package/test/integration/spec/transcription.js +6 -7
- package/test/unit/spec/common/browser-detection.js +9 -28
- package/test/unit/spec/fixture/locus.js +92 -90
- package/test/unit/spec/locus-info/controlsUtils.js +5 -5
- package/test/unit/spec/locus-info/embeddedAppsUtils.js +8 -6
- package/test/unit/spec/locus-info/index.js +1 -2
- package/test/unit/spec/locus-info/infoUtils.js +26 -33
- package/test/unit/spec/locus-info/lib/BasicSeqCmp.json +88 -430
- package/test/unit/spec/locus-info/lib/SeqCmp.json +513 -685
- package/test/unit/spec/locus-info/parser.js +3 -9
- package/test/unit/spec/locus-info/selfConstant.js +72 -103
- package/test/unit/spec/locus-info/selfUtils.js +21 -12
- package/test/unit/spec/meeting/effectsState.js +36 -46
- package/test/unit/spec/meeting/in-meeting-actions.ts +2 -3
- package/test/unit/spec/meeting/index.js +1342 -684
- package/test/unit/spec/meeting/muteState.js +42 -33
- package/test/unit/spec/meeting/request.js +75 -45
- package/test/unit/spec/meeting/utils.js +78 -53
- package/test/unit/spec/meeting-info/meetinginfov2.js +100 -73
- package/test/unit/spec/meeting-info/request.js +7 -9
- package/test/unit/spec/meeting-info/util.js +11 -12
- package/test/unit/spec/meeting-info/utilv2.js +110 -74
- package/test/unit/spec/meetings/collection.js +1 -1
- package/test/unit/spec/meetings/index.js +438 -257
- package/test/unit/spec/meetings/utils.js +14 -12
- package/test/unit/spec/member/index.js +0 -1
- package/test/unit/spec/member/util.js +5 -6
- package/test/unit/spec/members/index.js +104 -54
- package/test/unit/spec/members/request.js +29 -20
- package/test/unit/spec/members/utils.js +8 -5
- package/test/unit/spec/metrics/index.js +16 -21
- package/test/unit/spec/networkQualityMonitor/index.js +21 -15
- package/test/unit/spec/personal-meeting-room/personal-meeting-room.js +2 -7
- package/test/unit/spec/reachability/index.ts +9 -11
- package/test/unit/spec/reconnection-manager/index.js +16 -18
- package/test/unit/spec/roap/turnDiscovery.ts +22 -19
- package/test/unit/spec/stats-analyzer/index.js +25 -20
- package/test/utils/cmr.js +44 -42
- package/test/utils/testUtils.js +83 -74
- package/test/utils/webex-config.js +18 -18
- package/test/utils/webex-test-users.js +53 -50
package/src/media/index.ts
CHANGED
|
@@ -4,11 +4,7 @@
|
|
|
4
4
|
/* globals navigator */
|
|
5
5
|
|
|
6
6
|
import LoggerProxy from '../common/logs/logger-proxy';
|
|
7
|
-
import {
|
|
8
|
-
AUDIO_INPUT,
|
|
9
|
-
VIDEO_INPUT,
|
|
10
|
-
MEDIA_TRACK_CONSTRAINT,
|
|
11
|
-
} from '../constants';
|
|
7
|
+
import {AUDIO_INPUT, VIDEO_INPUT, MEDIA_TRACK_CONSTRAINT} from '../constants';
|
|
12
8
|
import Config from '../config';
|
|
13
9
|
import StaticConfig from '../common/config';
|
|
14
10
|
import MediaError from '../common/errors/media';
|
|
@@ -77,10 +73,10 @@ Media.generateLocalMedias = (mediaId: string, audioMuted: boolean, videoMuted: b
|
|
|
77
73
|
{
|
|
78
74
|
localSdp: JSON.stringify({
|
|
79
75
|
audioMuted,
|
|
80
|
-
videoMuted
|
|
76
|
+
videoMuted,
|
|
81
77
|
}),
|
|
82
|
-
mediaId
|
|
83
|
-
}
|
|
78
|
+
mediaId,
|
|
79
|
+
},
|
|
84
80
|
];
|
|
85
81
|
}
|
|
86
82
|
|
|
@@ -94,9 +90,7 @@ Media.generateLocalMedias = (mediaId: string, audioMuted: boolean, videoMuted: b
|
|
|
94
90
|
* @returns {Promise}
|
|
95
91
|
*/
|
|
96
92
|
Media.getLocalMedia = (options: any, config: object) => {
|
|
97
|
-
const {
|
|
98
|
-
sendAudio, sendVideo, sendShare, sharePreferences, isSharing
|
|
99
|
-
} = options;
|
|
93
|
+
const {sendAudio, sendVideo, sendShare, sharePreferences, isSharing} = options;
|
|
100
94
|
|
|
101
95
|
if (sendAudio || sendVideo) {
|
|
102
96
|
return Media.getMedia(sendAudio, sendVideo, config);
|
|
@@ -107,7 +101,7 @@ Media.getLocalMedia = (options: any, config: object) => {
|
|
|
107
101
|
{
|
|
108
102
|
sendAudio: false,
|
|
109
103
|
sendShare: true,
|
|
110
|
-
sharePreferences
|
|
104
|
+
sharePreferences,
|
|
111
105
|
},
|
|
112
106
|
config
|
|
113
107
|
);
|
|
@@ -136,31 +130,25 @@ Media.createMediaConnection = (
|
|
|
136
130
|
options: {
|
|
137
131
|
mediaProperties?: {
|
|
138
132
|
mediaDirection?: {
|
|
139
|
-
receiveAudio: boolean
|
|
140
|
-
receiveVideo: boolean
|
|
141
|
-
receiveShare: boolean
|
|
142
|
-
}
|
|
143
|
-
audioTrack?: MediaStreamTrack
|
|
144
|
-
videoTrack?: MediaStreamTrack
|
|
145
|
-
shareTrack?: MediaStreamTrack
|
|
146
|
-
}
|
|
147
|
-
remoteQualityLevel?: 'LOW'|'MEDIUM'|'HIGH'
|
|
148
|
-
enableRtx?: boolean
|
|
149
|
-
enableExtmap?: boolean
|
|
133
|
+
receiveAudio: boolean;
|
|
134
|
+
receiveVideo: boolean;
|
|
135
|
+
receiveShare: boolean;
|
|
136
|
+
};
|
|
137
|
+
audioTrack?: MediaStreamTrack;
|
|
138
|
+
videoTrack?: MediaStreamTrack;
|
|
139
|
+
shareTrack?: MediaStreamTrack;
|
|
140
|
+
};
|
|
141
|
+
remoteQualityLevel?: 'LOW' | 'MEDIUM' | 'HIGH';
|
|
142
|
+
enableRtx?: boolean;
|
|
143
|
+
enableExtmap?: boolean;
|
|
150
144
|
turnServerInfo?: {
|
|
151
|
-
url: string
|
|
152
|
-
username: string
|
|
153
|
-
password: string
|
|
154
|
-
}
|
|
145
|
+
url: string;
|
|
146
|
+
username: string;
|
|
147
|
+
password: string;
|
|
148
|
+
};
|
|
155
149
|
}
|
|
156
150
|
) => {
|
|
157
|
-
const {
|
|
158
|
-
mediaProperties,
|
|
159
|
-
remoteQualityLevel,
|
|
160
|
-
enableRtx,
|
|
161
|
-
enableExtmap,
|
|
162
|
-
turnServerInfo
|
|
163
|
-
} = options;
|
|
151
|
+
const {mediaProperties, remoteQualityLevel, enableRtx, enableExtmap, turnServerInfo} = options;
|
|
164
152
|
|
|
165
153
|
const iceServers = [];
|
|
166
154
|
|
|
@@ -168,57 +156,58 @@ Media.createMediaConnection = (
|
|
|
168
156
|
iceServers.push({
|
|
169
157
|
urls: turnServerInfo.url,
|
|
170
158
|
username: turnServerInfo.username || '',
|
|
171
|
-
credential: turnServerInfo.password || ''
|
|
159
|
+
credential: turnServerInfo.password || '',
|
|
172
160
|
});
|
|
173
161
|
}
|
|
174
162
|
|
|
175
163
|
if (isMultistream) {
|
|
176
|
-
return new MultistreamRoapMediaConnection(
|
|
177
|
-
|
|
178
|
-
|
|
164
|
+
return new MultistreamRoapMediaConnection(
|
|
165
|
+
{
|
|
166
|
+
iceServers,
|
|
167
|
+
},
|
|
168
|
+
debugId
|
|
169
|
+
);
|
|
179
170
|
}
|
|
180
171
|
|
|
181
172
|
if (!mediaProperties) {
|
|
182
173
|
throw new Error('mediaProperties have to be provided for non-multistream media connections');
|
|
183
174
|
}
|
|
184
175
|
|
|
185
|
-
const {
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
176
|
+
const {mediaDirection, audioTrack, videoTrack, shareTrack} = mediaProperties;
|
|
177
|
+
|
|
178
|
+
return new RoapMediaConnection(
|
|
179
|
+
{
|
|
180
|
+
iceServers,
|
|
181
|
+
skipInactiveTransceivers: false,
|
|
182
|
+
requireH264: true,
|
|
183
|
+
sdpMunging: {
|
|
184
|
+
convertPort9to0: false,
|
|
185
|
+
addContentSlides: true,
|
|
186
|
+
bandwidthLimits: {
|
|
187
|
+
audio: StaticConfig.meetings.bandwidth.audio,
|
|
188
|
+
video: StaticConfig.meetings.bandwidth.video,
|
|
189
|
+
},
|
|
190
|
+
startBitrate: StaticConfig.meetings.bandwidth.startBitrate,
|
|
191
|
+
periodicKeyframes: 20, // it's always been hardcoded in SDK so for now keeping it that way
|
|
192
|
+
disableExtmap: !enableExtmap,
|
|
193
|
+
disableRtx: !enableRtx, // see https://bugs.chromium.org/p/chromium/issues/detail?id=1020642 why we might want to remove RTX from SDP
|
|
203
194
|
},
|
|
204
|
-
startBitrate: StaticConfig.meetings.bandwidth.startBitrate,
|
|
205
|
-
periodicKeyframes: 20, // it's always been hardcoded in SDK so for now keeping it that way
|
|
206
|
-
disableExtmap: !enableExtmap,
|
|
207
|
-
disableRtx: !enableRtx, // see https://bugs.chromium.org/p/chromium/issues/detail?id=1020642 why we might want to remove RTX from SDP
|
|
208
|
-
}
|
|
209
|
-
}, {
|
|
210
|
-
send: {
|
|
211
|
-
audio: audioTrack,
|
|
212
|
-
video: videoTrack,
|
|
213
|
-
screenShareVideo: shareTrack
|
|
214
195
|
},
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
196
|
+
{
|
|
197
|
+
send: {
|
|
198
|
+
audio: audioTrack,
|
|
199
|
+
video: videoTrack,
|
|
200
|
+
screenShareVideo: shareTrack,
|
|
201
|
+
},
|
|
202
|
+
receive: {
|
|
203
|
+
audio: mediaDirection.receiveAudio,
|
|
204
|
+
video: mediaDirection.receiveVideo,
|
|
205
|
+
screenShareVideo: mediaDirection.receiveShare,
|
|
206
|
+
remoteQualityLevel,
|
|
207
|
+
},
|
|
208
|
+
},
|
|
209
|
+
debugId
|
|
210
|
+
);
|
|
222
211
|
};
|
|
223
212
|
|
|
224
213
|
/**
|
|
@@ -252,38 +241,31 @@ Media.getDisplayMedia = (
|
|
|
252
241
|
const hasSharePreferences = options.sharePreferences;
|
|
253
242
|
const hasCustomConstraints = hasSharePreferences && hasSharePreferences.shareConstraints;
|
|
254
243
|
const hasHighFrameRate = hasSharePreferences && hasSharePreferences.highFrameRate;
|
|
255
|
-
const {
|
|
256
|
-
|
|
257
|
-
resolution,
|
|
258
|
-
videoShareFrameRate,
|
|
259
|
-
screenFrameRate,
|
|
260
|
-
aspectRatio
|
|
261
|
-
} = Config.meetings;
|
|
244
|
+
const {screenResolution, resolution, videoShareFrameRate, screenFrameRate, aspectRatio} =
|
|
245
|
+
Config.meetings;
|
|
262
246
|
|
|
263
247
|
let shareConstraints: any = {
|
|
264
248
|
cursor: MEDIA_TRACK_CONSTRAINT.CURSOR.AWLAYS,
|
|
265
|
-
aspectRatio
|
|
249
|
+
aspectRatio,
|
|
266
250
|
};
|
|
267
251
|
|
|
268
252
|
if (hasCustomConstraints) {
|
|
269
253
|
shareConstraints = hasSharePreferences.shareConstraints;
|
|
270
|
-
}
|
|
271
|
-
else if (hasHighFrameRate) {
|
|
254
|
+
} else if (hasHighFrameRate) {
|
|
272
255
|
shareConstraints = {
|
|
273
256
|
...shareConstraints,
|
|
274
257
|
frameRate: videoShareFrameRate,
|
|
275
258
|
height: resolution.idealHeight,
|
|
276
259
|
width: resolution.idealWidth,
|
|
277
|
-
...config.resolution
|
|
260
|
+
...config.resolution,
|
|
278
261
|
};
|
|
279
|
-
}
|
|
280
|
-
else {
|
|
262
|
+
} else {
|
|
281
263
|
shareConstraints = {
|
|
282
264
|
...shareConstraints,
|
|
283
265
|
frameRate: customShareFrameRate || screenFrameRate,
|
|
284
266
|
height: customResolution.idealHeight || screenResolution.idealHeight,
|
|
285
267
|
width: customResolution.idealWidth || screenResolution.idealWidth,
|
|
286
|
-
...config.screenResolution
|
|
268
|
+
...config.screenResolution,
|
|
287
269
|
};
|
|
288
270
|
}
|
|
289
271
|
|
|
@@ -294,15 +276,14 @@ Media.getDisplayMedia = (
|
|
|
294
276
|
// to have higher quality, and for developers to control the values
|
|
295
277
|
// eventually we may have to add the same functionality to chrome, OR conversely, get to with firefox
|
|
296
278
|
|
|
297
|
-
|
|
298
279
|
if (isBrowser('firefox')) {
|
|
299
280
|
const mediaConfig: any = {
|
|
300
281
|
audio: options.sendAudio,
|
|
301
|
-
video: options.sendShare
|
|
282
|
+
video: options.sendShare,
|
|
302
283
|
};
|
|
303
284
|
|
|
304
|
-
|
|
305
|
-
|
|
285
|
+
return navigator.mediaDevices
|
|
286
|
+
.getDisplayMedia({audio: options.sendAudio, video: mediaConfig})
|
|
306
287
|
.then((stream) => {
|
|
307
288
|
if (options.sendShare && stream.getVideoTracks().length > 0) {
|
|
308
289
|
// Firefox has a bug with the spec where changing in the height and width only happens
|
|
@@ -311,7 +292,6 @@ Media.getDisplayMedia = (
|
|
|
311
292
|
stream.getVideoTracks()[0].applyConstraints(shareConstraints);
|
|
312
293
|
}
|
|
313
294
|
|
|
314
|
-
|
|
315
295
|
return stream;
|
|
316
296
|
});
|
|
317
297
|
}
|
|
@@ -341,34 +321,32 @@ Media.getMedia = (audio: any | boolean, video: any | boolean, config: any) => {
|
|
|
341
321
|
audio,
|
|
342
322
|
// TODO: Remove temporary workaround once Firefox fixes low constraint issues
|
|
343
323
|
// eslint-disable-next-line no-nested-ternary
|
|
344
|
-
video: video
|
|
345
|
-
isBrowser('firefox') && video.width && video.width.max === 320
|
|
346
|
-
{
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
{
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
false,
|
|
361
|
-
fake: process.env.NODE_ENV === 'test' // Special case to get fake media for Firefox browser for testing
|
|
324
|
+
video: video
|
|
325
|
+
? isBrowser('firefox') && video.width && video.width.max === 320
|
|
326
|
+
? {
|
|
327
|
+
deviceId: video.deviceId ? video.deviceId : undefined,
|
|
328
|
+
width: 320,
|
|
329
|
+
height: 180,
|
|
330
|
+
frameRate: video.frameRate ? video.frameRate : undefined,
|
|
331
|
+
facingMode: video.facingMode ? video.facingMode : undefined,
|
|
332
|
+
}
|
|
333
|
+
: {
|
|
334
|
+
deviceId: video.deviceId ? video.deviceId : undefined,
|
|
335
|
+
width: video.width ? video.width : defaultWidth,
|
|
336
|
+
height: video.height ? video.height : defaultHeight,
|
|
337
|
+
frameRate: video.frameRate ? video.frameRate : undefined,
|
|
338
|
+
facingMode: video.facingMode ? video.facingMode : undefined,
|
|
339
|
+
}
|
|
340
|
+
: false,
|
|
341
|
+
fake: process.env.NODE_ENV === 'test', // Special case to get fake media for Firefox browser for testing
|
|
362
342
|
};
|
|
363
343
|
|
|
364
|
-
return navigator.mediaDevices
|
|
365
|
-
.getUserMedia
|
|
366
|
-
.catch((err) => {
|
|
367
|
-
const logPath = 'Media:index#getMedia --> navigator.mediaDevices.getUserMedia';
|
|
344
|
+
return navigator.mediaDevices.getUserMedia(mediaConfig).catch((err) => {
|
|
345
|
+
const logPath = 'Media:index#getMedia --> navigator.mediaDevices.getUserMedia';
|
|
368
346
|
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
347
|
+
LoggerProxy.logger.error(`${logPath} failed - ${err} (${err.constraint})`);
|
|
348
|
+
throw err;
|
|
349
|
+
});
|
|
372
350
|
};
|
|
373
351
|
|
|
374
352
|
/**
|
|
@@ -383,24 +361,24 @@ Media.getMedia = (audio: any | boolean, video: any | boolean, config: any) => {
|
|
|
383
361
|
* sendVideo: true/false
|
|
384
362
|
*}
|
|
385
363
|
*/
|
|
386
|
-
Media.getSupportedDevice = ({
|
|
364
|
+
Media.getSupportedDevice = ({sendAudio, sendVideo}: {sendAudio: boolean; sendVideo: boolean}) =>
|
|
387
365
|
Promise.resolve().then(() => {
|
|
388
366
|
if (!navigator.mediaDevices || navigator.mediaDevices.enumerateDevices === undefined) {
|
|
389
367
|
return {
|
|
390
368
|
sendAudio: false,
|
|
391
|
-
sendVideo: false
|
|
369
|
+
sendVideo: false,
|
|
392
370
|
};
|
|
393
371
|
}
|
|
394
372
|
|
|
395
373
|
return navigator.mediaDevices.enumerateDevices().then((devices) => {
|
|
396
374
|
const supported = {
|
|
397
375
|
audio: devices.filter((device) => device.kind === AUDIO_INPUT).length > 0,
|
|
398
|
-
video: devices.filter((device) => device.kind === VIDEO_INPUT).length > 0
|
|
376
|
+
video: devices.filter((device) => device.kind === VIDEO_INPUT).length > 0,
|
|
399
377
|
};
|
|
400
378
|
|
|
401
379
|
return {
|
|
402
380
|
sendAudio: supported.audio && sendAudio,
|
|
403
|
-
sendVideo: supported.video && sendVideo
|
|
381
|
+
sendVideo: supported.video && sendVideo,
|
|
404
382
|
};
|
|
405
383
|
});
|
|
406
384
|
});
|
|
@@ -439,9 +417,10 @@ Media.stopTracks = (track: any) => {
|
|
|
439
417
|
if (track && track.stop) {
|
|
440
418
|
try {
|
|
441
419
|
track.stop();
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
|
|
420
|
+
} catch (e) {
|
|
421
|
+
LoggerProxy.logger.error(
|
|
422
|
+
`Media:index#stopTracks --> Unable to stop the track with state ${track.readyState}, error: ${e}`
|
|
423
|
+
);
|
|
445
424
|
}
|
|
446
425
|
}
|
|
447
426
|
});
|
|
@@ -455,7 +434,9 @@ Media.stopTracks = (track: any) => {
|
|
|
455
434
|
* @deprecated after v1.89.3
|
|
456
435
|
*/
|
|
457
436
|
Media.stopStream = (stream: any) => {
|
|
458
|
-
LoggerProxy.logger.warn(
|
|
437
|
+
LoggerProxy.logger.warn(
|
|
438
|
+
'Media:index#stopStream --> [DEPRECATION WARNING]: stopStream has been deprecated after v1.89.3'
|
|
439
|
+
);
|
|
459
440
|
if (!stream) {
|
|
460
441
|
return Promise.resolve();
|
|
461
442
|
}
|
|
@@ -470,8 +451,7 @@ Media.stopStream = (stream: any) => {
|
|
|
470
451
|
stream.getTracks().forEach((track) => {
|
|
471
452
|
track.stop();
|
|
472
453
|
});
|
|
473
|
-
}
|
|
474
|
-
else if (stream.stop) {
|
|
454
|
+
} else if (stream.stop) {
|
|
475
455
|
stream.stop();
|
|
476
456
|
}
|
|
477
457
|
});
|
|
@@ -510,13 +490,21 @@ Media.getUserMedia = (
|
|
|
510
490
|
},
|
|
511
491
|
config: object
|
|
512
492
|
) =>
|
|
513
|
-
Media.getLocalMedia(
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
493
|
+
Media.getLocalMedia(
|
|
494
|
+
{
|
|
495
|
+
sendAudio: mediaSetting.sendAudio ? audioVideo.audio || mediaSetting.sendAudio : false,
|
|
496
|
+
sendVideo: mediaSetting.sendVideo ? audioVideo.video || mediaSetting.sendVideo : false,
|
|
497
|
+
},
|
|
498
|
+
config
|
|
499
|
+
).then((localStream) =>
|
|
500
|
+
Media.getLocalMedia(
|
|
501
|
+
{
|
|
502
|
+
sendShare: mediaSetting.sendShare,
|
|
503
|
+
isSharing: mediaSetting.isSharing,
|
|
504
|
+
sharePreferences,
|
|
505
|
+
},
|
|
506
|
+
config
|
|
507
|
+
).then((shareStream) => [localStream, shareStream])
|
|
508
|
+
);
|
|
521
509
|
|
|
522
510
|
export default Media;
|
|
@@ -5,5 +5,5 @@ import {MediaConnection as MC} from '@webex/internal-media-core';
|
|
|
5
5
|
* because they are exported by @webex/internal-media-core as non-writable, non-configurable
|
|
6
6
|
* properties of MediaConnection and sinon doesn't allow spying on them or stubbing them.
|
|
7
7
|
*/
|
|
8
|
-
export const RoapMediaConnection = MC
|
|
9
|
-
export const MultistreamRoapMediaConnection = MC
|
|
8
|
+
export const {RoapMediaConnection} = MC;
|
|
9
|
+
export const {MultistreamRoapMediaConnection} = MC;
|
package/src/media/properties.ts
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import {MediaConnection as MC} from '@webex/internal-media-core';
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
MEETINGS,
|
|
5
|
-
PC_BAIL_TIMEOUT,
|
|
6
|
-
QUALITY_LEVELS
|
|
7
|
-
} from '../constants';
|
|
3
|
+
import {MEETINGS, PC_BAIL_TIMEOUT, QUALITY_LEVELS} from '../constants';
|
|
8
4
|
import LoggerProxy from '../common/logs/logger-proxy';
|
|
9
5
|
|
|
10
6
|
/**
|
|
@@ -137,7 +133,9 @@ export default class MediaProperties {
|
|
|
137
133
|
* @returns {void}
|
|
138
134
|
*/
|
|
139
135
|
unsetRemoteStream() {
|
|
140
|
-
LoggerProxy.logger.warn(
|
|
136
|
+
LoggerProxy.logger.warn(
|
|
137
|
+
'Media:properties#unsetRemoteStream --> [DEPRECATION WARNING]: unsetRemoteStream has been deprecated after v1.89.3 (use unsetRemoteTracks instead)'
|
|
138
|
+
);
|
|
141
139
|
// unsets audio and video only
|
|
142
140
|
this.unsetRemoteMedia();
|
|
143
141
|
}
|
|
@@ -166,7 +164,9 @@ export default class MediaProperties {
|
|
|
166
164
|
* @returns {void}
|
|
167
165
|
*/
|
|
168
166
|
unsetRemoteStreams() {
|
|
169
|
-
LoggerProxy.logger.warn(
|
|
167
|
+
LoggerProxy.logger.warn(
|
|
168
|
+
'Media:properties#unsetRemoteStreams --> [DEPRECATION WARNING]: unsetRemoteStreams has been deprecated after v1.89.3 (use unsetRemoteTracks instead)'
|
|
169
|
+
);
|
|
170
170
|
this.unsetRemoteStream();
|
|
171
171
|
this.unsetRemoteShare();
|
|
172
172
|
}
|
|
@@ -191,7 +191,9 @@ export default class MediaProperties {
|
|
|
191
191
|
* @returns {void}
|
|
192
192
|
*/
|
|
193
193
|
unsetMediaStreams() {
|
|
194
|
-
LoggerProxy.logger.warn(
|
|
194
|
+
LoggerProxy.logger.warn(
|
|
195
|
+
'Media:properties#unsetMediaStreams --> [DEPRECATION WARNING]: unsetMediaStreams has been deprecated after v1.89.3 (use unsetMediaTracks instead)'
|
|
196
|
+
);
|
|
195
197
|
this.unsetLocalVideoTrack();
|
|
196
198
|
this.unsetRemoteStream();
|
|
197
199
|
}
|
|
@@ -211,9 +213,8 @@ export default class MediaProperties {
|
|
|
211
213
|
* @returns {Promise<void>}
|
|
212
214
|
*/
|
|
213
215
|
waitForMediaConnectionConnected() {
|
|
214
|
-
const isConnected = () =>
|
|
215
|
-
this.webrtcMediaConnection.getConnectionState() === MC.ConnectionState.Connected
|
|
216
|
-
);
|
|
216
|
+
const isConnected = () =>
|
|
217
|
+
this.webrtcMediaConnection.getConnectionState() === MC.ConnectionState.Connected;
|
|
217
218
|
|
|
218
219
|
if (isConnected()) {
|
|
219
220
|
return Promise.resolve();
|
|
@@ -223,11 +224,16 @@ export default class MediaProperties {
|
|
|
223
224
|
let timer;
|
|
224
225
|
|
|
225
226
|
const connectionStateListener = () => {
|
|
226
|
-
LoggerProxy.logger.log(
|
|
227
|
+
LoggerProxy.logger.log(
|
|
228
|
+
`Media:properties#waitForMediaConnectionConnected --> connection state: ${this.webrtcMediaConnection.getConnectionState()}`
|
|
229
|
+
);
|
|
227
230
|
|
|
228
231
|
if (isConnected()) {
|
|
229
232
|
clearTimeout(timer);
|
|
230
|
-
this.webrtcMediaConnection.off(
|
|
233
|
+
this.webrtcMediaConnection.off(
|
|
234
|
+
MC.Event.CONNECTION_STATE_CHANGED,
|
|
235
|
+
connectionStateListener
|
|
236
|
+
);
|
|
231
237
|
resolve();
|
|
232
238
|
}
|
|
233
239
|
};
|
|
@@ -257,9 +263,10 @@ export default class MediaProperties {
|
|
|
257
263
|
const statsResult = await this.webrtcMediaConnection.getStats();
|
|
258
264
|
|
|
259
265
|
statsResult.forEach((report) => allStatsReports.push(report));
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
|
|
266
|
+
} catch (error) {
|
|
267
|
+
LoggerProxy.logger.warn(
|
|
268
|
+
`Media:properties#getCurrentConnectionType --> getStats() failed: ${error}`
|
|
269
|
+
);
|
|
263
270
|
}
|
|
264
271
|
|
|
265
272
|
const successfulCandidatePairs = allStatsReports.filter(
|
|
@@ -270,10 +277,14 @@ export default class MediaProperties {
|
|
|
270
277
|
|
|
271
278
|
// all of the successful pairs should have the same connection type, so just return the type for the first one
|
|
272
279
|
successfulCandidatePairs.some((pair) => {
|
|
273
|
-
const localCandidate = allStatsReports.find(
|
|
280
|
+
const localCandidate = allStatsReports.find(
|
|
281
|
+
(report) => report.type === 'local-candidate' && report.id === pair.localCandidateId
|
|
282
|
+
);
|
|
274
283
|
|
|
275
284
|
if (localCandidate === undefined) {
|
|
276
|
-
LoggerProxy.logger.warn(
|
|
285
|
+
LoggerProxy.logger.warn(
|
|
286
|
+
`Media:properties#getCurrentConnectionType --> failed to find local candidate "${pair.localCandidateId}" in getStats() results`
|
|
287
|
+
);
|
|
277
288
|
|
|
278
289
|
return false;
|
|
279
290
|
}
|
|
@@ -282,8 +293,7 @@ export default class MediaProperties {
|
|
|
282
293
|
|
|
283
294
|
if (localCandidate.relayProtocol) {
|
|
284
295
|
connectionType = `TURN-${localCandidate.relayProtocol.toUpperCase()}`;
|
|
285
|
-
}
|
|
286
|
-
else {
|
|
296
|
+
} else {
|
|
287
297
|
connectionType = localCandidate.protocol?.toUpperCase(); // it will be UDP or TCP
|
|
288
298
|
}
|
|
289
299
|
|
package/src/media/util.ts
CHANGED
|
@@ -6,7 +6,7 @@ const MediaUtil: any = {};
|
|
|
6
6
|
|
|
7
7
|
MediaUtil.createMediaStream = (tracks) => {
|
|
8
8
|
if (!tracks) {
|
|
9
|
-
LoggerProxy.logger.error(
|
|
9
|
+
LoggerProxy.logger.error("Media:util#createMediaStream --> Tracks don't exist");
|
|
10
10
|
}
|
|
11
11
|
const filtredTracks = tracks.filter((element) => !!element);
|
|
12
12
|
|