@webex/plugin-meetings 2.9.0 → 2.10.0
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/README.md +1 -0
- package/dist/member/index.js +9 -0
- package/dist/member/index.js.map +1 -1
- package/dist/member/util.js +15 -0
- package/dist/member/util.js.map +1 -1
- package/package.json +6 -6
- package/src/member/index.js +8 -0
- package/src/member/util.js +12 -0
- package/test/unit/spec/member/index.js +23 -0
- package/test/unit/spec/member/util.js +50 -0
package/README.md
CHANGED
|
@@ -974,6 +974,7 @@ member.id ... // String key for storing
|
|
|
974
974
|
member.name ... // String plain text name
|
|
975
975
|
member.isAudioMuted ... // Boolean
|
|
976
976
|
member.isVideoMuted ... // Boolean
|
|
977
|
+
member.isHandRaised ... //Boolean
|
|
977
978
|
member.isSelf ... // Boolean is this member YOUR user?
|
|
978
979
|
member.isHost ... // Boolean
|
|
979
980
|
member.isGuest ... // Boolean
|
package/dist/member/index.js
CHANGED
|
@@ -92,6 +92,14 @@ var Member = /*#__PURE__*/function () {
|
|
|
92
92
|
* @memberof Member
|
|
93
93
|
*/
|
|
94
94
|
|
|
95
|
+
this.isHandRaised = null;
|
|
96
|
+
/**
|
|
97
|
+
* @instance
|
|
98
|
+
* @type {Boolean}
|
|
99
|
+
* @public
|
|
100
|
+
* @memberof Member
|
|
101
|
+
*/
|
|
102
|
+
|
|
95
103
|
this.isSelf = null;
|
|
96
104
|
/**
|
|
97
105
|
* @instance
|
|
@@ -247,6 +255,7 @@ var Member = /*#__PURE__*/function () {
|
|
|
247
255
|
this.name = _util.default.extractName(participant);
|
|
248
256
|
this.isAudioMuted = _util.default.isAudioMuted(participant);
|
|
249
257
|
this.isVideoMuted = _util.default.isVideoMuted(participant);
|
|
258
|
+
this.isHandRaised = _util.default.isHandRaised(participant);
|
|
250
259
|
this.isGuest = _util.default.isGuest(participant);
|
|
251
260
|
this.isUser = _util.default.isUser(participant);
|
|
252
261
|
this.isDevice = _util.default.isDevice(participant);
|
package/dist/member/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Member","participant","options","MEETINGS","id","name","isAudioMuted","isVideoMuted","isSelf","isHost","isGuest","isInLobby","isInMeeting","isNotAdmitted","isContentSharing","status","isDevice","isUser","associatedUser","isRecording","isMutable","isRemovable","type","isModerator","isModeratorAssignmentProhibited","processParticipant","processParticipantOptions","processMember","MemberUtil","extractId","extractName","processStatus","processIsSelf","selfId","processIsHost","hostId","processIsContentSharing","contentSharingId","processType","processIsRecording","recordingId","extractStatus","_IN_LOBBY_","_IN_MEETING_","_NOT_IN_MEETING_","flag","sharingId","isSame","isAssociatedSame"],"sources":["index.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\nimport {\n MEETINGS,\n _IN_LOBBY_,\n _NOT_IN_MEETING_,\n _IN_MEETING_\n} from '../constants';\n\nimport MemberUtil from './util.js';\n\n/**\n * @class Member\n */\nexport default class Member {\n namespace = MEETINGS;\n\n /**\n * @param {Object} participant - the locus participant\n * @param {Object} [options] - constructor params\n * @param {String} options.selfId\n * @param {String} options.hostId\n * @param {String} options.contentSharingId\n * @param {String} options.type\n * @returns {Member}\n * @memberof Member\n */\n constructor(participant, options = {}) {\n /**\n * The server participant object\n * @instance\n * @type {Object}\n * @private\n * @memberof Member\n */\n this.participant = null;\n /**\n * The member id\n * @instance\n * @type {String}\n * @public\n * @memberof Member\n */\n this.id = null;\n /**\n * The member name\n * @instance\n * @type {String}\n * @public\n * @memberof Member\n */\n this.name = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isAudioMuted = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isVideoMuted = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isSelf = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isHost = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isGuest = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isInLobby = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isInMeeting = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isNotAdmitted = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isContentSharing = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.status = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isDevice = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isUser = null;\n /**\n * Is this member associated to another user by way of pairing (typical of devices)\n * @instance\n * @type {String}\n * @public\n * @memberof Member\n */\n this.associatedUser = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isRecording = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isMutable = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isRemovable = null;\n /**\n * @instance\n * @type {String}\n * @private\n * @memberof Member\n */\n this.type = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isModerator = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isModeratorAssignmentProhibited = null;\n // TODO: more participant types\n // such as native client, web client, is a device, what type of phone, etc\n this.processParticipant(participant);\n this.processParticipantOptions(participant, options);\n this.processMember();\n }\n\n /**\n * set all the participant values extracted directly from locus participant\n * @param {Object} participant the locus participant object\n * @returns {undefined}\n * @private\n * @memberof Member\n */\n processParticipant(participant) {\n this.participant = participant;\n if (participant) {\n this.id = MemberUtil.extractId(participant);\n this.name = MemberUtil.extractName(participant);\n this.isAudioMuted = MemberUtil.isAudioMuted(participant);\n this.isVideoMuted = MemberUtil.isVideoMuted(participant);\n this.isGuest = MemberUtil.isGuest(participant);\n this.isUser = MemberUtil.isUser(participant);\n this.isDevice = MemberUtil.isDevice(participant);\n this.isModerator = MemberUtil.isModerator(participant);\n this.isModeratorAssignmentProhibited = MemberUtil.isModeratorAssignmentProhibited(participant);\n this.processStatus(participant);\n // must be done last\n this.isNotAdmitted = MemberUtil.isNotAdmitted(participant, this.isGuest, this.status);\n }\n }\n\n /**\n * Use the members options and participant values to set on the member\n * @param {Object} participant the locus participant object\n * @param {Object} options the passed in options, what was set on members\n * @returns {undefined}\n * @private\n * @memberof Member\n */\n processParticipantOptions(participant, options) {\n if (participant && options) {\n this.processIsSelf(participant, options.selfId);\n this.processIsHost(participant, options.hostId);\n this.processIsContentSharing(participant, options.contentSharingId);\n this.processType(options.type);\n this.processIsRecording(participant, options.recordingId);\n }\n }\n\n /**\n * processes what already exists on the member to determine other info about the member\n * @returns {undefined}\n * @private\n * @memberof Member\n */\n processMember() {\n // must occur after self, guest, meeting, and type properties are calculated\n this.isRemovable = MemberUtil.isRemovable(this.isSelf, this.isGuest, this.isInMeeting, this.type);\n // must occur after self, device, meeting, mute status, and type properties are calculated\n this.isMutable = MemberUtil.isMutable(this.isSelf, this.isDevice, this.isInMeeting, this.isAudioMuted, this.type);\n }\n\n /**\n * set the status on member object\n * @param {Object} participant the locus participant object\n * @returns {undefined}\n * @private\n * @memberof Member\n */\n processStatus(participant) {\n this.status = MemberUtil.extractStatus(participant);\n switch (this.status) {\n case _IN_LOBBY_:\n this.isInLobby = true;\n this.isInMeeting = false;\n break;\n case _IN_MEETING_:\n this.isInLobby = false;\n this.isInMeeting = true;\n break;\n case _NOT_IN_MEETING_:\n this.isInLobby = false;\n this.isInMeeting = false;\n break;\n default:\n this.isInLobby = false;\n this.isInMeeting = false;\n }\n }\n\n /**\n * set the isContentSharing on member\n * @param {Boolean} flag\n * @returns {undefined}\n * @public\n * @memberof Member\n */\n setIsContentSharing(flag) {\n this.isContentSharing = flag;\n }\n\n /**\n * set the isHost on member\n * @param {Boolean} flag\n * @returns {undefined}\n * @public\n * @memberof Member\n */\n setIsHost(flag) {\n this.isHost = flag;\n }\n\n /**\n * set the isSelf on member\n * @param {Boolean} flag\n * @returns {undefined}\n * @public\n * @memberof Member\n */\n setIsSelf(flag) {\n this.isSelf = flag;\n }\n\n /**\n * determine if this member is content sharing\n * @param {Object} participant\n * @param {String} sharingId\n * @returns {undefined}\n * @public\n * @memberof Member\n */\n processIsContentSharing(participant, sharingId) {\n if (MemberUtil.isUser(participant)) {\n this.isContentSharing = MemberUtil.isSame(participant, sharingId);\n }\n else if (MemberUtil.isDevice(participant)) {\n this.isContentSharing = MemberUtil.isAssociatedSame(participant, sharingId);\n }\n }\n\n /**\n * Determine if this member is recording\n * @param {Object} participant\n * @param {String} recordingId\n * @returns {undefined}\n * @public\n * @memberof Member\n */\n processIsRecording(participant, recordingId) {\n this.isRecording = MemberUtil.isSame(participant, recordingId);\n }\n\n /**\n * determine if this member is the self\n * @param {Object} participant\n * @param {String} selfId\n * @returns {undefined}\n * @private\n * @memberof Member\n */\n processIsSelf(participant, selfId) {\n if (MemberUtil.isUser(participant)) {\n this.isSelf = MemberUtil.isSame(participant, selfId);\n }\n else if (MemberUtil.isDevice(participant)) {\n this.isSelf = MemberUtil.isAssociatedSame(participant, selfId);\n this.associatedUser = selfId;\n }\n }\n\n /**\n * determine if this member is the host\n * @param {Object} participant\n * @param {String} hostId\n * @returns {undefined}\n * @private\n * @memberof Member\n */\n processIsHost(participant, hostId) {\n if (MemberUtil.isUser(participant)) {\n this.isHost = MemberUtil.isSame(participant, hostId);\n }\n else if (MemberUtil.isDevice(participant)) {\n this.isHost = MemberUtil.isAssociatedSame(participant, hostId);\n }\n }\n\n /**\n * set the type for the member, could be MEETING or CALL\n * @param {String} type\n * @returns {undefined}\n * @private\n * @memberof Member\n */\n processType(type) {\n this.type = type;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAGA;;AAOA;;AAVA;AACA;AACA;;AAUA;AACA;AACA;IACqBA,M;EAGnB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,gBAAYC,WAAZ,EAAuC;IAAA,IAAdC,OAAc,uEAAJ,EAAI;IAAA;IAAA,iDAZ3BC,mBAY2B;;IACrC;AACJ;AACA;AACA;AACA;AACA;AACA;IACI,KAAKF,WAAL,GAAmB,IAAnB;IACA;AACJ;AACA;AACA;AACA;AACA;AACA;;IACI,KAAKG,EAAL,GAAU,IAAV;IACA;AACJ;AACA;AACA;AACA;AACA;AACA;;IACI,KAAKC,IAAL,GAAY,IAAZ;IACA;AACJ;AACA;AACA;AACA;AACA;;IACI,KAAKC,YAAL,GAAoB,IAApB;IACA;AACJ;AACA;AACA;AACA;AACA;;IACI,KAAKC,YAAL,GAAoB,IAApB;IACA;AACJ;AACA;AACA;AACA;AACA;;IACI,KAAKC,MAAL,GAAc,IAAd;IACA;AACJ;AACA;AACA;AACA;AACA;;IACI,KAAKC,MAAL,GAAc,IAAd;IACA;AACJ;AACA;AACA;AACA;AACA;;IACI,KAAKC,OAAL,GAAe,IAAf;IACA;AACJ;AACA;AACA;AACA;AACA;;IACI,KAAKC,SAAL,GAAiB,IAAjB;IACA;AACJ;AACA;AACA;AACA;AACA;;IACI,KAAKC,WAAL,GAAmB,IAAnB;IACA;AACJ;AACA;AACA;AACA;AACA;;IACI,KAAKC,aAAL,GAAqB,IAArB;IACA;AACJ;AACA;AACA;AACA;AACA;;IACI,KAAKC,gBAAL,GAAwB,IAAxB;IACA;AACJ;AACA;AACA;AACA;AACA;;IACI,KAAKC,MAAL,GAAc,IAAd;IACA;AACJ;AACA;AACA;AACA;AACA;;IACI,KAAKC,QAAL,GAAgB,IAAhB;IACA;AACJ;AACA;AACA;AACA;AACA;;IACI,KAAKC,MAAL,GAAc,IAAd;IACA;AACJ;AACA;AACA;AACA;AACA;AACA;;IACI,KAAKC,cAAL,GAAsB,IAAtB;IACA;AACJ;AACA;AACA;AACA;AACA;;IACI,KAAK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,CAAJ,EAAoC;QAClC,KAAKO,MAAL,GAAcoB,cAAWmB,MAAX,CAAkB9C,WAAlB,EAA+BgC,MAA/B,CAAd;MACD,CAFD,MAGK,IAAIL,cAAWZ,QAAX,CAAoBf,WAApB,CAAJ,EAAsC;QACzC,KAAKO,MAAL,GAAcoB,cAAWoB,gBAAX,CAA4B/C,WAA5B,EAAyCgC,MAAzC,CAAd;QACA,KAAKf,cAAL,GAAsBe,MAAtB;MACD;IACF;IAED;AACF;AACA;AACA;AACA;AACA;AACA;AACA;;;;WACE,uBAAchC,WAAd,EAA2BkC,MAA3B,EAAmC;MACjC,IAAIP,cAAWX,MAAX,CAAkBhB,WAAlB,CAAJ,EAAoC;QAClC,KAAKQ,MAAL,GAAcmB,cAAWmB,MAAX,CAAkB9C,WAAlB,EAA+BkC,MAA/B,CAAd;MACD,CAFD,MAGK,IAAIP,cAAWZ,QAAX,CAAoBf,WAApB,CAAJ,EAAsC;QACzC,KAAKQ,MAAL,GAAcmB,cAAWoB,gBAAX,CAA4B/C,WAA5B,EAAyCkC,MAAzC,CAAd;MACD;IACF;IAED;AACF;AACA;AACA;AACA;AACA;AACA;;;;WACE,qBAAYb,IAAZ,EAAkB;MAChB,KAAKA,IAAL,GAAYA,IAAZ;IACD"}
|
|
1
|
+
{"version":3,"names":["Member","participant","options","MEETINGS","id","name","isAudioMuted","isVideoMuted","isHandRaised","isSelf","isHost","isGuest","isInLobby","isInMeeting","isNotAdmitted","isContentSharing","status","isDevice","isUser","associatedUser","isRecording","isMutable","isRemovable","type","isModerator","isModeratorAssignmentProhibited","processParticipant","processParticipantOptions","processMember","MemberUtil","extractId","extractName","processStatus","processIsSelf","selfId","processIsHost","hostId","processIsContentSharing","contentSharingId","processType","processIsRecording","recordingId","extractStatus","_IN_LOBBY_","_IN_MEETING_","_NOT_IN_MEETING_","flag","sharingId","isSame","isAssociatedSame"],"sources":["index.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\nimport {\n MEETINGS,\n _IN_LOBBY_,\n _NOT_IN_MEETING_,\n _IN_MEETING_\n} from '../constants';\n\nimport MemberUtil from './util.js';\n\n/**\n * @class Member\n */\nexport default class Member {\n namespace = MEETINGS;\n\n /**\n * @param {Object} participant - the locus participant\n * @param {Object} [options] - constructor params\n * @param {String} options.selfId\n * @param {String} options.hostId\n * @param {String} options.contentSharingId\n * @param {String} options.type\n * @returns {Member}\n * @memberof Member\n */\n constructor(participant, options = {}) {\n /**\n * The server participant object\n * @instance\n * @type {Object}\n * @private\n * @memberof Member\n */\n this.participant = null;\n /**\n * The member id\n * @instance\n * @type {String}\n * @public\n * @memberof Member\n */\n this.id = null;\n /**\n * The member name\n * @instance\n * @type {String}\n * @public\n * @memberof Member\n */\n this.name = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isAudioMuted = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isVideoMuted = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isHandRaised = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isSelf = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isHost = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isGuest = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isInLobby = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isInMeeting = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isNotAdmitted = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isContentSharing = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.status = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isDevice = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isUser = null;\n /**\n * Is this member associated to another user by way of pairing (typical of devices)\n * @instance\n * @type {String}\n * @public\n * @memberof Member\n */\n this.associatedUser = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isRecording = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isMutable = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isRemovable = null;\n /**\n * @instance\n * @type {String}\n * @private\n * @memberof Member\n */\n this.type = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isModerator = null;\n /**\n * @instance\n * @type {Boolean}\n * @public\n * @memberof Member\n */\n this.isModeratorAssignmentProhibited = null;\n // TODO: more participant types\n // such as native client, web client, is a device, what type of phone, etc\n this.processParticipant(participant);\n this.processParticipantOptions(participant, options);\n this.processMember();\n }\n\n /**\n * set all the participant values extracted directly from locus participant\n * @param {Object} participant the locus participant object\n * @returns {undefined}\n * @private\n * @memberof Member\n */\n processParticipant(participant) {\n this.participant = participant;\n if (participant) {\n this.id = MemberUtil.extractId(participant);\n this.name = MemberUtil.extractName(participant);\n this.isAudioMuted = MemberUtil.isAudioMuted(participant);\n this.isVideoMuted = MemberUtil.isVideoMuted(participant);\n this.isHandRaised = MemberUtil.isHandRaised(participant);\n this.isGuest = MemberUtil.isGuest(participant);\n this.isUser = MemberUtil.isUser(participant);\n this.isDevice = MemberUtil.isDevice(participant);\n this.isModerator = MemberUtil.isModerator(participant);\n this.isModeratorAssignmentProhibited = MemberUtil.isModeratorAssignmentProhibited(participant);\n this.processStatus(participant);\n // must be done last\n this.isNotAdmitted = MemberUtil.isNotAdmitted(participant, this.isGuest, this.status);\n }\n }\n\n /**\n * Use the members options and participant values to set on the member\n * @param {Object} participant the locus participant object\n * @param {Object} options the passed in options, what was set on members\n * @returns {undefined}\n * @private\n * @memberof Member\n */\n processParticipantOptions(participant, options) {\n if (participant && options) {\n this.processIsSelf(participant, options.selfId);\n this.processIsHost(participant, options.hostId);\n this.processIsContentSharing(participant, options.contentSharingId);\n this.processType(options.type);\n this.processIsRecording(participant, options.recordingId);\n }\n }\n\n /**\n * processes what already exists on the member to determine other info about the member\n * @returns {undefined}\n * @private\n * @memberof Member\n */\n processMember() {\n // must occur after self, guest, meeting, and type properties are calculated\n this.isRemovable = MemberUtil.isRemovable(this.isSelf, this.isGuest, this.isInMeeting, this.type);\n // must occur after self, device, meeting, mute status, and type properties are calculated\n this.isMutable = MemberUtil.isMutable(this.isSelf, this.isDevice, this.isInMeeting, this.isAudioMuted, this.type);\n }\n\n /**\n * set the status on member object\n * @param {Object} participant the locus participant object\n * @returns {undefined}\n * @private\n * @memberof Member\n */\n processStatus(participant) {\n this.status = MemberUtil.extractStatus(participant);\n switch (this.status) {\n case _IN_LOBBY_:\n this.isInLobby = true;\n this.isInMeeting = false;\n break;\n case _IN_MEETING_:\n this.isInLobby = false;\n this.isInMeeting = true;\n break;\n case _NOT_IN_MEETING_:\n this.isInLobby = false;\n this.isInMeeting = false;\n break;\n default:\n this.isInLobby = false;\n this.isInMeeting = false;\n }\n }\n\n /**\n * set the isContentSharing on member\n * @param {Boolean} flag\n * @returns {undefined}\n * @public\n * @memberof Member\n */\n setIsContentSharing(flag) {\n this.isContentSharing = flag;\n }\n\n /**\n * set the isHost on member\n * @param {Boolean} flag\n * @returns {undefined}\n * @public\n * @memberof Member\n */\n setIsHost(flag) {\n this.isHost = flag;\n }\n\n /**\n * set the isSelf on member\n * @param {Boolean} flag\n * @returns {undefined}\n * @public\n * @memberof Member\n */\n setIsSelf(flag) {\n this.isSelf = flag;\n }\n\n /**\n * determine if this member is content sharing\n * @param {Object} participant\n * @param {String} sharingId\n * @returns {undefined}\n * @public\n * @memberof Member\n */\n processIsContentSharing(participant, sharingId) {\n if (MemberUtil.isUser(participant)) {\n this.isContentSharing = MemberUtil.isSame(participant, sharingId);\n }\n else if (MemberUtil.isDevice(participant)) {\n this.isContentSharing = MemberUtil.isAssociatedSame(participant, sharingId);\n }\n }\n\n /**\n * Determine if this member is recording\n * @param {Object} participant\n * @param {String} recordingId\n * @returns {undefined}\n * @public\n * @memberof Member\n */\n processIsRecording(participant, recordingId) {\n this.isRecording = MemberUtil.isSame(participant, recordingId);\n }\n\n /**\n * determine if this member is the self\n * @param {Object} participant\n * @param {String} selfId\n * @returns {undefined}\n * @private\n * @memberof Member\n */\n processIsSelf(participant, selfId) {\n if (MemberUtil.isUser(participant)) {\n this.isSelf = MemberUtil.isSame(participant, selfId);\n }\n else if (MemberUtil.isDevice(participant)) {\n this.isSelf = MemberUtil.isAssociatedSame(participant, selfId);\n this.associatedUser = selfId;\n }\n }\n\n /**\n * determine if this member is the host\n * @param {Object} participant\n * @param {String} hostId\n * @returns {undefined}\n * @private\n * @memberof Member\n */\n processIsHost(participant, hostId) {\n if (MemberUtil.isUser(participant)) {\n this.isHost = MemberUtil.isSame(participant, hostId);\n }\n else if (MemberUtil.isDevice(participant)) {\n this.isHost = MemberUtil.isAssociatedSame(participant, hostId);\n }\n }\n\n /**\n * set the type for the member, could be MEETING or CALL\n * @param {String} type\n * @returns {undefined}\n * @private\n * @memberof Member\n */\n processType(type) {\n this.type = type;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAGA;;AAOA;;AAVA;AACA;AACA;;AAUA;AACA;AACA;IACqBA,M;EAGnB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,gBAAYC,WAAZ,EAAuC;IAAA,IAAdC,OAAc,uEAAJ,EAAI;IAAA;IAAA,iDAZ3BC,mBAY2B;;IACrC;AACJ;AACA;AACA;AACA;AACA;AACA;IACI,KAAKF,WAAL,GAAmB,IAAnB;IACA;AACJ;AACA;AACA;AACA;AACA;AACA;;IACI,KAAKG,EAAL,GAAU,IAAV;IACA;AACJ;AACA;AACA;AACA;AACA;AACA;;IACI,KAAKC,IAAL,GAAY,IAAZ;IACA;AACJ;AACA;AACA;AACA;AACA;;IACI,KAAKC,YAAL,GAAoB,IAApB;IACA;AACJ;AACA;AACA;AACA;AACA;;IACI,KAAKC,YAAL,GAAoB,IAApB;IACA;AACJ;AACA;AACA;AACA;AACA;;IACI,KAAKC,YAAL,GAAoB,IAApB;IACA;AACJ;AACA;AACA;AACA;AACA;;IACI,KAAKC,MAAL,GAAc,IAAd;IACA;AACJ;AACA;AACA;AACA;AACA;;IACI,KAAKC,MAAL,GAAc,IAAd;IACA;AACJ;AACA;AACA;AACA;AACA;;IACI,KAAKC,OAAL,GAAe,IAAf;IACA;AACJ;AACA;AACA;AACA;AACA;;IACI,KAAKC,SAAL,GAAiB,IAAjB;IACA;AACJ;AACA;AACA;AACA;AACA;;IACI,KAAKC,WAAL,GAAmB,IAAnB;IACA;AACJ;AACA;AACA;AACA;AACA;;IACI,KAAKC,aAAL,GAAqB,IAArB;IACA;AACJ;AACA;AACA;AACA;AACA;;IACI,KAAKC,gBAAL,GAAwB,IAAxB;IACA;AACJ;AACA;AACA;AACA;AACA;;IACI,KAAKC,MAAL,GAAc,IAAd;IACA;AACJ;AACA;AACA;AACA;AACA;;IACI,KAAKC,QAAL,GAAgB,IAAhB;IACA;AACJ;AACA;AACA;AACA;AACA;;IACI,KAAKC,MAAL,GAAc,IAAd;IACA;AACJ;AACA;AACA;AACA;AACA;AACA;;IACI,KAAKC,cAAL,GAAsB,IAAtB;IACA;AACJ;AACA;AACA;AACA;AACA;;IACI,KAAKC,WAAL,GAAmB,IAAnB;IACA;AACJ;AACA;AACA;AACA;AACA;;IACI,KAAKC,SAAL,GAAiB,IAAjB;IACA;AACJ;AACA;AACA;AACA;AACA;;IACI,KAAKC,WAAL,GAAmB,IAAnB;IACA;AACJ;AACA;AACA;AACA;AACA;;IACI,KAAKC,IAAL,GAAY,IAAZ;IACA;AACJ;AACA;AACA;AACA;AACA;;IACI,KAAKC,WAAL,GAAmB,IAAnB;IACA;AACJ;AACA;AACA;AACA;AACA;;IACI,KAAKC,+BAAL,GAAuC,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sBe,MAAtB;MACD;IACF;IAED;AACF;AACA;AACA;AACA;AACA;AACA;AACA;;;;WACE,uBAAcjC,WAAd,EAA2BmC,MAA3B,EAAmC;MACjC,IAAIP,cAAWX,MAAX,CAAkBjB,WAAlB,CAAJ,EAAoC;QAClC,KAAKS,MAAL,GAAcmB,cAAWmB,MAAX,CAAkB/C,WAAlB,EAA+BmC,MAA/B,CAAd;MACD,CAFD,MAGK,IAAIP,cAAWZ,QAAX,CAAoBhB,WAApB,CAAJ,EAAsC;QACzC,KAAKS,MAAL,GAAcmB,cAAWoB,gBAAX,CAA4BhD,WAA5B,EAAyCmC,MAAzC,CAAd;MACD;IACF;IAED;AACF;AACA;AACA;AACA;AACA;AACA;;;;WACE,qBAAYb,IAAZ,EAAkB;MAChB,KAAKA,IAAL,GAAYA,IAAZ;IACD"}
|
package/dist/member/util.js
CHANGED
|
@@ -124,6 +124,21 @@ MemberUtil.isVideoMuted = function (participant) {
|
|
|
124
124
|
|
|
125
125
|
return MemberUtil.isMuted(participant.status, _constants.VIDEO_STATUS);
|
|
126
126
|
};
|
|
127
|
+
/**
|
|
128
|
+
* @param {Object} participant the locus participant
|
|
129
|
+
* @returns {Boolean}
|
|
130
|
+
*/
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
MemberUtil.isHandRaised = function (participant) {
|
|
134
|
+
var _participant$controls, _participant$controls2;
|
|
135
|
+
|
|
136
|
+
if (!participant) {
|
|
137
|
+
throw new _parameter.default('Raise hand could not be processed, participant is undefined.');
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
return ((_participant$controls = participant.controls) === null || _participant$controls === void 0 ? void 0 : (_participant$controls2 = _participant$controls.hand) === null || _participant$controls2 === void 0 ? void 0 : _participant$controls2.raised) || false;
|
|
141
|
+
};
|
|
127
142
|
/**
|
|
128
143
|
* utility method for audio/video muted status
|
|
129
144
|
* @param {String} status
|
package/dist/member/util.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["MemberUtil","isUser","participant","type","_USER_","isModerator","moderator","isGuest","guest","isDevice","_RESOURCE_ROOM_","isModeratorAssignmentProhibited","moderatorAssignmentNotAllowed","isSame","id","person","isAssociatedSame","associatedUsers","some","user","isNotAdmitted","status","devices","intent","_WAIT_","_IN_LOBBY_","_IN_MEETING_","isAudioMuted","ParameterError","mutedStatus","isMuted","AUDIO_STATUS","controls","audio","muted","isVideoMuted","VIDEO_STATUS","accessor","_RECEIVE_ONLY_","_SEND_RECEIVE_","getRecordingMember","record","recording","meta","modifiedBy","isRecording","localRecord","isRemovable","isSelf","isInMeeting","_CALL_","isMutable","extractStatus","length","_NOT_IN_MEETING_","state","_JOINED_","_IDLE_","foundDevice","find","device","_OBSERVE_","_LEFT_","extractId","extractName","name"],"sources":["util.js"],"sourcesContent":["import {\n _USER_,\n _RESOURCE_ROOM_,\n _OBSERVE_,\n _WAIT_,\n _LEFT_,\n _JOINED_,\n _IDLE_,\n _IN_LOBBY_,\n _NOT_IN_MEETING_,\n _IN_MEETING_,\n AUDIO_STATUS,\n VIDEO_STATUS,\n _SEND_RECEIVE_,\n _RECEIVE_ONLY_,\n _CALL_\n} from '../constants';\nimport ParameterError from '../common/errors/parameter';\n\nconst MemberUtil = {};\n\n/**\n * @param {Object} participant the locus participant\n * @returns {Boolean}\n */\nMemberUtil.isUser = (participant) => participant && participant.type === _USER_;\n\nMemberUtil.isModerator = (participant) => participant && participant.moderator;\n\n/**\n * @param {Object} participant the locus participant\n * @returns {Boolean}\n */\nMemberUtil.isGuest = (participant) => participant && participant.guest;\n\n/**\n * @param {Object} participant the locus participant\n * @returns {Boolean}\n */\nMemberUtil.isDevice = (participant) => participant && participant.type === _RESOURCE_ROOM_;\n\nMemberUtil.isModeratorAssignmentProhibited = (participant) => participant && participant.moderatorAssignmentNotAllowed;\n\n/**\n * checks to see if the participant id is the same as the passed id\n * there are multiple ids that can be used\n * @param {Object} participant the locus participant\n * @param {String} id\n * @returns {Boolean}\n */\nMemberUtil.isSame = (participant, id) => participant &&\n (participant.id === id || participant.person && participant.person.id === id);\n\n/**\n * checks to see if the participant id is the same as the passed id for associated devices\n * there are multiple ids that can be used\n * @param {Object} participant the locus participant\n * @param {String} id\n * @returns {Boolean}\n */\nMemberUtil.isAssociatedSame = (participant, id) => participant &&\nparticipant.associatedUsers &&\nparticipant.associatedUsers.some((user) => (user.id === id || user.person && user.person.id === id));\n\n/**\n * @param {Object} participant the locus participant\n * @param {Boolean} isGuest\n * @param {String} status\n * @returns {Boolean}\n */\nMemberUtil.isNotAdmitted = (participant, isGuest, status) => participant &&\n participant.guest && ((participant.devices && participant.devices[0] &&\n participant.devices[0].intent && participant.devices[0].intent.type === _WAIT_ &&\n isGuest && status === _IN_LOBBY_) || !status === _IN_MEETING_);\n\n/**\n * @param {Object} participant the locus participant\n * @returns {Boolean}\n */\nMemberUtil.isAudioMuted = (participant) => {\n if (!participant) {\n throw new ParameterError('Audio could not be processed, participant is undefined.');\n }\n const mutedStatus = MemberUtil.isMuted(participant.status, AUDIO_STATUS);\n\n if (participant.controls && participant.controls.audio) {\n if (participant.controls.audio.muted) {\n return true;\n }\n if (mutedStatus) {\n return true;\n }\n }\n\n return false;\n};\n\n/**\n * @param {Object} participant the locus participant\n * @returns {Boolean}\n */\nMemberUtil.isVideoMuted = (participant) => {\n if (!participant) {\n throw new ParameterError('Video could not be processed, participant is undefined.');\n }\n\n return MemberUtil.isMuted(participant.status, VIDEO_STATUS);\n};\n\n/**\n * utility method for audio/video muted status\n * @param {String} status\n * @param {String} accessor\n * @returns {Boolean}\n */\nMemberUtil.isMuted = (status, accessor) => {\n if (status) {\n if (status[accessor] === _RECEIVE_ONLY_) {\n return true;\n }\n if (status[accessor] === _SEND_RECEIVE_) {\n return false;\n }\n }\n\n return null;\n};\n\n/**\n * utility method for getting the recording member for later comparison\n * @param {Object} controls\n * @returns {String|null}\n */\nMemberUtil.getRecordingMember = (controls) => {\n if (!controls) {\n return null;\n }\n if (controls.record && controls.record.recording && controls.record.meta) {\n return controls.record.meta.modifiedBy;\n }\n\n return null;\n};\n\n/**\n * @param {Object} participant the locus participant\n * @returns {Boolean}\n */\nMemberUtil.isRecording = (participant) => {\n if (!participant) {\n throw new ParameterError('Recording could not be processed, participant is undefined.');\n }\n if (participant.controls && participant.controls.localRecord) {\n return participant.controls.localRecord.recording;\n }\n\n return false;\n};\n\nMemberUtil.isRemovable = (isSelf, isGuest, isInMeeting, type) => {\n if (isGuest || isSelf) {\n return false;\n }\n if (type === _CALL_) {\n return false;\n }\n if (isInMeeting) {\n return true;\n }\n\n return false;\n};\n\nMemberUtil.isMutable = (isSelf, isDevice, isInMeeting, isMuted, type) => {\n if (!isInMeeting) {\n return false;\n }\n if (isMuted) {\n return false;\n }\n if (type === _CALL_) {\n return false;\n }\n if (isSelf || isDevice) {\n return true;\n }\n\n return false;\n};\n\n/**\n * @param {Object} participant the locus participant\n * @returns {String}\n */\nMemberUtil.extractStatus = (participant) => {\n if (!(participant && participant.devices && participant.devices.length)) {\n return _NOT_IN_MEETING_;\n }\n if (participant.state === _JOINED_) {\n return _IN_MEETING_;\n }\n if (participant.state === _IDLE_) {\n if (participant.devices && participant.devices.length > 0) {\n const foundDevice = participant.devices.find((device) => device.intent && (device.intent.type === _WAIT_ || device.intent.type === _OBSERVE_));\n\n return foundDevice ? _IN_LOBBY_ : _NOT_IN_MEETING_;\n }\n\n return _NOT_IN_MEETING_;\n }\n if (participant.state === _LEFT_) {\n return _NOT_IN_MEETING_;\n }\n\n return _NOT_IN_MEETING_;\n};\n\n/**\n * @param {Object} participant the locus participant\n * @returns {String}\n */\nMemberUtil.extractId = (participant) => {\n if (participant) {\n return participant.id;\n }\n\n return null;\n};\n\n/**\n * @param {Object} participant the locus participant\n * @returns {String}\n */\nMemberUtil.extractName = (participant) => {\n if (participant && participant.person) {\n return participant.person.name;\n }\n\n return null;\n};\n\nexport default MemberUtil;\n"],"mappings":";;;;;;;;;;;;AAAA;;AAiBA;;AAEA,IAAMA,UAAU,GAAG,EAAnB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,CAACrC,MAAP,CAAcpB,IAAd,KAAuB0D,oBAA1E,CAAZ;MAAA,CAAzB,CAApB;MAEA,OAAOH,WAAW,GAAGjC,qBAAH,GAAgB6B,2BAAlC;IACD;;IAED,OAAOA,2BAAP;EACD;;EACD,IAAIpD,WAAW,CAACqD,KAAZ,KAAsBO,iBAA1B,EAAkC;IAChC,OAAOR,2BAAP;EACD;;EAED,OAAOA,2BAAP;AACD,CArBD;AAuBA;AACA;AACA;AACA;;;AACAtD,UAAU,CAAC+D,SAAX,GAAuB,UAAC7D,WAAD,EAAiB;EACtC,IAAIA,WAAJ,EAAiB;IACf,OAAOA,WAAW,CAACY,EAAnB;EACD;;EAED,OAAO,IAAP;AACD,CAND;AAQA;AACA;AACA;AACA;;;AACAd,UAAU,CAACgE,WAAX,GAAyB,UAAC9D,WAAD,EAAiB;EACxC,IAAIA,WAAW,IAAIA,WAAW,CAACa,MAA/B,EAAuC;IACrC,OAAOb,WAAW,CAACa,MAAZ,CAAmBkD,IAA1B;EACD;;EAED,OAAO,IAAP;AACD,CAND;;eAQejE,U"}
|
|
1
|
+
{"version":3,"names":["MemberUtil","isUser","participant","type","_USER_","isModerator","moderator","isGuest","guest","isDevice","_RESOURCE_ROOM_","isModeratorAssignmentProhibited","moderatorAssignmentNotAllowed","isSame","id","person","isAssociatedSame","associatedUsers","some","user","isNotAdmitted","status","devices","intent","_WAIT_","_IN_LOBBY_","_IN_MEETING_","isAudioMuted","ParameterError","mutedStatus","isMuted","AUDIO_STATUS","controls","audio","muted","isVideoMuted","VIDEO_STATUS","isHandRaised","hand","raised","accessor","_RECEIVE_ONLY_","_SEND_RECEIVE_","getRecordingMember","record","recording","meta","modifiedBy","isRecording","localRecord","isRemovable","isSelf","isInMeeting","_CALL_","isMutable","extractStatus","length","_NOT_IN_MEETING_","state","_JOINED_","_IDLE_","foundDevice","find","device","_OBSERVE_","_LEFT_","extractId","extractName","name"],"sources":["util.js"],"sourcesContent":["import {\n _USER_,\n _RESOURCE_ROOM_,\n _OBSERVE_,\n _WAIT_,\n _LEFT_,\n _JOINED_,\n _IDLE_,\n _IN_LOBBY_,\n _NOT_IN_MEETING_,\n _IN_MEETING_,\n AUDIO_STATUS,\n VIDEO_STATUS,\n _SEND_RECEIVE_,\n _RECEIVE_ONLY_,\n _CALL_\n} from '../constants';\nimport ParameterError from '../common/errors/parameter';\n\nconst MemberUtil = {};\n\n/**\n * @param {Object} participant the locus participant\n * @returns {Boolean}\n */\nMemberUtil.isUser = (participant) => participant && participant.type === _USER_;\n\nMemberUtil.isModerator = (participant) => participant && participant.moderator;\n\n/**\n * @param {Object} participant the locus participant\n * @returns {Boolean}\n */\nMemberUtil.isGuest = (participant) => participant && participant.guest;\n\n/**\n * @param {Object} participant the locus participant\n * @returns {Boolean}\n */\nMemberUtil.isDevice = (participant) => participant && participant.type === _RESOURCE_ROOM_;\n\nMemberUtil.isModeratorAssignmentProhibited = (participant) => participant && participant.moderatorAssignmentNotAllowed;\n\n/**\n * checks to see if the participant id is the same as the passed id\n * there are multiple ids that can be used\n * @param {Object} participant the locus participant\n * @param {String} id\n * @returns {Boolean}\n */\nMemberUtil.isSame = (participant, id) => participant &&\n (participant.id === id || participant.person && participant.person.id === id);\n\n/**\n * checks to see if the participant id is the same as the passed id for associated devices\n * there are multiple ids that can be used\n * @param {Object} participant the locus participant\n * @param {String} id\n * @returns {Boolean}\n */\nMemberUtil.isAssociatedSame = (participant, id) => participant &&\nparticipant.associatedUsers &&\nparticipant.associatedUsers.some((user) => (user.id === id || user.person && user.person.id === id));\n\n/**\n * @param {Object} participant the locus participant\n * @param {Boolean} isGuest\n * @param {String} status\n * @returns {Boolean}\n */\nMemberUtil.isNotAdmitted = (participant, isGuest, status) => participant &&\n participant.guest && ((participant.devices && participant.devices[0] &&\n participant.devices[0].intent && participant.devices[0].intent.type === _WAIT_ &&\n isGuest && status === _IN_LOBBY_) || !status === _IN_MEETING_);\n\n/**\n * @param {Object} participant the locus participant\n * @returns {Boolean}\n */\nMemberUtil.isAudioMuted = (participant) => {\n if (!participant) {\n throw new ParameterError('Audio could not be processed, participant is undefined.');\n }\n const mutedStatus = MemberUtil.isMuted(participant.status, AUDIO_STATUS);\n\n if (participant.controls && participant.controls.audio) {\n if (participant.controls.audio.muted) {\n return true;\n }\n if (mutedStatus) {\n return true;\n }\n }\n\n return false;\n};\n\n/**\n * @param {Object} participant the locus participant\n * @returns {Boolean}\n */\nMemberUtil.isVideoMuted = (participant) => {\n if (!participant) {\n throw new ParameterError('Video could not be processed, participant is undefined.');\n }\n\n return MemberUtil.isMuted(participant.status, VIDEO_STATUS);\n};\n\n/**\n * @param {Object} participant the locus participant\n * @returns {Boolean}\n */\nMemberUtil.isHandRaised = (participant) => {\n if (!participant) {\n throw new ParameterError('Raise hand could not be processed, participant is undefined.');\n }\n\n return participant.controls?.hand?.raised || false;\n};\n\n/**\n * utility method for audio/video muted status\n * @param {String} status\n * @param {String} accessor\n * @returns {Boolean}\n */\nMemberUtil.isMuted = (status, accessor) => {\n if (status) {\n if (status[accessor] === _RECEIVE_ONLY_) {\n return true;\n }\n if (status[accessor] === _SEND_RECEIVE_) {\n return false;\n }\n }\n\n return null;\n};\n\n/**\n * utility method for getting the recording member for later comparison\n * @param {Object} controls\n * @returns {String|null}\n */\nMemberUtil.getRecordingMember = (controls) => {\n if (!controls) {\n return null;\n }\n if (controls.record && controls.record.recording && controls.record.meta) {\n return controls.record.meta.modifiedBy;\n }\n\n return null;\n};\n\n/**\n * @param {Object} participant the locus participant\n * @returns {Boolean}\n */\nMemberUtil.isRecording = (participant) => {\n if (!participant) {\n throw new ParameterError('Recording could not be processed, participant is undefined.');\n }\n if (participant.controls && participant.controls.localRecord) {\n return participant.controls.localRecord.recording;\n }\n\n return false;\n};\n\nMemberUtil.isRemovable = (isSelf, isGuest, isInMeeting, type) => {\n if (isGuest || isSelf) {\n return false;\n }\n if (type === _CALL_) {\n return false;\n }\n if (isInMeeting) {\n return true;\n }\n\n return false;\n};\n\nMemberUtil.isMutable = (isSelf, isDevice, isInMeeting, isMuted, type) => {\n if (!isInMeeting) {\n return false;\n }\n if (isMuted) {\n return false;\n }\n if (type === _CALL_) {\n return false;\n }\n if (isSelf || isDevice) {\n return true;\n }\n\n return false;\n};\n\n/**\n * @param {Object} participant the locus participant\n * @returns {String}\n */\nMemberUtil.extractStatus = (participant) => {\n if (!(participant && participant.devices && participant.devices.length)) {\n return _NOT_IN_MEETING_;\n }\n if (participant.state === _JOINED_) {\n return _IN_MEETING_;\n }\n if (participant.state === _IDLE_) {\n if (participant.devices && participant.devices.length > 0) {\n const foundDevice = participant.devices.find((device) => device.intent && (device.intent.type === _WAIT_ || device.intent.type === _OBSERVE_));\n\n return foundDevice ? _IN_LOBBY_ : _NOT_IN_MEETING_;\n }\n\n return _NOT_IN_MEETING_;\n }\n if (participant.state === _LEFT_) {\n return _NOT_IN_MEETING_;\n }\n\n return _NOT_IN_MEETING_;\n};\n\n/**\n * @param {Object} participant the locus participant\n * @returns {String}\n */\nMemberUtil.extractId = (participant) => {\n if (participant) {\n return participant.id;\n }\n\n return null;\n};\n\n/**\n * @param {Object} participant the locus participant\n * @returns {String}\n */\nMemberUtil.extractName = (participant) => {\n if (participant && participant.person) {\n return participant.person.name;\n }\n\n return null;\n};\n\nexport default MemberUtil;\n"],"mappings":";;;;;;;;;;;;AAAA;;AAiBA;;AAEA,IAAMA,UAAU,GAAG,EAAnB;AAEA;AACA;AACA;AACA;;AACAA,UAAU,CAACC,MAAX,GAAoB,UAACC,WAAD;EAAA,OAAiBA,WAAW,IAAIA,WAAW,CAACC,IAAZ,KAAqBC,iBAArD;AAAA,CAApB;;AAEAJ,UAAU,CAACK,WAAX,GAAyB,UAACH,WAAD;EAAA,OAAiBA,WAAW,IAAIA,WAAW,CAACI,SAA5C;AAAA,CAAzB;AAEA;AACA;AACA;AACA;;;AACAN,UAAU,CAACO,OAAX,GAAqB,UAACL,WAAD;EAAA,OAAiBA,WAAW,IAAIA,WAAW,CAACM,KAA5C;AAAA,CAArB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C,qBAAH,GAAgBgC,2BAAlC;IACD;;IAED,OAAOA,2BAAP;EACD;;EACD,IAAIvD,WAAW,CAACwD,KAAZ,KAAsBO,iBAA1B,EAAkC;IAChC,OAAOR,2BAAP;EACD;;EAED,OAAOA,2BAAP;AACD,CArBD;AAuBA;AACA;AACA;AACA;;;AACAzD,UAAU,CAACkE,SAAX,GAAuB,UAAChE,WAAD,EAAiB;EACtC,IAAIA,WAAJ,EAAiB;IACf,OAAOA,WAAW,CAACY,EAAnB;EACD;;EAED,OAAO,IAAP;AACD,CAND;AAQA;AACA;AACA;AACA;;;AACAd,UAAU,CAACmE,WAAX,GAAyB,UAACjE,WAAD,EAAiB;EACxC,IAAIA,WAAW,IAAIA,WAAW,CAACa,MAA/B,EAAuC;IACrC,OAAOb,WAAW,CAACa,MAAZ,CAAmBqD,IAA1B;EACD;;EAED,OAAO,IAAP;AACD,CAND;;eAQepE,U"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webex/plugin-meetings",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.10.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"contributors": [
|
|
@@ -24,19 +24,19 @@
|
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@babel/runtime-corejs2": "^7.14.8",
|
|
27
|
-
"@webex/webex-core": "2.
|
|
28
|
-
"@webex/internal-plugin-mercury": "2.
|
|
29
|
-
"@webex/internal-plugin-conversation": "2.
|
|
27
|
+
"@webex/webex-core": "2.10.0",
|
|
28
|
+
"@webex/internal-plugin-mercury": "2.10.0",
|
|
29
|
+
"@webex/internal-plugin-conversation": "2.10.0",
|
|
30
30
|
"webrtc-adapter": "^7.7.0",
|
|
31
31
|
"lodash": "^4.17.21",
|
|
32
32
|
"uuid": "^3.3.2",
|
|
33
33
|
"global": "^4.4.0",
|
|
34
34
|
"ip-anonymize": "^0.1.0",
|
|
35
|
-
"@webex/common": "2.
|
|
35
|
+
"@webex/common": "2.10.0",
|
|
36
36
|
"bowser": "^2.11.0",
|
|
37
37
|
"sdp-transform": "^2.12.0",
|
|
38
38
|
"readable-stream": "^3.6.0",
|
|
39
|
-
"@webex/common-timers": "2.
|
|
39
|
+
"@webex/common-timers": "2.10.0",
|
|
40
40
|
"btoa": "^1.2.1",
|
|
41
41
|
"@webex/internal-media-core": "^0.0.4-beta",
|
|
42
42
|
"javascript-state-machine": "^3.1.0",
|
package/src/member/index.js
CHANGED
|
@@ -71,6 +71,13 @@ export default class Member {
|
|
|
71
71
|
* @public
|
|
72
72
|
* @memberof Member
|
|
73
73
|
*/
|
|
74
|
+
this.isHandRaised = null;
|
|
75
|
+
/**
|
|
76
|
+
* @instance
|
|
77
|
+
* @type {Boolean}
|
|
78
|
+
* @public
|
|
79
|
+
* @memberof Member
|
|
80
|
+
*/
|
|
74
81
|
this.isSelf = null;
|
|
75
82
|
/**
|
|
76
83
|
* @instance
|
|
@@ -206,6 +213,7 @@ export default class Member {
|
|
|
206
213
|
this.name = MemberUtil.extractName(participant);
|
|
207
214
|
this.isAudioMuted = MemberUtil.isAudioMuted(participant);
|
|
208
215
|
this.isVideoMuted = MemberUtil.isVideoMuted(participant);
|
|
216
|
+
this.isHandRaised = MemberUtil.isHandRaised(participant);
|
|
209
217
|
this.isGuest = MemberUtil.isGuest(participant);
|
|
210
218
|
this.isUser = MemberUtil.isUser(participant);
|
|
211
219
|
this.isDevice = MemberUtil.isDevice(participant);
|
package/src/member/util.js
CHANGED
|
@@ -107,6 +107,18 @@ MemberUtil.isVideoMuted = (participant) => {
|
|
|
107
107
|
return MemberUtil.isMuted(participant.status, VIDEO_STATUS);
|
|
108
108
|
};
|
|
109
109
|
|
|
110
|
+
/**
|
|
111
|
+
* @param {Object} participant the locus participant
|
|
112
|
+
* @returns {Boolean}
|
|
113
|
+
*/
|
|
114
|
+
MemberUtil.isHandRaised = (participant) => {
|
|
115
|
+
if (!participant) {
|
|
116
|
+
throw new ParameterError('Raise hand could not be processed, participant is undefined.');
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
return participant.controls?.hand?.raised || false;
|
|
120
|
+
};
|
|
121
|
+
|
|
110
122
|
/**
|
|
111
123
|
* utility method for audio/video muted status
|
|
112
124
|
* @param {String} status
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import sinon from 'sinon';
|
|
2
|
+
import {assert} from '@webex/test-helper-chai';
|
|
3
|
+
|
|
4
|
+
import MemberUtil from '@webex/plugin-meetings/src/member/util';
|
|
5
|
+
import Member from '@webex/plugin-meetings/src/member';
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
describe('member', () => {
|
|
9
|
+
afterEach(() => {
|
|
10
|
+
sinon.restore();
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
it('checks that processParticipant calls isHandRaised', () => {
|
|
14
|
+
const participant = {controls: {}};
|
|
15
|
+
|
|
16
|
+
const member = new Member({});
|
|
17
|
+
|
|
18
|
+
sinon.spy(MemberUtil, 'isHandRaised');
|
|
19
|
+
member.processParticipant(participant);
|
|
20
|
+
|
|
21
|
+
assert.calledOnceWithExactly(MemberUtil.isHandRaised, participant);
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import {assert} from '@webex/test-helper-chai';
|
|
2
|
+
|
|
3
|
+
import MemberUtil from '@webex/plugin-meetings/src/member/util';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
describe('isHandRaised', () => {
|
|
7
|
+
it('throws error when there is no participant', () => {
|
|
8
|
+
assert.throws(() => {
|
|
9
|
+
MemberUtil.isHandRaised();
|
|
10
|
+
}, 'Raise hand could not be processed, participant is undefined.');
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
it('returns false when controls is not there', () => {
|
|
14
|
+
const participant = {};
|
|
15
|
+
|
|
16
|
+
assert.isFalse(MemberUtil.isHandRaised(participant));
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it('returns false when hand is not there in controls', () => {
|
|
20
|
+
const participant = {
|
|
21
|
+
controls: {}
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
assert.isFalse(MemberUtil.isHandRaised(participant));
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it('returns true when hand raised is true', () => {
|
|
28
|
+
const participant = {
|
|
29
|
+
controls: {
|
|
30
|
+
hand: {
|
|
31
|
+
raised: true
|
|
32
|
+
},
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
assert.isTrue(MemberUtil.isHandRaised(participant));
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it('returns false when hand raised is false', () => {
|
|
40
|
+
const participant = {
|
|
41
|
+
controls: {
|
|
42
|
+
hand: {
|
|
43
|
+
raised: false
|
|
44
|
+
},
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
assert.isFalse(MemberUtil.isHandRaised(participant));
|
|
49
|
+
});
|
|
50
|
+
});
|