@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
package/test/utils/testUtils.js
CHANGED
|
@@ -19,7 +19,7 @@ const waitForSpy = (spy, event) => {
|
|
|
19
19
|
resolve(spy.args[0][0]);
|
|
20
20
|
}
|
|
21
21
|
}, 1000);
|
|
22
|
-
})
|
|
22
|
+
}),
|
|
23
23
|
]);
|
|
24
24
|
};
|
|
25
25
|
|
|
@@ -40,7 +40,7 @@ const waitForStateChange = (meeting, state) => {
|
|
|
40
40
|
resolve(meeting.locusInfo.parsedLocus.states);
|
|
41
41
|
}
|
|
42
42
|
}, 1000);
|
|
43
|
-
})
|
|
43
|
+
}),
|
|
44
44
|
]);
|
|
45
45
|
};
|
|
46
46
|
|
|
@@ -59,44 +59,46 @@ const waitForCallEnded = (user, email) => {
|
|
|
59
59
|
clearTimeout(timer);
|
|
60
60
|
clearInterval(interval);
|
|
61
61
|
resolve();
|
|
62
|
-
}
|
|
63
|
-
else {
|
|
62
|
+
} else {
|
|
64
63
|
console.log('MEETING STILL EXISTS!', user.webex.meetings.getAllMeetings());
|
|
65
64
|
}
|
|
66
65
|
}, 3000);
|
|
67
|
-
})
|
|
66
|
+
}),
|
|
68
67
|
]);
|
|
69
68
|
};
|
|
70
69
|
|
|
71
|
-
const syncAndEndMeeting = (user) =>
|
|
72
|
-
.
|
|
73
|
-
|
|
74
|
-
|
|
70
|
+
const syncAndEndMeeting = (user) =>
|
|
71
|
+
user.webex.meetings
|
|
72
|
+
.syncMeetings()
|
|
73
|
+
.then(() => {
|
|
74
|
+
const promise = [];
|
|
75
|
+
const meetings = user.webex.meetings.getAllMeetings();
|
|
75
76
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
.forEach((key) => {
|
|
77
|
+
if (Object.keys(meetings).length === 0) {
|
|
78
|
+
return Promise.resolve();
|
|
79
|
+
}
|
|
80
|
+
Object.keys(meetings).forEach((key) => {
|
|
81
81
|
promise.push(meetings[key].leave());
|
|
82
82
|
});
|
|
83
83
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
84
|
+
return Promise.all(promise);
|
|
85
|
+
})
|
|
86
|
+
.then(
|
|
87
|
+
() =>
|
|
88
|
+
new Promise((resolve) => {
|
|
89
|
+
const interval = setInterval(() => {
|
|
90
|
+
if (Object.keys(user.webex.meetings.getAllMeetings()).length === 0) {
|
|
91
|
+
clearInterval(interval);
|
|
92
|
+
resolve();
|
|
93
|
+
} else {
|
|
94
|
+
console.log('End Meetings before test failed');
|
|
95
|
+
}
|
|
96
|
+
}, 3000);
|
|
97
|
+
})
|
|
98
|
+
)
|
|
99
|
+
.catch((e) => {
|
|
100
|
+
console.log('ERROR on syncMeeting', e);
|
|
101
|
+
});
|
|
100
102
|
|
|
101
103
|
//
|
|
102
104
|
const waitForEvents = (scopeEvents, timeout = max) => {
|
|
@@ -125,11 +127,12 @@ const waitForEvents = (scopeEvents, timeout = max) => {
|
|
|
125
127
|
obj.user.memberId = value.meeting.locusInfo.parsedLocus.selfId;
|
|
126
128
|
}
|
|
127
129
|
if (obj.event === 'meeting:removed') {
|
|
128
|
-
console.log(
|
|
130
|
+
console.log(
|
|
131
|
+
`MEETING:REMOVED ${obj.user.name} ID ${obj.user.meeting.id} correlationID ${obj.user.meeting.correlationId}`
|
|
132
|
+
);
|
|
129
133
|
if (obj.user.meeting.id === value.meetingId) {
|
|
130
134
|
obj.user.meeting = null;
|
|
131
|
-
}
|
|
132
|
-
else {
|
|
135
|
+
} else {
|
|
133
136
|
console.log('MEETING EXISTING ', obj.user.webex.meetings.getAllMeetings());
|
|
134
137
|
reject(new Error(`Different Meeting Object ${value}`));
|
|
135
138
|
}
|
|
@@ -142,8 +145,7 @@ const waitForEvents = (scopeEvents, timeout = max) => {
|
|
|
142
145
|
|
|
143
146
|
resolve(result);
|
|
144
147
|
}
|
|
145
|
-
}
|
|
146
|
-
else if (result.length === scopeEvents.length) {
|
|
148
|
+
} else if (result.length === scopeEvents.length) {
|
|
147
149
|
resolve(result);
|
|
148
150
|
obj.scope.off(obj.event, handler);
|
|
149
151
|
clearTimeout(timer);
|
|
@@ -152,12 +154,11 @@ const waitForEvents = (scopeEvents, timeout = max) => {
|
|
|
152
154
|
|
|
153
155
|
obj.scope.on(obj.event, handler);
|
|
154
156
|
});
|
|
155
|
-
}
|
|
156
|
-
catch (e) {
|
|
157
|
+
} catch (e) {
|
|
157
158
|
console.error('waitForEvents', e);
|
|
158
159
|
reject(e);
|
|
159
160
|
}
|
|
160
|
-
})
|
|
161
|
+
}),
|
|
161
162
|
]);
|
|
162
163
|
};
|
|
163
164
|
|
|
@@ -172,25 +173,27 @@ const delayedPromise = (promise) => {
|
|
|
172
173
|
}),
|
|
173
174
|
new Promise((resolve, reject) => {
|
|
174
175
|
setTimeout(() => {
|
|
175
|
-
promise
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
176
|
+
promise
|
|
177
|
+
.then((res) => {
|
|
178
|
+
resolve(res);
|
|
179
|
+
clearTimeout(timer);
|
|
180
|
+
})
|
|
179
181
|
.catch((e) => {
|
|
180
182
|
console.error('delayedPromise', e);
|
|
181
183
|
reject(e);
|
|
182
184
|
});
|
|
183
185
|
}, 2000);
|
|
184
|
-
})
|
|
186
|
+
}),
|
|
185
187
|
]);
|
|
186
188
|
};
|
|
187
189
|
|
|
188
|
-
const delayedTest = (callback, timeout) =>
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
});
|
|
190
|
+
const delayedTest = (callback, timeout) =>
|
|
191
|
+
new Promise((resolve) => {
|
|
192
|
+
setTimeout(() => {
|
|
193
|
+
callback();
|
|
194
|
+
resolve();
|
|
195
|
+
}, timeout);
|
|
196
|
+
});
|
|
194
197
|
|
|
195
198
|
const addMedia = (user) => {
|
|
196
199
|
const mediaReadyPromises = {
|
|
@@ -209,23 +212,26 @@ const addMedia = (user) => {
|
|
|
209
212
|
|
|
210
213
|
user.meeting.on('media:ready', mediaReady);
|
|
211
214
|
|
|
212
|
-
return user.meeting
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
215
|
+
return user.meeting
|
|
216
|
+
.getMediaStreams({
|
|
217
|
+
sendAudio: true,
|
|
218
|
+
sendVideo: true,
|
|
219
|
+
sendShare: false,
|
|
220
|
+
})
|
|
221
|
+
.then(([localStream, localShare]) =>
|
|
222
|
+
user.meeting.addMedia({
|
|
223
|
+
mediaSettings: {
|
|
224
|
+
sendAudio: true,
|
|
225
|
+
sendVideo: true,
|
|
226
|
+
sendShare: false,
|
|
227
|
+
receiveShare: true,
|
|
228
|
+
receiveAudio: true,
|
|
229
|
+
receiveVideo: true,
|
|
230
|
+
},
|
|
231
|
+
localShare,
|
|
232
|
+
localStream,
|
|
233
|
+
})
|
|
234
|
+
)
|
|
229
235
|
.then(() => Promise.all(Object.values(mediaReadyPromises).map((defer) => defer.promise)))
|
|
230
236
|
.then(() => {
|
|
231
237
|
assert.exists(user.meeting.mediaProperties.audioTrack, 'audioTrack not present');
|
|
@@ -233,11 +239,12 @@ const addMedia = (user) => {
|
|
|
233
239
|
});
|
|
234
240
|
};
|
|
235
241
|
|
|
236
|
-
const waitUntil = (waitTime) =>
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
});
|
|
242
|
+
const waitUntil = (waitTime) =>
|
|
243
|
+
new Promise((resolve) => {
|
|
244
|
+
setTimeout(() => {
|
|
245
|
+
resolve();
|
|
246
|
+
}, waitTime);
|
|
247
|
+
});
|
|
241
248
|
|
|
242
249
|
const flushPromises = () => new Promise(setImmediate);
|
|
243
250
|
|
|
@@ -259,7 +266,10 @@ const getCircularReplacer = () => {
|
|
|
259
266
|
|
|
260
267
|
// this function is meant to be used as the "match" callback with waitForEvents()
|
|
261
268
|
// when you want to wait for a particular users's status to reach a certain value
|
|
262
|
-
const checkParticipantUpdatedStatus = (user, expectedStatus) => (event) =>
|
|
269
|
+
const checkParticipantUpdatedStatus = (user, expectedStatus) => (event) =>
|
|
270
|
+
!!event.delta.updated.find(
|
|
271
|
+
(member) => user.meeting.members.selfId === member.id && member.status === expectedStatus
|
|
272
|
+
);
|
|
263
273
|
|
|
264
274
|
export default {
|
|
265
275
|
waitForSpy,
|
|
@@ -273,6 +283,5 @@ export default {
|
|
|
273
283
|
waitUntil,
|
|
274
284
|
delayedTest,
|
|
275
285
|
flushPromises,
|
|
276
|
-
getCircularReplacer
|
|
286
|
+
getCircularReplacer,
|
|
277
287
|
};
|
|
278
|
-
|
|
@@ -8,29 +8,29 @@ const SCOPE = [
|
|
|
8
8
|
'spark:memberships_read',
|
|
9
9
|
'spark:memberships_write',
|
|
10
10
|
'spark:messages_read',
|
|
11
|
-
'spark:messages_write'
|
|
11
|
+
'spark:messages_write',
|
|
12
12
|
].join(' ');
|
|
13
13
|
|
|
14
14
|
const Config = {
|
|
15
|
-
version: (
|
|
16
|
-
appType: (
|
|
15
|
+
version: () => process.env.BUILD_VERSION || -1,
|
|
16
|
+
appType: () => {
|
|
17
17
|
const type = 'Web';
|
|
18
18
|
|
|
19
19
|
return type;
|
|
20
|
-
}
|
|
20
|
+
},
|
|
21
21
|
clientId: process.env.WEBEX_CLIENT_ID,
|
|
22
|
-
clientSecret: process.env.WEBEX_CLIENT_SECRET
|
|
22
|
+
clientSecret: process.env.WEBEX_CLIENT_SECRET,
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
Config.allowedOutboundTags = {
|
|
26
|
-
'webex-mention': ['data-object-type', 'data-object-id', 'data-group-type', 'data-object-url']
|
|
26
|
+
'webex-mention': ['data-object-type', 'data-object-id', 'data-group-type', 'data-object-url'],
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
Config.webex = {
|
|
30
30
|
maxReconnectAttempts: 5,
|
|
31
31
|
conversation: {
|
|
32
32
|
allowedInboundTags: Config.allowedInboundTags,
|
|
33
|
-
allowedOutboundTags: Config.allowedOutboundTags
|
|
33
|
+
allowedOutboundTags: Config.allowedOutboundTags,
|
|
34
34
|
},
|
|
35
35
|
credentials: {
|
|
36
36
|
clientType: 'confidential',
|
|
@@ -39,39 +39,39 @@ Config.webex = {
|
|
|
39
39
|
client_id: Config.clientId,
|
|
40
40
|
client_secret: Config.clientSecret,
|
|
41
41
|
redirect_uri: process.env.LAUNCH_URL,
|
|
42
|
-
scope: SCOPE
|
|
43
|
-
}
|
|
42
|
+
scope: SCOPE,
|
|
43
|
+
},
|
|
44
44
|
},
|
|
45
45
|
encryption: {
|
|
46
|
-
decryptionFailureMessage: 'This message cannot be decrypted'
|
|
46
|
+
decryptionFailureMessage: 'This message cannot be decrypted',
|
|
47
47
|
},
|
|
48
48
|
logger: {
|
|
49
|
-
level: process.env.NODE_ENV === 'test' ? 'error' : 'error'
|
|
49
|
+
level: process.env.NODE_ENV === 'test' ? 'error' : 'error',
|
|
50
50
|
},
|
|
51
51
|
meetings: {
|
|
52
52
|
metrics: {
|
|
53
|
-
autoSendMQA: true
|
|
53
|
+
autoSendMQA: true,
|
|
54
54
|
},
|
|
55
55
|
autoUploadLogs: false,
|
|
56
56
|
reconnection: {
|
|
57
|
-
enabled: true
|
|
57
|
+
enabled: true,
|
|
58
58
|
},
|
|
59
|
-
enableRtx: true
|
|
59
|
+
enableRtx: true,
|
|
60
60
|
},
|
|
61
61
|
people: {
|
|
62
|
-
showAllTypes: true
|
|
62
|
+
showAllTypes: true,
|
|
63
63
|
},
|
|
64
64
|
metrics: {
|
|
65
65
|
appVersion: Config.version,
|
|
66
|
-
appType: Config.appType
|
|
66
|
+
appType: Config.appType,
|
|
67
67
|
},
|
|
68
68
|
support: {
|
|
69
69
|
appVersion: Config.version,
|
|
70
70
|
appType: Config.appType,
|
|
71
|
-
languageCode: 'en'
|
|
71
|
+
languageCode: 'en',
|
|
72
72
|
},
|
|
73
73
|
trackingIdPrefix: 'ITCLIENT',
|
|
74
|
-
trackingIdSuffix: 'imu:false_imi:true'
|
|
74
|
+
trackingIdSuffix: 'imu:false_imi:true',
|
|
75
75
|
};
|
|
76
76
|
|
|
77
77
|
module.exports = Config;
|
|
@@ -8,6 +8,7 @@ const config = require('./webex-config');
|
|
|
8
8
|
|
|
9
9
|
// Include the plugins which you feel will be used by the webex instance
|
|
10
10
|
require('@webex/internal-plugin-mercury');
|
|
11
|
+
require('@webex/internal-plugin-llm');
|
|
11
12
|
require('@webex/internal-plugin-user');
|
|
12
13
|
require('@webex/internal-plugin-device');
|
|
13
14
|
require('@webex/internal-plugin-conversation');
|
|
@@ -16,64 +17,67 @@ require('@webex/plugin-people');
|
|
|
16
17
|
require('@webex/plugin-rooms');
|
|
17
18
|
require('@webex/plugin-meetings');
|
|
18
19
|
|
|
19
|
-
const generateTestUsers = (options) =>
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
const generateTestUsers = (options) =>
|
|
21
|
+
testUser
|
|
22
|
+
.create({count: options.count})
|
|
23
|
+
.then(async (userSet) => {
|
|
24
|
+
if (userSet.length !== options.count) {
|
|
25
|
+
return Promise.reject(new Error('Test users not created'));
|
|
26
|
+
}
|
|
24
27
|
|
|
25
|
-
|
|
26
|
-
|
|
28
|
+
// Pause for 5 seconds for CI
|
|
29
|
+
await new Promise((done) => setTimeout(done, 5000));
|
|
27
30
|
|
|
28
|
-
|
|
31
|
+
const userRegisterPromises = [];
|
|
29
32
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
33
|
+
userSet.forEach((user) => {
|
|
34
|
+
// eslint-disable-next-line no-param-reassign
|
|
35
|
+
user.webex = new WebexCore({
|
|
36
|
+
config: config.webex,
|
|
37
|
+
credentials: {
|
|
38
|
+
authorization: user.token,
|
|
39
|
+
},
|
|
40
|
+
meetings: {
|
|
41
|
+
autoUploadLogs: false,
|
|
42
|
+
},
|
|
43
|
+
});
|
|
41
44
|
|
|
42
|
-
|
|
45
|
+
user.webex.internal.support.submitLogs = sinon.stub().returns(Promise.resolve());
|
|
43
46
|
|
|
44
|
-
|
|
45
|
-
|
|
47
|
+
userRegisterPromises.push(user.webex.meetings.register());
|
|
48
|
+
});
|
|
46
49
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
});
|
|
50
|
+
return Promise.all(userRegisterPromises).then(() => userSet);
|
|
51
|
+
})
|
|
52
|
+
.catch((error) => {
|
|
53
|
+
console.error('#generateTestUsers=>ERROR', error);
|
|
54
|
+
});
|
|
53
55
|
|
|
54
|
-
const reserveCMR = (user) =>
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
56
|
+
const reserveCMR = (user) =>
|
|
57
|
+
user.webex
|
|
58
|
+
.request({
|
|
59
|
+
method: 'POST',
|
|
60
|
+
uri: 'https://whistler-prod.allnint.ciscospark.com/api/v1/reservations',
|
|
61
|
+
headers: {
|
|
62
|
+
authorization: `Bearer ${user.webex.credentials.supertoken.access_token}`,
|
|
63
|
+
'cisco-no-http-redirect': null,
|
|
64
|
+
'spark-user-agent': null,
|
|
65
|
+
trackingid: `ITCLIENT_ ${user.id} _0_imi:true`,
|
|
66
|
+
},
|
|
67
|
+
body: {
|
|
68
|
+
resourceType: 'CMR_3',
|
|
69
|
+
reservedBy: 'SDK_TEST_USER',
|
|
70
|
+
requestMetaData: {
|
|
71
|
+
emailAddress: user.emailAddress,
|
|
72
|
+
loginType: 'loginGuest',
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
})
|
|
76
|
+
.then((res) => {
|
|
77
|
+
console.log('SUCCESS ', res);
|
|
78
|
+
});
|
|
75
79
|
|
|
76
80
|
module.exports = {
|
|
77
81
|
generateTestUsers,
|
|
78
|
-
reserveCMR
|
|
82
|
+
reserveCMR,
|
|
79
83
|
};
|
package/tsconfig.json
ADDED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
|
|
4
|
-
|
|
5
|
-
_Object$defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
exports.RoapMediaConnection = exports.MultistreamRoapMediaConnection = void 0;
|
|
10
|
-
|
|
11
|
-
var _internalMediaCore = require("@webex/internal-media-core");
|
|
12
|
-
|
|
13
|
-
/* We have this wrapper just because otherwise it's impossible to mock
|
|
14
|
-
* RoapMediaConnection and MultistreamRoapMediaConnection constructors in unit tests,
|
|
15
|
-
* because they are exported by @webex/internal-media-core as non-writable, non-configurable
|
|
16
|
-
* properties of MediaConnection and sinon doesn't allow spying on them or stubbing them.
|
|
17
|
-
*/
|
|
18
|
-
var RoapMediaConnection = _internalMediaCore.MediaConnection.RoapMediaConnection;
|
|
19
|
-
exports.RoapMediaConnection = RoapMediaConnection;
|
|
20
|
-
var MultistreamRoapMediaConnection = _internalMediaCore.MediaConnection.MultistreamRoapMediaConnection;
|
|
21
|
-
exports.MultistreamRoapMediaConnection = MultistreamRoapMediaConnection;
|
|
22
|
-
//# sourceMappingURL=internal-media-core-wrapper.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["RoapMediaConnection","MC","MultistreamRoapMediaConnection"],"sources":["internal-media-core-wrapper.ts"],"sourcesContent":["import {MediaConnection as MC} from '@webex/internal-media-core';\n\n/* We have this wrapper just because otherwise it's impossible to mock\n * RoapMediaConnection and MultistreamRoapMediaConnection constructors in unit tests,\n * because they are exported by @webex/internal-media-core as non-writable, non-configurable\n * properties of MediaConnection and sinon doesn't allow spying on them or stubbing them.\n */\nexport const RoapMediaConnection = MC.RoapMediaConnection;\nexport const MultistreamRoapMediaConnection = MC.MultistreamRoapMediaConnection;\n"],"mappings":";;;;;;;;;;AAAA;;AAEA;AACA;AACA;AACA;AACA;AACO,IAAMA,mBAAmB,GAAGC,kCAAA,CAAGD,mBAA/B;;AACA,IAAME,8BAA8B,GAAGD,kCAAA,CAAGC,8BAA1C"}
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
|
|
4
|
-
|
|
5
|
-
var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
|
-
_Object$defineProperty(exports, "__esModule", {
|
|
8
|
-
value: true
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
exports.default = void 0;
|
|
12
|
-
|
|
13
|
-
var _parseInt2 = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/parse-int"));
|
|
14
|
-
|
|
15
|
-
var _keys = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/keys"));
|
|
16
|
-
|
|
17
|
-
var _tsSdp = require("@webex/ts-sdp");
|
|
18
|
-
|
|
19
|
-
var PeerConnectionUtils = {}; // max-fs values for all H264 profile levels
|
|
20
|
-
|
|
21
|
-
var maxFsForProfileLevel = {
|
|
22
|
-
10: 99,
|
|
23
|
-
11: 396,
|
|
24
|
-
12: 396,
|
|
25
|
-
13: 396,
|
|
26
|
-
20: 396,
|
|
27
|
-
21: 792,
|
|
28
|
-
22: 1620,
|
|
29
|
-
30: 1620,
|
|
30
|
-
31: 3600,
|
|
31
|
-
32: 5120,
|
|
32
|
-
40: 8192,
|
|
33
|
-
41: 8192,
|
|
34
|
-
42: 8704,
|
|
35
|
-
50: 22080,
|
|
36
|
-
51: 36864,
|
|
37
|
-
52: 36864,
|
|
38
|
-
60: 139264,
|
|
39
|
-
61: 139264,
|
|
40
|
-
62: 139264
|
|
41
|
-
};
|
|
42
|
-
var framesPerSecond = 30;
|
|
43
|
-
/**
|
|
44
|
-
* Convert C line to IPv4
|
|
45
|
-
* @param {string} sdp
|
|
46
|
-
* @returns {string}
|
|
47
|
-
*/
|
|
48
|
-
|
|
49
|
-
PeerConnectionUtils.convertCLineToIpv4 = function (sdp) {
|
|
50
|
-
var replaceSdp = sdp; // TODO: remove this once linus supports Ipv6 c line.currently linus rejects SDP with c line having ipv6 candidates we are
|
|
51
|
-
// mocking ipv6 to ipv4 candidates
|
|
52
|
-
// https://jira-eng-gpk2.cisco.com/jira/browse/SPARK-299232
|
|
53
|
-
|
|
54
|
-
replaceSdp = replaceSdp.replace(/c=IN IP6 .*/gi, 'c=IN IP4 0.0.0.0');
|
|
55
|
-
return replaceSdp;
|
|
56
|
-
};
|
|
57
|
-
/**
|
|
58
|
-
* estimate profile levels for max-fs & max-mbps values
|
|
59
|
-
* @param {string} sdp
|
|
60
|
-
* @param {number} maxFsValue
|
|
61
|
-
* @returns {string}
|
|
62
|
-
*/
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
PeerConnectionUtils.adjustH264Profile = function (sdp, maxFsValue) {
|
|
66
|
-
// converting with ts-sdp parser, no munging
|
|
67
|
-
var parsedSdp = (0, _tsSdp.parse)(sdp);
|
|
68
|
-
parsedSdp.avMedia.forEach(function (media) {
|
|
69
|
-
if (media.type === 'video') {
|
|
70
|
-
media.codecs.forEach(function (codec) {
|
|
71
|
-
var _codec$name;
|
|
72
|
-
|
|
73
|
-
if (((_codec$name = codec.name) === null || _codec$name === void 0 ? void 0 : _codec$name.toUpperCase()) === 'H264') {
|
|
74
|
-
// there should really be just 1 fmtp line, but just in case, we process all of them
|
|
75
|
-
codec.fmtParams = codec.fmtParams.map(function (fmtp) {
|
|
76
|
-
var parsedRegex = fmtp.match(/(.*)profile-level-id=(\w{4})(\w{2})(.*)/);
|
|
77
|
-
|
|
78
|
-
if (parsedRegex && parsedRegex.length === 5) {
|
|
79
|
-
var stuffBeforeProfileLevelId = parsedRegex[1];
|
|
80
|
-
var profile = parsedRegex[2].toLowerCase();
|
|
81
|
-
var levelId = (0, _parseInt2.default)(parsedRegex[3], 16);
|
|
82
|
-
var stuffAfterProfileLevelId = parsedRegex[4];
|
|
83
|
-
|
|
84
|
-
if (!maxFsForProfileLevel[levelId]) {
|
|
85
|
-
throw new Error("found unsupported h264 profile level id value in the SDP: ".concat(levelId));
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
if (maxFsForProfileLevel[levelId] === maxFsValue) {
|
|
89
|
-
// profile level already matches our desired max-fs value, so we don't need to do anything
|
|
90
|
-
return fmtp;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
if (maxFsForProfileLevel[levelId] < maxFsValue) {
|
|
94
|
-
// profile level has too low max-fs, so we need to override it (this is upgrading)
|
|
95
|
-
return "".concat(fmtp, ";max-fs=").concat(maxFsValue, ";max-mbps=").concat(maxFsValue * framesPerSecond);
|
|
96
|
-
} // profile level has too high max-fs value, so we need to use a lower level
|
|
97
|
-
// find highest level that has the matching maxFs
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
var newLevelId = (0, _keys.default)(maxFsForProfileLevel).reverse().find(function (key) {
|
|
101
|
-
return maxFsForProfileLevel[key] === maxFsValue;
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
if (newLevelId) {
|
|
105
|
-
// Object.keys returns keys as strings, so we need to parse it to an int again and then convert to hex
|
|
106
|
-
var newLevelIdHex = (0, _parseInt2.default)(newLevelId, 10).toString(16);
|
|
107
|
-
return "".concat(stuffBeforeProfileLevelId, "profile-level-id=").concat(profile).concat(newLevelIdHex, ";max-mbps=").concat(maxFsValue * framesPerSecond).concat(stuffAfterProfileLevelId);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
throw new Error("unsupported maxFsValue: ".concat(maxFsValue));
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
return fmtp;
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
});
|
|
119
|
-
return parsedSdp.toString();
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
var _default = PeerConnectionUtils;
|
|
123
|
-
exports.default = _default;
|
|
124
|
-
//# sourceMappingURL=util.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["PeerConnectionUtils","maxFsForProfileLevel","framesPerSecond","convertCLineToIpv4","sdp","replaceSdp","replace","adjustH264Profile","maxFsValue","parsedSdp","parse","avMedia","forEach","media","type","codecs","codec","name","toUpperCase","fmtParams","map","fmtp","parsedRegex","match","length","stuffBeforeProfileLevelId","profile","toLowerCase","levelId","stuffAfterProfileLevelId","Error","newLevelId","reverse","find","key","newLevelIdHex","toString"],"sources":["util.ts"],"sourcesContent":["import { parse } from '@webex/ts-sdp';\n\ninterface IPeerConnectionUtils {\n convertCLineToIpv4: (sdp: string) => string;\n adjustH264Profile: (sdp: string, maxFsValue: number) => string;\n}\n\nconst PeerConnectionUtils = {} as IPeerConnectionUtils;\n\n// max-fs values for all H264 profile levels\nconst maxFsForProfileLevel = {\n 10: 99,\n 11: 396,\n 12: 396,\n 13: 396,\n 20: 396,\n 21: 792,\n 22: 1620,\n 30: 1620,\n 31: 3600,\n 32: 5120,\n 40: 8192,\n 41: 8192,\n 42: 8704,\n 50: 22080,\n 51: 36864,\n 52: 36864,\n 60: 139264,\n 61: 139264,\n 62: 139264,\n};\n\nconst framesPerSecond = 30;\n\n/**\n * Convert C line to IPv4\n * @param {string} sdp\n * @returns {string}\n */\nPeerConnectionUtils.convertCLineToIpv4 = (sdp: string) => {\n let replaceSdp = sdp;\n\n // TODO: remove this once linus supports Ipv6 c line.currently linus rejects SDP with c line having ipv6 candidates we are\n // mocking ipv6 to ipv4 candidates\n // https://jira-eng-gpk2.cisco.com/jira/browse/SPARK-299232\n replaceSdp = replaceSdp.replace(/c=IN IP6 .*/gi, 'c=IN IP4 0.0.0.0');\n\n return replaceSdp;\n};\n\n/**\n * estimate profile levels for max-fs & max-mbps values\n * @param {string} sdp\n * @param {number} maxFsValue\n * @returns {string}\n */\nPeerConnectionUtils.adjustH264Profile = (sdp: string, maxFsValue: number) => {\n // converting with ts-sdp parser, no munging\n const parsedSdp = parse(sdp);\n\n parsedSdp.avMedia.forEach((media) => {\n if (media.type === 'video') {\n media.codecs.forEach((codec) => {\n if (codec.name?.toUpperCase() === 'H264') {\n // there should really be just 1 fmtp line, but just in case, we process all of them\n codec.fmtParams = codec.fmtParams.map((fmtp) => {\n const parsedRegex = fmtp.match(/(.*)profile-level-id=(\\w{4})(\\w{2})(.*)/);\n\n if (parsedRegex && parsedRegex.length === 5) {\n const stuffBeforeProfileLevelId = parsedRegex[1];\n const profile = parsedRegex[2].toLowerCase();\n const levelId = parseInt(parsedRegex[3], 16);\n const stuffAfterProfileLevelId = parsedRegex[4];\n\n if (!maxFsForProfileLevel[levelId]) {\n throw new Error(\n `found unsupported h264 profile level id value in the SDP: ${levelId}`\n );\n }\n\n if (maxFsForProfileLevel[levelId] === maxFsValue) {\n // profile level already matches our desired max-fs value, so we don't need to do anything\n return fmtp;\n }\n if (maxFsForProfileLevel[levelId] < maxFsValue) {\n // profile level has too low max-fs, so we need to override it (this is upgrading)\n return `${fmtp};max-fs=${maxFsValue};max-mbps=${maxFsValue * framesPerSecond}`;\n }\n\n // profile level has too high max-fs value, so we need to use a lower level\n\n // find highest level that has the matching maxFs\n const newLevelId = Object.keys(maxFsForProfileLevel)\n .reverse()\n .find((key) => maxFsForProfileLevel[key] === maxFsValue);\n\n if (newLevelId) {\n // Object.keys returns keys as strings, so we need to parse it to an int again and then convert to hex\n const newLevelIdHex = parseInt(newLevelId, 10).toString(16);\n\n return `${stuffBeforeProfileLevelId}profile-level-id=${profile}${newLevelIdHex};max-mbps=${maxFsValue * framesPerSecond}${stuffAfterProfileLevelId}`;\n }\n\n throw new Error(`unsupported maxFsValue: ${maxFsValue}`);\n }\n\n return fmtp;\n });\n }\n });\n }\n });\n\n return parsedSdp.toString();\n};\n\nexport default PeerConnectionUtils;\n"],"mappings":"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"}
|