@webex/plugin-meetings 3.0.0-beta.20 → 3.0.0-beta.22

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.
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequ
5
5
  _Object$defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.default = void 0;
8
+ exports.createMuteState = void 0;
9
9
  var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/promise"));
10
10
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
11
11
  var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
@@ -20,6 +20,7 @@ var _constants = require("../constants");
20
20
  If we ever need to support it, search for REMOTE_MUTE_VIDEO_MISSING_IMPLEMENTATION string to find the places that need updating
21
21
  */
22
22
 
23
+ // eslint-disable-next-line import/prefer-default-export
23
24
  var createMuteState = function createMuteState(type, meeting, mediaDirection) {
24
25
  if (type === _constants.AUDIO && !mediaDirection.sendAudio) {
25
26
  return null;
@@ -36,6 +37,7 @@ var createMuteState = function createMuteState(type, meeting, mediaDirection) {
36
37
 
37
38
  More info about Locus muting API: https://sqbu-github.cisco.com/pages/WebExSquared/locus/guides/mute.html#
38
39
  */
40
+ exports.createMuteState = createMuteState;
39
41
  var MuteState = /*#__PURE__*/function () {
40
42
  /**
41
43
  * Constructor
@@ -315,6 +317,4 @@ var MuteState = /*#__PURE__*/function () {
315
317
  }]);
316
318
  return MuteState;
317
319
  }();
318
- var _default = createMuteState;
319
- exports.default = _default;
320
320
  //# sourceMappingURL=muteState.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createMuteState","type","meeting","mediaDirection","AUDIO","sendAudio","VIDEO","sendVideo","LoggerProxy","logger","info","id","MuteState","ParameterError","state","client","localMute","server","remoteMute","remoteMuted","unmuteAllowed","syncToServerInProgress","pendingPromiseResolve","pendingPromiseReject","mute","reject","PermissionError","applyClientStateLocally","resolve","applyClientStateToServer","Media","setLocalTrack","mediaProperties","audioTrack","videoTrack","localMuteRequiresSync","remoteMuteRequiresSync","localMuteSyncPromise","sendLocalMuteRequestToServer","then","sendRemoteMuteRequestToServer","catch","e","audioMuted","audio","videoMuted","video","MeetingUtil","remoteUpdateAudioVideo","locus","locusInfo","onFullLocus","remoteUpdateError","warn","members","muteMember","selfId","muted","Error","isMuted","isSelf"],"sources":["muteState.ts"],"sourcesContent":["import LoggerProxy from '../common/logs/logger-proxy';\nimport ParameterError from '../common/errors/parameter';\nimport PermissionError from '../common/errors/permission';\nimport Media from '../media';\nimport MeetingUtil from './util';\nimport {AUDIO, VIDEO} from '../constants';\n\n/* Certain aspects of server interaction for video muting are not implemented as we currently don't support remote muting of video.\n If we ever need to support it, search for REMOTE_MUTE_VIDEO_MISSING_IMPLEMENTATION string to find the places that need updating\n*/\n\nconst createMuteState = (type, meeting, mediaDirection) => {\n if (type === AUDIO && !mediaDirection.sendAudio) {\n return null;\n }\n if (type === VIDEO && !mediaDirection.sendVideo) {\n return null;\n }\n\n LoggerProxy.logger.info(\n `Meeting:muteState#createMuteState --> ${type}: creating MuteState for meeting id ${meeting?.id}`\n );\n\n return new MuteState(type, meeting);\n};\n\n/** The purpose of this class is to manage the local and remote mute state and make sure that the server state always matches\n the last requested state by the client.\n\n More info about Locus muting API: https://sqbu-github.cisco.com/pages/WebExSquared/locus/guides/mute.html#\n*/\nclass MuteState {\n pendingPromiseReject: any;\n pendingPromiseResolve: any;\n state: any;\n type: any;\n\n /**\n * Constructor\n *\n * @param {String} type - audio or video\n * @param {Object} meeting - the meeting object (used for reading current remote mute status)\n */\n constructor(type: string, meeting: any) {\n if (type !== AUDIO && type !== VIDEO) {\n throw new ParameterError('Mute state is designed for handling audio or video only');\n }\n this.type = type;\n this.state = {\n client: {\n localMute: false,\n },\n server: {\n localMute: false,\n // initial values available only for audio (REMOTE_MUTE_VIDEO_MISSING_IMPLEMENTATION)\n remoteMute: type === AUDIO ? meeting.remoteMuted : false,\n unmuteAllowed: type === AUDIO ? meeting.unmuteAllowed : true,\n },\n syncToServerInProgress: false,\n };\n // these 2 hold the resolve, reject methods for the promise we returned to the client in last handleClientRequest() call\n this.pendingPromiseResolve = null;\n this.pendingPromiseReject = null;\n }\n\n /**\n * Handles mute/unmute request from the client/user. Returns a promise that's resolved once the server update is completed or\n * at the point that this request becomese superseded by another client request.\n *\n * The client doesn't have to wait for the returned promise to resolve before calling handleClientRequest() again. If\n * handleClientRequest() is called again before the previous one resolved, the MuteState class will make sure that eventually\n * the server state will match the last requested state from the client.\n *\n * @public\n * @memberof MuteState\n * @param {Object} [meeting] the meeting object\n * @param {Boolean} [mute] true for muting, false for unmuting request\n * @returns {Promise}\n */\n public handleClientRequest(meeting?: object, mute?: boolean) {\n LoggerProxy.logger.info(\n `Meeting:muteState#handleClientRequest --> ${this.type}: user requesting new mute state: ${mute}`\n );\n\n if (!mute && !this.state.server.unmuteAllowed) {\n return Promise.reject(\n new PermissionError('User is not allowed to unmute self (hard mute feature is being used)')\n );\n }\n\n // we don't check if we're already in the same state, because even if we were, we would still have to apply the mute state locally,\n // because the client may have changed the audio/vidoe tracks\n this.state.client.localMute = mute;\n this.applyClientStateLocally(meeting);\n\n return new Promise((resolve, reject) => {\n if (this.pendingPromiseResolve) {\n // resolve the last promise we returned to the client as the client has issued a new request that has superseded the previous one\n this.pendingPromiseResolve();\n }\n this.pendingPromiseResolve = resolve;\n this.pendingPromiseReject = reject;\n this.applyClientStateToServer(meeting);\n });\n }\n\n /**\n * Applies the current mute state to the local track (by enabling or disabling it accordingly)\n *\n * @public\n * @param {Object} [meeting] the meeting object\n * @memberof MuteState\n * @returns {void}\n */\n public applyClientStateLocally(meeting?: any) {\n Media.setLocalTrack(\n !this.state.client.localMute,\n this.type === AUDIO ? meeting.mediaProperties.audioTrack : meeting.mediaProperties.videoTrack\n );\n }\n\n /**\n * Updates the server local and remote mute values so that they match the current client desired state.\n *\n * @private\n * @param {Object} [meeting] the meeting object\n * @memberof MuteState\n * @returns {void}\n */\n private applyClientStateToServer(meeting?: object) {\n if (this.state.syncToServerInProgress) {\n LoggerProxy.logger.info(\n `Meeting:muteState#applyClientStateToServer --> ${this.type}: request to server in progress, we need to wait for it to complete`\n );\n\n return;\n }\n\n const localMuteRequiresSync = this.state.client.localMute !== this.state.server.localMute;\n const remoteMuteRequiresSync = !this.state.client.localMute && this.state.server.remoteMute;\n\n LoggerProxy.logger.info(\n `Meeting:muteState#applyClientStateToServer --> ${this.type}: localMuteRequiresSync: ${localMuteRequiresSync} (${this.state.client.localMute} ?= ${this.state.server.localMute})`\n );\n LoggerProxy.logger.info(\n `Meeting:muteState#applyClientStateToServer --> ${this.type}: remoteMuteRequiresSync: ${remoteMuteRequiresSync}`\n );\n\n if (!localMuteRequiresSync && !remoteMuteRequiresSync) {\n LoggerProxy.logger.info(\n `Meeting:muteState#applyClientStateToServer --> ${this.type}: client state already matching server state, nothing to do`\n );\n\n if (this.pendingPromiseResolve) {\n this.pendingPromiseResolve();\n }\n this.pendingPromiseResolve = null;\n this.pendingPromiseReject = null;\n\n return;\n }\n\n this.state.syncToServerInProgress = true;\n\n // first sync local mute with server\n const localMuteSyncPromise = localMuteRequiresSync\n ? this.sendLocalMuteRequestToServer(meeting)\n : Promise.resolve();\n\n localMuteSyncPromise\n .then(() =>\n // then follow it up with remote mute sync\n remoteMuteRequiresSync ? this.sendRemoteMuteRequestToServer(meeting) : Promise.resolve()\n )\n .then(() => {\n this.state.syncToServerInProgress = false;\n LoggerProxy.logger.info(\n `Meeting:muteState#applyClientStateToServer --> ${this.type}: sync with server completed`\n );\n\n // need to check if a new sync is required, because this.state.client may have changed while we were doing the current sync\n this.applyClientStateToServer(meeting);\n })\n .catch((e) => {\n this.state.syncToServerInProgress = false;\n\n if (this.pendingPromiseReject) {\n this.pendingPromiseReject(e);\n }\n this.pendingPromiseResolve = null;\n this.pendingPromiseReject = null;\n });\n }\n\n /**\n * Sets the local mute value in the server\n *\n * @private\n * @param {Object} [meeting] the meeting object\n * @memberof MuteState\n * @returns {Promise}\n */\n private sendLocalMuteRequestToServer(meeting?: any) {\n const audioMuted =\n this.type === AUDIO ? this.state.client.localMute : meeting.audio?.state.client.localMute;\n const videoMuted =\n this.type === VIDEO ? this.state.client.localMute : meeting.video?.state.client.localMute;\n\n LoggerProxy.logger.info(\n `Meeting:muteState#sendLocalMuteRequestToServer --> ${this.type}: sending local mute (audio=${audioMuted}, video=${videoMuted}) to server`\n );\n\n return MeetingUtil.remoteUpdateAudioVideo(audioMuted, videoMuted, meeting)\n .then((locus) => {\n LoggerProxy.logger.info(\n `Meeting:muteState#sendLocalMuteRequestToServer --> ${this.type}: local mute (audio=${audioMuted}, video=${videoMuted}) applied to server`\n );\n\n this.state.server.localMute = this.type === AUDIO ? audioMuted : videoMuted;\n\n meeting.locusInfo.onFullLocus(locus);\n\n return locus;\n })\n .catch((remoteUpdateError) => {\n LoggerProxy.logger.warn(\n `Meeting:muteState#sendLocalMuteRequestToServer --> ${this.type}: failed to apply local mute (audio=${audioMuted}, video=${videoMuted}) to server: ${remoteUpdateError}`\n );\n\n return Promise.reject(remoteUpdateError);\n });\n }\n\n /**\n * Sets the remote mute value in the server\n *\n * @private\n * @param {Object} [meeting] the meeting object\n * @memberof MuteState\n * @returns {Promise}\n */\n private sendRemoteMuteRequestToServer(meeting?: any) {\n if (this.type === AUDIO) {\n const remoteMute = this.state.client.localMute;\n\n LoggerProxy.logger.info(\n `Meeting:muteState#sendRemoteMuteRequestToServer --> ${this.type}: sending remote mute:${remoteMute} to server`\n );\n\n return meeting.members\n .muteMember(meeting.members.selfId, remoteMute)\n .then(() => {\n LoggerProxy.logger.info(\n `Meeting:muteState#sendRemoteMuteRequestToServer --> ${this.type}: remote mute:${remoteMute} applied to server`\n );\n\n this.state.server.remoteMute = remoteMute;\n })\n .catch((remoteUpdateError) => {\n LoggerProxy.logger.warn(\n `Meeting:muteState#sendRemoteMuteRequestToServer --> ${this.type}: failed to apply remote mute ${remoteMute} to server: ${remoteUpdateError}`\n );\n\n return Promise.reject(remoteUpdateError);\n });\n }\n\n // for now we don't need to support remote muting of video (REMOTE_MUTE_VIDEO_MISSING_IMPLEMENTATION)\n this.state.server.remoteMute = this.state.client.localMute;\n\n return Promise.resolve();\n }\n\n /**\n * This method should be called whenever the server remote mute state is changed\n *\n * @public\n * @memberof MuteState\n * @param {Boolean} [muted] true if user is remotely muted, false otherwise\n * @param {Boolean} [unmuteAllowed] indicates if user is allowed to unmute self (false when \"hard mute\" feature is used)\n * @returns {undefined}\n */\n public handleServerRemoteMuteUpdate(muted?: boolean, unmuteAllowed?: boolean) {\n LoggerProxy.logger.info(\n `Meeting:muteState#handleServerRemoteMuteUpdate --> ${this.type}: updating server remoteMute to (${muted})`\n );\n this.state.server.remoteMute = muted;\n this.state.server.unmuteAllowed = unmuteAllowed;\n }\n\n /**\n * This method should be called whenever we receive from the server a requirement to locally unmute\n *\n * @public\n * @memberof MuteState\n * @param {Object} [meeting] the meeting object\n * @returns {undefined}\n */\n public handleServerLocalUnmuteRequired(meeting?: object) {\n LoggerProxy.logger.info(\n `Meeting:muteState#handleServerLocalUnmuteRequired --> ${this.type}: localAudioUnmuteRequired received -> doing local unmute`\n );\n\n this.state.server.remoteMute = false;\n this.state.client.localMute = false;\n\n if (this.pendingPromiseReject) {\n this.pendingPromiseReject(\n new Error('Server requested local unmute - this overrides any client request in progress')\n );\n this.pendingPromiseResolve = null;\n this.pendingPromiseReject = null;\n }\n\n this.applyClientStateLocally(meeting);\n this.applyClientStateToServer(meeting);\n }\n\n /**\n * Returns true if the user is locally or remotely muted\n *\n * @public\n * @memberof MuteState\n * @returns {Boolean}\n */\n public isMuted() {\n return (\n this.state.client.localMute || this.state.server.localMute || this.state.server.remoteMute\n );\n }\n\n /**\n * Returns true if the user is muted as a result of the client request (and not remotely muted)\n *\n * @public\n * @memberof MuteState\n * @returns {Boolean}\n */\n public isSelf() {\n return this.state.client.localMute && !this.state.server.remoteMute;\n }\n\n // defined for backwards compatibility with the old AudioStateMachine/VideoStateMachine classes\n get muted() {\n return this.isMuted();\n }\n\n // defined for backwards compatibility with the old AudioStateMachine/VideoStateMachine classes\n get self() {\n return this.isSelf();\n }\n}\n\nexport default createMuteState;\n"],"mappings":";;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;;AAEA,IAAMA,eAAe,GAAG,SAAlBA,eAAe,CAAIC,IAAI,EAAEC,OAAO,EAAEC,cAAc,EAAK;EACzD,IAAIF,IAAI,KAAKG,gBAAK,IAAI,CAACD,cAAc,CAACE,SAAS,EAAE;IAC/C,OAAO,IAAI;EACb;EACA,IAAIJ,IAAI,KAAKK,gBAAK,IAAI,CAACH,cAAc,CAACI,SAAS,EAAE;IAC/C,OAAO,IAAI;EACb;EAEAC,oBAAW,CAACC,MAAM,CAACC,IAAI,iDACoBT,IAAI,iDAAuCC,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAES,EAAE,EAChG;EAED,OAAO,IAAIC,SAAS,CAACX,IAAI,EAAEC,OAAO,CAAC;AACrC,CAAC;;AAED;AACA;AACA;AACA;AACA;AAJA,IAKMU,SAAS;EAMb;AACF;AACA;AACA;AACA;AACA;EACE,mBAAYX,IAAY,EAAEC,OAAY,EAAE;IAAA;IAAA;IAAA;IAAA;IAAA;IACtC,IAAID,IAAI,KAAKG,gBAAK,IAAIH,IAAI,KAAKK,gBAAK,EAAE;MACpC,MAAM,IAAIO,kBAAc,CAAC,yDAAyD,CAAC;IACrF;IACA,IAAI,CAACZ,IAAI,GAAGA,IAAI;IAChB,IAAI,CAACa,KAAK,GAAG;MACXC,MAAM,EAAE;QACNC,SAAS,EAAE;MACb,CAAC;MACDC,MAAM,EAAE;QACND,SAAS,EAAE,KAAK;QAChB;QACAE,UAAU,EAAEjB,IAAI,KAAKG,gBAAK,GAAGF,OAAO,CAACiB,WAAW,GAAG,KAAK;QACxDC,aAAa,EAAEnB,IAAI,KAAKG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AAI;MAClC;MAEA,IAAI,CAACI,uBAAuB,CAACzB,OAAO,CAAC;MACrC,IAAI,CAAC2B,wBAAwB,CAAC3B,OAAO,CAAC;IACxC;;IAEA;AACF;AACA;AACA;AACA;AACA;AACA;EANE;IAAA;IAAA,OAOA,mBAAiB;MACf,OACE,IAAI,CAACY,KAAK,CAACC,MAAM,CAACC,SAAS,IAAI,IAAI,CAACF,KAAK,CAACG,MAAM,CAACD,SAAS,IAAI,IAAI,CAACF,KAAK,CAACG,MAAM,CAACC,UAAU;IAE9F;;IAEA;AACF;AACA;AACA;AACA;AACA;AACA;EANE;IAAA;IAAA,OAOA,kBAAgB;MACd,OAAO,IAAI,CAACJ,KAAK,CAACC,MAAM,CAACC,SAAS,IAAI,CAAC,IAAI,CAACF,KAAK,CAACG,MAAM,CAACC,UAAU;IACrE;;IAEA;EAAA;IAAA;IAAA,KACA,eAAY;MACV,OAAO,IAAI,CAACyC,OAAO,EAAE;IACvB;;IAEA;EAAA;IAAA;IAAA,KACA,eAAW;MACT,OAAO,IAAI,CAACC,MAAM,EAAE;IACtB;EAAC;EAAA;AAAA;AAAA,eAGY5D,eAAe;AAAA"}
1
+ {"version":3,"names":["createMuteState","type","meeting","mediaDirection","AUDIO","sendAudio","VIDEO","sendVideo","LoggerProxy","logger","info","id","MuteState","ParameterError","state","client","localMute","server","remoteMute","remoteMuted","unmuteAllowed","syncToServerInProgress","pendingPromiseResolve","pendingPromiseReject","mute","reject","PermissionError","applyClientStateLocally","resolve","applyClientStateToServer","Media","setLocalTrack","mediaProperties","audioTrack","videoTrack","localMuteRequiresSync","remoteMuteRequiresSync","localMuteSyncPromise","sendLocalMuteRequestToServer","then","sendRemoteMuteRequestToServer","catch","e","audioMuted","audio","videoMuted","video","MeetingUtil","remoteUpdateAudioVideo","locus","locusInfo","onFullLocus","remoteUpdateError","warn","members","muteMember","selfId","muted","Error","isMuted","isSelf"],"sources":["muteState.ts"],"sourcesContent":["import LoggerProxy from '../common/logs/logger-proxy';\nimport ParameterError from '../common/errors/parameter';\nimport PermissionError from '../common/errors/permission';\nimport Media from '../media';\nimport MeetingUtil from './util';\nimport {AUDIO, VIDEO} from '../constants';\n\n/* Certain aspects of server interaction for video muting are not implemented as we currently don't support remote muting of video.\n If we ever need to support it, search for REMOTE_MUTE_VIDEO_MISSING_IMPLEMENTATION string to find the places that need updating\n*/\n\n// eslint-disable-next-line import/prefer-default-export\nexport const createMuteState = (type, meeting, mediaDirection) => {\n if (type === AUDIO && !mediaDirection.sendAudio) {\n return null;\n }\n if (type === VIDEO && !mediaDirection.sendVideo) {\n return null;\n }\n\n LoggerProxy.logger.info(\n `Meeting:muteState#createMuteState --> ${type}: creating MuteState for meeting id ${meeting?.id}`\n );\n\n return new MuteState(type, meeting);\n};\n\n/** The purpose of this class is to manage the local and remote mute state and make sure that the server state always matches\n the last requested state by the client.\n\n More info about Locus muting API: https://sqbu-github.cisco.com/pages/WebExSquared/locus/guides/mute.html#\n*/\nclass MuteState {\n pendingPromiseReject: any;\n pendingPromiseResolve: any;\n state: any;\n type: any;\n\n /**\n * Constructor\n *\n * @param {String} type - audio or video\n * @param {Object} meeting - the meeting object (used for reading current remote mute status)\n */\n constructor(type: string, meeting: any) {\n if (type !== AUDIO && type !== VIDEO) {\n throw new ParameterError('Mute state is designed for handling audio or video only');\n }\n this.type = type;\n this.state = {\n client: {\n localMute: false,\n },\n server: {\n localMute: false,\n // initial values available only for audio (REMOTE_MUTE_VIDEO_MISSING_IMPLEMENTATION)\n remoteMute: type === AUDIO ? meeting.remoteMuted : false,\n unmuteAllowed: type === AUDIO ? meeting.unmuteAllowed : true,\n },\n syncToServerInProgress: false,\n };\n // these 2 hold the resolve, reject methods for the promise we returned to the client in last handleClientRequest() call\n this.pendingPromiseResolve = null;\n this.pendingPromiseReject = null;\n }\n\n /**\n * Handles mute/unmute request from the client/user. Returns a promise that's resolved once the server update is completed or\n * at the point that this request becomese superseded by another client request.\n *\n * The client doesn't have to wait for the returned promise to resolve before calling handleClientRequest() again. If\n * handleClientRequest() is called again before the previous one resolved, the MuteState class will make sure that eventually\n * the server state will match the last requested state from the client.\n *\n * @public\n * @memberof MuteState\n * @param {Object} [meeting] the meeting object\n * @param {Boolean} [mute] true for muting, false for unmuting request\n * @returns {Promise}\n */\n public handleClientRequest(meeting?: object, mute?: boolean) {\n LoggerProxy.logger.info(\n `Meeting:muteState#handleClientRequest --> ${this.type}: user requesting new mute state: ${mute}`\n );\n\n if (!mute && !this.state.server.unmuteAllowed) {\n return Promise.reject(\n new PermissionError('User is not allowed to unmute self (hard mute feature is being used)')\n );\n }\n\n // we don't check if we're already in the same state, because even if we were, we would still have to apply the mute state locally,\n // because the client may have changed the audio/vidoe tracks\n this.state.client.localMute = mute;\n this.applyClientStateLocally(meeting);\n\n return new Promise((resolve, reject) => {\n if (this.pendingPromiseResolve) {\n // resolve the last promise we returned to the client as the client has issued a new request that has superseded the previous one\n this.pendingPromiseResolve();\n }\n this.pendingPromiseResolve = resolve;\n this.pendingPromiseReject = reject;\n this.applyClientStateToServer(meeting);\n });\n }\n\n /**\n * Applies the current mute state to the local track (by enabling or disabling it accordingly)\n *\n * @public\n * @param {Object} [meeting] the meeting object\n * @memberof MuteState\n * @returns {void}\n */\n public applyClientStateLocally(meeting?: any) {\n Media.setLocalTrack(\n !this.state.client.localMute,\n this.type === AUDIO ? meeting.mediaProperties.audioTrack : meeting.mediaProperties.videoTrack\n );\n }\n\n /**\n * Updates the server local and remote mute values so that they match the current client desired state.\n *\n * @private\n * @param {Object} [meeting] the meeting object\n * @memberof MuteState\n * @returns {void}\n */\n private applyClientStateToServer(meeting?: object) {\n if (this.state.syncToServerInProgress) {\n LoggerProxy.logger.info(\n `Meeting:muteState#applyClientStateToServer --> ${this.type}: request to server in progress, we need to wait for it to complete`\n );\n\n return;\n }\n\n const localMuteRequiresSync = this.state.client.localMute !== this.state.server.localMute;\n const remoteMuteRequiresSync = !this.state.client.localMute && this.state.server.remoteMute;\n\n LoggerProxy.logger.info(\n `Meeting:muteState#applyClientStateToServer --> ${this.type}: localMuteRequiresSync: ${localMuteRequiresSync} (${this.state.client.localMute} ?= ${this.state.server.localMute})`\n );\n LoggerProxy.logger.info(\n `Meeting:muteState#applyClientStateToServer --> ${this.type}: remoteMuteRequiresSync: ${remoteMuteRequiresSync}`\n );\n\n if (!localMuteRequiresSync && !remoteMuteRequiresSync) {\n LoggerProxy.logger.info(\n `Meeting:muteState#applyClientStateToServer --> ${this.type}: client state already matching server state, nothing to do`\n );\n\n if (this.pendingPromiseResolve) {\n this.pendingPromiseResolve();\n }\n this.pendingPromiseResolve = null;\n this.pendingPromiseReject = null;\n\n return;\n }\n\n this.state.syncToServerInProgress = true;\n\n // first sync local mute with server\n const localMuteSyncPromise = localMuteRequiresSync\n ? this.sendLocalMuteRequestToServer(meeting)\n : Promise.resolve();\n\n localMuteSyncPromise\n .then(() =>\n // then follow it up with remote mute sync\n remoteMuteRequiresSync ? this.sendRemoteMuteRequestToServer(meeting) : Promise.resolve()\n )\n .then(() => {\n this.state.syncToServerInProgress = false;\n LoggerProxy.logger.info(\n `Meeting:muteState#applyClientStateToServer --> ${this.type}: sync with server completed`\n );\n\n // need to check if a new sync is required, because this.state.client may have changed while we were doing the current sync\n this.applyClientStateToServer(meeting);\n })\n .catch((e) => {\n this.state.syncToServerInProgress = false;\n\n if (this.pendingPromiseReject) {\n this.pendingPromiseReject(e);\n }\n this.pendingPromiseResolve = null;\n this.pendingPromiseReject = null;\n });\n }\n\n /**\n * Sets the local mute value in the server\n *\n * @private\n * @param {Object} [meeting] the meeting object\n * @memberof MuteState\n * @returns {Promise}\n */\n private sendLocalMuteRequestToServer(meeting?: any) {\n const audioMuted =\n this.type === AUDIO ? this.state.client.localMute : meeting.audio?.state.client.localMute;\n const videoMuted =\n this.type === VIDEO ? this.state.client.localMute : meeting.video?.state.client.localMute;\n\n LoggerProxy.logger.info(\n `Meeting:muteState#sendLocalMuteRequestToServer --> ${this.type}: sending local mute (audio=${audioMuted}, video=${videoMuted}) to server`\n );\n\n return MeetingUtil.remoteUpdateAudioVideo(audioMuted, videoMuted, meeting)\n .then((locus) => {\n LoggerProxy.logger.info(\n `Meeting:muteState#sendLocalMuteRequestToServer --> ${this.type}: local mute (audio=${audioMuted}, video=${videoMuted}) applied to server`\n );\n\n this.state.server.localMute = this.type === AUDIO ? audioMuted : videoMuted;\n\n meeting.locusInfo.onFullLocus(locus);\n\n return locus;\n })\n .catch((remoteUpdateError) => {\n LoggerProxy.logger.warn(\n `Meeting:muteState#sendLocalMuteRequestToServer --> ${this.type}: failed to apply local mute (audio=${audioMuted}, video=${videoMuted}) to server: ${remoteUpdateError}`\n );\n\n return Promise.reject(remoteUpdateError);\n });\n }\n\n /**\n * Sets the remote mute value in the server\n *\n * @private\n * @param {Object} [meeting] the meeting object\n * @memberof MuteState\n * @returns {Promise}\n */\n private sendRemoteMuteRequestToServer(meeting?: any) {\n if (this.type === AUDIO) {\n const remoteMute = this.state.client.localMute;\n\n LoggerProxy.logger.info(\n `Meeting:muteState#sendRemoteMuteRequestToServer --> ${this.type}: sending remote mute:${remoteMute} to server`\n );\n\n return meeting.members\n .muteMember(meeting.members.selfId, remoteMute)\n .then(() => {\n LoggerProxy.logger.info(\n `Meeting:muteState#sendRemoteMuteRequestToServer --> ${this.type}: remote mute:${remoteMute} applied to server`\n );\n\n this.state.server.remoteMute = remoteMute;\n })\n .catch((remoteUpdateError) => {\n LoggerProxy.logger.warn(\n `Meeting:muteState#sendRemoteMuteRequestToServer --> ${this.type}: failed to apply remote mute ${remoteMute} to server: ${remoteUpdateError}`\n );\n\n return Promise.reject(remoteUpdateError);\n });\n }\n\n // for now we don't need to support remote muting of video (REMOTE_MUTE_VIDEO_MISSING_IMPLEMENTATION)\n this.state.server.remoteMute = this.state.client.localMute;\n\n return Promise.resolve();\n }\n\n /**\n * This method should be called whenever the server remote mute state is changed\n *\n * @public\n * @memberof MuteState\n * @param {Boolean} [muted] true if user is remotely muted, false otherwise\n * @param {Boolean} [unmuteAllowed] indicates if user is allowed to unmute self (false when \"hard mute\" feature is used)\n * @returns {undefined}\n */\n public handleServerRemoteMuteUpdate(muted?: boolean, unmuteAllowed?: boolean) {\n LoggerProxy.logger.info(\n `Meeting:muteState#handleServerRemoteMuteUpdate --> ${this.type}: updating server remoteMute to (${muted})`\n );\n this.state.server.remoteMute = muted;\n this.state.server.unmuteAllowed = unmuteAllowed;\n }\n\n /**\n * This method should be called whenever we receive from the server a requirement to locally unmute\n *\n * @public\n * @memberof MuteState\n * @param {Object} [meeting] the meeting object\n * @returns {undefined}\n */\n public handleServerLocalUnmuteRequired(meeting?: object) {\n LoggerProxy.logger.info(\n `Meeting:muteState#handleServerLocalUnmuteRequired --> ${this.type}: localAudioUnmuteRequired received -> doing local unmute`\n );\n\n this.state.server.remoteMute = false;\n this.state.client.localMute = false;\n\n if (this.pendingPromiseReject) {\n this.pendingPromiseReject(\n new Error('Server requested local unmute - this overrides any client request in progress')\n );\n this.pendingPromiseResolve = null;\n this.pendingPromiseReject = null;\n }\n\n this.applyClientStateLocally(meeting);\n this.applyClientStateToServer(meeting);\n }\n\n /**\n * Returns true if the user is locally or remotely muted\n *\n * @public\n * @memberof MuteState\n * @returns {Boolean}\n */\n public isMuted() {\n return (\n this.state.client.localMute || this.state.server.localMute || this.state.server.remoteMute\n );\n }\n\n /**\n * Returns true if the user is muted as a result of the client request (and not remotely muted)\n *\n * @public\n * @memberof MuteState\n * @returns {Boolean}\n */\n public isSelf() {\n return this.state.client.localMute && !this.state.server.remoteMute;\n }\n\n // defined for backwards compatibility with the old AudioStateMachine/VideoStateMachine classes\n get muted() {\n return this.isMuted();\n }\n\n // defined for backwards compatibility with the old AudioStateMachine/VideoStateMachine classes\n get self() {\n return this.isSelf();\n }\n}\n"],"mappings":";;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;;AAEA;AACO,IAAMA,eAAe,GAAG,SAAlBA,eAAe,CAAIC,IAAI,EAAEC,OAAO,EAAEC,cAAc,E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CAACC,UAAU;IAE9F;;IAEA;AACF;AACA;AACA;AACA;AACA;AACA;EANE;IAAA;IAAA,OAOA,kBAAgB;MACd,OAAO,IAAI,CAACJ,KAAK,CAACC,MAAM,CAACC,SAAS,IAAI,CAAC,IAAI,CAACF,KAAK,CAACG,MAAM,CAACC,UAAU;IACrE;;IAEA;EAAA;IAAA;IAAA,KACA,eAAY;MACV,OAAO,IAAI,CAACyC,OAAO,EAAE;IACvB;;IAEA;EAAA;IAAA;IAAA,KACA,eAAW;MACT,OAAO,IAAI,CAACC,MAAM,EAAE;IACtB;EAAC;EAAA;AAAA"}
@@ -36,12 +36,12 @@ var Reactions = {
36
36
  codepoints: '1F44F',
37
37
  shortcodes: ':clap:'
38
38
  },
39
- thumbs_up: {
39
+ thumb_up: {
40
40
  type: 'thumb_up',
41
41
  codepoints: '1F44D',
42
42
  shortcodes: ':thumbsup:'
43
43
  },
44
- thumbs_down: {
44
+ thumb_down: {
45
45
  type: 'thumb_down',
46
46
  codepoints: '1F44E',
47
47
  shortcodes: ':thumbsdown:'
@@ -1 +1 @@
1
- {"version":3,"names":["Reactions","smile","type","codepoints","shortcodes","sad","wow","haha","celebrate","clap","thumbs_up","thumbs_down","heart","fire","prayer","speed_up","slow_down","SkinTones","normal","light","medium_light","medium","medium_dark","dark"],"sources":["reactions.ts"],"sourcesContent":["import {Reaction, ReactionType, SkinTone, SkinToneType} from './reactions.type';\n\nconst Reactions: Record<ReactionType, Reaction> = {\n smile: {\n type: 'smile',\n codepoints: '1F642',\n shortcodes: ':slightly_smiling_face:',\n },\n sad: {\n type: 'sad',\n codepoints: '1F625',\n shortcodes: ':sad_but_relieved_face:',\n },\n wow: {\n type: 'wow',\n codepoints: '1F62E',\n shortcodes: ':open_mouth:',\n },\n haha: {\n type: 'haha',\n codepoints: '1F603',\n shortcodes: ':smiley:',\n },\n celebrate: {\n type: 'celebrate',\n codepoints: '1F389',\n shortcodes: ':party_popper:',\n },\n clap: {\n type: 'clap',\n codepoints: '1F44F',\n shortcodes: ':clap:',\n },\n thumbs_up: {\n type: 'thumb_up',\n codepoints: '1F44D',\n shortcodes: ':thumbsup:',\n },\n thumbs_down: {\n type: 'thumb_down',\n codepoints: '1F44E',\n shortcodes: ':thumbsdown:',\n },\n heart: {\n type: 'heart',\n codepoints: '2764',\n shortcodes: ':heart:',\n },\n fire: {\n type: 'fire',\n codepoints: '1F525',\n shortcodes: ':fire:',\n },\n prayer: {\n type: 'prayer',\n codepoints: '1F64F',\n shortcodes: ':pray:',\n },\n speed_up: {\n type: 'speed_up',\n codepoints: '1F407',\n shortcodes: ':rabbit:',\n },\n slow_down: {\n type: 'slow_down',\n codepoints: '1F422',\n shortcodes: ':turtle:',\n },\n};\n\nconst SkinTones: Record<SkinToneType, SkinTone> = {\n normal: {\n type: 'normal_skin_tone',\n codepoints: '',\n shortcodes: '',\n },\n light: {\n type: 'light_skin_tone',\n codepoints: '1F3FB',\n shortcodes: ':skin-tone-2:',\n },\n medium_light: {\n type: 'medium_light_skin_tone',\n codepoints: '1F3FC',\n shortcodes: ':skin-tone-3:',\n },\n medium: {\n type: 'medium_skin_tone',\n codepoints: '1F3FD',\n shortcodes: ':skin-tone-4:',\n },\n medium_dark: {\n type: 'medium_dark_skin_tone',\n codepoints: '1F3FE',\n shortcodes: ':skin-tone-5:',\n },\n dark: {\n type: 'dark_skin_tone',\n codepoints: '1F3FF',\n shortcodes: ':skin-tone-6:',\n },\n};\n\nexport {Reactions, SkinTones};\n"],"mappings":";;;;;;;AAEA,IAAMA,SAAyC,GAAG;EAChDC,KAAK,EAAE;IACLC,IAAI,EAAE,OAAO;IACbC,UAAU,EAAE,OAAO;IACnBC,UAAU,EAAE;EACd,CAAC;EACDC,GAAG,EAAE;IACHH,IAAI,EAAE,KAAK;IACXC,UAAU,EAAE,OAAO;IACnBC,UAAU,EAAE;EACd,CAAC;EACDE,GAAG,EAAE;IACHJ,IAAI,EAAE,KAAK;IACXC,UAAU,EAAE,OAAO;IACnBC,UAAU,EAAE;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AAY,EAAE;IACZlB,IAAI,EAAE,wBAAwB;IAC9BC,UAAU,EAAE,OAAO;IACnBC,UAAU,EAAE;EACd,CAAC;EACDiB,MAAM,EAAE;IACNnB,IAAI,EAAE,kBAAkB;IACxBC,UAAU,EAAE,OAAO;IACnBC,UAAU,EAAE;EACd,CAAC;EACDkB,WAAW,EAAE;IACXpB,IAAI,EAAE,uBAAuB;IAC7BC,UAAU,EAAE,OAAO;IACnBC,UAAU,EAAE;EACd,CAAC;EACDmB,IAAI,EAAE;IACJrB,IAAI,EAAE,gBAAgB;IACtBC,UAAU,EAAE,OAAO;IACnBC,UAAU,EAAE;EACd;AACF,CAAC;AAAC"}
1
+ {"version":3,"names":["Reactions","smile","type","codepoints","shortcodes","sad","wow","haha","celebrate","clap","thumb_up","thumb_down","heart","fire","prayer","speed_up","slow_down","SkinTones","normal","light","medium_light","medium","medium_dark","dark"],"sources":["reactions.ts"],"sourcesContent":["import {Reaction, ReactionServerType, SkinTone, SkinToneType} from './reactions.type';\n\nconst Reactions: Record<ReactionServerType, Reaction> = {\n smile: {\n type: 'smile',\n codepoints: '1F642',\n shortcodes: ':slightly_smiling_face:',\n },\n sad: {\n type: 'sad',\n codepoints: '1F625',\n shortcodes: ':sad_but_relieved_face:',\n },\n wow: {\n type: 'wow',\n codepoints: '1F62E',\n shortcodes: ':open_mouth:',\n },\n haha: {\n type: 'haha',\n codepoints: '1F603',\n shortcodes: ':smiley:',\n },\n celebrate: {\n type: 'celebrate',\n codepoints: '1F389',\n shortcodes: ':party_popper:',\n },\n clap: {\n type: 'clap',\n codepoints: '1F44F',\n shortcodes: ':clap:',\n },\n thumb_up: {\n type: 'thumb_up',\n codepoints: '1F44D',\n shortcodes: ':thumbsup:',\n },\n thumb_down: {\n type: 'thumb_down',\n codepoints: '1F44E',\n shortcodes: ':thumbsdown:',\n },\n heart: {\n type: 'heart',\n codepoints: '2764',\n shortcodes: ':heart:',\n },\n fire: {\n type: 'fire',\n codepoints: '1F525',\n shortcodes: ':fire:',\n },\n prayer: {\n type: 'prayer',\n codepoints: '1F64F',\n shortcodes: ':pray:',\n },\n speed_up: {\n type: 'speed_up',\n codepoints: '1F407',\n shortcodes: ':rabbit:',\n },\n slow_down: {\n type: 'slow_down',\n codepoints: '1F422',\n shortcodes: ':turtle:',\n },\n};\n\nconst SkinTones: Record<SkinToneType, SkinTone> = {\n normal: {\n type: 'normal_skin_tone',\n codepoints: '',\n shortcodes: '',\n },\n light: {\n type: 'light_skin_tone',\n codepoints: '1F3FB',\n shortcodes: ':skin-tone-2:',\n },\n medium_light: {\n type: 'medium_light_skin_tone',\n codepoints: '1F3FC',\n shortcodes: ':skin-tone-3:',\n },\n medium: {\n type: 'medium_skin_tone',\n codepoints: '1F3FD',\n shortcodes: ':skin-tone-4:',\n },\n medium_dark: {\n type: 'medium_dark_skin_tone',\n codepoints: '1F3FE',\n shortcodes: ':skin-tone-5:',\n },\n dark: {\n type: 'dark_skin_tone',\n codepoints: '1F3FF',\n shortcodes: ':skin-tone-6:',\n },\n};\n\nexport {Reactions, SkinTones};\n"],"mappings":";;;;;;;AAEA,IAAMA,SAA+C,GAAG;EACtDC,KAAK,EAAE;IACLC,IAAI,EAAE,OAAO;IACbC,UAAU,EAAE,OAAO;IACnBC,UAAU,EAAE;EACd,CAAC;EACDC,GAAG,EAAE;IACHH,IAAI,EAAE,KAAK;IACXC,UAAU,EAAE,OAAO;IACnBC,UAAU,EAAE;EACd,CAAC;EACDE,GAAG,EAAE;IACHJ,IAAI,EAAE,KAAK;IACXC,UAAU,EAAE,OAAO;IACnBC,UAAU,EAAE;EACd,CAAC;EACDG,IAAI,EAAE;IACJL,IAAI,EAAE,MAAM;IACZC,UAAU,EAAE,OAAO;IACnBC,UAAU,EAAE;EACd,CAAC;EACDI,SAAS,EAAE;IACTN,IAAI,EAAE,WAAW;IACjBC,UAAU,EAAE,OAAO;IACnBC,UAAU,EAAE;EACd,CAAC;EACDK,IAAI,EAAE;IACJP,IAAI,EAAE,MAAM;IACZ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BC,UAAU,EAAE,OAAO;IACnBC,UAAU,EAAE;EACd,CAAC;EACDmB,IAAI,EAAE;IACJrB,IAAI,EAAE,gBAAgB;IACtBC,UAAU,EAAE,OAAO;IACnBC,UAAU,EAAE;EACd;AACF,CAAC;AAAC"}
@@ -4,25 +4,25 @@ var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/defi
4
4
  _Object$defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.SkinToneType = exports.ReactionType = void 0;
7
+ exports.SkinToneType = exports.ReactionServerType = void 0;
8
8
  // eslint-disable-next-line no-shadow
9
- var ReactionType; // eslint-disable-next-line no-shadow
10
- exports.ReactionType = ReactionType;
11
- (function (ReactionType) {
12
- ReactionType["smile"] = "smile";
13
- ReactionType["sad"] = "sad";
14
- ReactionType["wow"] = "wow";
15
- ReactionType["haha"] = "haha";
16
- ReactionType["celebrate"] = "celebrate";
17
- ReactionType["clap"] = "clap";
18
- ReactionType["thumbs_up"] = "thumbs_up";
19
- ReactionType["thumbs_down"] = "thumbs_down";
20
- ReactionType["heart"] = "heart";
21
- ReactionType["fire"] = "fire";
22
- ReactionType["prayer"] = "prayer";
23
- ReactionType["speed_up"] = "speed_up";
24
- ReactionType["slow_down"] = "slow_down";
25
- })(ReactionType || (exports.ReactionType = ReactionType = {}));
9
+ var ReactionServerType; // eslint-disable-next-line no-shadow
10
+ exports.ReactionServerType = ReactionServerType;
11
+ (function (ReactionServerType) {
12
+ ReactionServerType["smile"] = "smile";
13
+ ReactionServerType["sad"] = "sad";
14
+ ReactionServerType["wow"] = "wow";
15
+ ReactionServerType["haha"] = "haha";
16
+ ReactionServerType["celebrate"] = "celebrate";
17
+ ReactionServerType["clap"] = "clap";
18
+ ReactionServerType["thumb_up"] = "thumb_up";
19
+ ReactionServerType["thumb_down"] = "thumb_down";
20
+ ReactionServerType["heart"] = "heart";
21
+ ReactionServerType["fire"] = "fire";
22
+ ReactionServerType["prayer"] = "prayer";
23
+ ReactionServerType["speed_up"] = "speed_up";
24
+ ReactionServerType["slow_down"] = "slow_down";
25
+ })(ReactionServerType || (exports.ReactionServerType = ReactionServerType = {}));
26
26
  var SkinToneType;
27
27
  exports.SkinToneType = SkinToneType;
28
28
  (function (SkinToneType) {
@@ -1 +1 @@
1
- {"version":3,"names":["ReactionType","SkinToneType"],"sources":["reactions.type.ts"],"sourcesContent":["import {REACTION_RELAY_TYPES} from './constants';\n\nexport type EmoticonData = {\n type: string;\n codepoints?: string;\n shortcodes?: string;\n};\n\nexport type SkinTone = EmoticonData;\n\nexport type Reaction = EmoticonData & {\n tone?: SkinTone;\n};\n\n// eslint-disable-next-line no-shadow\nexport enum ReactionType {\n smile = 'smile',\n sad = 'sad',\n wow = 'wow',\n haha = 'haha',\n celebrate = 'celebrate',\n clap = 'clap',\n thumbs_up = 'thumbs_up',\n thumbs_down = 'thumbs_down',\n heart = 'heart',\n fire = 'fire',\n prayer = 'prayer',\n speed_up = 'speed_up',\n slow_down = 'slow_down',\n}\n\n// eslint-disable-next-line no-shadow\nexport enum SkinToneType {\n normal = 'normal',\n light = 'light',\n medium_light = 'medium_light',\n medium = 'medium',\n medium_dark = 'medium_dark',\n dark = 'dark',\n}\n\nexport type Sender = {\n participantId: string;\n};\n\nexport type ProcessedReaction = {\n reaction: Reaction;\n sender: {\n id: Sender['participantId'];\n name: string;\n };\n};\n\ntype RelayEventData = {\n relayType: (typeof REACTION_RELAY_TYPES)['REACTION'];\n reaction: Reaction;\n sender: Sender;\n};\n\nexport type RelayEvent = {\n data: RelayEventData;\n};\n"],"mappings":";;;;;;;AAcA;AAAA,IACYA,YAAY,EAgBxB;AAAA;AAAA,WAhBYA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;AAAA,GAAZA,YAAY,4BAAZA,YAAY;AAAA,IAiBZC,YAAY;AAAA;AAAA,WAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;AAAA,GAAZA,YAAY,4BAAZA,YAAY"}
1
+ {"version":3,"names":["ReactionServerType","SkinToneType"],"sources":["reactions.type.ts"],"sourcesContent":["import {REACTION_RELAY_TYPES} from './constants';\n\nexport type EmoticonData = {\n type: string;\n codepoints?: string;\n shortcodes?: string;\n};\n\nexport type SkinTone = EmoticonData;\n\nexport type Reaction = EmoticonData & {\n tone?: SkinTone;\n};\n\n// eslint-disable-next-line no-shadow\nexport enum ReactionServerType {\n smile = 'smile',\n sad = 'sad',\n wow = 'wow',\n haha = 'haha',\n celebrate = 'celebrate',\n clap = 'clap',\n thumb_up = 'thumb_up',\n thumb_down = 'thumb_down',\n heart = 'heart',\n fire = 'fire',\n prayer = 'prayer',\n speed_up = 'speed_up',\n slow_down = 'slow_down',\n}\n\n// eslint-disable-next-line no-shadow\nexport enum SkinToneType {\n normal = 'normal',\n light = 'light',\n medium_light = 'medium_light',\n medium = 'medium',\n medium_dark = 'medium_dark',\n dark = 'dark',\n}\n\nexport type Sender = {\n participantId: string;\n};\n\nexport type ProcessedReaction = {\n reaction: Reaction;\n sender: {\n id: Sender['participantId'];\n name: string;\n };\n};\n\ntype RelayEventData = {\n relayType: (typeof REACTION_RELAY_TYPES)['REACTION'];\n reaction: Reaction;\n sender: Sender;\n};\n\nexport type RelayEvent = {\n data: RelayEventData;\n};\n"],"mappings":";;;;;;;AAcA;AAAA,IACYA,kBAAkB,EAgB9B;AAAA;AAAA,WAhBYA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;EAAlBA,kBAAkB;AAAA,GAAlBA,kBAAkB,kCAAlBA,kBAAkB;AAAA,IAiBlBC,YAAY;AAAA;AAAA,WAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;AAAA,GAAZA,YAAY,4BAAZA,YAAY"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webex/plugin-meetings",
3
- "version": "3.0.0-beta.20",
3
+ "version": "3.0.0-beta.22",
4
4
  "description": "",
5
5
  "license": "Cisco EULA (https://www.cisco.com/c/en/us/products/end-user-license-agreement.html)",
6
6
  "contributors": [
@@ -12,7 +12,7 @@
12
12
  "Taymoor Khan <taykhan@cisco.com>"
13
13
  ],
14
14
  "main": "dist/index.js",
15
- "types": "types/index.d.ts",
15
+ "types": "dist/types/index.d.ts",
16
16
  "devMain": "src/index.js",
17
17
  "repository": {
18
18
  "type": "git",
@@ -29,15 +29,15 @@
29
29
  ]
30
30
  },
31
31
  "scripts": {
32
- "build": "yarn run -T tsc --declaration true --declarationDir ./types"
32
+ "build": "yarn run -T tsc --declaration true --declarationDir ./dist/types"
33
33
  },
34
34
  "devDependencies": {
35
- "@webex/plugin-meetings": "3.0.0-beta.20",
36
- "@webex/test-helper-chai": "3.0.0-beta.20",
37
- "@webex/test-helper-mocha": "3.0.0-beta.20",
38
- "@webex/test-helper-mock-webex": "3.0.0-beta.20",
39
- "@webex/test-helper-retry": "3.0.0-beta.20",
40
- "@webex/test-helper-test-users": "3.0.0-beta.20",
35
+ "@webex/plugin-meetings": "3.0.0-beta.22",
36
+ "@webex/test-helper-chai": "3.0.0-beta.22",
37
+ "@webex/test-helper-mocha": "3.0.0-beta.22",
38
+ "@webex/test-helper-mock-webex": "3.0.0-beta.22",
39
+ "@webex/test-helper-retry": "3.0.0-beta.22",
40
+ "@webex/test-helper-test-users": "3.0.0-beta.22",
41
41
  "chai": "^4.3.4",
42
42
  "chai-as-promised": "^7.1.1",
43
43
  "jsdom-global": "3.0.2",
@@ -45,18 +45,18 @@
45
45
  "typed-emitter": "^2.1.0"
46
46
  },
47
47
  "dependencies": {
48
- "@webex/common": "3.0.0-beta.20",
48
+ "@webex/common": "3.0.0-beta.22",
49
49
  "@webex/internal-media-core": "1.33.0",
50
- "@webex/internal-plugin-conversation": "3.0.0-beta.20",
51
- "@webex/internal-plugin-device": "3.0.0-beta.20",
52
- "@webex/internal-plugin-llm": "3.0.0-beta.20",
53
- "@webex/internal-plugin-mercury": "3.0.0-beta.20",
54
- "@webex/internal-plugin-metrics": "3.0.0-beta.20",
55
- "@webex/internal-plugin-support": "3.0.0-beta.20",
56
- "@webex/internal-plugin-user": "3.0.0-beta.20",
57
- "@webex/plugin-people": "3.0.0-beta.20",
58
- "@webex/plugin-rooms": "3.0.0-beta.20",
59
- "@webex/webex-core": "3.0.0-beta.20",
50
+ "@webex/internal-plugin-conversation": "3.0.0-beta.22",
51
+ "@webex/internal-plugin-device": "3.0.0-beta.22",
52
+ "@webex/internal-plugin-llm": "3.0.0-beta.22",
53
+ "@webex/internal-plugin-mercury": "3.0.0-beta.22",
54
+ "@webex/internal-plugin-metrics": "3.0.0-beta.22",
55
+ "@webex/internal-plugin-support": "3.0.0-beta.22",
56
+ "@webex/internal-plugin-user": "3.0.0-beta.22",
57
+ "@webex/plugin-people": "3.0.0-beta.22",
58
+ "@webex/plugin-rooms": "3.0.0-beta.22",
59
+ "@webex/webex-core": "3.0.0-beta.22",
60
60
  "ampersand-collection": "^2.0.2",
61
61
  "bowser": "^2.11.0",
62
62
  "btoa": "^1.2.1",
package/src/index.js CHANGED
@@ -11,5 +11,6 @@ registerPlugin('meetings', Meetings, {
11
11
  export default Meetings;
12
12
 
13
13
  export * as CONSTANTS from './constants';
14
+ export * as REACTIONS from './reactions/reactions';
14
15
 
15
16
  export {default as TriggerProxy} from './common/events/trigger-proxy';
@@ -998,6 +998,8 @@ export default class LocusInfo extends EventsScope {
998
998
  const parsedMediaShares = MediaSharesUtils.getMediaShares(this.mediaShares, mediaShares);
999
999
 
1000
1000
  this.updateMeeting(parsedMediaShares.current);
1001
+ this.parsedLocus.mediaShares = parsedMediaShares.current;
1002
+ this.mediaShares = mediaShares;
1001
1003
  this.emitScoped(
1002
1004
  {
1003
1005
  file: 'locus-info',
@@ -1009,8 +1011,6 @@ export default class LocusInfo extends EventsScope {
1009
1011
  previous: parsedMediaShares.previous,
1010
1012
  }
1011
1013
  );
1012
- this.parsedLocus.mediaShares = parsedMediaShares.current;
1013
- this.mediaShares = mediaShares;
1014
1014
  }
1015
1015
  }
1016
1016
 
@@ -425,37 +425,6 @@ Media.stopTracks = (track: any) => {
425
425
  });
426
426
  };
427
427
 
428
- /**
429
- *
430
- * Stop input stream
431
- * @param {Stream} stream A media stream
432
- * @returns {null}
433
- * @deprecated after v1.89.3
434
- */
435
- Media.stopStream = (stream: any) => {
436
- LoggerProxy.logger.warn(
437
- 'Media:index#stopStream --> [DEPRECATION WARNING]: stopStream has been deprecated after v1.89.3'
438
- );
439
- if (!stream) {
440
- return Promise.resolve();
441
- }
442
-
443
- /*
444
- * To release local media
445
- * 1) Chrome requires all tracks to be stopped (stream.stop got deprecated)
446
- * 2) Firefox requires the stream to be stopped
447
- */
448
- return Promise.resolve().then(() => {
449
- if (stream.getTracks) {
450
- stream.getTracks().forEach((track) => {
451
- track.stop();
452
- });
453
- } else if (stream.stop) {
454
- stream.stop();
455
- }
456
- });
457
- };
458
-
459
428
  /**
460
429
  * generates streams for audio video and share
461
430
  * @param {object} mediaSetting parameter