@webex/plugin-meetings 2.37.0 → 2.37.1
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 -20
- package/dist/common/browser-detection.js.map +1 -1
- package/dist/common/collection.js +5 -20
- package/dist/common/collection.js.map +1 -1
- package/dist/common/config.js +0 -7
- package/dist/common/config.js.map +1 -1
- package/dist/common/errors/captcha-error.js +5 -26
- package/dist/common/errors/captcha-error.js.map +1 -1
- package/dist/common/errors/intent-to-join.js +5 -26
- package/dist/common/errors/intent-to-join.js.map +1 -1
- package/dist/common/errors/join-meeting.js +6 -27
- package/dist/common/errors/join-meeting.js.map +1 -1
- package/dist/common/errors/media.js +5 -26
- package/dist/common/errors/media.js.map +1 -1
- package/dist/common/errors/parameter.js +5 -33
- package/dist/common/errors/parameter.js.map +1 -1
- package/dist/common/errors/password-error.js +5 -26
- package/dist/common/errors/password-error.js.map +1 -1
- package/dist/common/errors/permission.js +4 -25
- package/dist/common/errors/permission.js.map +1 -1
- package/dist/common/errors/reconnection-in-progress.js +0 -17
- package/dist/common/errors/reconnection-in-progress.js.map +1 -1
- package/dist/common/errors/reconnection.js +5 -26
- package/dist/common/errors/reconnection.js.map +1 -1
- package/dist/common/errors/stats.js +5 -26
- package/dist/common/errors/stats.js.map +1 -1
- package/dist/common/errors/webex-errors.js +7 -46
- package/dist/common/errors/webex-errors.js.map +1 -1
- package/dist/common/errors/webex-meetings-error.js +1 -24
- package/dist/common/errors/webex-meetings-error.js.map +1 -1
- package/dist/common/events/events-scope.js +0 -22
- package/dist/common/events/events-scope.js.map +1 -1
- package/dist/common/events/events.js +0 -23
- package/dist/common/events/events.js.map +1 -1
- package/dist/common/events/trigger-proxy.js +0 -12
- package/dist/common/events/trigger-proxy.js.map +1 -1
- package/dist/common/events/util.js +0 -15
- package/dist/common/events/util.js.map +1 -1
- package/dist/common/logs/logger-config.js +0 -4
- package/dist/common/logs/logger-config.js.map +1 -1
- package/dist/common/logs/logger-proxy.js +1 -8
- package/dist/common/logs/logger-proxy.js.map +1 -1
- package/dist/common/logs/request.js +35 -61
- package/dist/common/logs/request.js.map +1 -1
- package/dist/common/queue.js +4 -14
- package/dist/common/queue.js.map +1 -1
- package/dist/config.js +1 -5
- package/dist/config.js.map +1 -1
- package/dist/constants.js +46 -42
- package/dist/constants.js.map +1 -1
- package/dist/index.js +1 -17
- package/dist/index.js.map +1 -1
- package/dist/locus-info/controlsUtils.js +10 -28
- package/dist/locus-info/controlsUtils.js.map +1 -1
- package/dist/locus-info/embeddedAppsUtils.js +3 -26
- package/dist/locus-info/embeddedAppsUtils.js.map +1 -1
- package/dist/locus-info/fullState.js +0 -15
- package/dist/locus-info/fullState.js.map +1 -1
- package/dist/locus-info/hostUtils.js +4 -12
- package/dist/locus-info/hostUtils.js.map +1 -1
- package/dist/locus-info/index.js +101 -193
- package/dist/locus-info/index.js.map +1 -1
- package/dist/locus-info/infoUtils.js +0 -37
- package/dist/locus-info/infoUtils.js.map +1 -1
- package/dist/locus-info/mediaSharesUtils.js +12 -38
- package/dist/locus-info/mediaSharesUtils.js.map +1 -1
- package/dist/locus-info/parser.js +87 -123
- package/dist/locus-info/parser.js.map +1 -1
- package/dist/locus-info/selfUtils.js +16 -81
- package/dist/locus-info/selfUtils.js.map +1 -1
- package/dist/media/index.js +74 -137
- package/dist/media/index.js.map +1 -1
- package/dist/media/properties.js +64 -110
- package/dist/media/properties.js.map +1 -1
- package/dist/media/util.js +3 -17
- package/dist/media/util.js.map +1 -1
- package/dist/mediaQualityMetrics/config.js +10 -12
- package/dist/mediaQualityMetrics/config.js.map +1 -1
- package/dist/meeting/effectsState.js +120 -192
- package/dist/meeting/effectsState.js.map +1 -1
- package/dist/meeting/in-meeting-actions.js +0 -13
- package/dist/meeting/in-meeting-actions.js.map +1 -1
- package/dist/meeting/index.js +812 -1487
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting/muteState.js +31 -78
- package/dist/meeting/muteState.js.map +1 -1
- package/dist/meeting/request.js +157 -227
- package/dist/meeting/request.js.map +1 -1
- package/dist/meeting/state.js +21 -31
- package/dist/meeting/state.js.map +1 -1
- package/dist/meeting/util.js +25 -169
- package/dist/meeting/util.js.map +1 -1
- package/dist/meeting-info/collection.js +3 -25
- package/dist/meeting-info/collection.js.map +1 -1
- package/dist/meeting-info/index.js +10 -33
- package/dist/meeting-info/index.js.map +1 -1
- package/dist/meeting-info/meeting-info-v2.js +179 -268
- package/dist/meeting-info/meeting-info-v2.js.map +1 -1
- package/dist/meeting-info/request.js +1 -16
- package/dist/meeting-info/request.js.map +1 -1
- package/dist/meeting-info/util.js +98 -183
- package/dist/meeting-info/util.js.map +1 -1
- package/dist/meeting-info/utilv2.js +137 -228
- package/dist/meeting-info/utilv2.js.map +1 -1
- package/dist/meetings/collection.js +3 -21
- package/dist/meetings/collection.js.map +1 -1
- package/dist/meetings/index.js +451 -570
- package/dist/meetings/index.js.map +1 -1
- package/dist/meetings/request.js +7 -30
- package/dist/meetings/request.js.map +1 -1
- package/dist/meetings/util.js +94 -148
- package/dist/meetings/util.js.map +1 -1
- package/dist/member/index.js +49 -89
- package/dist/member/index.js.map +1 -1
- package/dist/member/util.js +17 -68
- package/dist/member/util.js.map +1 -1
- package/dist/members/collection.js +2 -12
- package/dist/members/collection.js.map +1 -1
- package/dist/members/index.js +68 -184
- package/dist/members/index.js.map +1 -1
- package/dist/members/request.js +21 -56
- package/dist/members/request.js.map +1 -1
- package/dist/members/util.js +9 -38
- package/dist/members/util.js.map +1 -1
- package/dist/metrics/config.js +0 -2
- package/dist/metrics/config.js.map +1 -1
- package/dist/metrics/constants.js +1 -2
- package/dist/metrics/constants.js.map +1 -1
- package/dist/metrics/index.js +48 -136
- package/dist/metrics/index.js.map +1 -1
- package/dist/networkQualityMonitor/index.js +28 -57
- package/dist/networkQualityMonitor/index.js.map +1 -1
- package/dist/peer-connection-manager/index.js +60 -190
- package/dist/peer-connection-manager/index.js.map +1 -1
- package/dist/peer-connection-manager/util.js +10 -24
- package/dist/peer-connection-manager/util.js.map +1 -1
- package/dist/personal-meeting-room/index.js +10 -45
- package/dist/personal-meeting-room/index.js.map +1 -1
- package/dist/personal-meeting-room/request.js +2 -33
- package/dist/personal-meeting-room/request.js.map +1 -1
- package/dist/personal-meeting-room/util.js +0 -13
- package/dist/personal-meeting-room/util.js.map +1 -1
- package/dist/reachability/index.js +100 -166
- package/dist/reachability/index.js.map +1 -1
- package/dist/reachability/request.js +2 -18
- package/dist/reachability/request.js.map +1 -1
- package/dist/reactions/reactions.js +0 -2
- package/dist/reactions/reactions.js.map +1 -1
- package/dist/reactions/reactions.type.js +0 -5
- package/dist/reactions/reactions.type.js.map +1 -1
- package/dist/reconnection-manager/index.js +294 -468
- package/dist/reconnection-manager/index.js.map +1 -1
- package/dist/roap/collection.js +1 -12
- package/dist/roap/collection.js.map +1 -1
- package/dist/roap/handler.js +15 -85
- package/dist/roap/handler.js.map +1 -1
- package/dist/roap/index.js +42 -94
- package/dist/roap/index.js.map +1 -1
- package/dist/roap/request.js +81 -148
- package/dist/roap/request.js.map +1 -1
- package/dist/roap/state.js +2 -39
- package/dist/roap/state.js.map +1 -1
- package/dist/roap/turnDiscovery.js +8 -52
- package/dist/roap/turnDiscovery.js.map +1 -1
- package/dist/roap/util.js +0 -26
- package/dist/roap/util.js.map +1 -1
- package/dist/statsAnalyzer/global.js +0 -2
- package/dist/statsAnalyzer/global.js.map +1 -1
- package/dist/statsAnalyzer/index.js +68 -168
- package/dist/statsAnalyzer/index.js.map +1 -1
- package/dist/statsAnalyzer/mqaUtil.js +54 -53
- package/dist/statsAnalyzer/mqaUtil.js.map +1 -1
- package/dist/transcription/index.js +13 -45
- package/dist/transcription/index.js.map +1 -1
- package/internal-README.md +7 -6
- package/package.json +17 -17
- 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 +138 -119
- 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 +118 -109
- package/src/media/properties.ts +26 -20
- package/src/media/util.ts +2 -2
- 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 +1435 -1210
- package/src/meeting/muteState.ts +62 -31
- package/src/meeting/request.ts +160 -113
- package/src/meeting/state.ts +45 -30
- package/src/meeting/util.ts +131 -90
- 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 +513 -441
- package/src/meetings/request.ts +26 -24
- package/src/meetings/util.ts +26 -23
- 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 +172 -121
- 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/networkQualityMonitor/index.ts +20 -23
- package/src/peer-connection-manager/index.ts +321 -241
- package/src/peer-connection-manager/util.ts +4 -2
- 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 +2 -3
- package/src/reconnection-manager/index.ts +159 -98
- package/src/roap/collection.ts +2 -4
- package/src/roap/handler.ts +63 -32
- package/src/roap/index.ts +78 -58
- package/src/roap/request.ts +69 -54
- package/src/roap/state.ts +17 -11
- package/src/roap/turnDiscovery.ts +60 -31
- package/src/roap/util.ts +39 -31
- package/src/statsAnalyzer/global.ts +30 -33
- package/src/statsAnalyzer/index.ts +397 -169
- package/src/statsAnalyzer/mqaUtil.ts +178 -72
- package/src/transcription/index.ts +34 -32
- package/test/integration/spec/journey.js +666 -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 +24 -31
- 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 +33 -45
- package/test/unit/spec/meeting/in-meeting-actions.ts +2 -3
- package/test/unit/spec/meeting/index.js +1141 -649
- package/test/unit/spec/meeting/muteState.js +42 -33
- package/test/unit/spec/meeting/request.js +56 -45
- package/test/unit/spec/meeting/utils.js +66 -49
- 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 +84 -35
- 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/peerconnection-manager/index.js +88 -58
- package/test/unit/spec/peerconnection-manager/utils.js +5 -4
- package/test/unit/spec/peerconnection-manager/utils.test-fixtures.ts +7 -8
- 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 +14 -17
- package/test/unit/spec/roap/index.ts +18 -8
- package/test/unit/spec/roap/turnDiscovery.ts +22 -19
- package/test/unit/spec/roap/util.js +3 -3
- package/test/unit/spec/stats-analyzer/index.js +29 -24
- 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
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
AUDIO_INPUT,
|
|
9
9
|
VIDEO_INPUT,
|
|
10
10
|
PEER_CONNECTION_STATE,
|
|
11
|
-
MEDIA_TRACK_CONSTRAINT
|
|
11
|
+
MEDIA_TRACK_CONSTRAINT,
|
|
12
12
|
} from '../constants';
|
|
13
13
|
import Config from '../config';
|
|
14
14
|
import PeerConnectionManager from '../peer-connection-manager';
|
|
@@ -82,11 +82,13 @@ Media.reconnectMedia = (
|
|
|
82
82
|
meetingId: string;
|
|
83
83
|
remoteQualityLevel: string;
|
|
84
84
|
enableRtx: any;
|
|
85
|
-
enableExtmap: any
|
|
85
|
+
enableExtmap: any;
|
|
86
86
|
}
|
|
87
87
|
) => {
|
|
88
|
-
if (
|
|
89
|
-
peerConnection.connectionState === PEER_CONNECTION_STATE.
|
|
88
|
+
if (
|
|
89
|
+
peerConnection.connectionState === PEER_CONNECTION_STATE.CLOSED ||
|
|
90
|
+
peerConnection.connectionState === PEER_CONNECTION_STATE.FAILED
|
|
91
|
+
) {
|
|
90
92
|
return Promise.reject(new ReconnectionError('Reinitiate peerconnection'));
|
|
91
93
|
}
|
|
92
94
|
|
|
@@ -94,7 +96,7 @@ Media.reconnectMedia = (
|
|
|
94
96
|
meetingId,
|
|
95
97
|
remoteQualityLevel,
|
|
96
98
|
enableRtx,
|
|
97
|
-
enableExtmap
|
|
99
|
+
enableExtmap,
|
|
98
100
|
});
|
|
99
101
|
};
|
|
100
102
|
|
|
@@ -111,10 +113,10 @@ Media.generateLocalMedias = (mediaId: string, audioMuted: boolean, videoMuted: b
|
|
|
111
113
|
{
|
|
112
114
|
localSdp: JSON.stringify({
|
|
113
115
|
audioMuted,
|
|
114
|
-
videoMuted
|
|
116
|
+
videoMuted,
|
|
115
117
|
}),
|
|
116
|
-
mediaId
|
|
117
|
-
}
|
|
118
|
+
mediaId,
|
|
119
|
+
},
|
|
118
120
|
];
|
|
119
121
|
}
|
|
120
122
|
|
|
@@ -128,9 +130,7 @@ Media.generateLocalMedias = (mediaId: string, audioMuted: boolean, videoMuted: b
|
|
|
128
130
|
* @returns {Promise}
|
|
129
131
|
*/
|
|
130
132
|
Media.getLocalMedia = (options: any, config: object) => {
|
|
131
|
-
const {
|
|
132
|
-
sendAudio, sendVideo, sendShare, sharePreferences, isSharing
|
|
133
|
-
} = options;
|
|
133
|
+
const {sendAudio, sendVideo, sendShare, sharePreferences, isSharing} = options;
|
|
134
134
|
|
|
135
135
|
if (sendAudio || sendVideo) {
|
|
136
136
|
return Media.getMedia(sendAudio, sendVideo, config);
|
|
@@ -141,7 +141,7 @@ Media.getLocalMedia = (options: any, config: object) => {
|
|
|
141
141
|
{
|
|
142
142
|
sendAudio: false,
|
|
143
143
|
sendShare: true,
|
|
144
|
-
sharePreferences
|
|
144
|
+
sharePreferences,
|
|
145
145
|
},
|
|
146
146
|
config
|
|
147
147
|
);
|
|
@@ -157,12 +157,15 @@ Media.getLocalMedia = (options: any, config: object) => {
|
|
|
157
157
|
* @returns {Object} returns direction tracks to be added in transceiver
|
|
158
158
|
*/
|
|
159
159
|
Media.checkTracks = (trackType: string, track: object, receiveTracks: boolean) => {
|
|
160
|
+
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
160
161
|
const getDirection = (sendTracks, receiveTracks) => {
|
|
161
162
|
if (sendTracks && receiveTracks) {
|
|
162
163
|
return 'sendrecv';
|
|
163
|
-
}
|
|
164
|
+
}
|
|
165
|
+
if (sendTracks && !receiveTracks) {
|
|
164
166
|
return 'sendonly';
|
|
165
|
-
}
|
|
167
|
+
}
|
|
168
|
+
if (!sendTracks && receiveTracks) {
|
|
166
169
|
return 'recvonly';
|
|
167
170
|
}
|
|
168
171
|
|
|
@@ -197,37 +200,51 @@ Media.attachMedia = (
|
|
|
197
200
|
enableExtmap: any;
|
|
198
201
|
}
|
|
199
202
|
) => {
|
|
200
|
-
const {
|
|
201
|
-
mediaDirection,
|
|
202
|
-
audioTrack,
|
|
203
|
-
videoTrack,
|
|
204
|
-
shareTrack,
|
|
205
|
-
peerConnection
|
|
206
|
-
} = mediaProperties;
|
|
203
|
+
const {mediaDirection, audioTrack, videoTrack, shareTrack, peerConnection} = mediaProperties;
|
|
207
204
|
|
|
208
205
|
let result = null;
|
|
209
206
|
|
|
210
207
|
// Add Transceiver for audio
|
|
211
|
-
result = Media.checkTracks(
|
|
212
|
-
|
|
208
|
+
result = Media.checkTracks(
|
|
209
|
+
'audio',
|
|
210
|
+
mediaDirection.sendAudio && audioTrack,
|
|
211
|
+
mediaDirection.receiveAudio
|
|
212
|
+
);
|
|
213
|
+
peerConnection.audioTransceiver = peerConnection.addTransceiver(result.track, {
|
|
214
|
+
direction: result.direction,
|
|
215
|
+
});
|
|
213
216
|
|
|
214
217
|
// Add Transceiver for video
|
|
215
|
-
result = Media.checkTracks(
|
|
216
|
-
|
|
218
|
+
result = Media.checkTracks(
|
|
219
|
+
'video',
|
|
220
|
+
mediaDirection.sendVideo && videoTrack,
|
|
221
|
+
mediaDirection.receiveVideo
|
|
222
|
+
);
|
|
223
|
+
peerConnection.videoTransceiver = peerConnection.addTransceiver(result.track, {
|
|
224
|
+
direction: result.direction,
|
|
225
|
+
});
|
|
217
226
|
|
|
218
227
|
// Add Transceiver for share
|
|
219
|
-
result = Media.checkTracks(
|
|
220
|
-
|
|
228
|
+
result = Media.checkTracks(
|
|
229
|
+
'video',
|
|
230
|
+
mediaDirection.sendShare && shareTrack,
|
|
231
|
+
mediaDirection.receiveShare
|
|
232
|
+
);
|
|
233
|
+
peerConnection.shareTransceiver = peerConnection.addTransceiver(result.track, {
|
|
234
|
+
direction: result.direction,
|
|
235
|
+
});
|
|
221
236
|
|
|
222
237
|
peerConnection.onnegotiationneeded = (event) => {
|
|
223
|
-
LoggerProxy.logger.info(
|
|
238
|
+
LoggerProxy.logger.info(
|
|
239
|
+
`Media:index#attachMedia --> onnegotiationneeded#PeerConnection: ${event}`
|
|
240
|
+
);
|
|
224
241
|
};
|
|
225
242
|
|
|
226
243
|
return PeerConnectionManager.createOffer(peerConnection, {
|
|
227
244
|
meetingId,
|
|
228
245
|
remoteQualityLevel,
|
|
229
246
|
enableRtx,
|
|
230
|
-
enableExtmap
|
|
247
|
+
enableExtmap,
|
|
231
248
|
});
|
|
232
249
|
};
|
|
233
250
|
|
|
@@ -253,20 +270,14 @@ Media.updateMedia = (
|
|
|
253
270
|
enableExtmap: any;
|
|
254
271
|
}
|
|
255
272
|
) => {
|
|
256
|
-
const {
|
|
257
|
-
mediaDirection,
|
|
258
|
-
audioTrack,
|
|
259
|
-
videoTrack,
|
|
260
|
-
shareTrack,
|
|
261
|
-
peerConnection
|
|
262
|
-
} = mediaProperties;
|
|
273
|
+
const {mediaDirection, audioTrack, videoTrack, shareTrack, peerConnection} = mediaProperties;
|
|
263
274
|
|
|
264
275
|
// update audio transceiver
|
|
265
276
|
Media.setTrackOnTransceiver(peerConnection.audioTransceiver, {
|
|
266
277
|
type: 'audio',
|
|
267
278
|
track: audioTrack,
|
|
268
279
|
sendTrack: mediaDirection.sendAudio && audioTrack,
|
|
269
|
-
receiveTrack: mediaDirection.receiveAudio
|
|
280
|
+
receiveTrack: mediaDirection.receiveAudio,
|
|
270
281
|
});
|
|
271
282
|
|
|
272
283
|
// update video transceiver
|
|
@@ -274,7 +285,7 @@ Media.updateMedia = (
|
|
|
274
285
|
type: 'video',
|
|
275
286
|
track: videoTrack,
|
|
276
287
|
sendTrack: mediaDirection.sendVideo && videoTrack,
|
|
277
|
-
receiveTrack: mediaDirection.receiveVideo
|
|
288
|
+
receiveTrack: mediaDirection.receiveVideo,
|
|
278
289
|
});
|
|
279
290
|
|
|
280
291
|
// update content transceiver
|
|
@@ -282,17 +293,19 @@ Media.updateMedia = (
|
|
|
282
293
|
type: 'video',
|
|
283
294
|
track: shareTrack,
|
|
284
295
|
sendTrack: mediaDirection.sendShare && shareTrack,
|
|
285
|
-
receiveTrack: mediaDirection.receiveShare
|
|
296
|
+
receiveTrack: mediaDirection.receiveShare,
|
|
286
297
|
});
|
|
287
298
|
peerConnection.onnegotiationneeded = (event) => {
|
|
288
|
-
LoggerProxy.logger.info(
|
|
299
|
+
LoggerProxy.logger.info(
|
|
300
|
+
`Media:index#updateMedia --> onnegotiationneeded#PeerConnection: ${event}`
|
|
301
|
+
);
|
|
289
302
|
};
|
|
290
303
|
|
|
291
304
|
return PeerConnectionManager.createOffer(peerConnection, {
|
|
292
305
|
meetingId,
|
|
293
306
|
remoteQualityLevel,
|
|
294
307
|
enableRtx,
|
|
295
|
-
enableExtmap
|
|
308
|
+
enableExtmap,
|
|
296
309
|
});
|
|
297
310
|
};
|
|
298
311
|
|
|
@@ -311,9 +324,7 @@ Media.setTrackOnTransceiver = (
|
|
|
311
324
|
receiveTrack: any;
|
|
312
325
|
}
|
|
313
326
|
) => {
|
|
314
|
-
const {
|
|
315
|
-
type, track, sendTrack, receiveTrack
|
|
316
|
-
} = options;
|
|
327
|
+
const {type, track, sendTrack, receiveTrack} = options;
|
|
317
328
|
|
|
318
329
|
try {
|
|
319
330
|
const result = Media.checkTracks(type, sendTrack && track, receiveTrack);
|
|
@@ -322,8 +333,7 @@ Media.setTrackOnTransceiver = (
|
|
|
322
333
|
if (options.track) {
|
|
323
334
|
transceiver.sender.replaceTrack(track);
|
|
324
335
|
}
|
|
325
|
-
}
|
|
326
|
-
catch (e) {
|
|
336
|
+
} catch (e) {
|
|
327
337
|
LoggerProxy.logger.error(`Media:index#setTrackOnTransceiver --> ${e}`);
|
|
328
338
|
throw e;
|
|
329
339
|
}
|
|
@@ -361,7 +371,7 @@ Media.updateTransceiver = (
|
|
|
361
371
|
meetingId,
|
|
362
372
|
remoteQualityLevel,
|
|
363
373
|
enableRtx,
|
|
364
|
-
enableExtmap
|
|
374
|
+
enableExtmap,
|
|
365
375
|
});
|
|
366
376
|
};
|
|
367
377
|
|
|
@@ -396,38 +406,31 @@ Media.getDisplayMedia = (
|
|
|
396
406
|
const hasSharePreferences = options.sharePreferences;
|
|
397
407
|
const hasCustomConstraints = hasSharePreferences && hasSharePreferences.shareConstraints;
|
|
398
408
|
const hasHighFrameRate = hasSharePreferences && hasSharePreferences.highFrameRate;
|
|
399
|
-
const {
|
|
400
|
-
|
|
401
|
-
resolution,
|
|
402
|
-
videoShareFrameRate,
|
|
403
|
-
screenFrameRate,
|
|
404
|
-
aspectRatio
|
|
405
|
-
} = Config.meetings;
|
|
409
|
+
const {screenResolution, resolution, videoShareFrameRate, screenFrameRate, aspectRatio} =
|
|
410
|
+
Config.meetings;
|
|
406
411
|
|
|
407
412
|
let shareConstraints: any = {
|
|
408
413
|
cursor: MEDIA_TRACK_CONSTRAINT.CURSOR.AWLAYS,
|
|
409
|
-
aspectRatio
|
|
414
|
+
aspectRatio,
|
|
410
415
|
};
|
|
411
416
|
|
|
412
417
|
if (hasCustomConstraints) {
|
|
413
418
|
shareConstraints = hasSharePreferences.shareConstraints;
|
|
414
|
-
}
|
|
415
|
-
else if (hasHighFrameRate) {
|
|
419
|
+
} else if (hasHighFrameRate) {
|
|
416
420
|
shareConstraints = {
|
|
417
421
|
...shareConstraints,
|
|
418
422
|
frameRate: videoShareFrameRate,
|
|
419
423
|
height: resolution.idealHeight,
|
|
420
424
|
width: resolution.idealWidth,
|
|
421
|
-
...config.resolution
|
|
425
|
+
...config.resolution,
|
|
422
426
|
};
|
|
423
|
-
}
|
|
424
|
-
else {
|
|
427
|
+
} else {
|
|
425
428
|
shareConstraints = {
|
|
426
429
|
...shareConstraints,
|
|
427
430
|
frameRate: customShareFrameRate || screenFrameRate,
|
|
428
431
|
height: customResolution.idealHeight || screenResolution.idealHeight,
|
|
429
432
|
width: customResolution.idealWidth || screenResolution.idealWidth,
|
|
430
|
-
...config.screenResolution
|
|
433
|
+
...config.screenResolution,
|
|
431
434
|
};
|
|
432
435
|
}
|
|
433
436
|
|
|
@@ -438,15 +441,14 @@ Media.getDisplayMedia = (
|
|
|
438
441
|
// to have higher quality, and for developers to control the values
|
|
439
442
|
// eventually we may have to add the same functionality to chrome, OR conversely, get to with firefox
|
|
440
443
|
|
|
441
|
-
|
|
442
444
|
if (isBrowser('firefox')) {
|
|
443
445
|
const mediaConfig: any = {
|
|
444
446
|
audio: options.sendAudio,
|
|
445
|
-
video: options.sendShare
|
|
447
|
+
video: options.sendShare,
|
|
446
448
|
};
|
|
447
449
|
|
|
448
|
-
|
|
449
|
-
|
|
450
|
+
return navigator.mediaDevices
|
|
451
|
+
.getDisplayMedia({audio: options.sendAudio, video: mediaConfig})
|
|
450
452
|
.then((stream) => {
|
|
451
453
|
if (options.sendShare && stream.getVideoTracks().length > 0) {
|
|
452
454
|
// Firefox has a bug with the spec where changing in the height and width only happens
|
|
@@ -455,7 +457,6 @@ Media.getDisplayMedia = (
|
|
|
455
457
|
stream.getVideoTracks()[0].applyConstraints(shareConstraints);
|
|
456
458
|
}
|
|
457
459
|
|
|
458
|
-
|
|
459
460
|
return stream;
|
|
460
461
|
});
|
|
461
462
|
}
|
|
@@ -485,34 +486,32 @@ Media.getMedia = (audio: any | boolean, video: any | boolean, config: any) => {
|
|
|
485
486
|
audio,
|
|
486
487
|
// TODO: Remove temporary workaround once Firefox fixes low constraint issues
|
|
487
488
|
// eslint-disable-next-line no-nested-ternary
|
|
488
|
-
video: video
|
|
489
|
-
isBrowser('firefox') && video.width && video.width.max === 320
|
|
490
|
-
{
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
{
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
false,
|
|
505
|
-
fake: process.env.NODE_ENV === 'test' // Special case to get fake media for Firefox browser for testing
|
|
489
|
+
video: video
|
|
490
|
+
? isBrowser('firefox') && video.width && video.width.max === 320
|
|
491
|
+
? {
|
|
492
|
+
deviceId: video.deviceId ? video.deviceId : undefined,
|
|
493
|
+
width: 320,
|
|
494
|
+
height: 180,
|
|
495
|
+
frameRate: video.frameRate ? video.frameRate : undefined,
|
|
496
|
+
facingMode: video.facingMode ? video.facingMode : undefined,
|
|
497
|
+
}
|
|
498
|
+
: {
|
|
499
|
+
deviceId: video.deviceId ? video.deviceId : undefined,
|
|
500
|
+
width: video.width ? video.width : defaultWidth,
|
|
501
|
+
height: video.height ? video.height : defaultHeight,
|
|
502
|
+
frameRate: video.frameRate ? video.frameRate : undefined,
|
|
503
|
+
facingMode: video.facingMode ? video.facingMode : undefined,
|
|
504
|
+
}
|
|
505
|
+
: false,
|
|
506
|
+
fake: process.env.NODE_ENV === 'test', // Special case to get fake media for Firefox browser for testing
|
|
506
507
|
};
|
|
507
508
|
|
|
508
|
-
return navigator.mediaDevices
|
|
509
|
-
.getUserMedia
|
|
510
|
-
.catch((err) => {
|
|
511
|
-
const logPath = 'Media:index#getMedia --> navigator.mediaDevices.getUserMedia';
|
|
509
|
+
return navigator.mediaDevices.getUserMedia(mediaConfig).catch((err) => {
|
|
510
|
+
const logPath = 'Media:index#getMedia --> navigator.mediaDevices.getUserMedia';
|
|
512
511
|
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
512
|
+
LoggerProxy.logger.error(`${logPath} failed - ${err} (${err.constraint})`);
|
|
513
|
+
throw err;
|
|
514
|
+
});
|
|
516
515
|
};
|
|
517
516
|
|
|
518
517
|
/**
|
|
@@ -527,24 +526,24 @@ Media.getMedia = (audio: any | boolean, video: any | boolean, config: any) => {
|
|
|
527
526
|
* sendVideo: true/false
|
|
528
527
|
*}
|
|
529
528
|
*/
|
|
530
|
-
Media.getSupportedDevice = ({
|
|
529
|
+
Media.getSupportedDevice = ({sendAudio, sendVideo}: {sendAudio: boolean; sendVideo: boolean}) =>
|
|
531
530
|
Promise.resolve().then(() => {
|
|
532
531
|
if (!navigator.mediaDevices || navigator.mediaDevices.enumerateDevices === undefined) {
|
|
533
532
|
return {
|
|
534
533
|
sendAudio: false,
|
|
535
|
-
sendVideo: false
|
|
534
|
+
sendVideo: false,
|
|
536
535
|
};
|
|
537
536
|
}
|
|
538
537
|
|
|
539
538
|
return navigator.mediaDevices.enumerateDevices().then((devices) => {
|
|
540
539
|
const supported = {
|
|
541
540
|
audio: devices.filter((device) => device.kind === AUDIO_INPUT).length > 0,
|
|
542
|
-
video: devices.filter((device) => device.kind === VIDEO_INPUT).length > 0
|
|
541
|
+
video: devices.filter((device) => device.kind === VIDEO_INPUT).length > 0,
|
|
543
542
|
};
|
|
544
543
|
|
|
545
544
|
return {
|
|
546
545
|
sendAudio: supported.audio && sendAudio,
|
|
547
|
-
sendVideo: supported.video && sendVideo
|
|
546
|
+
sendVideo: supported.video && sendVideo,
|
|
548
547
|
};
|
|
549
548
|
});
|
|
550
549
|
});
|
|
@@ -583,9 +582,10 @@ Media.stopTracks = (track: any) => {
|
|
|
583
582
|
if (track && track.stop) {
|
|
584
583
|
try {
|
|
585
584
|
track.stop();
|
|
586
|
-
}
|
|
587
|
-
|
|
588
|
-
|
|
585
|
+
} catch (e) {
|
|
586
|
+
LoggerProxy.logger.error(
|
|
587
|
+
`Media:index#stopTracks --> Unable to stop the track with state ${track.readyState}, error: ${e}`
|
|
588
|
+
);
|
|
589
589
|
}
|
|
590
590
|
}
|
|
591
591
|
});
|
|
@@ -599,7 +599,9 @@ Media.stopTracks = (track: any) => {
|
|
|
599
599
|
* @deprecated after v1.89.3
|
|
600
600
|
*/
|
|
601
601
|
Media.stopStream = (stream: any) => {
|
|
602
|
-
LoggerProxy.logger.warn(
|
|
602
|
+
LoggerProxy.logger.warn(
|
|
603
|
+
'Media:index#stopStream --> [DEPRECATION WARNING]: stopStream has been deprecated after v1.89.3'
|
|
604
|
+
);
|
|
603
605
|
if (!stream) {
|
|
604
606
|
return Promise.resolve();
|
|
605
607
|
}
|
|
@@ -614,8 +616,7 @@ Media.stopStream = (stream: any) => {
|
|
|
614
616
|
stream.getTracks().forEach((track) => {
|
|
615
617
|
track.stop();
|
|
616
618
|
});
|
|
617
|
-
}
|
|
618
|
-
else if (stream.stop) {
|
|
619
|
+
} else if (stream.stop) {
|
|
619
620
|
stream.stop();
|
|
620
621
|
}
|
|
621
622
|
});
|
|
@@ -654,13 +655,21 @@ Media.getUserMedia = (
|
|
|
654
655
|
},
|
|
655
656
|
config: object
|
|
656
657
|
) =>
|
|
657
|
-
Media.getLocalMedia(
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
658
|
+
Media.getLocalMedia(
|
|
659
|
+
{
|
|
660
|
+
sendAudio: mediaSetting.sendAudio ? audioVideo.audio || mediaSetting.sendAudio : false,
|
|
661
|
+
sendVideo: mediaSetting.sendVideo ? audioVideo.video || mediaSetting.sendVideo : false,
|
|
662
|
+
},
|
|
663
|
+
config
|
|
664
|
+
).then((localStream) =>
|
|
665
|
+
Media.getLocalMedia(
|
|
666
|
+
{
|
|
667
|
+
sendShare: mediaSetting.sendShare,
|
|
668
|
+
isSharing: mediaSetting.isSharing,
|
|
669
|
+
sharePreferences,
|
|
670
|
+
},
|
|
671
|
+
config
|
|
672
|
+
).then((shareStream) => [localStream, shareStream])
|
|
673
|
+
);
|
|
665
674
|
|
|
666
675
|
export default Media;
|
package/src/media/properties.ts
CHANGED
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ICE_STATE,
|
|
3
|
-
MEETINGS,
|
|
4
|
-
PC_BAIL_TIMEOUT,
|
|
5
|
-
QUALITY_LEVELS
|
|
6
|
-
} from '../constants';
|
|
1
|
+
import {ICE_STATE, MEETINGS, PC_BAIL_TIMEOUT, QUALITY_LEVELS} from '../constants';
|
|
7
2
|
import LoggerProxy from '../common/logs/logger-proxy';
|
|
8
3
|
|
|
9
4
|
import MediaUtil from './util';
|
|
@@ -142,7 +137,9 @@ export default class MediaProperties {
|
|
|
142
137
|
* @returns {void}
|
|
143
138
|
*/
|
|
144
139
|
unsetRemoteStream() {
|
|
145
|
-
LoggerProxy.logger.warn(
|
|
140
|
+
LoggerProxy.logger.warn(
|
|
141
|
+
'Media:properties#unsetRemoteStream --> [DEPRECATION WARNING]: unsetRemoteStream has been deprecated after v1.89.3 (use unsetRemoteTracks instead)'
|
|
142
|
+
);
|
|
146
143
|
// unsets audio and video only
|
|
147
144
|
this.unsetRemoteMedia();
|
|
148
145
|
}
|
|
@@ -171,7 +168,9 @@ export default class MediaProperties {
|
|
|
171
168
|
* @returns {void}
|
|
172
169
|
*/
|
|
173
170
|
unsetRemoteStreams() {
|
|
174
|
-
LoggerProxy.logger.warn(
|
|
171
|
+
LoggerProxy.logger.warn(
|
|
172
|
+
'Media:properties#unsetRemoteStreams --> [DEPRECATION WARNING]: unsetRemoteStreams has been deprecated after v1.89.3 (use unsetRemoteTracks instead)'
|
|
173
|
+
);
|
|
175
174
|
this.unsetRemoteStream();
|
|
176
175
|
this.unsetRemoteShare();
|
|
177
176
|
}
|
|
@@ -196,7 +195,9 @@ export default class MediaProperties {
|
|
|
196
195
|
* @returns {void}
|
|
197
196
|
*/
|
|
198
197
|
unsetMediaStreams() {
|
|
199
|
-
LoggerProxy.logger.warn(
|
|
198
|
+
LoggerProxy.logger.warn(
|
|
199
|
+
'Media:properties#unsetMediaStreams --> [DEPRECATION WARNING]: unsetMediaStreams has been deprecated after v1.89.3 (use unsetMediaTracks instead)'
|
|
200
|
+
);
|
|
200
201
|
this.unsetLocalVideoTrack();
|
|
201
202
|
this.unsetRemoteStream();
|
|
202
203
|
}
|
|
@@ -216,10 +217,9 @@ export default class MediaProperties {
|
|
|
216
217
|
* @returns {Promise<void>}
|
|
217
218
|
*/
|
|
218
219
|
waitForIceConnectedState() {
|
|
219
|
-
const isIceConnected = () =>
|
|
220
|
+
const isIceConnected = () =>
|
|
220
221
|
this.peerConnection.iceConnectionState === ICE_STATE.CONNECTED ||
|
|
221
|
-
|
|
222
|
-
);
|
|
222
|
+
this.peerConnection.iceConnectionState === ICE_STATE.COMPLETED;
|
|
223
223
|
|
|
224
224
|
if (isIceConnected()) {
|
|
225
225
|
return Promise.resolve();
|
|
@@ -229,7 +229,9 @@ export default class MediaProperties {
|
|
|
229
229
|
let timer;
|
|
230
230
|
|
|
231
231
|
const iceListener = () => {
|
|
232
|
-
LoggerProxy.logger.log(
|
|
232
|
+
LoggerProxy.logger.log(
|
|
233
|
+
`Media:properties#waitForIceConnectedState --> ice state: ${this.peerConnection.iceConnectionState}, conn state: ${this.peerConnection.connectionState}`
|
|
234
|
+
);
|
|
233
235
|
|
|
234
236
|
if (isIceConnected()) {
|
|
235
237
|
clearTimeout(timer);
|
|
@@ -263,9 +265,10 @@ export default class MediaProperties {
|
|
|
263
265
|
const statsResult = await this.peerConnection.getStats();
|
|
264
266
|
|
|
265
267
|
statsResult.forEach((report) => allStatsReports.push(report));
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
|
|
268
|
+
} catch (error) {
|
|
269
|
+
LoggerProxy.logger.warn(
|
|
270
|
+
`Media:properties#getCurrentConnectionType --> getStats() failed: ${error}`
|
|
271
|
+
);
|
|
269
272
|
}
|
|
270
273
|
|
|
271
274
|
const successfulCandidatePairs = allStatsReports.filter(
|
|
@@ -276,10 +279,14 @@ export default class MediaProperties {
|
|
|
276
279
|
|
|
277
280
|
// all of the successful pairs should have the same connection type, so just return the type for the first one
|
|
278
281
|
successfulCandidatePairs.some((pair) => {
|
|
279
|
-
const localCandidate = allStatsReports.find(
|
|
282
|
+
const localCandidate = allStatsReports.find(
|
|
283
|
+
(report) => report.type === 'local-candidate' && report.id === pair.localCandidateId
|
|
284
|
+
);
|
|
280
285
|
|
|
281
286
|
if (localCandidate === undefined) {
|
|
282
|
-
LoggerProxy.logger.warn(
|
|
287
|
+
LoggerProxy.logger.warn(
|
|
288
|
+
`Media:properties#getCurrentConnectionType --> failed to find local candidate "${pair.localCandidateId}" in getStats() results`
|
|
289
|
+
);
|
|
283
290
|
|
|
284
291
|
return false;
|
|
285
292
|
}
|
|
@@ -288,8 +295,7 @@ export default class MediaProperties {
|
|
|
288
295
|
|
|
289
296
|
if (localCandidate.relayProtocol) {
|
|
290
297
|
connectionType = `TURN-${localCandidate.relayProtocol.toUpperCase()}`;
|
|
291
|
-
}
|
|
292
|
-
else {
|
|
298
|
+
} else {
|
|
293
299
|
connectionType = localCandidate.protocol?.toUpperCase(); // it will be UDP or TCP
|
|
294
300
|
}
|
|
295
301
|
|
package/src/media/util.ts
CHANGED
|
@@ -15,7 +15,7 @@ MediaUtil.createPeerConnection = (turnServerInfo) => {
|
|
|
15
15
|
config.iceServers.push({
|
|
16
16
|
urls: turnServerInfo.url,
|
|
17
17
|
username: turnServerInfo.username || '',
|
|
18
|
-
credential: turnServerInfo.password || ''
|
|
18
|
+
credential: turnServerInfo.password || '',
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
21
|
if (isBrowser('firefox')) {
|
|
@@ -27,7 +27,7 @@ MediaUtil.createPeerConnection = (turnServerInfo) => {
|
|
|
27
27
|
|
|
28
28
|
MediaUtil.createMediaStream = (tracks) => {
|
|
29
29
|
if (!tracks) {
|
|
30
|
-
LoggerProxy.logger.error(
|
|
30
|
+
LoggerProxy.logger.error("Media:util#createMediaStream --> Tracks don't exist");
|
|
31
31
|
}
|
|
32
32
|
const filtredTracks = tracks.filter((element) => !!element);
|
|
33
33
|
|