@webex/plugin-meetings 3.0.0-beta.1 → 3.0.0-beta.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/common/browser-detection.js.map +1 -1
- package/dist/common/collection.js.map +1 -1
- package/dist/common/config.js.map +1 -1
- package/dist/common/errors/captcha-error.js +7 -0
- package/dist/common/errors/captcha-error.js.map +1 -1
- package/dist/common/errors/intent-to-join.js +8 -0
- package/dist/common/errors/intent-to-join.js.map +1 -1
- package/dist/common/errors/join-meeting.js +8 -0
- package/dist/common/errors/join-meeting.js.map +1 -1
- package/dist/common/errors/media.js +7 -0
- package/dist/common/errors/media.js.map +1 -1
- package/dist/common/errors/parameter.js.map +1 -1
- package/dist/common/errors/password-error.js +7 -0
- package/dist/common/errors/password-error.js.map +1 -1
- package/dist/common/errors/permission.js +7 -0
- package/dist/common/errors/permission.js.map +1 -1
- package/dist/common/errors/reconnection-in-progress.js.map +1 -1
- package/dist/common/errors/reconnection.js +7 -0
- package/dist/common/errors/reconnection.js.map +1 -1
- package/dist/common/errors/stats.js +7 -0
- package/dist/common/errors/stats.js.map +1 -1
- package/dist/common/errors/webex-errors.js +5 -29
- package/dist/common/errors/webex-errors.js.map +1 -1
- package/dist/common/errors/webex-meetings-error.js +5 -2
- package/dist/common/errors/webex-meetings-error.js.map +1 -1
- package/dist/common/events/events-scope.js.map +1 -1
- package/dist/common/events/events.js.map +1 -1
- package/dist/common/events/trigger-proxy.js.map +1 -1
- package/dist/common/events/util.js.map +1 -1
- package/dist/common/logs/logger-config.js.map +1 -1
- package/dist/common/logs/logger-proxy.js.map +1 -1
- package/dist/common/logs/request.js +3 -0
- package/dist/common/logs/request.js.map +1 -1
- package/dist/common/queue.js.map +1 -1
- package/dist/config.js +1 -0
- package/dist/config.js.map +1 -1
- package/dist/constants.js +15 -74
- package/dist/constants.js.map +1 -1
- package/dist/locus-info/controlsUtils.js.map +1 -1
- package/dist/locus-info/embeddedAppsUtils.js.map +1 -1
- package/dist/locus-info/fullState.js.map +1 -1
- package/dist/locus-info/hostUtils.js.map +1 -1
- package/dist/locus-info/index.js +43 -5
- package/dist/locus-info/index.js.map +1 -1
- package/dist/locus-info/infoUtils.js +4 -0
- package/dist/locus-info/infoUtils.js.map +1 -1
- package/dist/locus-info/mediaSharesUtils.js.map +1 -1
- package/dist/locus-info/parser.js +12 -3
- package/dist/locus-info/parser.js.map +1 -1
- package/dist/locus-info/selfUtils.js.map +1 -1
- package/dist/media/index.js +71 -210
- package/dist/media/index.js.map +1 -1
- package/dist/media/internal-media-core-wrapper.js +22 -0
- package/dist/media/internal-media-core-wrapper.js.map +1 -0
- package/dist/media/properties.js +32 -25
- package/dist/media/properties.js.map +1 -1
- package/dist/media/util.js +0 -27
- package/dist/media/util.js.map +1 -1
- package/dist/mediaQualityMetrics/config.js.map +1 -1
- package/dist/meeting/effectsState.js +8 -1
- package/dist/meeting/effectsState.js.map +1 -1
- package/dist/meeting/index.js +1146 -602
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting/muteState.js +6 -0
- package/dist/meeting/muteState.js.map +1 -1
- package/dist/meeting/request.js +83 -24
- package/dist/meeting/request.js.map +1 -1
- package/dist/meeting/state.js.map +1 -1
- package/dist/meeting/util.js +5 -44
- package/dist/meeting/util.js.map +1 -1
- package/dist/meeting-info/collection.js +4 -1
- package/dist/meeting-info/collection.js.map +1 -1
- package/dist/meeting-info/index.js +5 -0
- package/dist/meeting-info/index.js.map +1 -1
- package/dist/meeting-info/meeting-info-v2.js +14 -2
- package/dist/meeting-info/meeting-info-v2.js.map +1 -1
- package/dist/meeting-info/request.js +3 -0
- package/dist/meeting-info/request.js.map +1 -1
- package/dist/meeting-info/util.js.map +1 -1
- package/dist/meeting-info/utilv2.js.map +1 -1
- package/dist/meetings/collection.js +4 -1
- package/dist/meetings/collection.js.map +1 -1
- package/dist/meetings/index.js +136 -25
- package/dist/meetings/index.js.map +1 -1
- package/dist/meetings/request.js +4 -0
- package/dist/meetings/request.js.map +1 -1
- package/dist/meetings/util.js +24 -1
- package/dist/meetings/util.js.map +1 -1
- package/dist/member/index.js +30 -7
- package/dist/member/index.js.map +1 -1
- package/dist/member/util.js +2 -1
- package/dist/member/util.js.map +1 -1
- package/dist/members/collection.js +1 -0
- package/dist/members/collection.js.map +1 -1
- package/dist/members/index.js +82 -1
- package/dist/members/index.js.map +1 -1
- package/dist/members/request.js +19 -9
- package/dist/members/request.js.map +1 -1
- package/dist/members/util.js.map +1 -1
- package/dist/metrics/config.js.map +1 -1
- package/dist/metrics/constants.js.map +1 -1
- package/dist/metrics/index.js +8 -0
- package/dist/metrics/index.js.map +1 -1
- package/dist/multistream/mediaRequestManager.js +133 -0
- package/dist/multistream/mediaRequestManager.js.map +1 -0
- package/dist/multistream/multistreamMedia.js +116 -0
- package/dist/multistream/multistreamMedia.js.map +1 -0
- package/dist/multistream/receiveSlot.js +209 -0
- package/dist/multistream/receiveSlot.js.map +1 -0
- package/dist/multistream/receiveSlotManager.js +195 -0
- package/dist/multistream/receiveSlotManager.js.map +1 -0
- package/dist/multistream/remoteMedia.js +289 -0
- package/dist/multistream/remoteMedia.js.map +1 -0
- package/dist/multistream/remoteMediaGroup.js +243 -0
- package/dist/multistream/remoteMediaGroup.js.map +1 -0
- package/dist/multistream/remoteMediaManager.js +1113 -0
- package/dist/multistream/remoteMediaManager.js.map +1 -0
- package/dist/networkQualityMonitor/index.js +10 -2
- package/dist/networkQualityMonitor/index.js.map +1 -1
- package/dist/personal-meeting-room/index.js +11 -0
- package/dist/personal-meeting-room/index.js.map +1 -1
- package/dist/personal-meeting-room/request.js +2 -1
- package/dist/personal-meeting-room/request.js.map +1 -1
- package/dist/personal-meeting-room/util.js.map +1 -1
- package/dist/reachability/index.js +17 -7
- package/dist/reachability/index.js.map +1 -1
- package/dist/reachability/request.js +1 -0
- package/dist/reachability/request.js.map +1 -1
- package/dist/reactions/reactions.js +111 -0
- package/dist/reactions/reactions.js.map +1 -0
- package/dist/reactions/reactions.type.js +40 -0
- package/dist/reactions/reactions.type.js.map +1 -0
- package/dist/reconnection-manager/index.js +130 -132
- package/dist/reconnection-manager/index.js.map +1 -1
- package/dist/roap/index.js +58 -231
- package/dist/roap/index.js.map +1 -1
- package/dist/roap/request.js +7 -116
- package/dist/roap/request.js.map +1 -1
- package/dist/roap/turnDiscovery.js +20 -6
- package/dist/roap/turnDiscovery.js.map +1 -1
- package/dist/statsAnalyzer/global.js +2 -0
- package/dist/statsAnalyzer/global.js.map +1 -1
- package/dist/statsAnalyzer/index.js +58 -37
- package/dist/statsAnalyzer/index.js.map +1 -1
- package/dist/statsAnalyzer/mqaUtil.js +9 -3
- package/dist/statsAnalyzer/mqaUtil.js.map +1 -1
- package/dist/transcription/index.js +10 -3
- package/dist/transcription/index.js.map +1 -1
- package/package.json +21 -20
- package/src/common/{browser-detection.js → browser-detection.ts} +1 -1
- package/src/common/collection.ts +6 -6
- package/src/common/{config.js → config.ts} +1 -1
- package/src/common/errors/{captcha-error.js → captcha-error.ts} +5 -1
- package/src/common/errors/{intent-to-join.js → intent-to-join.ts} +6 -1
- package/src/common/errors/{join-meeting.js → join-meeting.ts} +6 -1
- package/src/common/errors/{media.js → media.ts} +5 -1
- package/src/common/errors/parameter.ts +3 -2
- package/src/common/errors/{password-error.js → password-error.ts} +5 -1
- package/src/common/errors/{permission.js → permission.ts} +5 -1
- package/src/common/errors/{reconnection-in-progress.js → reconnection-in-progress.ts} +0 -0
- package/src/common/errors/{reconnection.js → reconnection.ts} +5 -1
- package/src/common/errors/{stats.js → stats.ts} +5 -1
- package/src/common/errors/{webex-errors.js → webex-errors.ts} +1 -20
- package/src/common/errors/{webex-meetings-error.js → webex-meetings-error.ts} +3 -1
- package/src/common/events/{events-scope.js → events-scope.ts} +1 -1
- package/src/common/events/{events.js → events.ts} +0 -0
- package/src/common/events/{trigger-proxy.js → trigger-proxy.ts} +1 -2
- package/src/common/events/{util.js → util.ts} +1 -1
- package/src/common/logs/{logger-config.js → logger-config.ts} +1 -2
- package/src/common/logs/{logger-proxy.js → logger-proxy.ts} +1 -1
- package/src/common/logs/{request.js → request.ts} +12 -2
- package/src/common/queue.ts +1 -2
- package/src/{config.js → config.ts} +2 -0
- package/src/constants.ts +139 -179
- package/src/locus-info/{controlsUtils.js → controlsUtils.ts} +4 -4
- package/src/locus-info/{embeddedAppsUtils.js → embeddedAppsUtils.ts} +5 -6
- package/src/locus-info/{fullState.js → fullState.ts} +1 -1
- package/src/locus-info/{hostUtils.js → hostUtils.ts} +5 -5
- package/src/locus-info/{index.js → index.ts} +67 -32
- package/src/locus-info/{infoUtils.js → infoUtils.ts} +7 -4
- package/src/locus-info/{mediaSharesUtils.js → mediaSharesUtils.ts} +13 -13
- package/src/locus-info/{parser.js → parser.ts} +22 -12
- package/src/locus-info/{selfUtils.js → selfUtils.ts} +17 -19
- package/src/media/{index.js → index.ts} +130 -205
- package/src/media/internal-media-core-wrapper.ts +9 -0
- package/src/media/{properties.js → properties.ts} +35 -29
- package/src/media/util.ts +16 -0
- package/src/mediaQualityMetrics/{config.js → config.ts} +1 -1
- package/src/meeting/{effectsState.js → effectsState.ts} +12 -6
- package/src/meeting/{index.js → index.ts} +993 -474
- package/src/meeting/{muteState.js → muteState.ts} +16 -11
- package/src/meeting/{request.js → request.ts} +148 -36
- package/src/meeting/{state.js → state.ts} +6 -6
- package/src/meeting/{util.js → util.ts} +9 -51
- package/src/meeting-info/{collection.js → collection.ts} +4 -1
- package/src/meeting-info/{index.js → index.ts} +10 -6
- package/src/meeting-info/{meeting-info-v2.js → meeting-info-v2.ts} +28 -10
- package/src/meeting-info/{request.js → request.ts} +6 -2
- package/src/meeting-info/{util.js → util.ts} +6 -5
- package/src/meeting-info/{utilv2.js → utilv2.ts} +8 -7
- package/src/meetings/{collection.js → collection.ts} +5 -2
- package/src/meetings/{index.js → index.ts} +118 -22
- package/src/meetings/{request.js → request.ts} +6 -1
- package/src/meetings/{util.js → util.ts} +28 -5
- package/src/member/{index.js → index.ts} +46 -15
- package/src/member/{util.js → util.ts} +17 -16
- package/src/members/{collection.js → collection.ts} +2 -1
- package/src/members/{index.js → index.ts} +94 -26
- package/src/members/{request.js → request.ts} +16 -5
- package/src/members/{util.js → util.ts} +7 -7
- package/src/metrics/{config.js → config.ts} +0 -2
- package/src/metrics/{constants.js → constants.ts} +0 -0
- package/src/metrics/{index.js → index.ts} +27 -8
- package/src/multistream/mediaRequestManager.ts +166 -0
- package/src/multistream/multistreamMedia.ts +92 -0
- package/src/multistream/receiveSlot.ts +141 -0
- package/src/multistream/receiveSlotManager.ts +142 -0
- package/src/multistream/remoteMedia.ts +228 -0
- package/src/multistream/remoteMediaGroup.ts +224 -0
- package/src/multistream/remoteMediaManager.ts +911 -0
- package/src/networkQualityMonitor/{index.js → index.ts} +18 -3
- package/src/personal-meeting-room/{index.js → index.ts} +17 -4
- package/src/personal-meeting-room/{request.js → request.ts} +3 -1
- package/src/personal-meeting-room/{util.js → util.ts} +1 -1
- package/src/reachability/{index.js → index.ts} +28 -17
- package/src/reachability/request.ts +4 -2
- package/src/reactions/reactions.ts +104 -0
- package/src/reactions/reactions.type.ts +36 -0
- package/src/reconnection-manager/{index.js → index.ts} +81 -65
- package/src/roap/index.ts +229 -0
- package/src/roap/{request.js → request.ts} +15 -74
- package/src/roap/turnDiscovery.ts +26 -11
- package/src/statsAnalyzer/{global.js → global.ts} +2 -0
- package/src/statsAnalyzer/{index.js → index.ts} +66 -61
- package/src/statsAnalyzer/{mqaUtil.js → mqaUtil.ts} +6 -1
- package/src/transcription/{index.js → index.ts} +16 -11
- package/test/integration/spec/journey.js +1 -1
- package/test/integration/spec/space-meeting.js +1 -2
- package/test/unit/spec/locus-info/infoUtils.js +17 -1
- package/test/unit/spec/media/index.ts +207 -0
- package/test/unit/spec/media/properties.ts +73 -82
- package/test/unit/spec/meeting/effectsState.js +1 -3
- package/test/unit/spec/meeting/index.js +672 -245
- package/test/unit/spec/meeting/muteState.js +7 -0
- package/test/unit/spec/meeting/request.js +25 -1
- package/test/unit/spec/meeting/utils.js +63 -2
- package/test/unit/spec/meetings/index.js +0 -4
- package/test/unit/spec/members/index.js +164 -2
- package/test/unit/spec/multistream/mediaRequestManager.ts +515 -0
- package/test/unit/spec/multistream/receiveSlot.ts +104 -0
- package/test/unit/spec/multistream/receiveSlotManager.ts +173 -0
- package/test/unit/spec/multistream/remoteMedia.ts +225 -0
- package/test/unit/spec/multistream/remoteMediaGroup.ts +396 -0
- package/test/unit/spec/multistream/remoteMediaManager.ts +1309 -0
- package/test/unit/spec/reconnection-manager/index.js +68 -2
- package/test/unit/spec/roap/index.ts +63 -35
- package/test/unit/spec/stats-analyzer/index.js +19 -22
- package/dist/peer-connection-manager/index.js +0 -794
- package/dist/peer-connection-manager/index.js.map +0 -1
- package/dist/peer-connection-manager/util.js +0 -124
- package/dist/peer-connection-manager/util.js.map +0 -1
- package/dist/roap/collection.js +0 -73
- package/dist/roap/collection.js.map +0 -1
- package/dist/roap/handler.js +0 -337
- package/dist/roap/handler.js.map +0 -1
- package/dist/roap/state.js +0 -164
- package/dist/roap/state.js.map +0 -1
- package/dist/roap/util.js +0 -102
- package/dist/roap/util.js.map +0 -1
- package/src/media/util.js +0 -38
- package/src/peer-connection-manager/index.js +0 -723
- package/src/peer-connection-manager/util.ts +0 -117
- package/src/roap/collection.js +0 -63
- package/src/roap/handler.js +0 -252
- package/src/roap/index.js +0 -380
- package/src/roap/state.js +0 -149
- package/src/roap/util.js +0 -93
- package/test/unit/spec/peerconnection-manager/index.js +0 -188
- package/test/unit/spec/peerconnection-manager/utils.js +0 -48
- package/test/unit/spec/peerconnection-manager/utils.test-fixtures.ts +0 -389
- package/test/unit/spec/roap/util.js +0 -30
|
@@ -7,15 +7,15 @@ import LoggerProxy from '../common/logs/logger-proxy';
|
|
|
7
7
|
import {
|
|
8
8
|
AUDIO_INPUT,
|
|
9
9
|
VIDEO_INPUT,
|
|
10
|
-
|
|
11
|
-
MEDIA_TRACK_CONSTRAINT
|
|
10
|
+
MEDIA_TRACK_CONSTRAINT,
|
|
12
11
|
} from '../constants';
|
|
13
12
|
import Config from '../config';
|
|
14
|
-
import
|
|
15
|
-
import ReconnectionError from '../common/errors/reconnection';
|
|
13
|
+
import StaticConfig from '../common/config';
|
|
16
14
|
import MediaError from '../common/errors/media';
|
|
17
15
|
import BrowserDetection from '../common/browser-detection';
|
|
18
16
|
|
|
17
|
+
import {RoapMediaConnection, MultistreamRoapMediaConnection} from './internal-media-core-wrapper';
|
|
18
|
+
|
|
19
19
|
const {isBrowser} = BrowserDetection();
|
|
20
20
|
|
|
21
21
|
/**
|
|
@@ -46,7 +46,7 @@ const {isBrowser} = BrowserDetection();
|
|
|
46
46
|
* Handles the quirks of each browser.
|
|
47
47
|
* Extends and enhances adapter.js, i.e., the "media" file from the web client.
|
|
48
48
|
*/
|
|
49
|
-
const Media = {};
|
|
49
|
+
const Media: any = {};
|
|
50
50
|
|
|
51
51
|
/**
|
|
52
52
|
* @param {boolean} enabled
|
|
@@ -54,7 +54,7 @@ const Media = {};
|
|
|
54
54
|
* @returns {Boolean}
|
|
55
55
|
* @public
|
|
56
56
|
*/
|
|
57
|
-
Media.setLocalTrack = (enabled, track) => {
|
|
57
|
+
Media.setLocalTrack = (enabled: boolean, track: MediaStreamTrack) => {
|
|
58
58
|
if (track) {
|
|
59
59
|
track.enabled = enabled;
|
|
60
60
|
|
|
@@ -64,32 +64,6 @@ Media.setLocalTrack = (enabled, track) => {
|
|
|
64
64
|
return false;
|
|
65
65
|
};
|
|
66
66
|
|
|
67
|
-
/**
|
|
68
|
-
* @param {RTCPeerConnection} peerConnection
|
|
69
|
-
* @param {Object} meetingProperties
|
|
70
|
-
* @param {string} meetingProperties.meetingId
|
|
71
|
-
* @param {string} meetingProperties.remoteQualityLevel LOW|MEDIUM|HIGH
|
|
72
|
-
* @returns {Promise}
|
|
73
|
-
*/
|
|
74
|
-
Media.reconnectMedia = (peerConnection, {
|
|
75
|
-
meetingId,
|
|
76
|
-
remoteQualityLevel,
|
|
77
|
-
enableRtx,
|
|
78
|
-
enableExtmap
|
|
79
|
-
}) => {
|
|
80
|
-
if (peerConnection.connectionState === PEER_CONNECTION_STATE.CLOSED ||
|
|
81
|
-
peerConnection.connectionState === PEER_CONNECTION_STATE.FAILED) {
|
|
82
|
-
return Promise.reject(new ReconnectionError('Reinitiate peerconnection'));
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
return PeerConnectionManager.createOffer(peerConnection, {
|
|
86
|
-
meetingId,
|
|
87
|
-
remoteQualityLevel,
|
|
88
|
-
enableRtx,
|
|
89
|
-
enableExtmap
|
|
90
|
-
});
|
|
91
|
-
};
|
|
92
|
-
|
|
93
67
|
/**
|
|
94
68
|
* format the media array for send
|
|
95
69
|
* @param {String} mediaId
|
|
@@ -97,7 +71,7 @@ Media.reconnectMedia = (peerConnection, {
|
|
|
97
71
|
* @param {Boolean} videoMuted
|
|
98
72
|
* @returns {Array} medias
|
|
99
73
|
*/
|
|
100
|
-
Media.generateLocalMedias = (mediaId, audioMuted, videoMuted) => {
|
|
74
|
+
Media.generateLocalMedias = (mediaId: string, audioMuted: boolean, videoMuted: boolean) => {
|
|
101
75
|
if (mediaId) {
|
|
102
76
|
return [
|
|
103
77
|
{
|
|
@@ -119,7 +93,7 @@ Media.generateLocalMedias = (mediaId, audioMuted, videoMuted) => {
|
|
|
119
93
|
* @param {Object} config SDK Configuration for meetings plugin
|
|
120
94
|
* @returns {Promise}
|
|
121
95
|
*/
|
|
122
|
-
Media.getLocalMedia = (options, config) => {
|
|
96
|
+
Media.getLocalMedia = (options: any, config: object) => {
|
|
123
97
|
const {
|
|
124
98
|
sendAudio, sendVideo, sendShare, sharePreferences, isSharing
|
|
125
99
|
} = options;
|
|
@@ -141,186 +115,110 @@ Media.getLocalMedia = (options, config) => {
|
|
|
141
115
|
|
|
142
116
|
return Promise.resolve(undefined);
|
|
143
117
|
};
|
|
118
|
+
|
|
144
119
|
/**
|
|
145
|
-
*
|
|
146
|
-
*
|
|
147
|
-
* @param {
|
|
148
|
-
* @param {
|
|
149
|
-
* @
|
|
120
|
+
* creates a webrtc media connection with provided tracks and mediaDirection configuration
|
|
121
|
+
*
|
|
122
|
+
* @param {boolean} isMultistream
|
|
123
|
+
* @param {string} debugId string useful for debugging (will appear in media connection logs)
|
|
124
|
+
* @param {Object} options
|
|
125
|
+
* @param {Object} [options.mediaProperties] only applicable to non-multistream connections, contains mediaDirection and local tracks:
|
|
126
|
+
* audioTrack, videoTrack and shareTrack
|
|
127
|
+
* @param {string} [options.remoteQualityLevel] LOW|MEDIUM|HIGH applicable only to non-multistream connections
|
|
128
|
+
* @param {boolean} [options.enableRtx] applicable only to non-multistream connections
|
|
129
|
+
* @param {boolean} [options.enableExtmap] applicable only to non-multistream connections
|
|
130
|
+
* @param {Object} [options.turnServerInfo]
|
|
131
|
+
* @returns {RoapMediaConnection}
|
|
150
132
|
*/
|
|
151
|
-
Media.
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
133
|
+
Media.createMediaConnection = (
|
|
134
|
+
isMultistream: boolean,
|
|
135
|
+
debugId: string,
|
|
136
|
+
options: {
|
|
137
|
+
mediaProperties?: {
|
|
138
|
+
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,
|
|
150
|
+
turnServerInfo?: {
|
|
151
|
+
url: string,
|
|
152
|
+
username: string,
|
|
153
|
+
password: string
|
|
159
154
|
}
|
|
160
|
-
|
|
161
|
-
return 'inactive';
|
|
162
|
-
};
|
|
163
|
-
|
|
164
|
-
if (track) {
|
|
165
|
-
return {track, direction: getDirection(!!track, receiveTracks)};
|
|
166
155
|
}
|
|
167
|
-
|
|
168
|
-
return {track: trackType, direction: getDirection(!!track, receiveTracks)};
|
|
169
|
-
};
|
|
170
|
-
/**
|
|
171
|
-
* creates peerconnection and attaches streams
|
|
172
|
-
* @param {MediaDirection} mediaProperties
|
|
173
|
-
* @param {Object} meetingProperties
|
|
174
|
-
* @param {string} meetingProperties.meetingId
|
|
175
|
-
* @param {string} meetingProperties.remoteQualityLevel LOW|MEDIUM|HIGH
|
|
176
|
-
* @returns {Array} [peerConnection, ]
|
|
177
|
-
*/
|
|
178
|
-
Media.attachMedia = (mediaProperties, {
|
|
179
|
-
meetingId,
|
|
180
|
-
remoteQualityLevel,
|
|
181
|
-
enableRtx,
|
|
182
|
-
enableExtmap
|
|
183
|
-
}) => {
|
|
156
|
+
) => {
|
|
184
157
|
const {
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
} =
|
|
191
|
-
|
|
192
|
-
let result = null;
|
|
193
|
-
|
|
194
|
-
// Add Transceiver for audio
|
|
195
|
-
result = Media.checkTracks('audio', mediaDirection.sendAudio && audioTrack, mediaDirection.receiveAudio);
|
|
196
|
-
peerConnection.audioTransceiver = peerConnection.addTransceiver(result.track, {direction: result.direction});
|
|
158
|
+
mediaProperties,
|
|
159
|
+
remoteQualityLevel,
|
|
160
|
+
enableRtx,
|
|
161
|
+
enableExtmap,
|
|
162
|
+
turnServerInfo
|
|
163
|
+
} = options;
|
|
197
164
|
|
|
198
|
-
|
|
199
|
-
result = Media.checkTracks('video', mediaDirection.sendVideo && videoTrack, mediaDirection.receiveVideo);
|
|
200
|
-
peerConnection.videoTransceiver = peerConnection.addTransceiver(result.track, {direction: result.direction});
|
|
165
|
+
const iceServers = [];
|
|
201
166
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
167
|
+
if (turnServerInfo) {
|
|
168
|
+
iceServers.push({
|
|
169
|
+
urls: turnServerInfo.url,
|
|
170
|
+
username: turnServerInfo.username || '',
|
|
171
|
+
credential: turnServerInfo.password || ''
|
|
172
|
+
});
|
|
173
|
+
}
|
|
205
174
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
175
|
+
if (isMultistream) {
|
|
176
|
+
return new MultistreamRoapMediaConnection({
|
|
177
|
+
iceServers,
|
|
178
|
+
}, debugId);
|
|
179
|
+
}
|
|
209
180
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
enableRtx,
|
|
214
|
-
enableExtmap
|
|
215
|
-
});
|
|
216
|
-
};
|
|
181
|
+
if (!mediaProperties) {
|
|
182
|
+
throw new Error('mediaProperties have to be provided for non-multistream media connections');
|
|
183
|
+
}
|
|
217
184
|
|
|
218
|
-
/**
|
|
219
|
-
* updates all the media streams and creates a new media offer
|
|
220
|
-
* @param {MediaDirection} mediaProperties
|
|
221
|
-
* @param {Object} meetingProperties
|
|
222
|
-
* @param {string} meetingProperties.meetingId
|
|
223
|
-
* @param {string} meetingProperties.remoteQualityLevel LOW|MEDIUM|HIGH
|
|
224
|
-
* @returns {Promise}
|
|
225
|
-
*/
|
|
226
|
-
Media.updateMedia = (mediaProperties, {
|
|
227
|
-
meetingId,
|
|
228
|
-
remoteQualityLevel,
|
|
229
|
-
enableRtx,
|
|
230
|
-
enableExtmap
|
|
231
|
-
}) => {
|
|
232
185
|
const {
|
|
233
186
|
mediaDirection,
|
|
234
187
|
audioTrack,
|
|
235
188
|
videoTrack,
|
|
236
|
-
shareTrack
|
|
237
|
-
peerConnection
|
|
189
|
+
shareTrack
|
|
238
190
|
} = mediaProperties;
|
|
239
191
|
|
|
240
|
-
// update audio transceiver
|
|
241
|
-
Media.setTrackOnTransceiver(peerConnection.audioTransceiver, {
|
|
242
|
-
type: 'audio',
|
|
243
|
-
track: audioTrack,
|
|
244
|
-
sendTrack: mediaDirection.sendAudio && audioTrack,
|
|
245
|
-
receiveTrack: mediaDirection.receiveAudio
|
|
246
|
-
});
|
|
247
192
|
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
peerConnection.onnegotiationneeded = (event) => {
|
|
264
|
-
LoggerProxy.logger.info(`Media:index#updateMedia --> onnegotiationneeded#PeerConnection: ${event}`);
|
|
265
|
-
};
|
|
266
|
-
|
|
267
|
-
return PeerConnectionManager.createOffer(peerConnection, {
|
|
268
|
-
meetingId,
|
|
269
|
-
remoteQualityLevel,
|
|
270
|
-
enableRtx,
|
|
271
|
-
enableExtmap
|
|
272
|
-
});
|
|
273
|
-
};
|
|
274
|
-
|
|
275
|
-
/**
|
|
276
|
-
* @param {RTCRtpTransceiver} transceiver
|
|
277
|
-
* @param {Object} options
|
|
278
|
-
* @param {MediaStreamTrack} options.track
|
|
279
|
-
* @returns {undefined}
|
|
280
|
-
*/
|
|
281
|
-
Media.setTrackOnTransceiver = (transceiver, options) => {
|
|
282
|
-
const {
|
|
283
|
-
type, track, sendTrack, receiveTrack
|
|
284
|
-
} = options;
|
|
285
|
-
|
|
286
|
-
try {
|
|
287
|
-
const result = Media.checkTracks(type, sendTrack && track, receiveTrack);
|
|
288
|
-
|
|
289
|
-
transceiver.direction = result.direction;
|
|
290
|
-
if (options.track) {
|
|
291
|
-
transceiver.sender.replaceTrack(track);
|
|
193
|
+
return new RoapMediaConnection({
|
|
194
|
+
iceServers,
|
|
195
|
+
skipInactiveTransceivers: false,
|
|
196
|
+
requireH264: true,
|
|
197
|
+
sdpMunging: {
|
|
198
|
+
convertPort9to0: false,
|
|
199
|
+
addContentSlides: true,
|
|
200
|
+
bandwidthLimits: {
|
|
201
|
+
audio: StaticConfig.meetings.bandwidth.audio,
|
|
202
|
+
video: StaticConfig.meetings.bandwidth.video,
|
|
203
|
+
},
|
|
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
|
|
292
208
|
}
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
* @param {RTCRtpTransceiver} transceiver
|
|
307
|
-
* @param {Object} options see #Media.setTrackOnTransceiver
|
|
308
|
-
* @returns {Promise}
|
|
309
|
-
*/
|
|
310
|
-
Media.updateTransceiver = ({
|
|
311
|
-
meetingId,
|
|
312
|
-
remoteQualityLevel,
|
|
313
|
-
enableRtx,
|
|
314
|
-
enableExtmap
|
|
315
|
-
}, peerConnection, transceiver, options) => {
|
|
316
|
-
Media.setTrackOnTransceiver(transceiver, options);
|
|
317
|
-
|
|
318
|
-
return PeerConnectionManager.createOffer(peerConnection, {
|
|
319
|
-
meetingId,
|
|
320
|
-
remoteQualityLevel,
|
|
321
|
-
enableRtx,
|
|
322
|
-
enableExtmap
|
|
323
|
-
});
|
|
209
|
+
}, {
|
|
210
|
+
send: {
|
|
211
|
+
audio: audioTrack,
|
|
212
|
+
video: videoTrack,
|
|
213
|
+
screenShareVideo: shareTrack
|
|
214
|
+
},
|
|
215
|
+
receive: {
|
|
216
|
+
audio: mediaDirection.receiveAudio,
|
|
217
|
+
video: mediaDirection.receiveVideo,
|
|
218
|
+
screenShareVideo: mediaDirection.receiveShare,
|
|
219
|
+
remoteQualityLevel
|
|
220
|
+
}
|
|
221
|
+
}, debugId);
|
|
324
222
|
};
|
|
325
223
|
|
|
326
224
|
/**
|
|
@@ -335,7 +233,17 @@ Media.updateTransceiver = ({
|
|
|
335
233
|
* @param {Object} config SDK Configuration for meetings plugin
|
|
336
234
|
* @returns {Promise.<MediaStream>}
|
|
337
235
|
*/
|
|
338
|
-
Media.getDisplayMedia = (
|
|
236
|
+
Media.getDisplayMedia = (
|
|
237
|
+
options: {
|
|
238
|
+
sendAudio: boolean;
|
|
239
|
+
sendShare: boolean;
|
|
240
|
+
sharePreferences: {
|
|
241
|
+
shareConstraints: MediaTrackConstraints;
|
|
242
|
+
highFrameRate: any;
|
|
243
|
+
};
|
|
244
|
+
},
|
|
245
|
+
config: any = {}
|
|
246
|
+
) => {
|
|
339
247
|
// SDK screen share resolution settings from Webex.init
|
|
340
248
|
const customResolution = config.screenResolution || {};
|
|
341
249
|
// user defined screen share frame rate
|
|
@@ -352,7 +260,7 @@ Media.getDisplayMedia = (options, config = {}) => {
|
|
|
352
260
|
aspectRatio
|
|
353
261
|
} = Config.meetings;
|
|
354
262
|
|
|
355
|
-
let shareConstraints = {
|
|
263
|
+
let shareConstraints: any = {
|
|
356
264
|
cursor: MEDIA_TRACK_CONSTRAINT.CURSOR.AWLAYS,
|
|
357
265
|
aspectRatio
|
|
358
266
|
};
|
|
@@ -388,7 +296,7 @@ Media.getDisplayMedia = (options, config = {}) => {
|
|
|
388
296
|
|
|
389
297
|
|
|
390
298
|
if (isBrowser('firefox')) {
|
|
391
|
-
const mediaConfig = {
|
|
299
|
+
const mediaConfig: any = {
|
|
392
300
|
audio: options.sendAudio,
|
|
393
301
|
video: options.sendShare
|
|
394
302
|
};
|
|
@@ -408,7 +316,7 @@ Media.getDisplayMedia = (options, config = {}) => {
|
|
|
408
316
|
});
|
|
409
317
|
}
|
|
410
318
|
|
|
411
|
-
const getDisplayMediaParams = {video: options.sendShare ? shareConstraints : false};
|
|
319
|
+
const getDisplayMediaParams: any = {video: options.sendShare ? shareConstraints : false};
|
|
412
320
|
|
|
413
321
|
// safari doesn't support sending screen share audio
|
|
414
322
|
// https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getDisplayMedia
|
|
@@ -426,7 +334,7 @@ Media.getDisplayMedia = (options, config = {}) => {
|
|
|
426
334
|
* @param {Object} config SDK Configuration for meetings plugin
|
|
427
335
|
* @returns {Object} {streams}
|
|
428
336
|
*/
|
|
429
|
-
Media.getMedia = (audio, video, config) => {
|
|
337
|
+
Media.getMedia = (audio: any | boolean, video: any | boolean, config: any) => {
|
|
430
338
|
const defaultWidth = {ideal: config.resolution.idealWidth, max: config.resolution.maxWidth};
|
|
431
339
|
const defaultHeight = {ideal: config.resolution.idealHeight, max: config.resolution.maxHeight};
|
|
432
340
|
const mediaConfig = {
|
|
@@ -471,7 +379,7 @@ Media.getMedia = (audio, video, config) => {
|
|
|
471
379
|
* sendVideo: true/false
|
|
472
380
|
*}
|
|
473
381
|
*/
|
|
474
|
-
Media.getSupportedDevice = ({sendAudio, sendVideo}) =>
|
|
382
|
+
Media.getSupportedDevice = ({ sendAudio, sendVideo }: { sendAudio: boolean; sendVideo: boolean }) =>
|
|
475
383
|
Promise.resolve().then(() => {
|
|
476
384
|
if (!navigator.mediaDevices || navigator.mediaDevices.enumerateDevices === undefined) {
|
|
477
385
|
return {
|
|
@@ -518,7 +426,7 @@ Media.toggleStream = () => {};
|
|
|
518
426
|
* @param {MediaTrack} track A media stream
|
|
519
427
|
* @returns {null}
|
|
520
428
|
*/
|
|
521
|
-
Media.stopTracks = (track) => {
|
|
429
|
+
Media.stopTracks = (track: any) => {
|
|
522
430
|
if (!track) {
|
|
523
431
|
return Promise.resolve();
|
|
524
432
|
}
|
|
@@ -542,7 +450,7 @@ Media.stopTracks = (track) => {
|
|
|
542
450
|
* @returns {null}
|
|
543
451
|
* @deprecated after v1.89.3
|
|
544
452
|
*/
|
|
545
|
-
Media.stopStream = (stream) => {
|
|
453
|
+
Media.stopStream = (stream: any) => {
|
|
546
454
|
LoggerProxy.logger.warn('Media:index#stopStream --> [DEPRECATION WARNING]: stopStream has been deprecated after v1.89.3');
|
|
547
455
|
if (!stream) {
|
|
548
456
|
return Promise.resolve();
|
|
@@ -581,7 +489,24 @@ Media.stopStream = (stream) => {
|
|
|
581
489
|
* @param {Object} config SDK Config
|
|
582
490
|
* @returns {Array} [localStream, shareStream]
|
|
583
491
|
*/
|
|
584
|
-
Media.getUserMedia = (
|
|
492
|
+
Media.getUserMedia = (
|
|
493
|
+
mediaSetting: {
|
|
494
|
+
sendAudio: object;
|
|
495
|
+
sendVideo: object;
|
|
496
|
+
sendShare: object;
|
|
497
|
+
isSharing: object;
|
|
498
|
+
},
|
|
499
|
+
audioVideo: {
|
|
500
|
+
audio: object;
|
|
501
|
+
video: object;
|
|
502
|
+
},
|
|
503
|
+
sharePreferences: {
|
|
504
|
+
shareConstraints: object;
|
|
505
|
+
highFrameRate: boolean;
|
|
506
|
+
},
|
|
507
|
+
config: object
|
|
508
|
+
) =>
|
|
509
|
+
Media.getLocalMedia({
|
|
585
510
|
sendAudio: mediaSetting.sendAudio ? audioVideo.audio || mediaSetting.sendAudio : false,
|
|
586
511
|
sendVideo: mediaSetting.sendVideo ? audioVideo.video || mediaSetting.sendVideo : false
|
|
587
512
|
}, config).then((localStream) => Media.getLocalMedia({
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import {MediaConnection as MC} from '@webex/internal-media-core';
|
|
2
|
+
|
|
3
|
+
/* We have this wrapper just because otherwise it's impossible to mock
|
|
4
|
+
* RoapMediaConnection and MultistreamRoapMediaConnection constructors in unit tests,
|
|
5
|
+
* because they are exported by @webex/internal-media-core as non-writable, non-configurable
|
|
6
|
+
* properties of MediaConnection and sinon doesn't allow spying on them or stubbing them.
|
|
7
|
+
*/
|
|
8
|
+
export const RoapMediaConnection = MC.RoapMediaConnection;
|
|
9
|
+
export const MultistreamRoapMediaConnection = MC.MultistreamRoapMediaConnection;
|
|
@@ -1,25 +1,36 @@
|
|
|
1
|
+
import {MediaConnection as MC} from '@webex/internal-media-core';
|
|
2
|
+
|
|
1
3
|
import {
|
|
2
|
-
ICE_STATE,
|
|
3
4
|
MEETINGS,
|
|
4
5
|
PC_BAIL_TIMEOUT,
|
|
5
6
|
QUALITY_LEVELS
|
|
6
7
|
} from '../constants';
|
|
7
8
|
import LoggerProxy from '../common/logs/logger-proxy';
|
|
8
9
|
|
|
9
|
-
import MediaUtil from './util';
|
|
10
|
-
|
|
11
10
|
/**
|
|
12
11
|
* @class MediaProperties
|
|
13
12
|
*/
|
|
14
13
|
export default class MediaProperties {
|
|
14
|
+
audioTrack: any;
|
|
15
|
+
localQualityLevel: any;
|
|
16
|
+
mediaDirection: any;
|
|
17
|
+
mediaSettings: any;
|
|
18
|
+
webrtcMediaConnection: any;
|
|
19
|
+
remoteAudioTrack: any;
|
|
20
|
+
remoteQualityLevel: any;
|
|
21
|
+
remoteShare: any;
|
|
22
|
+
remoteVideoTrack: any;
|
|
23
|
+
shareTrack: any;
|
|
24
|
+
videoDeviceId: any;
|
|
25
|
+
videoTrack: any;
|
|
15
26
|
namespace = MEETINGS;
|
|
16
27
|
|
|
17
28
|
/**
|
|
18
29
|
* @param {Object} [options] -- to auto construct
|
|
19
30
|
* @returns {MediaProperties}
|
|
20
31
|
*/
|
|
21
|
-
constructor(options = {}) {
|
|
22
|
-
this.
|
|
32
|
+
constructor(options: any = {}) {
|
|
33
|
+
this.webrtcMediaConnection = null;
|
|
23
34
|
this.mediaDirection = options.mediaDirection;
|
|
24
35
|
this.videoTrack = options.videoTrack;
|
|
25
36
|
this.audioTrack = options.audioTrack;
|
|
@@ -49,8 +60,8 @@ export default class MediaProperties {
|
|
|
49
60
|
this.mediaSettings[type] = values;
|
|
50
61
|
}
|
|
51
62
|
|
|
52
|
-
setMediaPeerConnection(
|
|
53
|
-
this.
|
|
63
|
+
setMediaPeerConnection(mediaPeerConnection) {
|
|
64
|
+
this.webrtcMediaConnection = mediaPeerConnection;
|
|
54
65
|
}
|
|
55
66
|
|
|
56
67
|
setLocalVideoTrack(videoTrack) {
|
|
@@ -82,7 +93,7 @@ export default class MediaProperties {
|
|
|
82
93
|
* @param {MediaTrack} remoteAudioTrack MediaTrack to save
|
|
83
94
|
* @returns {void}
|
|
84
95
|
*/
|
|
85
|
-
setRemoteAudioTrack(remoteAudioTrack) {
|
|
96
|
+
setRemoteAudioTrack(remoteAudioTrack: any) {
|
|
86
97
|
this.remoteAudioTrack = remoteAudioTrack;
|
|
87
98
|
}
|
|
88
99
|
|
|
@@ -91,7 +102,7 @@ export default class MediaProperties {
|
|
|
91
102
|
* @param {MediaTrack} remoteVideoTrack MediaTrack to save
|
|
92
103
|
* @returns {void}
|
|
93
104
|
*/
|
|
94
|
-
setRemoteVideoTrack(remoteVideoTrack) {
|
|
105
|
+
setRemoteVideoTrack(remoteVideoTrack: any) {
|
|
95
106
|
this.remoteVideoTrack = remoteVideoTrack;
|
|
96
107
|
}
|
|
97
108
|
|
|
@@ -100,16 +111,12 @@ export default class MediaProperties {
|
|
|
100
111
|
* @param {string} deviceId Preferred video input device
|
|
101
112
|
* @returns {void}
|
|
102
113
|
*/
|
|
103
|
-
setVideoDeviceId(deviceId) {
|
|
114
|
+
setVideoDeviceId(deviceId: string) {
|
|
104
115
|
this.videoDeviceId = deviceId;
|
|
105
116
|
}
|
|
106
117
|
|
|
107
118
|
unsetPeerConnection() {
|
|
108
|
-
this.
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
reInitiatePeerconnection(turnServerInfo) {
|
|
112
|
-
this.peerConnection = MediaUtil.createPeerConnection(turnServerInfo);
|
|
119
|
+
this.webrtcMediaConnection = null;
|
|
113
120
|
}
|
|
114
121
|
|
|
115
122
|
unsetLocalVideoTrack() {
|
|
@@ -199,39 +206,38 @@ export default class MediaProperties {
|
|
|
199
206
|
}
|
|
200
207
|
|
|
201
208
|
/**
|
|
202
|
-
* Waits
|
|
209
|
+
* Waits for the webrtc media connection to be connected.
|
|
203
210
|
*
|
|
204
211
|
* @returns {Promise<void>}
|
|
205
212
|
*/
|
|
206
|
-
|
|
207
|
-
const
|
|
208
|
-
this.
|
|
209
|
-
this.peerConnection.iceConnectionState === ICE_STATE.COMPLETED
|
|
213
|
+
waitForMediaConnectionConnected() {
|
|
214
|
+
const isConnected = () => (
|
|
215
|
+
this.webrtcMediaConnection.getConnectionState() === MC.ConnectionState.Connected
|
|
210
216
|
);
|
|
211
217
|
|
|
212
|
-
if (
|
|
218
|
+
if (isConnected()) {
|
|
213
219
|
return Promise.resolve();
|
|
214
220
|
}
|
|
215
221
|
|
|
216
222
|
return new Promise((resolve, reject) => {
|
|
217
223
|
let timer;
|
|
218
224
|
|
|
219
|
-
const
|
|
220
|
-
LoggerProxy.logger.log(`Media:properties#
|
|
225
|
+
const connectionStateListener = () => {
|
|
226
|
+
LoggerProxy.logger.log(`Media:properties#waitForMediaConnectionConnected --> connection state: ${this.webrtcMediaConnection.getConnectionState()}`);
|
|
221
227
|
|
|
222
|
-
if (
|
|
228
|
+
if (isConnected()) {
|
|
223
229
|
clearTimeout(timer);
|
|
224
|
-
this.
|
|
230
|
+
this.webrtcMediaConnection.off(MC.Event.CONNECTION_STATE_CHANGED, connectionStateListener);
|
|
225
231
|
resolve();
|
|
226
232
|
}
|
|
227
233
|
};
|
|
228
234
|
|
|
229
235
|
timer = setTimeout(() => {
|
|
230
|
-
this.
|
|
236
|
+
this.webrtcMediaConnection.off(MC.Event.CONNECTION_STATE_CHANGED, connectionStateListener);
|
|
231
237
|
reject();
|
|
232
238
|
}, PC_BAIL_TIMEOUT);
|
|
233
239
|
|
|
234
|
-
this.
|
|
240
|
+
this.webrtcMediaConnection.on(MC.Event.CONNECTION_STATE_CHANGED, connectionStateListener);
|
|
235
241
|
});
|
|
236
242
|
}
|
|
237
243
|
|
|
@@ -242,13 +248,13 @@ export default class MediaProperties {
|
|
|
242
248
|
*/
|
|
243
249
|
async getCurrentConnectionType() {
|
|
244
250
|
// we can only get the connection type after ICE connection has been established
|
|
245
|
-
await this.
|
|
251
|
+
await this.waitForMediaConnectionConnected();
|
|
246
252
|
|
|
247
253
|
const allStatsReports = [];
|
|
248
254
|
|
|
249
255
|
try {
|
|
250
256
|
// eslint-disable-next-line no-await-in-loop
|
|
251
|
-
const statsResult = await this.
|
|
257
|
+
const statsResult = await this.webrtcMediaConnection.getStats();
|
|
252
258
|
|
|
253
259
|
statsResult.forEach((report) => allStatsReports.push(report));
|
|
254
260
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/* globals MediaStream */
|
|
2
|
+
|
|
3
|
+
import LoggerProxy from '../common/logs/logger-proxy';
|
|
4
|
+
|
|
5
|
+
const MediaUtil: any = {};
|
|
6
|
+
|
|
7
|
+
MediaUtil.createMediaStream = (tracks) => {
|
|
8
|
+
if (!tracks) {
|
|
9
|
+
LoggerProxy.logger.error('Media:util#createMediaStream --> Tracks don\'t exist');
|
|
10
|
+
}
|
|
11
|
+
const filtredTracks = tracks.filter((element) => !!element);
|
|
12
|
+
|
|
13
|
+
return new MediaStream(filtredTracks);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export default MediaUtil;
|