@webex/plugin-meetings 3.0.0-beta.2 → 3.0.0-beta.20
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/breakouts/breakout.js +116 -0
- package/dist/breakouts/breakout.js.map +1 -0
- package/dist/breakouts/collection.js +23 -0
- package/dist/breakouts/collection.js.map +1 -0
- package/dist/breakouts/index.js +226 -0
- package/dist/breakouts/index.js.map +1 -0
- 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 +10 -24
- package/dist/common/errors/captcha-error.js.map +1 -1
- package/dist/common/errors/intent-to-join.js +11 -24
- package/dist/common/errors/intent-to-join.js.map +1 -1
- package/dist/common/errors/join-meeting.js +12 -25
- package/dist/common/errors/join-meeting.js.map +1 -1
- package/dist/common/errors/media.js +10 -24
- 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 +10 -24
- package/dist/common/errors/password-error.js.map +1 -1
- package/dist/common/errors/permission.js +9 -23
- 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 +10 -24
- package/dist/common/errors/reconnection.js.map +1 -1
- package/dist/common/errors/stats.js +10 -24
- package/dist/common/errors/stats.js.map +1 -1
- package/dist/common/errors/webex-errors.js +6 -41
- package/dist/common/errors/webex-errors.js.map +1 -1
- package/dist/common/errors/webex-meetings-error.js +5 -25
- 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 +37 -60
- 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 +6 -6
- package/dist/config.js.map +1 -1
- package/dist/constants.js +88 -46
- 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 +12 -29
- 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 +184 -190
- package/dist/locus-info/index.js.map +1 -1
- package/dist/locus-info/infoUtils.js +3 -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 +92 -118
- package/dist/locus-info/parser.js.map +1 -1
- package/dist/locus-info/selfUtils.js +34 -91
- package/dist/locus-info/selfUtils.js.map +1 -1
- package/dist/media/index.js +67 -111
- package/dist/media/index.js.map +1 -1
- package/dist/media/properties.js +80 -114
- package/dist/media/properties.js.map +1 -1
- package/dist/media/util.js +2 -9
- 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 +125 -190
- package/dist/meeting/effectsState.js.map +1 -1
- package/dist/meeting/in-meeting-actions.js +5 -14
- package/dist/meeting/in-meeting-actions.js.map +1 -1
- package/dist/meeting/index.js +1692 -1925
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting/muteState.js +36 -77
- package/dist/meeting/muteState.js.map +1 -1
- package/dist/meeting/request.js +224 -230
- package/dist/meeting/request.js.map +1 -1
- package/dist/meeting/request.type.js +7 -0
- package/dist/meeting/request.type.js.map +1 -0
- package/dist/meeting/state.js +21 -31
- package/dist/meeting/state.js.map +1 -1
- package/dist/meeting/util.js +43 -215
- package/dist/meeting/util.js.map +1 -1
- package/dist/meeting-info/collection.js +6 -25
- package/dist/meeting-info/collection.js.map +1 -1
- package/dist/meeting-info/index.js +14 -32
- package/dist/meeting-info/index.js.map +1 -1
- package/dist/meeting-info/meeting-info-v2.js +193 -268
- package/dist/meeting-info/meeting-info-v2.js.map +1 -1
- package/dist/meeting-info/request.js +3 -15
- 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 +5 -20
- package/dist/meetings/collection.js.map +1 -1
- package/dist/meetings/index.js +490 -560
- package/dist/meetings/index.js.map +1 -1
- package/dist/meetings/request.js +24 -41
- package/dist/meetings/request.js.map +1 -1
- package/dist/meetings/util.js +99 -155
- package/dist/meetings/util.js.map +1 -1
- package/dist/member/index.js +78 -86
- package/dist/member/index.js.map +1 -1
- package/dist/member/util.js +31 -68
- package/dist/member/util.js.map +1 -1
- package/dist/members/collection.js +3 -12
- package/dist/members/collection.js.map +1 -1
- package/dist/members/index.js +93 -200
- package/dist/members/index.js.map +1 -1
- package/dist/members/request.js +16 -39
- 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 +55 -135
- package/dist/metrics/index.js.map +1 -1
- package/dist/multistream/mediaRequestManager.js +57 -32
- package/dist/multistream/mediaRequestManager.js.map +1 -1
- package/dist/multistream/multistreamMedia.js +15 -21
- package/dist/multistream/multistreamMedia.js.map +1 -1
- package/dist/multistream/receiveSlot.js +10 -50
- package/dist/multistream/receiveSlot.js.map +1 -1
- package/dist/multistream/receiveSlotManager.js +45 -82
- package/dist/multistream/receiveSlotManager.js.map +1 -1
- package/dist/multistream/remoteMedia.js +18 -58
- package/dist/multistream/remoteMedia.js.map +1 -1
- package/dist/multistream/remoteMediaGroup.js +6 -40
- package/dist/multistream/remoteMediaGroup.js.map +1 -1
- package/dist/multistream/remoteMediaManager.js +362 -416
- package/dist/multistream/remoteMediaManager.js.map +1 -1
- package/dist/networkQualityMonitor/index.js +36 -57
- package/dist/networkQualityMonitor/index.js.map +1 -1
- package/dist/personal-meeting-room/index.js +21 -45
- package/dist/personal-meeting-room/index.js.map +1 -1
- package/dist/personal-meeting-room/request.js +1 -31
- 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 +138 -182
- package/dist/reachability/index.js.map +1 -1
- package/dist/reachability/request.js +3 -18
- package/dist/reachability/request.js.map +1 -1
- package/dist/reactions/constants.js +13 -0
- package/dist/reactions/constants.js.map +1 -0
- package/dist/reactions/reactions.js +109 -0
- package/dist/reactions/reactions.js.map +1 -0
- package/dist/reactions/reactions.type.js +36 -0
- package/dist/reactions/reactions.type.js.map +1 -0
- package/dist/reconnection-manager/index.js +322 -455
- package/dist/reconnection-manager/index.js.map +1 -1
- package/dist/recording-controller/enums.js +17 -0
- package/dist/recording-controller/enums.js.map +1 -0
- package/dist/recording-controller/index.js +343 -0
- package/dist/recording-controller/index.js.map +1 -0
- package/dist/recording-controller/util.js +63 -0
- package/dist/recording-controller/util.js.map +1 -0
- package/dist/roap/index.js +39 -64
- package/dist/roap/index.js.map +1 -1
- package/dist/roap/request.js +94 -113
- package/dist/roap/request.js.map +1 -1
- package/dist/roap/turnDiscovery.js +85 -94
- package/dist/roap/turnDiscovery.js.map +1 -1
- package/dist/statsAnalyzer/global.js +0 -2
- package/dist/statsAnalyzer/global.js.map +1 -1
- package/dist/statsAnalyzer/index.js +85 -175
- package/dist/statsAnalyzer/index.js.map +1 -1
- package/dist/statsAnalyzer/mqaUtil.js +72 -53
- package/dist/statsAnalyzer/mqaUtil.js.map +1 -1
- package/dist/transcription/index.js +22 -47
- package/dist/transcription/index.js.map +1 -1
- package/internal-README.md +7 -6
- package/package.json +25 -20
- package/src/breakouts/README.md +190 -0
- package/src/breakouts/breakout.ts +110 -0
- package/src/breakouts/collection.ts +19 -0
- package/src/breakouts/index.ts +225 -0
- package/src/common/{browser-detection.js → browser-detection.ts} +9 -6
- package/src/common/collection.ts +9 -7
- package/src/common/{config.js → config.ts} +1 -1
- package/src/common/errors/{captcha-error.js → captcha-error.ts} +11 -7
- package/src/common/errors/{intent-to-join.js → intent-to-join.ts} +12 -7
- package/src/common/errors/{join-meeting.js → join-meeting.ts} +17 -8
- package/src/common/errors/{media.js → media.ts} +11 -7
- package/src/common/errors/parameter.ts +11 -7
- package/src/common/errors/{password-error.js → password-error.ts} +11 -7
- package/src/common/errors/{permission.js → permission.ts} +10 -6
- package/src/common/errors/{reconnection-in-progress.js → reconnection-in-progress.ts} +0 -0
- package/src/common/errors/{reconnection.js → reconnection.ts} +11 -7
- package/src/common/errors/{stats.js → stats.ts} +11 -7
- package/src/common/errors/{webex-errors.js → webex-errors.ts} +8 -7
- package/src/common/errors/{webex-meetings-error.js → webex-meetings-error.ts} +4 -2
- package/src/common/events/{events-scope.js → events-scope.ts} +6 -2
- package/src/common/events/{events.js → events.ts} +5 -1
- package/src/common/events/{trigger-proxy.js → trigger-proxy.ts} +9 -5
- package/src/common/events/{util.js → util.ts} +2 -3
- package/src/common/logs/{logger-config.js → logger-config.ts} +1 -2
- package/src/common/logs/logger-proxy.ts +44 -0
- package/src/common/logs/{request.js → request.ts} +22 -9
- package/src/common/queue.ts +1 -2
- package/src/{config.js → config.ts} +17 -12
- package/src/constants.ts +40 -1
- package/src/index.js +1 -1
- package/src/locus-info/controlsUtils.ts +114 -0
- package/src/locus-info/{embeddedAppsUtils.js → embeddedAppsUtils.ts} +5 -6
- package/src/locus-info/{fullState.js → fullState.ts} +16 -12
- package/src/locus-info/{hostUtils.js → hostUtils.ts} +9 -8
- package/src/locus-info/{index.js → index.ts} +148 -64
- package/src/locus-info/{infoUtils.js → infoUtils.ts} +19 -8
- package/src/locus-info/{mediaSharesUtils.js → mediaSharesUtils.ts} +17 -17
- package/src/locus-info/{parser.js → parser.ts} +67 -79
- package/src/locus-info/{selfUtils.js → selfUtils.ts} +123 -68
- package/src/media/{index.js → index.ts} +181 -131
- package/src/media/{properties.js → properties.ts} +47 -28
- package/src/media/{util.js → util.ts} +2 -2
- package/src/mediaQualityMetrics/{config.js → config.ts} +46 -46
- package/src/meeting/{effectsState.js → effectsState.ts} +47 -41
- package/src/meeting/in-meeting-actions.ts +15 -3
- package/src/meeting/{index.js → index.ts} +2263 -1427
- package/src/meeting/{muteState.js → muteState.ts} +78 -42
- package/src/meeting/{request.js → request.ts} +292 -142
- package/src/meeting/request.type.ts +13 -0
- package/src/meeting/{state.js → state.ts} +50 -35
- package/src/meeting/{util.js → util.ts} +112 -115
- package/src/meeting-info/{collection.js → collection.ts} +6 -2
- package/src/meeting-info/{index.js → index.ts} +42 -36
- package/src/meeting-info/meeting-info-v2.ts +273 -0
- package/src/meeting-info/{request.js → request.ts} +14 -4
- package/src/meeting-info/{util.js → util.ts} +60 -51
- package/src/meeting-info/{utilv2.js → utilv2.ts} +65 -58
- package/src/meetings/{collection.js → collection.ts} +6 -3
- package/src/meetings/index.ts +1159 -0
- package/src/meetings/{request.js → request.ts} +32 -25
- package/src/meetings/{util.js → util.ts} +34 -32
- package/src/member/{index.js → index.ts} +102 -56
- package/src/member/{util.js → util.ts} +52 -25
- package/src/members/{collection.js → collection.ts} +2 -2
- package/src/members/{index.js → index.ts} +219 -142
- package/src/members/{request.js → request.ts} +60 -16
- package/src/members/{util.js → util.ts} +50 -48
- package/src/metrics/{config.js → config.ts} +254 -83
- package/src/metrics/{constants.js → constants.ts} +0 -2
- package/src/metrics/{index.js → index.ts} +106 -74
- package/src/multistream/mediaRequestManager.ts +81 -15
- package/src/multistream/multistreamMedia.ts +5 -0
- package/src/multistream/receiveSlot.ts +18 -12
- package/src/multistream/receiveSlotManager.ts +23 -21
- package/src/multistream/remoteMedia.ts +15 -5
- package/src/multistream/remoteMediaGroup.ts +4 -3
- package/src/multistream/remoteMediaManager.ts +153 -37
- package/src/networkQualityMonitor/{index.js → index.ts} +37 -25
- package/src/personal-meeting-room/{index.js → index.ts} +28 -19
- package/src/personal-meeting-room/{request.js → request.ts} +13 -4
- package/src/personal-meeting-room/{util.js → util.ts} +4 -4
- package/src/reachability/{index.js → index.ts} +99 -83
- package/src/reachability/request.ts +39 -33
- package/src/reactions/constants.ts +4 -0
- package/src/reactions/reactions.ts +104 -0
- package/src/reactions/reactions.type.ts +62 -0
- package/src/reconnection-manager/{index.js → index.ts} +195 -102
- package/src/recording-controller/enums.ts +8 -0
- package/src/recording-controller/index.ts +315 -0
- package/src/recording-controller/util.ts +58 -0
- package/src/roap/{index.js → index.ts} +73 -56
- package/src/roap/request.ts +157 -0
- package/src/roap/turnDiscovery.ts +77 -37
- package/src/statsAnalyzer/{global.js → global.ts} +30 -33
- package/src/statsAnalyzer/{index.js → index.ts} +468 -192
- package/src/statsAnalyzer/mqaUtil.ts +290 -0
- package/src/transcription/{index.js → index.ts} +46 -39
- package/test/integration/spec/journey.js +664 -463
- package/test/integration/spec/space-meeting.js +320 -206
- package/test/integration/spec/transcription.js +7 -8
- package/test/unit/spec/breakouts/breakout.ts +119 -0
- package/test/unit/spec/breakouts/collection.ts +15 -0
- package/test/unit/spec/breakouts/index.ts +293 -0
- 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 +25 -5
- package/test/unit/spec/locus-info/embeddedAppsUtils.js +8 -6
- package/test/unit/spec/locus-info/index.js +104 -2
- package/test/unit/spec/locus-info/infoUtils.js +41 -32
- 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 +97 -103
- package/test/unit/spec/locus-info/selfUtils.js +105 -12
- package/test/unit/spec/media/index.ts +31 -47
- package/test/unit/spec/media/properties.ts +9 -9
- package/test/unit/spec/meeting/effectsState.js +39 -45
- package/test/unit/spec/meeting/in-meeting-actions.ts +5 -2
- package/test/unit/spec/meeting/index.js +2017 -742
- package/test/unit/spec/meeting/muteState.js +42 -33
- package/test/unit/spec/meeting/request.js +115 -44
- package/test/unit/spec/meeting/utils.js +104 -171
- 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 +439 -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 +31 -7
- 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/multistream/mediaRequestManager.ts +316 -50
- package/test/unit/spec/multistream/receiveSlot.ts +6 -6
- package/test/unit/spec/multistream/receiveSlotManager.ts +13 -13
- package/test/unit/spec/multistream/remoteMedia.ts +10 -2
- package/test/unit/spec/multistream/remoteMediaGroup.ts +5 -5
- package/test/unit/spec/multistream/remoteMediaManager.ts +412 -65
- 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 +58 -26
- package/test/unit/spec/reconnection-manager/index.js +102 -9
- package/test/unit/spec/recording-controller/index.js +231 -0
- package/test/unit/spec/recording-controller/util.js +102 -0
- package/test/unit/spec/roap/index.ts +2 -1
- package/test/unit/spec/roap/request.ts +114 -0
- package/test/unit/spec/roap/turnDiscovery.ts +64 -45
- package/test/unit/spec/stats-analyzer/index.js +27 -22
- 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 +54 -50
- package/tsconfig.json +6 -0
- package/dist/media/internal-media-core-wrapper.js +0 -22
- package/dist/media/internal-media-core-wrapper.js.map +0 -1
- package/dist/peer-connection-manager/util.js +0 -124
- package/dist/peer-connection-manager/util.js.map +0 -1
- package/src/common/logs/logger-proxy.js +0 -33
- package/src/locus-info/controlsUtils.js +0 -102
- package/src/media/internal-media-core-wrapper.ts +0 -9
- package/src/meeting-info/meeting-info-v2.js +0 -255
- package/src/meetings/index.js +0 -1015
- package/src/peer-connection-manager/util.ts +0 -117
- package/src/roap/request.js +0 -127
- package/src/statsAnalyzer/mqaUtil.js +0 -173
- package/test/unit/spec/peerconnection-manager/utils.test-fixtures.ts +0 -389
|
@@ -1,8 +1,17 @@
|
|
|
1
|
+
/* eslint-disable prefer-destructuring */
|
|
2
|
+
|
|
1
3
|
import {cloneDeep} from 'lodash';
|
|
2
|
-
import {
|
|
4
|
+
import {ConnectionState} from '@webex/internal-media-core';
|
|
3
5
|
|
|
4
6
|
import EventsScope from '../common/events/events-scope';
|
|
5
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
DEFAULT_GET_STATS_FILTER,
|
|
9
|
+
STATS,
|
|
10
|
+
MQA_INTEVAL,
|
|
11
|
+
NETWORK_TYPE,
|
|
12
|
+
MEDIA_DEVICES,
|
|
13
|
+
_UNKNOWN_,
|
|
14
|
+
} from '../constants';
|
|
6
15
|
import mqaData from '../mediaQualityMetrics/config';
|
|
7
16
|
import LoggerProxy from '../common/logs/logger-proxy';
|
|
8
17
|
|
|
@@ -11,7 +20,7 @@ import {
|
|
|
11
20
|
getAudioSenderMqa,
|
|
12
21
|
getAudioReceiverMqa,
|
|
13
22
|
getVideoSenderMqa,
|
|
14
|
-
getVideoReceiverMqa
|
|
23
|
+
getVideoReceiverMqa,
|
|
15
24
|
} from './mqaUtil';
|
|
16
25
|
|
|
17
26
|
export const EVENTS = {
|
|
@@ -30,6 +39,21 @@ export const EVENTS = {
|
|
|
30
39
|
* @extends {EventsScope}
|
|
31
40
|
*/
|
|
32
41
|
export class StatsAnalyzer extends EventsScope {
|
|
42
|
+
config: any;
|
|
43
|
+
correlationId: any;
|
|
44
|
+
lastEmittedStartStopEvent: any;
|
|
45
|
+
lastMqaDataSent: any;
|
|
46
|
+
lastStatsResults: any;
|
|
47
|
+
localMQEStats: any;
|
|
48
|
+
meetingMediaStatus: any;
|
|
49
|
+
mqaInterval: NodeJS.Timeout;
|
|
50
|
+
mqaSentCount: any;
|
|
51
|
+
networkQualityMonitor: any;
|
|
52
|
+
mediaConnection: any;
|
|
53
|
+
statsInterval: NodeJS.Timeout;
|
|
54
|
+
statsResults: any;
|
|
55
|
+
statsStarted: any;
|
|
56
|
+
|
|
33
57
|
/**
|
|
34
58
|
* Creates a new instance of StatsAnalyzer
|
|
35
59
|
* @constructor
|
|
@@ -38,7 +62,11 @@ export class StatsAnalyzer extends EventsScope {
|
|
|
38
62
|
* @param {Object} networkQualityMonitor class for assessing network characteristics (jitter, packetLoss, latency)
|
|
39
63
|
* @param {Object} statsResults Default properties for stats
|
|
40
64
|
*/
|
|
41
|
-
constructor(
|
|
65
|
+
constructor(
|
|
66
|
+
config: any,
|
|
67
|
+
networkQualityMonitor: object = {},
|
|
68
|
+
statsResults: object = defaultStats
|
|
69
|
+
) {
|
|
42
70
|
super();
|
|
43
71
|
this.statsStarted = false;
|
|
44
72
|
this.statsResults = statsResults;
|
|
@@ -48,10 +76,14 @@ export class StatsAnalyzer extends EventsScope {
|
|
|
48
76
|
this.correlationId = config.correlationId;
|
|
49
77
|
this.mqaSentCount = -1;
|
|
50
78
|
this.lastMqaDataSent = {
|
|
51
|
-
resolutions: {
|
|
79
|
+
resolutions: {
|
|
80
|
+
video: {send: {}, recv: {}},
|
|
81
|
+
audio: {send: {}, recv: {}},
|
|
82
|
+
share: {send: {}, recv: {}},
|
|
83
|
+
},
|
|
52
84
|
video: {send: {}, recv: {}},
|
|
53
85
|
audio: {send: {}, recv: {}},
|
|
54
|
-
share: {send: {}, recv: {}}
|
|
86
|
+
share: {send: {}, recv: {}},
|
|
55
87
|
};
|
|
56
88
|
this.localMQEStats = {
|
|
57
89
|
audio: {
|
|
@@ -59,14 +91,14 @@ export class StatsAnalyzer extends EventsScope {
|
|
|
59
91
|
packetsLost: [],
|
|
60
92
|
jitter: [],
|
|
61
93
|
latency: [],
|
|
62
|
-
bitRate: []
|
|
94
|
+
bitRate: [],
|
|
63
95
|
},
|
|
64
96
|
TX: {
|
|
65
97
|
packetsLost: [],
|
|
66
98
|
jitter: [],
|
|
67
99
|
latency: [],
|
|
68
|
-
bitRate: []
|
|
69
|
-
}
|
|
100
|
+
bitRate: [],
|
|
101
|
+
},
|
|
70
102
|
},
|
|
71
103
|
video: {
|
|
72
104
|
RX: {
|
|
@@ -78,7 +110,7 @@ export class StatsAnalyzer extends EventsScope {
|
|
|
78
110
|
resolutionWidth: [],
|
|
79
111
|
resolutionHeight: [],
|
|
80
112
|
requestedKeyFrame: [],
|
|
81
|
-
receivedKeyFrame: []
|
|
113
|
+
receivedKeyFrame: [],
|
|
82
114
|
},
|
|
83
115
|
TX: {
|
|
84
116
|
packetsLost: [],
|
|
@@ -89,9 +121,9 @@ export class StatsAnalyzer extends EventsScope {
|
|
|
89
121
|
resolutionWidth: [],
|
|
90
122
|
resolutionHeight: [],
|
|
91
123
|
requestedKeyFrame: [],
|
|
92
|
-
receivedKeyFrame: []
|
|
93
|
-
}
|
|
94
|
-
}
|
|
124
|
+
receivedKeyFrame: [],
|
|
125
|
+
},
|
|
126
|
+
},
|
|
95
127
|
};
|
|
96
128
|
this.lastEmittedStartStopEvent = {
|
|
97
129
|
audio: {
|
|
@@ -115,37 +147,60 @@ export class StatsAnalyzer extends EventsScope {
|
|
|
115
147
|
this.localMQEStats.audio.RX.packetsLost.push(lastMqa.audioReceive[0].common.mediaHopByHopLost);
|
|
116
148
|
this.localMQEStats.audio.RX.jitter.push(lastMqa.audioReceive[0].streams[0].common.rtpJitter);
|
|
117
149
|
this.localMQEStats.audio.RX.latency.push(lastMqa.audioReceive[0].common.roundTripTime);
|
|
118
|
-
this.localMQEStats.audio.RX.bitRate.push(
|
|
150
|
+
this.localMQEStats.audio.RX.bitRate.push(
|
|
151
|
+
lastMqa.audioReceive[0].streams[0].common.receivedBitrate
|
|
152
|
+
);
|
|
119
153
|
|
|
120
154
|
this.localMQEStats.audio.TX.packetsLost.push(lastMqa.audioTransmit[0].common.remoteLossRate);
|
|
121
155
|
this.localMQEStats.audio.TX.jitter.push(lastMqa.audioTransmit[0].common.remoteJitter);
|
|
122
156
|
this.localMQEStats.audio.TX.latency.push(lastMqa.audioTransmit[0].common.roundTripTime);
|
|
123
|
-
this.localMQEStats.audio.TX.bitRate.push(
|
|
157
|
+
this.localMQEStats.audio.TX.bitRate.push(
|
|
158
|
+
lastMqa.audioTransmit[0].streams[0].common.transmittedBitrate
|
|
159
|
+
);
|
|
124
160
|
|
|
125
161
|
// Video
|
|
126
162
|
|
|
127
163
|
this.localMQEStats.video.RX.packetsLost.push(lastMqa.videoReceive[0].common.mediaHopByHopLost);
|
|
128
164
|
this.localMQEStats.video.RX.jitter.push(lastMqa.videoReceive[0].streams[0].common.rtpJitter);
|
|
129
|
-
this.localMQEStats.video.RX.latency.push(
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
this.localMQEStats.video.RX.
|
|
133
|
-
|
|
165
|
+
this.localMQEStats.video.RX.latency.push(
|
|
166
|
+
lastMqa.videoReceive[0].streams[0].common.roundTripTime
|
|
167
|
+
);
|
|
168
|
+
this.localMQEStats.video.RX.bitRate.push(
|
|
169
|
+
lastMqa.videoReceive[0].streams[0].common.receivedBitrate
|
|
170
|
+
);
|
|
171
|
+
this.localMQEStats.video.RX.frameRate.push(
|
|
172
|
+
lastMqa.videoReceive[0].streams[0].common.receivedFrameRate
|
|
173
|
+
);
|
|
174
|
+
this.localMQEStats.video.RX.resolutionWidth.push(
|
|
175
|
+
lastMqa.videoReceive[0].streams[0].receivedWidth
|
|
176
|
+
);
|
|
177
|
+
this.localMQEStats.video.RX.resolutionHeight.push(
|
|
178
|
+
lastMqa.videoReceive[0].streams[0].receivedHeight
|
|
179
|
+
);
|
|
134
180
|
this.localMQEStats.video.RX.requestedKeyFrame.push();
|
|
135
181
|
this.localMQEStats.video.RX.receivedKeyFrame.push();
|
|
136
182
|
|
|
137
183
|
this.localMQEStats.video.TX.packetsLost.push(lastMqa.videoTransmit[0].common.remoteLossRate);
|
|
138
184
|
this.localMQEStats.video.TX.jitter.push(lastMqa.videoTransmit[0].common.remoteJitter);
|
|
139
185
|
this.localMQEStats.video.TX.latency.push(lastMqa.videoTransmit[0].common.roundTripTime);
|
|
140
|
-
this.localMQEStats.video.TX.bitRate.push(
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
this.localMQEStats.video.TX.
|
|
144
|
-
|
|
186
|
+
this.localMQEStats.video.TX.bitRate.push(
|
|
187
|
+
lastMqa.videoTransmit[0].streams[0].common.transmittedBitrate
|
|
188
|
+
);
|
|
189
|
+
this.localMQEStats.video.TX.frameRate.push(
|
|
190
|
+
lastMqa.videoTransmit[0].streams[0].common.transmittedFrameRate
|
|
191
|
+
);
|
|
192
|
+
this.localMQEStats.video.TX.resolutionWidth.push(
|
|
193
|
+
lastMqa.videoTransmit[0].streams[0].transmittedWidth
|
|
194
|
+
);
|
|
195
|
+
this.localMQEStats.video.TX.resolutionHeight.push(
|
|
196
|
+
lastMqa.videoTransmit[0].streams[0].transmittedHeight
|
|
197
|
+
);
|
|
198
|
+
this.localMQEStats.video.TX.requestedKeyFrame.push(
|
|
199
|
+
lastMqa.videoTransmit[0].streams[0].requestedKeyFrames
|
|
200
|
+
);
|
|
145
201
|
this.localMQEStats.video.TX.receivedKeyFrame.push();
|
|
146
202
|
}
|
|
147
203
|
|
|
148
|
-
|
|
149
204
|
resetStatsResults() {
|
|
150
205
|
this.statsResults.audio.send.meanRemoteJitter = [];
|
|
151
206
|
this.statsResults.video.send.meanRemoteJitter = [];
|
|
@@ -171,7 +226,7 @@ export class StatsAnalyzer extends EventsScope {
|
|
|
171
226
|
* @memberof StatsAnalyzer
|
|
172
227
|
* @returns {void}
|
|
173
228
|
*/
|
|
174
|
-
updateMediaStatus(status) {
|
|
229
|
+
public updateMediaStatus(status: object) {
|
|
175
230
|
this.meetingMediaStatus = status;
|
|
176
231
|
}
|
|
177
232
|
|
|
@@ -182,7 +237,7 @@ export class StatsAnalyzer extends EventsScope {
|
|
|
182
237
|
* @memberof StatsAnalyzer
|
|
183
238
|
* @returns {void}
|
|
184
239
|
*/
|
|
185
|
-
sendMqaData() {
|
|
240
|
+
public sendMqaData() {
|
|
186
241
|
const audioReceiver = mqaData.intervals[0].audioReceive[0];
|
|
187
242
|
const audioSender = mqaData.intervals[0].audioTransmit[0];
|
|
188
243
|
const videoReceiver = mqaData.intervals[0].videoReceive[0];
|
|
@@ -193,23 +248,23 @@ export class StatsAnalyzer extends EventsScope {
|
|
|
193
248
|
getAudioSenderMqa({
|
|
194
249
|
audioSender,
|
|
195
250
|
statsResults: this.statsResults,
|
|
196
|
-
lastMqaDataSent: this.lastMqaDataSent
|
|
251
|
+
lastMqaDataSent: this.lastMqaDataSent,
|
|
197
252
|
});
|
|
198
253
|
getAudioReceiverMqa({
|
|
199
254
|
audioReceiver,
|
|
200
255
|
statsResults: this.statsResults,
|
|
201
|
-
lastMqaDataSent: this.lastMqaDataSent
|
|
256
|
+
lastMqaDataSent: this.lastMqaDataSent,
|
|
202
257
|
});
|
|
203
258
|
|
|
204
259
|
getVideoReceiverMqa({
|
|
205
260
|
videoReceiver,
|
|
206
261
|
statsResults: this.statsResults,
|
|
207
|
-
lastMqaDataSent: this.lastMqaDataSent
|
|
262
|
+
lastMqaDataSent: this.lastMqaDataSent,
|
|
208
263
|
});
|
|
209
264
|
getVideoSenderMqa({
|
|
210
265
|
videoSender,
|
|
211
266
|
statsResults: this.statsResults,
|
|
212
|
-
lastMqaDataSent: this.lastMqaDataSent
|
|
267
|
+
lastMqaDataSent: this.lastMqaDataSent,
|
|
213
268
|
});
|
|
214
269
|
|
|
215
270
|
// Capture mqa for share scenario
|
|
@@ -218,25 +273,36 @@ export class StatsAnalyzer extends EventsScope {
|
|
|
218
273
|
videoSender: shareSender,
|
|
219
274
|
statsResults: this.statsResults,
|
|
220
275
|
lastMqaDataSent: this.lastMqaDataSent,
|
|
221
|
-
isShareStream: true
|
|
276
|
+
isShareStream: true,
|
|
222
277
|
});
|
|
223
278
|
|
|
224
279
|
getVideoReceiverMqa({
|
|
225
280
|
videoReceiver: shareReceiver,
|
|
226
281
|
statsResults: this.statsResults,
|
|
227
282
|
lastMqaDataSent: this.lastMqaDataSent,
|
|
228
|
-
isShareStream: true
|
|
283
|
+
isShareStream: true,
|
|
229
284
|
});
|
|
230
|
-
|
|
231
|
-
|
|
285
|
+
mqaData.intervals[0].intervalMetadata.peerReflexiveIP =
|
|
286
|
+
this.statsResults.connectionType.local.ipAddress[0];
|
|
232
287
|
|
|
233
288
|
// Adding peripheral information
|
|
234
289
|
mqaData.intervals[0].intervalMetadata.peripherals = [];
|
|
235
|
-
mqaData.intervals[0].intervalMetadata.peripherals.push({
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
290
|
+
mqaData.intervals[0].intervalMetadata.peripherals.push({
|
|
291
|
+
information: _UNKNOWN_,
|
|
292
|
+
name: MEDIA_DEVICES.SPEAKER,
|
|
293
|
+
});
|
|
294
|
+
mqaData.intervals[0].intervalMetadata.peripherals.push({
|
|
295
|
+
information:
|
|
296
|
+
this.statsResults[STATS.AUDIO_CORRELATE][STATS.SEND_DIRECTION].trackLabel || _UNKNOWN_,
|
|
297
|
+
name: MEDIA_DEVICES.MICROPHONE,
|
|
298
|
+
});
|
|
299
|
+
mqaData.intervals[0].intervalMetadata.peripherals.push({
|
|
300
|
+
information:
|
|
301
|
+
this.statsResults[STATS.VIDEO_CORRELATE][STATS.SEND_DIRECTION].trackLabel || _UNKNOWN_,
|
|
302
|
+
name: MEDIA_DEVICES.CAMERA,
|
|
303
|
+
});
|
|
239
304
|
|
|
305
|
+
// @ts-ignore
|
|
240
306
|
mqaData.networkType = this.statsResults.connectionType.local.networkType;
|
|
241
307
|
|
|
242
308
|
this.mqaSentCount += 1;
|
|
@@ -253,12 +319,13 @@ export class StatsAnalyzer extends EventsScope {
|
|
|
253
319
|
this.emit(
|
|
254
320
|
{
|
|
255
321
|
file: 'statsAnalyzer',
|
|
256
|
-
function: 'sendMqaData'
|
|
322
|
+
function: 'sendMqaData',
|
|
257
323
|
},
|
|
258
324
|
EVENTS.MEDIA_QUALITY,
|
|
259
325
|
{
|
|
260
326
|
data: mqaData.intervals[0],
|
|
261
|
-
|
|
327
|
+
// @ts-ignore
|
|
328
|
+
networkType: mqaData.networkType,
|
|
262
329
|
}
|
|
263
330
|
);
|
|
264
331
|
}
|
|
@@ -268,10 +335,10 @@ export class StatsAnalyzer extends EventsScope {
|
|
|
268
335
|
*
|
|
269
336
|
* @private
|
|
270
337
|
* @memberof StatsAnalyzer
|
|
271
|
-
* @param {
|
|
338
|
+
* @param {RoapMediaConnection} mediaConnection
|
|
272
339
|
* @returns {void}
|
|
273
340
|
*/
|
|
274
|
-
updateMediaConnection(mediaConnection) {
|
|
341
|
+
updateMediaConnection(mediaConnection: any) {
|
|
275
342
|
this.mediaConnection = mediaConnection;
|
|
276
343
|
}
|
|
277
344
|
|
|
@@ -280,25 +347,24 @@ export class StatsAnalyzer extends EventsScope {
|
|
|
280
347
|
*
|
|
281
348
|
* @public
|
|
282
349
|
* @memberof StatsAnalyzer
|
|
283
|
-
* @param {
|
|
350
|
+
* @param {RoapMediaConnection} mediaConnection
|
|
284
351
|
* @returns {Promise}
|
|
285
352
|
*/
|
|
286
|
-
startAnalyzer(mediaConnection) {
|
|
353
|
+
public startAnalyzer(mediaConnection: any) {
|
|
287
354
|
if (!this.statsStarted) {
|
|
288
355
|
this.statsStarted = true;
|
|
289
356
|
this.mediaConnection = mediaConnection;
|
|
290
357
|
|
|
291
|
-
return this.getStatsAndParse()
|
|
292
|
-
.
|
|
293
|
-
this.
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
358
|
+
return this.getStatsAndParse().then(() => {
|
|
359
|
+
this.statsInterval = setInterval(() => {
|
|
360
|
+
this.getStatsAndParse();
|
|
361
|
+
}, this.config.analyzerInterval);
|
|
362
|
+
// Trigger initial fetch
|
|
363
|
+
this.sendMqaData();
|
|
364
|
+
this.mqaInterval = setInterval(() => {
|
|
297
365
|
this.sendMqaData();
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
}, MQA_INTEVAL);
|
|
301
|
-
});
|
|
366
|
+
}, MQA_INTEVAL);
|
|
367
|
+
});
|
|
302
368
|
}
|
|
303
369
|
|
|
304
370
|
return Promise.resolve();
|
|
@@ -311,7 +377,7 @@ export class StatsAnalyzer extends EventsScope {
|
|
|
311
377
|
* @memberof StatsAnalyzer
|
|
312
378
|
* @returns {void}
|
|
313
379
|
*/
|
|
314
|
-
stopAnalyzer() {
|
|
380
|
+
public stopAnalyzer() {
|
|
315
381
|
const sendOneLastMqa = this.mqaInterval && this.statsInterval;
|
|
316
382
|
|
|
317
383
|
if (this.statsInterval) {
|
|
@@ -345,7 +411,7 @@ export class StatsAnalyzer extends EventsScope {
|
|
|
345
411
|
* @returns {void}
|
|
346
412
|
* @memberof StatsAnalyzer
|
|
347
413
|
*/
|
|
348
|
-
parseGetStatsResult(getStatsResult, type, isSender) {
|
|
414
|
+
private parseGetStatsResult(getStatsResult: any, type: string, isSender: boolean) {
|
|
349
415
|
if (!getStatsResult) {
|
|
350
416
|
return;
|
|
351
417
|
}
|
|
@@ -362,6 +428,7 @@ export class StatsAnalyzer extends EventsScope {
|
|
|
362
428
|
break;
|
|
363
429
|
case 'remote-inbound-rtp':
|
|
364
430
|
case 'remote-outbound-rtp':
|
|
431
|
+
// @ts-ignore
|
|
365
432
|
this.compareSentAndReceived(getStatsResult, type, isSender);
|
|
366
433
|
break;
|
|
367
434
|
case 'remotecandidate':
|
|
@@ -372,6 +439,7 @@ export class StatsAnalyzer extends EventsScope {
|
|
|
372
439
|
this.parseCandidate(getStatsResult, type, isSender, false);
|
|
373
440
|
break;
|
|
374
441
|
case 'media-source':
|
|
442
|
+
// @ts-ignore
|
|
375
443
|
this.parseAudioSource(getStatsResult, type);
|
|
376
444
|
break;
|
|
377
445
|
default:
|
|
@@ -387,7 +455,11 @@ export class StatsAnalyzer extends EventsScope {
|
|
|
387
455
|
* @param {boolean} isSender
|
|
388
456
|
* @returns {void}
|
|
389
457
|
*/
|
|
390
|
-
filterAndParseGetStatsResults(
|
|
458
|
+
private filterAndParseGetStatsResults(
|
|
459
|
+
getStatsResults: Array<any>,
|
|
460
|
+
type: string,
|
|
461
|
+
isSender: boolean
|
|
462
|
+
) {
|
|
391
463
|
const {types} = DEFAULT_GET_STATS_FILTER;
|
|
392
464
|
|
|
393
465
|
getStatsResults.forEach((result) => {
|
|
@@ -403,7 +475,7 @@ export class StatsAnalyzer extends EventsScope {
|
|
|
403
475
|
* @param {boolean} type
|
|
404
476
|
* @returns {void}
|
|
405
477
|
*/
|
|
406
|
-
parseAudioSource(result, type) {
|
|
478
|
+
parseAudioSource(result: any, type: any) {
|
|
407
479
|
if (!result) {
|
|
408
480
|
return;
|
|
409
481
|
}
|
|
@@ -428,7 +500,12 @@ export class StatsAnalyzer extends EventsScope {
|
|
|
428
500
|
* @memberof StatsAnalyzer
|
|
429
501
|
* @returns {void}
|
|
430
502
|
*/
|
|
431
|
-
emitStartStopEvents = (
|
|
503
|
+
emitStartStopEvents = (
|
|
504
|
+
mediaType: string,
|
|
505
|
+
previousValue: number,
|
|
506
|
+
currentValue: number,
|
|
507
|
+
isLocal: boolean
|
|
508
|
+
) => {
|
|
432
509
|
if (mediaType !== 'audio' && mediaType !== 'video' && mediaType !== 'share') {
|
|
433
510
|
throw new Error(`Unsupported mediaType: ${mediaType}`);
|
|
434
511
|
}
|
|
@@ -438,32 +515,32 @@ export class StatsAnalyzer extends EventsScope {
|
|
|
438
515
|
// eslint-disable-next-line no-param-reassign
|
|
439
516
|
if (currentValue === undefined) currentValue = 0;
|
|
440
517
|
|
|
441
|
-
const lastEmittedEvent = isLocal
|
|
518
|
+
const lastEmittedEvent = isLocal
|
|
519
|
+
? this.lastEmittedStartStopEvent[mediaType].local
|
|
520
|
+
: this.lastEmittedStartStopEvent[mediaType].remote;
|
|
442
521
|
|
|
443
522
|
let newEvent;
|
|
444
523
|
|
|
445
|
-
if (
|
|
524
|
+
if (currentValue - previousValue > 0) {
|
|
446
525
|
newEvent = isLocal ? EVENTS.LOCAL_MEDIA_STARTED : EVENTS.REMOTE_MEDIA_STARTED;
|
|
447
|
-
}
|
|
448
|
-
else if ((currentValue === previousValue) && currentValue > 0) {
|
|
526
|
+
} else if (currentValue === previousValue && currentValue > 0) {
|
|
449
527
|
newEvent = isLocal ? EVENTS.LOCAL_MEDIA_STOPPED : EVENTS.REMOTE_MEDIA_STOPPED;
|
|
450
528
|
}
|
|
451
529
|
|
|
452
530
|
if (newEvent && lastEmittedEvent !== newEvent) {
|
|
453
531
|
if (isLocal) {
|
|
454
532
|
this.lastEmittedStartStopEvent[mediaType].local = newEvent;
|
|
455
|
-
}
|
|
456
|
-
else {
|
|
533
|
+
} else {
|
|
457
534
|
this.lastEmittedStartStopEvent[mediaType].remote = newEvent;
|
|
458
535
|
}
|
|
459
536
|
this.emit(
|
|
460
537
|
{
|
|
461
538
|
file: 'statsAnalyzer/index',
|
|
462
|
-
function: 'compareLastStatsResult'
|
|
539
|
+
function: 'compareLastStatsResult',
|
|
463
540
|
},
|
|
464
541
|
newEvent,
|
|
465
542
|
{
|
|
466
|
-
type: mediaType
|
|
543
|
+
type: mediaType,
|
|
467
544
|
}
|
|
468
545
|
);
|
|
469
546
|
}
|
|
@@ -476,7 +553,7 @@ export class StatsAnalyzer extends EventsScope {
|
|
|
476
553
|
* @memberof StatsAnalyzer
|
|
477
554
|
* @returns {void}
|
|
478
555
|
*/
|
|
479
|
-
compareLastStatsResult() {
|
|
556
|
+
private compareLastStatsResult() {
|
|
480
557
|
if (this.lastStatsResults !== null && this.meetingMediaStatus) {
|
|
481
558
|
// compare audio stats sent
|
|
482
559
|
let mediaType = STATS.AUDIO_CORRELATE;
|
|
@@ -487,54 +564,98 @@ export class StatsAnalyzer extends EventsScope {
|
|
|
487
564
|
currentStats = this.statsResults[mediaType].send;
|
|
488
565
|
previousStats = this.lastStatsResults[mediaType].send;
|
|
489
566
|
|
|
490
|
-
if (
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
567
|
+
if (
|
|
568
|
+
currentStats.totalPacketsSent === previousStats.totalPacketsSent ||
|
|
569
|
+
currentStats.totalPacketsSent === 0
|
|
570
|
+
) {
|
|
571
|
+
LoggerProxy.logger.info(
|
|
572
|
+
`StatsAnalyzer:index#compareLastStatsResult --> No ${mediaType} RTP packets sent`
|
|
573
|
+
);
|
|
574
|
+
} else {
|
|
575
|
+
if (
|
|
576
|
+
currentStats.totalAudioEnergy === previousStats.totalAudioEnergy ||
|
|
577
|
+
currentStats.totalAudioEnergy === 0
|
|
578
|
+
) {
|
|
579
|
+
LoggerProxy.logger.info(
|
|
580
|
+
`StatsAnalyzer:index#compareLastStatsResult --> No ${mediaType} Energy present`
|
|
581
|
+
);
|
|
496
582
|
}
|
|
497
583
|
|
|
498
584
|
if (currentStats.audioLevel === 0) {
|
|
499
|
-
LoggerProxy.logger.info(
|
|
585
|
+
LoggerProxy.logger.info(
|
|
586
|
+
`StatsAnalyzer:index#compareLastStatsResult --> ${mediaType} level is 0 for the user`
|
|
587
|
+
);
|
|
500
588
|
}
|
|
501
589
|
}
|
|
502
590
|
|
|
503
|
-
this.emitStartStopEvents(
|
|
591
|
+
this.emitStartStopEvents(
|
|
592
|
+
mediaType,
|
|
593
|
+
previousStats.totalPacketsSent,
|
|
594
|
+
currentStats.totalPacketsSent,
|
|
595
|
+
true
|
|
596
|
+
);
|
|
504
597
|
}
|
|
505
598
|
|
|
506
599
|
if (this.meetingMediaStatus.expected.receiveAudio) {
|
|
507
|
-
|
|
600
|
+
// compare audio stats received
|
|
508
601
|
currentStats = this.statsResults[mediaType].recv;
|
|
509
602
|
previousStats = this.lastStatsResults[mediaType].recv;
|
|
510
603
|
|
|
511
|
-
if (
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
604
|
+
if (
|
|
605
|
+
currentStats.totalPacketsReceived === previousStats.totalPacketsReceived ||
|
|
606
|
+
currentStats.totalPacketsReceived === 0
|
|
607
|
+
) {
|
|
608
|
+
LoggerProxy.logger.info(
|
|
609
|
+
`StatsAnalyzer:index#compareLastStatsResult --> No ${mediaType} RTP packets received`
|
|
610
|
+
);
|
|
611
|
+
} else if (
|
|
612
|
+
currentStats.totalSamplesReceived === previousStats.totalSamplesReceived ||
|
|
613
|
+
currentStats.totalSamplesReceived === 0
|
|
614
|
+
) {
|
|
615
|
+
LoggerProxy.logger.info(
|
|
616
|
+
`StatsAnalyzer:index#compareLastStatsResult --> No ${mediaType} samples received`
|
|
617
|
+
);
|
|
517
618
|
}
|
|
518
619
|
|
|
519
|
-
this.emitStartStopEvents(
|
|
620
|
+
this.emitStartStopEvents(
|
|
621
|
+
mediaType,
|
|
622
|
+
previousStats.totalPacketsReceived,
|
|
623
|
+
currentStats.totalPacketsReceived,
|
|
624
|
+
false
|
|
625
|
+
);
|
|
520
626
|
}
|
|
521
627
|
|
|
522
628
|
mediaType = STATS.VIDEO_CORRELATE;
|
|
523
629
|
if (this.meetingMediaStatus.expected.sendVideo) {
|
|
524
|
-
|
|
630
|
+
// compare video stats sent
|
|
525
631
|
currentStats = this.statsResults[mediaType].send;
|
|
526
632
|
previousStats = this.lastStatsResults[mediaType].send;
|
|
527
633
|
|
|
528
|
-
if (
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
634
|
+
if (
|
|
635
|
+
currentStats.totalPacketsSent === previousStats.totalPacketsSent ||
|
|
636
|
+
currentStats.totalPacketsSent === 0
|
|
637
|
+
) {
|
|
638
|
+
LoggerProxy.logger.info(
|
|
639
|
+
`StatsAnalyzer:index#compareLastStatsResult --> No ${mediaType} RTP packets sent`
|
|
640
|
+
);
|
|
641
|
+
} else {
|
|
642
|
+
if (
|
|
643
|
+
currentStats.framesEncoded === previousStats.framesEncoded ||
|
|
644
|
+
currentStats.framesEncoded === 0
|
|
645
|
+
) {
|
|
646
|
+
LoggerProxy.logger.info(
|
|
647
|
+
`StatsAnalyzer:index#compareLastStatsResult --> No ${mediaType} Frames Encoded`
|
|
648
|
+
);
|
|
534
649
|
}
|
|
535
650
|
|
|
536
|
-
if (
|
|
537
|
-
|
|
651
|
+
if (
|
|
652
|
+
this.statsResults.resolutions[mediaType].send.framesSent ===
|
|
653
|
+
this.lastStatsResults.resolutions[mediaType].send.framesSent ||
|
|
654
|
+
this.statsResults.resolutions[mediaType].send.framesSent === 0
|
|
655
|
+
) {
|
|
656
|
+
LoggerProxy.logger.info(
|
|
657
|
+
`StatsAnalyzer:index#compareLastStatsResult --> No ${mediaType} Frames sent`
|
|
658
|
+
);
|
|
538
659
|
}
|
|
539
660
|
}
|
|
540
661
|
|
|
@@ -546,27 +667,48 @@ export class StatsAnalyzer extends EventsScope {
|
|
|
546
667
|
);
|
|
547
668
|
}
|
|
548
669
|
|
|
549
|
-
|
|
550
670
|
if (this.meetingMediaStatus.expected.receiveVideo) {
|
|
551
|
-
|
|
671
|
+
// compare video stats reveived
|
|
552
672
|
|
|
553
673
|
currentStats = this.statsResults[mediaType].recv;
|
|
554
674
|
previousStats = this.lastStatsResults[mediaType].recv;
|
|
555
675
|
|
|
556
|
-
if (
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
676
|
+
if (
|
|
677
|
+
currentStats.totalPacketsReceived === previousStats.totalPacketsReceived ||
|
|
678
|
+
currentStats.totalPacketsReceived === 0
|
|
679
|
+
) {
|
|
680
|
+
LoggerProxy.logger.info(
|
|
681
|
+
`StatsAnalyzer:index#compareLastStatsResult --> No ${mediaType} RTP packets received`
|
|
682
|
+
);
|
|
683
|
+
} else {
|
|
684
|
+
if (
|
|
685
|
+
this.statsResults.resolutions[mediaType].recv.framesReceived ===
|
|
686
|
+
this.lastStatsResults.resolutions[mediaType].recv.framesReceived ||
|
|
687
|
+
this.statsResults.resolutions[mediaType].recv.framesReceived === 0
|
|
688
|
+
) {
|
|
689
|
+
LoggerProxy.logger.info(
|
|
690
|
+
`StatsAnalyzer:index#compareLastStatsResult --> No ${mediaType} frames received`
|
|
691
|
+
);
|
|
562
692
|
}
|
|
563
693
|
|
|
564
|
-
if (
|
|
565
|
-
|
|
694
|
+
if (
|
|
695
|
+
this.statsResults[mediaType].recv.framesDecoded ===
|
|
696
|
+
this.lastStatsResults[mediaType].recv.framesDecoded ||
|
|
697
|
+
this.statsResults.resolutions[mediaType].send.framesDecoded === 0
|
|
698
|
+
) {
|
|
699
|
+
LoggerProxy.logger.info(
|
|
700
|
+
`StatsAnalyzer:index#compareLastStatsResult --> No ${mediaType} frames decoded`
|
|
701
|
+
);
|
|
566
702
|
}
|
|
567
703
|
|
|
568
|
-
if (
|
|
569
|
-
|
|
704
|
+
if (
|
|
705
|
+
this.statsResults.resolutions[mediaType].recv.framesDropped -
|
|
706
|
+
this.lastStatsResults.resolutions[mediaType].recv.framesDropped >
|
|
707
|
+
10
|
|
708
|
+
) {
|
|
709
|
+
LoggerProxy.logger.info(
|
|
710
|
+
`StatsAnalyzer:index#compareLastStatsResult --> ${mediaType} frames are getting dropped`
|
|
711
|
+
);
|
|
570
712
|
}
|
|
571
713
|
}
|
|
572
714
|
|
|
@@ -580,21 +722,36 @@ export class StatsAnalyzer extends EventsScope {
|
|
|
580
722
|
|
|
581
723
|
mediaType = STATS.SHARE_CORRELATE;
|
|
582
724
|
if (this.meetingMediaStatus.expected.sendShare) {
|
|
583
|
-
|
|
725
|
+
// compare share stats sent
|
|
584
726
|
|
|
585
727
|
currentStats = this.statsResults[mediaType].send;
|
|
586
728
|
previousStats = this.lastStatsResults[mediaType].send;
|
|
587
729
|
|
|
588
|
-
if (
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
730
|
+
if (
|
|
731
|
+
currentStats.totalPacketsSent === previousStats.totalPacketsSent ||
|
|
732
|
+
currentStats.totalPacketsSent === 0
|
|
733
|
+
) {
|
|
734
|
+
LoggerProxy.logger.info(
|
|
735
|
+
`StatsAnalyzer:index#compareLastStatsResult --> No ${mediaType} RTP packets sent`
|
|
736
|
+
);
|
|
737
|
+
} else {
|
|
738
|
+
if (
|
|
739
|
+
currentStats.framesEncoded === previousStats.framesEncoded ||
|
|
740
|
+
currentStats.framesEncoded === 0
|
|
741
|
+
) {
|
|
742
|
+
LoggerProxy.logger.info(
|
|
743
|
+
`StatsAnalyzer:index#compareLastStatsResult --> No ${mediaType} frames getting encoded`
|
|
744
|
+
);
|
|
594
745
|
}
|
|
595
746
|
|
|
596
|
-
if (
|
|
597
|
-
|
|
747
|
+
if (
|
|
748
|
+
this.statsResults.resolutions[mediaType].send.framesSent ===
|
|
749
|
+
this.lastStatsResults.resolutions[mediaType].send.framesSent ||
|
|
750
|
+
this.statsResults.resolutions[mediaType].send.framesSent === 0
|
|
751
|
+
) {
|
|
752
|
+
LoggerProxy.logger.info(
|
|
753
|
+
`StatsAnalyzer:index#compareLastStatsResult --> No ${mediaType} frames sent`
|
|
754
|
+
);
|
|
598
755
|
}
|
|
599
756
|
}
|
|
600
757
|
|
|
@@ -603,20 +760,42 @@ export class StatsAnalyzer extends EventsScope {
|
|
|
603
760
|
currentStats = this.statsResults[mediaType].recv;
|
|
604
761
|
previousStats = this.lastStatsResults[mediaType].recv;
|
|
605
762
|
|
|
606
|
-
if (
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
763
|
+
if (
|
|
764
|
+
currentStats.totalPacketsReceived === previousStats.totalPacketsReceived ||
|
|
765
|
+
currentStats.totalPacketsSent === 0
|
|
766
|
+
) {
|
|
767
|
+
LoggerProxy.logger.info(
|
|
768
|
+
`StatsAnalyzer:index#compareLastStatsResult --> No ${mediaType} RTP packets received`
|
|
769
|
+
);
|
|
770
|
+
} else {
|
|
771
|
+
if (
|
|
772
|
+
this.statsResults.resolutions[mediaType].recv.framesReceived ===
|
|
773
|
+
this.lastStatsResults.resolutions[mediaType].recv.framesReceived ||
|
|
774
|
+
this.statsResults.resolutions[mediaType].recv.framesReceived === 0
|
|
775
|
+
) {
|
|
776
|
+
LoggerProxy.logger.info(
|
|
777
|
+
`StatsAnalyzer:index#compareLastStatsResult --> No ${mediaType} frames received`
|
|
778
|
+
);
|
|
612
779
|
}
|
|
613
780
|
|
|
614
|
-
if (
|
|
615
|
-
|
|
781
|
+
if (
|
|
782
|
+
this.statsResults[mediaType].recv.framesDecoded ===
|
|
783
|
+
this.lastStatsResults[mediaType].recv.framesDecoded ||
|
|
784
|
+
this.statsResults.resolutions[mediaType].send.framesDecoded === 0
|
|
785
|
+
) {
|
|
786
|
+
LoggerProxy.logger.info(
|
|
787
|
+
`StatsAnalyzer:index#compareLastStatsResult --> No ${mediaType} frames decoded`
|
|
788
|
+
);
|
|
616
789
|
}
|
|
617
790
|
|
|
618
|
-
if (
|
|
619
|
-
|
|
791
|
+
if (
|
|
792
|
+
this.statsResults.resolutions[mediaType].recv.framesDropped -
|
|
793
|
+
this.lastStatsResults.resolutions[mediaType].recv.framesDropped >
|
|
794
|
+
10
|
|
795
|
+
) {
|
|
796
|
+
LoggerProxy.logger.info(
|
|
797
|
+
`StatsAnalyzer:index#compareLastStatsResult --> ${mediaType} frames are getting dropped`
|
|
798
|
+
);
|
|
620
799
|
}
|
|
621
800
|
}
|
|
622
801
|
|
|
@@ -634,13 +813,18 @@ export class StatsAnalyzer extends EventsScope {
|
|
|
634
813
|
* @memberof StatsAnalyzer
|
|
635
814
|
* @returns {Promise}
|
|
636
815
|
*/
|
|
637
|
-
getStatsAndParse() {
|
|
816
|
+
private getStatsAndParse() {
|
|
638
817
|
if (!this.mediaConnection) {
|
|
639
818
|
return Promise.resolve();
|
|
640
819
|
}
|
|
641
820
|
|
|
642
|
-
if (
|
|
643
|
-
|
|
821
|
+
if (
|
|
822
|
+
this.mediaConnection &&
|
|
823
|
+
this.mediaConnection.getConnectionState() === ConnectionState.Failed
|
|
824
|
+
) {
|
|
825
|
+
LoggerProxy.logger.trace(
|
|
826
|
+
'StatsAnalyzer:index#getStatsAndParse --> media connection is in failed state'
|
|
827
|
+
);
|
|
644
828
|
|
|
645
829
|
return Promise.resolve();
|
|
646
830
|
}
|
|
@@ -648,20 +832,47 @@ export class StatsAnalyzer extends EventsScope {
|
|
|
648
832
|
LoggerProxy.logger.trace('StatsAnalyzer:index#getStatsAndParse --> Collecting Stats');
|
|
649
833
|
|
|
650
834
|
return this.mediaConnection.getTransceiverStats().then((transceiverStats) => {
|
|
651
|
-
this.filterAndParseGetStatsResults(
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
this.filterAndParseGetStatsResults(
|
|
835
|
+
this.filterAndParseGetStatsResults(
|
|
836
|
+
transceiverStats.video.sender,
|
|
837
|
+
STATS.VIDEO_CORRELATE,
|
|
838
|
+
true
|
|
839
|
+
);
|
|
840
|
+
this.filterAndParseGetStatsResults(
|
|
841
|
+
transceiverStats.video.receiver,
|
|
842
|
+
STATS.VIDEO_CORRELATE,
|
|
843
|
+
false
|
|
844
|
+
);
|
|
845
|
+
this.filterAndParseGetStatsResults(
|
|
846
|
+
transceiverStats.audio.sender,
|
|
847
|
+
STATS.AUDIO_CORRELATE,
|
|
848
|
+
true
|
|
849
|
+
);
|
|
850
|
+
this.filterAndParseGetStatsResults(
|
|
851
|
+
transceiverStats.audio.receiver,
|
|
852
|
+
STATS.AUDIO_CORRELATE,
|
|
853
|
+
false
|
|
854
|
+
);
|
|
855
|
+
this.filterAndParseGetStatsResults(
|
|
856
|
+
transceiverStats.screenShareVideo.sender,
|
|
857
|
+
STATS.SHARE_CORRELATE,
|
|
858
|
+
true
|
|
859
|
+
);
|
|
860
|
+
this.filterAndParseGetStatsResults(
|
|
861
|
+
transceiverStats.screenShareVideo.receiver,
|
|
862
|
+
STATS.SHARE_CORRELATE,
|
|
863
|
+
false
|
|
864
|
+
);
|
|
657
865
|
|
|
658
866
|
// updates the current direction of media
|
|
659
867
|
this.statsResults[STATS.AUDIO_CORRELATE].direction = transceiverStats.audio.currentDirection;
|
|
660
868
|
this.statsResults[STATS.VIDEO_CORRELATE].direction = transceiverStats.video.currentDirection;
|
|
661
|
-
this.statsResults[STATS.SHARE_CORRELATE].direction =
|
|
869
|
+
this.statsResults[STATS.SHARE_CORRELATE].direction =
|
|
870
|
+
transceiverStats.screenShareVideo.currentDirection;
|
|
662
871
|
|
|
663
|
-
this.statsResults[STATS.AUDIO_CORRELATE][STATS.SEND_DIRECTION].trackLabel =
|
|
664
|
-
|
|
872
|
+
this.statsResults[STATS.AUDIO_CORRELATE][STATS.SEND_DIRECTION].trackLabel =
|
|
873
|
+
transceiverStats.audio.localTrackLabel;
|
|
874
|
+
this.statsResults[STATS.VIDEO_CORRELATE][STATS.SEND_DIRECTION].trackLabel =
|
|
875
|
+
transceiverStats.video.localTrackLabel;
|
|
665
876
|
|
|
666
877
|
this.compareLastStatsResult();
|
|
667
878
|
|
|
@@ -669,7 +880,9 @@ export class StatsAnalyzer extends EventsScope {
|
|
|
669
880
|
// DO Deep copy, for some reason it takes the reference all the time rather then old value set
|
|
670
881
|
this.lastStatsResults = JSON.parse(JSON.stringify(this.statsResults));
|
|
671
882
|
|
|
672
|
-
LoggerProxy.logger.trace(
|
|
883
|
+
LoggerProxy.logger.trace(
|
|
884
|
+
'StatsAnalyzer:index#getStatsAndParse --> Finished Collecting Stats'
|
|
885
|
+
);
|
|
673
886
|
});
|
|
674
887
|
}
|
|
675
888
|
|
|
@@ -680,7 +893,7 @@ export class StatsAnalyzer extends EventsScope {
|
|
|
680
893
|
* @param {*} type
|
|
681
894
|
* @returns {void}
|
|
682
895
|
*/
|
|
683
|
-
processOutboundRTPResult(result, type) {
|
|
896
|
+
private processOutboundRTPResult(result: any, type: any) {
|
|
684
897
|
const mediaType = type || STATS.AUDIO_CORRELATE;
|
|
685
898
|
const sendrecvType = STATS.SEND_DIRECTION;
|
|
686
899
|
|
|
@@ -694,10 +907,12 @@ export class StatsAnalyzer extends EventsScope {
|
|
|
694
907
|
this.statsResults.internal[mediaType][sendrecvType].framesEncoded = result.framesEncoded;
|
|
695
908
|
}
|
|
696
909
|
if (!this.statsResults.internal[mediaType][sendrecvType].keyFramesEncoded) {
|
|
697
|
-
this.statsResults.internal[mediaType][sendrecvType].keyFramesEncoded =
|
|
910
|
+
this.statsResults.internal[mediaType][sendrecvType].keyFramesEncoded =
|
|
911
|
+
result.keyFramesEncoded;
|
|
698
912
|
}
|
|
699
913
|
|
|
700
|
-
const bytes =
|
|
914
|
+
const bytes =
|
|
915
|
+
result.bytesSent - this.statsResults.internal[mediaType][sendrecvType].prevBytesSent;
|
|
701
916
|
|
|
702
917
|
this.statsResults.internal[mediaType][sendrecvType].prevBytesSent = result.bytesSent;
|
|
703
918
|
|
|
@@ -706,15 +921,19 @@ export class StatsAnalyzer extends EventsScope {
|
|
|
706
921
|
this.statsResults[mediaType][sendrecvType].availableBandwidth = kilobytes.toFixed(1);
|
|
707
922
|
this.statsResults[mediaType].bytesSent = kilobytes;
|
|
708
923
|
|
|
709
|
-
this.statsResults[mediaType][sendrecvType].framesEncoded =
|
|
710
|
-
|
|
924
|
+
this.statsResults[mediaType][sendrecvType].framesEncoded =
|
|
925
|
+
result.framesEncoded - this.statsResults.internal[mediaType][sendrecvType].framesEncoded;
|
|
926
|
+
this.statsResults[mediaType][sendrecvType].keyFramesEncoded =
|
|
927
|
+
result.keyFramesEncoded -
|
|
928
|
+
this.statsResults.internal[mediaType][sendrecvType].keyFramesEncoded;
|
|
711
929
|
this.statsResults.internal[mediaType].outboundRtpId = result.id;
|
|
712
930
|
|
|
713
931
|
if (!this.statsResults.internal[mediaType][sendrecvType].packetsSent) {
|
|
714
932
|
this.statsResults.internal[mediaType][sendrecvType].packetsSent = result.packetsSent;
|
|
715
933
|
}
|
|
716
934
|
|
|
717
|
-
this.statsResults[mediaType][sendrecvType].packetsSent =
|
|
935
|
+
this.statsResults[mediaType][sendrecvType].packetsSent =
|
|
936
|
+
result.packetsSent - this.statsResults.internal[mediaType][sendrecvType].packetsSent;
|
|
718
937
|
this.statsResults.internal[mediaType][sendrecvType].packetsSent = result.packetsSent;
|
|
719
938
|
|
|
720
939
|
// Data saved to send MQA metrics
|
|
@@ -726,17 +945,21 @@ export class StatsAnalyzer extends EventsScope {
|
|
|
726
945
|
this.statsResults[mediaType][sendrecvType].totalFirCount = result.firCount;
|
|
727
946
|
this.statsResults[mediaType][sendrecvType].framesSent = result.framesSent;
|
|
728
947
|
this.statsResults[mediaType][sendrecvType].framesEncoded = result.framesEncoded;
|
|
729
|
-
this.statsResults[mediaType][sendrecvType].encoderImplementation =
|
|
730
|
-
|
|
731
|
-
this.statsResults[mediaType][sendrecvType].
|
|
732
|
-
|
|
948
|
+
this.statsResults[mediaType][sendrecvType].encoderImplementation =
|
|
949
|
+
result.encoderImplementation;
|
|
950
|
+
this.statsResults[mediaType][sendrecvType].qualityLimitationReason =
|
|
951
|
+
result.qualityLimitationReason;
|
|
952
|
+
this.statsResults[mediaType][sendrecvType].qualityLimitationResolutionChanges =
|
|
953
|
+
result.qualityLimitationResolutionChanges;
|
|
954
|
+
this.statsResults[mediaType][sendrecvType].retransmittedPacketsSent =
|
|
955
|
+
result.retransmittedPacketsSent;
|
|
733
956
|
this.statsResults[mediaType][sendrecvType].totalBytesSent = result.bytesSent;
|
|
734
957
|
this.statsResults[mediaType][sendrecvType].headerBytesSent = result.headerBytesSent;
|
|
735
|
-
this.statsResults[mediaType][sendrecvType].retransmittedBytesSent =
|
|
958
|
+
this.statsResults[mediaType][sendrecvType].retransmittedBytesSent =
|
|
959
|
+
result.retransmittedBytesSent;
|
|
736
960
|
}
|
|
737
961
|
}
|
|
738
962
|
|
|
739
|
-
|
|
740
963
|
/**
|
|
741
964
|
* Processes InboundRTP stats result and stores
|
|
742
965
|
* @private
|
|
@@ -744,7 +967,7 @@ export class StatsAnalyzer extends EventsScope {
|
|
|
744
967
|
* @param {*} type
|
|
745
968
|
* @returns {void}
|
|
746
969
|
*/
|
|
747
|
-
processInboundRTPResult(result, type) {
|
|
970
|
+
private processInboundRTPResult(result: any, type: any) {
|
|
748
971
|
const mediaType = type || STATS.AUDIO_CORRELATE;
|
|
749
972
|
const sendrecvType = STATS.RECEIVE_DIRECTION;
|
|
750
973
|
|
|
@@ -752,7 +975,8 @@ export class StatsAnalyzer extends EventsScope {
|
|
|
752
975
|
let kilobytes = 0;
|
|
753
976
|
|
|
754
977
|
if (!this.statsResults.internal[mediaType][sendrecvType].prevBytesReceived) {
|
|
755
|
-
this.statsResults.internal[mediaType][sendrecvType].prevBytesReceived =
|
|
978
|
+
this.statsResults.internal[mediaType][sendrecvType].prevBytesReceived =
|
|
979
|
+
result.bytesReceived;
|
|
756
980
|
}
|
|
757
981
|
|
|
758
982
|
if (!this.statsResults.internal[mediaType][sendrecvType].pliCount) {
|
|
@@ -764,14 +988,18 @@ export class StatsAnalyzer extends EventsScope {
|
|
|
764
988
|
}
|
|
765
989
|
|
|
766
990
|
if (!this.statsResults.internal[mediaType][sendrecvType].totalPacketsReceived) {
|
|
767
|
-
this.statsResults.internal[mediaType][sendrecvType].totalPacketsReceived =
|
|
991
|
+
this.statsResults.internal[mediaType][sendrecvType].totalPacketsReceived =
|
|
992
|
+
result.packetsReceived;
|
|
768
993
|
}
|
|
769
994
|
|
|
770
995
|
if (!this.statsResults.internal[mediaType][sendrecvType].lastPacketReceivedTimestamp) {
|
|
771
|
-
this.statsResults.internal[mediaType][sendrecvType].lastPacketReceivedTimestamp =
|
|
996
|
+
this.statsResults.internal[mediaType][sendrecvType].lastPacketReceivedTimestamp =
|
|
997
|
+
result.lastPacketReceivedTimestamp;
|
|
772
998
|
}
|
|
773
999
|
|
|
774
|
-
const bytes =
|
|
1000
|
+
const bytes =
|
|
1001
|
+
result.bytesReceived -
|
|
1002
|
+
this.statsResults.internal[mediaType][sendrecvType].prevBytesReceived;
|
|
775
1003
|
|
|
776
1004
|
this.statsResults.internal[mediaType][sendrecvType].prevBytesReceived = result.bytesReceived;
|
|
777
1005
|
|
|
@@ -779,35 +1007,52 @@ export class StatsAnalyzer extends EventsScope {
|
|
|
779
1007
|
this.statsResults[mediaType][sendrecvType].availableBandwidth = kilobytes.toFixed(1);
|
|
780
1008
|
this.statsResults[mediaType].bytesReceived = kilobytes.toFixed(1);
|
|
781
1009
|
|
|
782
|
-
this.statsResults[mediaType][sendrecvType].pliCount =
|
|
783
|
-
|
|
1010
|
+
this.statsResults[mediaType][sendrecvType].pliCount =
|
|
1011
|
+
result.pliCount - this.statsResults.internal[mediaType][sendrecvType].pliCount;
|
|
1012
|
+
this.statsResults[mediaType][sendrecvType].currentPacketsLost =
|
|
1013
|
+
result.packetsLost - this.statsResults.internal[mediaType][sendrecvType].packetsLost;
|
|
784
1014
|
if (this.statsResults[mediaType][sendrecvType].currentPacketsLost < 0) {
|
|
785
1015
|
this.statsResults[mediaType][sendrecvType].currentPacketsLost = 0;
|
|
786
1016
|
}
|
|
787
1017
|
|
|
788
|
-
this.statsResults[mediaType][sendrecvType].packetsReceived =
|
|
789
|
-
|
|
1018
|
+
this.statsResults[mediaType][sendrecvType].packetsReceived =
|
|
1019
|
+
result.packetsReceived -
|
|
1020
|
+
this.statsResults.internal[mediaType][sendrecvType].totalPacketsReceived;
|
|
1021
|
+
this.statsResults.internal[mediaType][sendrecvType].totalPacketsReceived =
|
|
1022
|
+
result.packetsReceived;
|
|
790
1023
|
|
|
791
1024
|
if (this.statsResults[mediaType][sendrecvType].packetsReceived === 0) {
|
|
792
|
-
LoggerProxy.logger.info(
|
|
1025
|
+
LoggerProxy.logger.info(
|
|
1026
|
+
`StatsAnalyzer:index#processInboundRTPResult --> No packets received for ${mediaType} `,
|
|
1027
|
+
this.statsResults[mediaType][sendrecvType].packetsReceived
|
|
1028
|
+
);
|
|
793
1029
|
}
|
|
794
1030
|
|
|
795
1031
|
// Check the over all packet Lost ratio
|
|
796
|
-
this.statsResults[mediaType][sendrecvType].currentPacketLossRatio =
|
|
1032
|
+
this.statsResults[mediaType][sendrecvType].currentPacketLossRatio =
|
|
1033
|
+
this.statsResults[mediaType][sendrecvType].currentPacketsLost > 0
|
|
1034
|
+
? this.statsResults[mediaType][sendrecvType].currentPacketsLost /
|
|
1035
|
+
(this.statsResults[mediaType][sendrecvType].packetsReceived +
|
|
1036
|
+
this.statsResults[mediaType][sendrecvType].currentPacketsLost)
|
|
1037
|
+
: 0;
|
|
797
1038
|
if (this.statsResults[mediaType][sendrecvType].currentPacketLossRatio > 3) {
|
|
798
|
-
LoggerProxy.logger.info(
|
|
1039
|
+
LoggerProxy.logger.info(
|
|
1040
|
+
'StatsAnalyzer:index#processInboundRTPResult --> Packets getting lost from the receiver ',
|
|
1041
|
+
this.statsResults[mediaType][sendrecvType].currentPacketLossRatio
|
|
1042
|
+
);
|
|
799
1043
|
}
|
|
800
1044
|
|
|
801
1045
|
// TODO: check the packet loss value is negative values here
|
|
802
1046
|
|
|
803
1047
|
if (result.packetsLost) {
|
|
804
|
-
this.statsResults[mediaType][sendrecvType].totalPacketsLost =
|
|
805
|
-
|
|
806
|
-
else {
|
|
1048
|
+
this.statsResults[mediaType][sendrecvType].totalPacketsLost =
|
|
1049
|
+
result.packetsLost > 0 ? result.packetsLost : -result.packetsLost;
|
|
1050
|
+
} else {
|
|
807
1051
|
this.statsResults[mediaType][sendrecvType].totalPacketsLost = 0;
|
|
808
1052
|
}
|
|
809
1053
|
|
|
810
|
-
this.statsResults[mediaType][sendrecvType].lastPacketReceivedTimestamp =
|
|
1054
|
+
this.statsResults[mediaType][sendrecvType].lastPacketReceivedTimestamp =
|
|
1055
|
+
result.lastPacketReceivedTimestamp;
|
|
811
1056
|
|
|
812
1057
|
// From Thin
|
|
813
1058
|
this.statsResults[mediaType][sendrecvType].totalNackCount = result.nackCount;
|
|
@@ -815,10 +1060,10 @@ export class StatsAnalyzer extends EventsScope {
|
|
|
815
1060
|
this.statsResults[mediaType][sendrecvType].framesDecoded = result.framesDecoded;
|
|
816
1061
|
this.statsResults[mediaType][sendrecvType].keyFramesDecoded = result.keyFramesDecoded;
|
|
817
1062
|
|
|
818
|
-
this.statsResults[mediaType][sendrecvType].decoderImplementation =
|
|
1063
|
+
this.statsResults[mediaType][sendrecvType].decoderImplementation =
|
|
1064
|
+
result.decoderImplementation;
|
|
819
1065
|
this.statsResults[mediaType][sendrecvType].totalPacketsReceived = result.packetsReceived;
|
|
820
1066
|
|
|
821
|
-
|
|
822
1067
|
this.statsResults[mediaType][sendrecvType].fecPacketsDiscarded = result.fecPacketsDiscarded;
|
|
823
1068
|
this.statsResults[mediaType][sendrecvType].fecPacketsReceived = result.fecPacketsReceived;
|
|
824
1069
|
this.statsResults[mediaType][sendrecvType].totalBytesReceived = result.bytesReceived;
|
|
@@ -830,8 +1075,10 @@ export class StatsAnalyzer extends EventsScope {
|
|
|
830
1075
|
|
|
831
1076
|
this.statsResults[mediaType][sendrecvType].audioLevel = result.audioLevel;
|
|
832
1077
|
this.statsResults[mediaType][sendrecvType].totalAudioEnergy = result.totalAudioEnergy;
|
|
833
|
-
this.statsResults[mediaType][sendrecvType].totalSamplesReceived =
|
|
834
|
-
|
|
1078
|
+
this.statsResults[mediaType][sendrecvType].totalSamplesReceived =
|
|
1079
|
+
result.totalSamplesReceived || 0;
|
|
1080
|
+
this.statsResults[mediaType][sendrecvType].totalSamplesDecoded =
|
|
1081
|
+
result.totalSamplesDecoded || 0;
|
|
835
1082
|
this.statsResults[mediaType][sendrecvType].concealedSamples = result.concealedSamples || 0;
|
|
836
1083
|
}
|
|
837
1084
|
}
|
|
@@ -846,7 +1093,7 @@ export class StatsAnalyzer extends EventsScope {
|
|
|
846
1093
|
*
|
|
847
1094
|
* @returns {void}
|
|
848
1095
|
*/
|
|
849
|
-
parseCandidate = (result, type, isSender, isRemote) => {
|
|
1096
|
+
parseCandidate = (result: any, type: any, isSender: boolean, isRemote: boolean) => {
|
|
850
1097
|
if (!result || !result.id) {
|
|
851
1098
|
return;
|
|
852
1099
|
}
|
|
@@ -875,7 +1122,10 @@ export class StatsAnalyzer extends EventsScope {
|
|
|
875
1122
|
RemoteNetworkType[result.id] = [];
|
|
876
1123
|
}
|
|
877
1124
|
|
|
878
|
-
if (
|
|
1125
|
+
if (
|
|
1126
|
+
result.candidateType &&
|
|
1127
|
+
RemoteCandidateType[result.id].indexOf(result.candidateType) === -1
|
|
1128
|
+
) {
|
|
879
1129
|
RemoteCandidateType[result.id].push(result.candidateType);
|
|
880
1130
|
}
|
|
881
1131
|
|
|
@@ -883,7 +1133,10 @@ export class StatsAnalyzer extends EventsScope {
|
|
|
883
1133
|
RemoteTransport[result.id].push(result.protocol.toUpperCase());
|
|
884
1134
|
}
|
|
885
1135
|
|
|
886
|
-
if (
|
|
1136
|
+
if (
|
|
1137
|
+
result.ip &&
|
|
1138
|
+
RemoteIpAddress[result.id].indexOf(`${result.ip}:${result.portNumber}`) === -1
|
|
1139
|
+
) {
|
|
887
1140
|
RemoteIpAddress[result.id].push(`${result.ip}`); // TODO: Add ports
|
|
888
1141
|
}
|
|
889
1142
|
|
|
@@ -900,13 +1153,16 @@ export class StatsAnalyzer extends EventsScope {
|
|
|
900
1153
|
transport: RemoteTransport[result.id],
|
|
901
1154
|
timestamp: result.time,
|
|
902
1155
|
id: result.id,
|
|
903
|
-
type: result.type
|
|
1156
|
+
type: result.type,
|
|
904
1157
|
};
|
|
905
1158
|
|
|
906
1159
|
this.statsResults.connectionType[ipType].candidateType = RemoteCandidateType[result.id];
|
|
907
1160
|
this.statsResults.connectionType[ipType].ipAddress = RemoteIpAddress[result.id];
|
|
908
1161
|
|
|
909
|
-
this.statsResults.connectionType[ipType].networkType =
|
|
1162
|
+
this.statsResults.connectionType[ipType].networkType =
|
|
1163
|
+
RemoteNetworkType[result.id][0] === NETWORK_TYPE.VPN
|
|
1164
|
+
? NETWORK_TYPE.UNKNOWN
|
|
1165
|
+
: RemoteNetworkType[result.id][0];
|
|
910
1166
|
this.statsResults.connectionType[ipType].transport = RemoteTransport[result.id];
|
|
911
1167
|
|
|
912
1168
|
this.statsResults[type][sendRecvType].totalRoundTripTime = result.totalRoundTripTime;
|
|
@@ -921,13 +1177,14 @@ export class StatsAnalyzer extends EventsScope {
|
|
|
921
1177
|
* @returns {void}
|
|
922
1178
|
* @memberof StatsAnalyzer
|
|
923
1179
|
*/
|
|
924
|
-
processTrackResult(result, mediaType) {
|
|
1180
|
+
private processTrackResult(result: any, mediaType: any) {
|
|
925
1181
|
if (!result || result.type !== 'track') {
|
|
926
1182
|
return;
|
|
927
1183
|
}
|
|
928
1184
|
if (result.type !== 'track') return;
|
|
929
1185
|
|
|
930
|
-
const sendrecvType =
|
|
1186
|
+
const sendrecvType =
|
|
1187
|
+
result.remoteSource === true ? STATS.RECEIVE_DIRECTION : STATS.SEND_DIRECTION;
|
|
931
1188
|
|
|
932
1189
|
if (result.frameWidth && result.frameHeight) {
|
|
933
1190
|
this.statsResults.resolutions[mediaType][sendrecvType].width = result.frameWidth;
|
|
@@ -942,18 +1199,21 @@ export class StatsAnalyzer extends EventsScope {
|
|
|
942
1199
|
this.statsResults.resolutions[mediaType][sendrecvType].framesDropped = result.framesDropped;
|
|
943
1200
|
}
|
|
944
1201
|
|
|
945
|
-
|
|
946
1202
|
if (result.trackIdentifier && mediaType !== STATS.AUDIO_CORRELATE) {
|
|
947
|
-
this.statsResults.resolutions[mediaType][sendrecvType].trackIdentifier =
|
|
1203
|
+
this.statsResults.resolutions[mediaType][sendrecvType].trackIdentifier =
|
|
1204
|
+
result.trackIdentifier;
|
|
948
1205
|
|
|
949
1206
|
const jitterBufferDelay = result && result.jitterBufferDelay;
|
|
950
1207
|
const jitterBufferEmittedCount = result && result.jitterBufferEmittedCount;
|
|
951
1208
|
|
|
952
|
-
this.statsResults.resolutions[mediaType][sendrecvType].avgJitterDelay =
|
|
1209
|
+
this.statsResults.resolutions[mediaType][sendrecvType].avgJitterDelay =
|
|
1210
|
+
jitterBufferEmittedCount && +jitterBufferDelay / +jitterBufferEmittedCount;
|
|
953
1211
|
|
|
954
1212
|
// Used to calculate the jitter
|
|
955
|
-
this.statsResults.resolutions[mediaType][sendrecvType].jitterBufferDelay =
|
|
956
|
-
|
|
1213
|
+
this.statsResults.resolutions[mediaType][sendrecvType].jitterBufferDelay =
|
|
1214
|
+
result.jitterBufferDelay;
|
|
1215
|
+
this.statsResults.resolutions[mediaType][sendrecvType].jitterBufferEmittedCount =
|
|
1216
|
+
result.jitterBufferEmittedCount;
|
|
957
1217
|
}
|
|
958
1218
|
}
|
|
959
1219
|
|
|
@@ -965,16 +1225,19 @@ export class StatsAnalyzer extends EventsScope {
|
|
|
965
1225
|
* @returns {void}
|
|
966
1226
|
* @memberof StatsAnalyzer
|
|
967
1227
|
*/
|
|
968
|
-
compareSentAndReceived(result, type) {
|
|
1228
|
+
private compareSentAndReceived(result: any, type: any) {
|
|
969
1229
|
if (!type) {
|
|
970
1230
|
return;
|
|
971
1231
|
}
|
|
972
1232
|
|
|
973
1233
|
const mediaType = type;
|
|
974
1234
|
|
|
975
|
-
if (!this.statsResults.internal[mediaType].send.totalPacketsLostOnReceiver) {
|
|
1235
|
+
if (!this.statsResults.internal[mediaType].send.totalPacketsLostOnReceiver) {
|
|
1236
|
+
this.statsResults.internal[mediaType].send.totalPacketsLostOnReceiver = result.packetsLost;
|
|
1237
|
+
}
|
|
976
1238
|
|
|
977
|
-
const currentPacketLoss =
|
|
1239
|
+
const currentPacketLoss =
|
|
1240
|
+
result.packetsLost - this.statsResults.internal[mediaType].send.totalPacketsLostOnReceiver;
|
|
978
1241
|
|
|
979
1242
|
this.statsResults.internal[mediaType].send.totalPacketsLostOnReceiver = result.packetsLost;
|
|
980
1243
|
this.statsResults[mediaType].send.packetsLostOnReceiver = currentPacketLoss;
|
|
@@ -988,18 +1251,31 @@ export class StatsAnalyzer extends EventsScope {
|
|
|
988
1251
|
this.statsResults[mediaType].send.reportsReceived = result.reportsReceived;
|
|
989
1252
|
|
|
990
1253
|
// Total packloss ratio on this video section of the call
|
|
991
|
-
this.statsResults[mediaType].send.overAllPacketLossRatio =
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
1254
|
+
this.statsResults[mediaType].send.overAllPacketLossRatio =
|
|
1255
|
+
this.statsResults[mediaType].send.totalPacketsLostOnReceiver > 0
|
|
1256
|
+
? this.statsResults[mediaType].send.totalPacketsLostOnReceiver /
|
|
1257
|
+
this.statsResults[mediaType].send.totalPacketsSent
|
|
1258
|
+
: 0;
|
|
1259
|
+
this.statsResults[mediaType].send.currentPacketLossRatio =
|
|
1260
|
+
this.statsResults[mediaType].send.packetsLostOnReceiver > 0
|
|
1261
|
+
? (this.statsResults[mediaType].send.packetsLostOnReceiver * 100) /
|
|
1262
|
+
(this.statsResults[mediaType].send.packetsSent +
|
|
1263
|
+
this.statsResults[mediaType].send.packetsLostOnReceiver)
|
|
1264
|
+
: 0;
|
|
1265
|
+
|
|
1266
|
+
if (
|
|
1267
|
+
this.statsResults[mediaType].send.maxPacketLossRatio <
|
|
1268
|
+
this.statsResults[mediaType].send.currentPacketLossRatio
|
|
1269
|
+
) {
|
|
1270
|
+
this.statsResults[mediaType].send.maxPacketLossRatio =
|
|
1271
|
+
this.statsResults[mediaType].send.currentPacketLossRatio;
|
|
996
1272
|
}
|
|
997
1273
|
|
|
998
1274
|
if (result.type === 'remote-inbound-rtp') {
|
|
999
1275
|
this.networkQualityMonitor.determineUplinkNetworkQuality({
|
|
1000
1276
|
mediaType,
|
|
1001
1277
|
remoteRtpResults: result,
|
|
1002
|
-
statsAnalyzerCurrentStats: this.statsResults
|
|
1278
|
+
statsAnalyzerCurrentStats: this.statsResults,
|
|
1003
1279
|
});
|
|
1004
1280
|
}
|
|
1005
1281
|
}
|