@webex/plugin-meetings 2.21.0 → 2.21.1

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.
@@ -1,22 +1,20 @@
1
1
  "use strict";
2
2
 
3
- var _Object$defineProperty2 = require("@babel/runtime-corejs2/core-js/object/define-property");
3
+ var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
4
4
 
5
5
  var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
6
6
 
7
- _Object$defineProperty2(exports, "__esModule", {
7
+ _Object$defineProperty(exports, "__esModule", {
8
8
  value: true
9
9
  });
10
10
 
11
11
  exports.default = void 0;
12
12
 
13
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/define-property"));
14
-
15
13
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
16
14
 
17
15
  var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
18
16
 
19
- var _defineProperty3 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
17
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
20
18
 
21
19
  var _constants = require("../constants");
22
20
 
@@ -33,11 +31,9 @@ var MediaProperties = /*#__PURE__*/function () {
33
31
  * @returns {MediaProperties}
34
32
  */
35
33
  function MediaProperties() {
36
- var _this = this;
37
-
38
34
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
39
35
  (0, _classCallCheck2.default)(this, MediaProperties);
40
- (0, _defineProperty3.default)(this, "namespace", _constants.MEETINGS);
36
+ (0, _defineProperty2.default)(this, "namespace", _constants.MEETINGS);
41
37
  this.peerConnection = _util.default.createPeerConnection();
42
38
  this.mediaDirection = options.mediaDirection;
43
39
  this.videoTrack = options.videoTrack;
@@ -49,23 +45,7 @@ var MediaProperties = /*#__PURE__*/function () {
49
45
  this.localQualityLevel = options.localQualityLevel || _constants.QUALITY_LEVELS.HIGH;
50
46
  this.remoteQualityLevel = options.remoteQualityLevel || _constants.QUALITY_LEVELS.HIGH;
51
47
  this.mediaSettings = {};
52
- this.videoDeviceId = null; // deprecated after v1.89.3, remove when feasible.
53
- // backwards compatible code.
54
-
55
- (0, _defineProperty2.default)(this, 'remoteStream', {
56
- set: function set(stream) {
57
- var audio = stream.getAudioTracks();
58
- var video = stream.getVideoTracks();
59
- _this.remoteAudioTrack = audio.length && audio[0];
60
- _this.remoteVideoTrack = video.length && video[0];
61
- },
62
- get: function get() {
63
- _loggerProxy.default.logger.warn('Media:properties#remoteStream --> [DEPRECATION WARNING]: remoteStream (getter) has been deprecated after v1.89.3 (use remoteAudioTrack, remoteVideoTrack instead)'); // return if set or create a stream for backwards compatibility
64
-
65
-
66
- return _util.default.createMediaStream([_this.remoteAudioTrack, _this.remoteVideoTrack]);
67
- }
68
- });
48
+ this.videoDeviceId = null;
69
49
  }
70
50
  /**
71
51
  * Retrieves the preferred video input device
@@ -118,22 +98,6 @@ var MediaProperties = /*#__PURE__*/function () {
118
98
  value: function setRemoteQualityLevel(remoteQualityLevel) {
119
99
  this.remoteQualityLevel = remoteQualityLevel;
120
100
  }
121
- /**
122
- * @deprecated after v1.89.3
123
- * @param {remoteStream} remoteStream Sets remote media stream
124
- * @returns {null}
125
- * Use setRemoteAudioTrack, setRemoteVideoTrack
126
- * and setRemoteShareTrack.
127
- */
128
-
129
- }, {
130
- key: "setRemoteStream",
131
- value: function setRemoteStream(remoteStream) {
132
- _loggerProxy.default.logger.warn('Media:properties#setRemoteStream --> [DEPRECATION WARNING]: setRemoteStream has been deprecated after v1.89.3 (use setRemoteAudioTrack, setRemoteVideoTrack instead)'); // calls setter
133
-
134
-
135
- this.remoteStream = remoteStream;
136
- }
137
101
  }, {
138
102
  key: "setRemoteShare",
139
103
  value: function setRemoteShare(remoteShare) {
@@ -1 +1 @@
1
- {"version":3,"names":["MediaProperties","options","MEETINGS","peerConnection","MediaUtil","createPeerConnection","mediaDirection","videoTrack","audioTrack","shareTrack","remoteShare","remoteAudioTrack","remoteVideoTrack","localQualityLevel","QUALITY_LEVELS","HIGH","remoteQualityLevel","mediaSettings","videoDeviceId","set","stream","audio","getAudioTracks","video","getVideoTracks","length","get","LoggerProxy","logger","warn","createMediaStream","type","values","remoteStream","deviceId","unsetRemoteMedia","unsetLocalVideoTrack","unsetLocalShareTrack","unsetRemoteStream","unsetRemoteShare"],"sources":["properties.js"],"sourcesContent":["import {\n MEETINGS,\n QUALITY_LEVELS\n} from '../constants';\nimport LoggerProxy from '../common/logs/logger-proxy';\n\nimport MediaUtil from './util';\n\n/**\n * @class MediaProperties\n */\nexport default class MediaProperties {\n namespace = MEETINGS;\n\n /**\n * @param {Object} [options] -- to auto construct\n * @returns {MediaProperties}\n */\n constructor(options = {}) {\n this.peerConnection = MediaUtil.createPeerConnection();\n this.mediaDirection = options.mediaDirection;\n this.videoTrack = options.videoTrack;\n this.audioTrack = options.audioTrack;\n this.shareTrack = options.shareTrack;\n this.remoteShare = options.remoteShare;\n this.remoteAudioTrack = options.remoteAudioTrack;\n this.remoteVideoTrack = options.remoteVideoTrack;\n this.localQualityLevel = options.localQualityLevel || QUALITY_LEVELS.HIGH;\n this.remoteQualityLevel = options.remoteQualityLevel || QUALITY_LEVELS.HIGH;\n this.mediaSettings = {};\n this.videoDeviceId = null;\n\n // deprecated after v1.89.3, remove when feasible.\n // backwards compatible code.\n Object.defineProperty(this, 'remoteStream', {\n set: (stream) => {\n const audio = stream.getAudioTracks();\n const video = stream.getVideoTracks();\n\n this.remoteAudioTrack = audio.length && audio[0];\n this.remoteVideoTrack = video.length && video[0];\n },\n get: () => {\n LoggerProxy.logger.warn('Media:properties#remoteStream --> [DEPRECATION WARNING]: remoteStream (getter) has been deprecated after v1.89.3 (use remoteAudioTrack, remoteVideoTrack instead)');\n\n // return if set or create a stream for backwards compatibility\n return MediaUtil.createMediaStream([this.remoteAudioTrack, this.remoteVideoTrack]);\n }\n });\n }\n\n /**\n * Retrieves the preferred video input device\n * @returns {Object|null}\n */\n getVideoDeviceId() {\n return this.videoDeviceId || null;\n }\n\n setMediaDirection(mediaDirection) {\n this.mediaDirection = mediaDirection;\n }\n\n setMediaSettings(type, values) {\n this.mediaSettings[type] = values;\n }\n\n setMediaPeerConnection(peerConnection) {\n this.peerConnection = peerConnection;\n }\n\n setLocalVideoTrack(videoTrack) {\n this.videoTrack = videoTrack;\n }\n\n setLocalAudioTrack(audioTrack) {\n this.audioTrack = audioTrack;\n }\n\n setLocalQualityLevel(localQualityLevel) {\n this.localQualityLevel = localQualityLevel;\n }\n\n setLocalShareTrack(shareTrack) {\n this.shareTrack = shareTrack;\n }\n\n setRemoteQualityLevel(remoteQualityLevel) {\n this.remoteQualityLevel = remoteQualityLevel;\n }\n\n /**\n * @deprecated after v1.89.3\n * @param {remoteStream} remoteStream Sets remote media stream\n * @returns {null}\n * Use setRemoteAudioTrack, setRemoteVideoTrack\n * and setRemoteShareTrack.\n */\n setRemoteStream(remoteStream) {\n LoggerProxy.logger.warn('Media:properties#setRemoteStream --> [DEPRECATION WARNING]: setRemoteStream has been deprecated after v1.89.3 (use setRemoteAudioTrack, setRemoteVideoTrack instead)');\n // calls setter\n this.remoteStream = remoteStream;\n }\n\n setRemoteShare(remoteShare) {\n this.remoteShare = remoteShare;\n }\n\n /**\n * Sets the remote audio track\n * @param {MediaTrack} remoteAudioTrack MediaTrack to save\n * @returns {void}\n */\n setRemoteAudioTrack(remoteAudioTrack) {\n this.remoteAudioTrack = remoteAudioTrack;\n }\n\n /**\n * Sets the remote video track\n * @param {MediaTrack} remoteVideoTrack MediaTrack to save\n * @returns {void}\n */\n setRemoteVideoTrack(remoteVideoTrack) {\n this.remoteVideoTrack = remoteVideoTrack;\n }\n\n /**\n * Stores the preferred video input device\n * @param {string} deviceId Preferred video input device\n * @returns {void}\n */\n setVideoDeviceId(deviceId) {\n this.videoDeviceId = deviceId;\n }\n\n unsetPeerConnection() {\n this.peerConnection = null;\n }\n\n reInitiatePeerconnection() {\n this.peerConnection = MediaUtil.createPeerConnection();\n }\n\n unsetLocalVideoTrack() {\n this.videoTrack = null;\n }\n\n unsetLocalShareTrack() {\n this.shareTrack = null;\n }\n\n unsetLocalAudioTrack() {\n this.audioTrack = null;\n }\n\n /**\n * Removes remote stream from class instance\n * @deprecated after v1.89.3\n * @returns {void}\n */\n unsetRemoteStream() {\n LoggerProxy.logger.warn('Media:properties#unsetRemoteStream --> [DEPRECATION WARNING]: unsetRemoteStream has been deprecated after v1.89.3 (use unsetRemoteTracks instead)');\n // unsets audio and video only\n this.unsetRemoteMedia();\n }\n\n /**\n * Removes both remote audio and video from class instance\n * @returns {void}\n */\n unsetRemoteMedia() {\n this.remoteAudioTrack = null;\n this.remoteVideoTrack = null;\n }\n\n unsetRemoteShare() {\n this.remoteShare = null;\n }\n\n unsetLocalVideoTracks() {\n this.unsetLocalVideoTrack();\n this.unsetLocalShareTrack();\n }\n\n /**\n * Removes remote stream and remote share from class instance\n * @deprecated after v1.89.3\n * @returns {void}\n */\n unsetRemoteStreams() {\n LoggerProxy.logger.warn('Media:properties#unsetRemoteStreams --> [DEPRECATION WARNING]: unsetRemoteStreams has been deprecated after v1.89.3 (use unsetRemoteTracks instead)');\n this.unsetRemoteStream();\n this.unsetRemoteShare();\n }\n\n /**\n * Unsets all remote tracks\n * @returns {void}\n */\n unsetRemoteTracks() {\n this.unsetRemoteMedia();\n this.unsetRemoteShare();\n }\n\n unsetShareStreams() {\n this.unsetLocalShareTrack();\n this.unsetRemoteShare();\n }\n\n /**\n * Removes both local and remote video stream from class instance\n * @deprecated after v1.89.3\n * @returns {void}\n */\n unsetMediaStreams() {\n LoggerProxy.logger.warn('Media:properties#unsetMediaStreams --> [DEPRECATION WARNING]: unsetMediaStreams has been deprecated after v1.89.3 (use unsetMediaTracks instead)');\n this.unsetLocalVideoTrack();\n this.unsetRemoteStream();\n }\n\n /**\n * Removes both local and remote video stream from class instance\n * @returns {void}\n */\n un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Z,oBAAA,CAAYC,MAAZ,CAAmBC,IAAnB,CAAwB,kJAAxB;;MACA,KAAKO,oBAAL;MACA,KAAKE,iBAAL;IACD;IAED;AACF;AACA;AACA;;;;WACE,4BAAmB;MACjB,KAAKF,oBAAL;MACA,KAAKD,gBAAL;IACD"}
1
+ {"version":3,"names":["MediaProperties","options","MEETINGS","peerConnection","MediaUtil","createPeerConnection","mediaDirection","videoTrack","audioTrack","shareTrack","remoteShare","remoteAudioTrack","remoteVideoTrack","localQualityLevel","QUALITY_LEVELS","HIGH","remoteQualityLevel","mediaSettings","videoDeviceId","type","values","deviceId","LoggerProxy","logger","warn","unsetRemoteMedia","unsetLocalVideoTrack","unsetLocalShareTrack","unsetRemoteStream","unsetRemoteShare"],"sources":["properties.js"],"sourcesContent":["import {\n MEETINGS,\n QUALITY_LEVELS\n} from '../constants';\nimport LoggerProxy from '../common/logs/logger-proxy';\n\nimport MediaUtil from './util';\n\n/**\n * @class MediaProperties\n */\nexport default class MediaProperties {\n namespace = MEETINGS;\n\n /**\n * @param {Object} [options] -- to auto construct\n * @returns {MediaProperties}\n */\n constructor(options = {}) {\n this.peerConnection = MediaUtil.createPeerConnection();\n this.mediaDirection = options.mediaDirection;\n this.videoTrack = options.videoTrack;\n this.audioTrack = options.audioTrack;\n this.shareTrack = options.shareTrack;\n this.remoteShare = options.remoteShare;\n this.remoteAudioTrack = options.remoteAudioTrack;\n this.remoteVideoTrack = options.remoteVideoTrack;\n this.localQualityLevel = options.localQualityLevel || QUALITY_LEVELS.HIGH;\n this.remoteQualityLevel = options.remoteQualityLevel || QUALITY_LEVELS.HIGH;\n this.mediaSettings = {};\n this.videoDeviceId = null;\n }\n\n /**\n * Retrieves the preferred video input device\n * @returns {Object|null}\n */\n getVideoDeviceId() {\n return this.videoDeviceId || null;\n }\n\n setMediaDirection(mediaDirection) {\n this.mediaDirection = mediaDirection;\n }\n\n setMediaSettings(type, values) {\n this.mediaSettings[type] = values;\n }\n\n setMediaPeerConnection(peerConnection) {\n this.peerConnection = peerConnection;\n }\n\n setLocalVideoTrack(videoTrack) {\n this.videoTrack = videoTrack;\n }\n\n setLocalAudioTrack(audioTrack) {\n this.audioTrack = audioTrack;\n }\n\n setLocalQualityLevel(localQualityLevel) {\n this.localQualityLevel = localQualityLevel;\n }\n\n setLocalShareTrack(shareTrack) {\n this.shareTrack = shareTrack;\n }\n\n setRemoteQualityLevel(remoteQualityLevel) {\n this.remoteQualityLevel = remoteQualityLevel;\n }\n\n setRemoteShare(remoteShare) {\n this.remoteShare = remoteShare;\n }\n\n /**\n * Sets the remote audio track\n * @param {MediaTrack} remoteAudioTrack MediaTrack to save\n * @returns {void}\n */\n setRemoteAudioTrack(remoteAudioTrack) {\n this.remoteAudioTrack = remoteAudioTrack;\n }\n\n /**\n * Sets the remote video track\n * @param {MediaTrack} remoteVideoTrack MediaTrack to save\n * @returns {void}\n */\n setRemoteVideoTrack(remoteVideoTrack) {\n this.remoteVideoTrack = remoteVideoTrack;\n }\n\n /**\n * Stores the preferred video input device\n * @param {string} deviceId Preferred video input device\n * @returns {void}\n */\n setVideoDeviceId(deviceId) {\n this.videoDeviceId = deviceId;\n }\n\n unsetPeerConnection() {\n this.peerConnection = null;\n }\n\n reInitiatePeerconnection() {\n this.peerConnection = MediaUtil.createPeerConnection();\n }\n\n unsetLocalVideoTrack() {\n this.videoTrack = null;\n }\n\n unsetLocalShareTrack() {\n this.shareTrack = null;\n }\n\n unsetLocalAudioTrack() {\n this.audioTrack = null;\n }\n\n /**\n * Removes remote stream from class instance\n * @deprecated after v1.89.3\n * @returns {void}\n */\n unsetRemoteStream() {\n LoggerProxy.logger.warn('Media:properties#unsetRemoteStream --> [DEPRECATION WARNING]: unsetRemoteStream has been deprecated after v1.89.3 (use unsetRemoteTracks instead)');\n // unsets audio and video only\n this.unsetRemoteMedia();\n }\n\n /**\n * Removes both remote audio and video from class instance\n * @returns {void}\n */\n unsetRemoteMedia() {\n this.remoteAudioTrack = null;\n this.remoteVideoTrack = null;\n }\n\n unsetRemoteShare() {\n this.remoteShare = null;\n }\n\n unsetLocalVideoTracks() {\n this.unsetLocalVideoTrack();\n this.unsetLocalShareTrack();\n }\n\n /**\n * Removes remote stream and remote share from class instance\n * @deprecated after v1.89.3\n * @returns {void}\n */\n unsetRemoteStreams() {\n LoggerProxy.logger.warn('Media:properties#unsetRemoteStreams --> [DEPRECATION WARNING]: unsetRemoteStreams has been deprecated after v1.89.3 (use unsetRemoteTracks instead)');\n this.unsetRemoteStream();\n this.unsetRemoteShare();\n }\n\n /**\n * Unsets all remote tracks\n * @returns {void}\n */\n unsetRemoteTracks() {\n this.unsetRemoteMedia();\n this.unsetRemoteShare();\n }\n\n unsetShareStreams() {\n this.unsetLocalShareTrack();\n this.unsetRemoteShare();\n }\n\n /**\n * Removes both local and remote video stream from class instance\n * @deprecated after v1.89.3\n * @returns {void}\n */\n unsetMediaStreams() {\n LoggerProxy.logger.warn('Media:properties#unsetMediaStreams --> [DEPRECATION WARNING]: unsetMediaStreams has been deprecated after v1.89.3 (use unsetMediaTracks instead)');\n this.unsetLocalVideoTrack();\n this.unsetRemoteStream();\n }\n\n /**\n * Removes both local and remote video stream from class instance\n * @returns {void}\n */\n unsetMediaTracks() {\n this.unsetLocalVideoTrack();\n this.unsetRemoteMedia();\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;AAIA;;AAEA;;AAEA;AACA;AACA;IACqBA,e;EAGnB;AACF;AACA;AACA;EACE,2BAA0B;IAAA,IAAdC,OAAc,uEAAJ,EAAI;IAAA;IAAA,iDANdC,mBAMc;IACxB,KAAKC,cAAL,GAAsBC,aAAA,CAAUC,oBAAV,EAAtB;IACA,KAAKC,cAAL,GAAsBL,OAAO,CAACK,cAA9B;IACA,KAAKC,UAAL,GAAkBN,OAAO,CAACM,UAA1B;IACA,KAAKC,UAAL,GAAkBP,OAAO,CAACO,UAA1B;IACA,KAAKC,UAAL,GAAkBR,OAAO,CAACQ,UAA1B;IACA,KAAKC,WAAL,G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BAAL;MACA,KAAKE,iBAAL;IACD;IAED;AACF;AACA;AACA;;;;WACE,4BAAmB;MACjB,KAAKF,oBAAL;MACA,KAAKD,gBAAL;IACD"}
@@ -44,7 +44,7 @@ var createMuteState = function createMuteState(type, meeting, mediaDirection) {
44
44
 
45
45
  return new MuteState(type, meeting);
46
46
  };
47
- /* The purpose of this class is to manage the local and remote mute state and make sure that the server state always matches
47
+ /** The purpose of this class is to manage the local and remote mute state and make sure that the server state always matches
48
48
  the last requested state by the client.
49
49
 
50
50
  More info about Locus muting API: https://sqbu-github.cisco.com/pages/WebExSquared/locus/guides/mute.html#
@@ -52,6 +52,12 @@ var createMuteState = function createMuteState(type, meeting, mediaDirection) {
52
52
 
53
53
 
54
54
  var MuteState = /*#__PURE__*/function () {
55
+ /**
56
+ * Constructor
57
+ *
58
+ * @param {String} type - audio or video
59
+ * @param {Object} meeting - the meeting object (used for reading current remote mute status)
60
+ */
55
61
  function MuteState(type, meeting) {
56
62
  (0, _classCallCheck2.default)(this, MuteState);
57
63
 
@@ -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.js"],"sourcesContent":["\nimport 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 '../meeting/util';\nimport {AUDIO, VIDEO} from '../constants';\n\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(`Meeting:muteState#createMuteState --> ${type}: creating MuteState for meeting id ${meeting?.id}`);\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 constructor(type, meeting) {\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 handleClientRequest(meeting, mute) {\n LoggerProxy.logger.info(`Meeting:muteState#handleClientRequest --> ${this.type}: user requesting new mute state: ${mute}`);\n\n if (!mute && !this.state.server.unmuteAllowed) {\n return Promise.reject(new PermissionError('User is not allowed to unmute self (hard mute feature is being used)'));\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 applyClientStateLocally(meeting) {\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 applyClientStateToServer(meeting) {\n if (this.state.syncToServerInProgress) {\n LoggerProxy.logger.info(`Meeting:muteState#applyClientStateToServer --> ${this.type}: request to server in progress, we need to wait for it to complete`);\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(`Meeting:muteState#applyClientStateToServer --> ${this.type}: localMuteRequiresSync: ${localMuteRequiresSync} (${this.state.client.localMute} ?= ${this.state.server.localMute})`);\n LoggerProxy.logger.info(`Meeting:muteState#applyClientStateToServer --> ${this.type}: remoteMuteRequiresSync: ${remoteMuteRequiresSync}`);\n\n if (!localMuteRequiresSync && !remoteMuteRequiresSync) {\n LoggerProxy.logger.info(`Meeting:muteState#applyClientStateToServer --> ${this.type}: client state already matching server state, nothing to do`);\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) ? this.sendLocalMuteRequestToServer(meeting) : Promise.resolve();\n\n localMuteSyncPromise\n .then(() =>\n // then follow it up with remote mute sync\n ((remoteMuteRequiresSync) ? this.sendRemoteMuteRequestToServer(meeting) : Promise.resolve()))\n .then(() => {\n this.state.syncToServerInProgress = false;\n LoggerProxy.logger.info(`Meeting:muteState#applyClientStateToServer --> ${this.type}: sync with server completed`);\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 sendLocalMuteRequestToServer(meeting) {\n const audioMuted = (this.type === AUDIO) ? this.state.client.localMute : meeting.audio?.state.client.localMute;\n const videoMuted = (this.type === VIDEO) ? this.state.client.localMute : meeting.video?.state.client.localMute;\n\n LoggerProxy.logger.info(`Meeting:muteState#sendLocalMuteRequestToServer --> ${this.type}: sending local mute (audio=${audioMuted}, video=${videoMuted}) to server`);\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 /**\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 sendRemoteMuteRequestToServer(meeting) {\n if (this.type === AUDIO) {\n const remoteMute = this.state.client.localMute;\n\n LoggerProxy.logger.info(`Meeting:muteState#sendRemoteMuteRequestToServer --> ${this.type}: sending remote mute:${remoteMute} to server`);\n\n return meeting.members.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 handleServerRemoteMuteUpdate(muted, unmuteAllowed) {\n LoggerProxy.logger.info(`Meeting:muteState#handleServerRemoteMuteUpdate --> ${this.type}: updating server remoteMute to (${muted})`);\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 handleServerLocalUnmuteRequired(meeting) {\n LoggerProxy.logger.info(`Meeting:muteState#handleServerLocalUnmuteRequired --> ${this.type}: localAudioUnmuteRequired received -> doing local unmute`);\n\n this.state.server.remoteMute = false;\n this.state.client.localMute = false;\n\n if (this.pendingPromiseReject) {\n this.pendingPromiseReject(new Error('Server requested local unmute - this overrides any client request in progress'));\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 isMuted() {\n return this.state.client.localMute || this.state.server.localMute || this.state.server.remoteMute;\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 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":";;;;;;;;;;;;;;;;;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAGA;AACA;AACA;AAEA,IAAMA,eAAe,GAAG,SAAlBA,eAAkB,CAACC,IAAD,EAAOC,OAAP,EAAgBC,cAAhB,EAAmC;EACzD,IAAIF,IAAI,KAAKG,gBAAT,IAAkB,CAACD,cAAc,CAACE,SAAtC,EAAiD;IAC/C,OAAO,IAAP;EACD;;EACD,IAAIJ,IAAI,KAAKK,gBAAT,IAAkB,CAACH,cAAc,CAACI,SAAtC,EAAiD;IAC/C,OAAO,IAAP;EACD;;EAEDC,oBAAA,CAAYC,MAAZ,CAAmBC,IAAnB,iDAAiET,IAAjE,iDAA4GC,OAA5G,aAA4GA,OAA5G,uBA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;IAED;AACF;AACA;AACA;AACA;AACA;AACA;AACA;;;;WACE,yCAAgClB,OAAhC,EAAyC;MACvCM,oBAAA,CAAYC,MAAZ,CAAmBC,IAAnB,iEAAiF,KAAKT,IAAtF;;MAEA,KAAKa,KAAL,CAAWG,MAAX,CAAkBC,UAAlB,GAA+B,KAA/B;MACA,KAAKJ,KAAL,CAAWC,MAAX,CAAkBC,SAAlB,GAA8B,KAA9B;;MAEA,IAAI,KAAKO,oBAAT,EAA+B;QAC7B,KAAKA,oBAAL,CAA0B,IAAImC,KAAJ,CAAU,+EAAV,CAA1B;QACA,KAAKpC,qBAAL,GAA6B,IAA7B;QACA,KAAKC,oBAAL,GAA4B,IAA5B;MACD;;MAED,KAAKI,uBAAL,CAA6BzB,OAA7B;MACA,KAAK2B,wBAAL,CAA8B3B,OAA9B;IACD;IAED;AACF;AACA;AACA;AACA;AACA;AACA;;;;WACE,mBAAU;MACR,OAAO,KAAKY,KAAL,CAAWC,MAAX,CAAkBC,SAAlB,IAA+B,KAAKF,KAAL,CAAWG,MAAX,CAAkBD,SAAjD,IAA8D,KAAKF,KAAL,CAAWG,MAAX,CAAkBC,UAAvF;IACD;IAED;AACF;AACA;AACA;AACA;AACA;AACA;;;;WACE,kBAAS;MACP,OAAO,KAAKJ,KAAL,CAAWC,MAAX,CAAkBC,SAAlB,IAA+B,CAAC,KAAKF,KAAL,CAAWG,MAAX,CAAkBC,UAAzD;IACD,C,CAED;;;;SACA,eAAY;MACV,OAAO,KAAKyC,OAAL,EAAP;IACD,C,CAED;;;;SACA,eAAW;MACT,OAAO,KAAKC,MAAL,EAAP;IACD;;;;;eAGY5D,e"}
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.js"],"sourcesContent":["\nimport 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 '../meeting/util';\nimport {AUDIO, VIDEO} from '../constants';\n\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(`Meeting:muteState#createMuteState --> ${type}: creating MuteState for meeting id ${meeting?.id}`);\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 /**\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, meeting) {\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 handleClientRequest(meeting, mute) {\n LoggerProxy.logger.info(`Meeting:muteState#handleClientRequest --> ${this.type}: user requesting new mute state: ${mute}`);\n\n if (!mute && !this.state.server.unmuteAllowed) {\n return Promise.reject(new PermissionError('User is not allowed to unmute self (hard mute feature is being used)'));\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 applyClientStateLocally(meeting) {\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 applyClientStateToServer(meeting) {\n if (this.state.syncToServerInProgress) {\n LoggerProxy.logger.info(`Meeting:muteState#applyClientStateToServer --> ${this.type}: request to server in progress, we need to wait for it to complete`);\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(`Meeting:muteState#applyClientStateToServer --> ${this.type}: localMuteRequiresSync: ${localMuteRequiresSync} (${this.state.client.localMute} ?= ${this.state.server.localMute})`);\n LoggerProxy.logger.info(`Meeting:muteState#applyClientStateToServer --> ${this.type}: remoteMuteRequiresSync: ${remoteMuteRequiresSync}`);\n\n if (!localMuteRequiresSync && !remoteMuteRequiresSync) {\n LoggerProxy.logger.info(`Meeting:muteState#applyClientStateToServer --> ${this.type}: client state already matching server state, nothing to do`);\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) ? this.sendLocalMuteRequestToServer(meeting) : Promise.resolve();\n\n localMuteSyncPromise\n .then(() =>\n // then follow it up with remote mute sync\n ((remoteMuteRequiresSync) ? this.sendRemoteMuteRequestToServer(meeting) : Promise.resolve()))\n .then(() => {\n this.state.syncToServerInProgress = false;\n LoggerProxy.logger.info(`Meeting:muteState#applyClientStateToServer --> ${this.type}: sync with server completed`);\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 sendLocalMuteRequestToServer(meeting) {\n const audioMuted = (this.type === AUDIO) ? this.state.client.localMute : meeting.audio?.state.client.localMute;\n const videoMuted = (this.type === VIDEO) ? this.state.client.localMute : meeting.video?.state.client.localMute;\n\n LoggerProxy.logger.info(`Meeting:muteState#sendLocalMuteRequestToServer --> ${this.type}: sending local mute (audio=${audioMuted}, video=${videoMuted}) to server`);\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 /**\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 sendRemoteMuteRequestToServer(meeting) {\n if (this.type === AUDIO) {\n const remoteMute = this.state.client.localMute;\n\n LoggerProxy.logger.info(`Meeting:muteState#sendRemoteMuteRequestToServer --> ${this.type}: sending remote mute:${remoteMute} to server`);\n\n return meeting.members.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 handleServerRemoteMuteUpdate(muted, unmuteAllowed) {\n LoggerProxy.logger.info(`Meeting:muteState#handleServerRemoteMuteUpdate --> ${this.type}: updating server remoteMute to (${muted})`);\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 handleServerLocalUnmuteRequired(meeting) {\n LoggerProxy.logger.info(`Meeting:muteState#handleServerLocalUnmuteRequired --> ${this.type}: localAudioUnmuteRequired received -> doing local unmute`);\n\n this.state.server.remoteMute = false;\n this.state.client.localMute = false;\n\n if (this.pendingPromiseReject) {\n this.pendingPromiseReject(new Error('Server requested local unmute - this overrides any client request in progress'));\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 isMuted() {\n return this.state.client.localMute || this.state.server.localMute || this.state.server.remoteMute;\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 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":";;;;;;;;;;;;;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E,kBAAS;MACP,OAAO,KAAKJ,KAAL,CAAWC,MAAX,CAAkBC,SAAlB,IAA+B,CAAC,KAAKF,KAAL,CAAWG,MAAX,CAAkBC,UAAzD;IACD,C,CAED;;;;SACA,eAAY;MACV,OAAO,KAAKyC,OAAL,EAAP;IACD,C,CAED;;;;SACA,eAAW;MACT,OAAO,KAAKC,MAAL,EAAP;IACD;;;;;eAGY5D,e"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webex/plugin-meetings",
3
- "version": "2.21.0",
3
+ "version": "2.21.1",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "contributors": [
@@ -24,15 +24,15 @@
24
24
  },
25
25
  "dependencies": {
26
26
  "@babel/runtime-corejs2": "^7.14.8",
27
- "@webex/webex-core": "2.21.0",
28
- "@webex/internal-plugin-mercury": "2.21.0",
29
- "@webex/internal-plugin-conversation": "2.21.0",
27
+ "@webex/webex-core": "2.21.1",
28
+ "@webex/internal-plugin-mercury": "2.21.1",
29
+ "@webex/internal-plugin-conversation": "2.21.1",
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.21.0",
35
+ "@webex/common": "2.21.1",
36
36
  "bowser": "^2.11.0",
37
37
  "sdp-transform": "^2.12.0",
38
38
  "btoa": "^1.2.1",
@@ -29,24 +29,6 @@ export default class MediaProperties {
29
29
  this.remoteQualityLevel = options.remoteQualityLevel || QUALITY_LEVELS.HIGH;
30
30
  this.mediaSettings = {};
31
31
  this.videoDeviceId = null;
32
-
33
- // deprecated after v1.89.3, remove when feasible.
34
- // backwards compatible code.
35
- Object.defineProperty(this, 'remoteStream', {
36
- set: (stream) => {
37
- const audio = stream.getAudioTracks();
38
- const video = stream.getVideoTracks();
39
-
40
- this.remoteAudioTrack = audio.length && audio[0];
41
- this.remoteVideoTrack = video.length && video[0];
42
- },
43
- get: () => {
44
- LoggerProxy.logger.warn('Media:properties#remoteStream --> [DEPRECATION WARNING]: remoteStream (getter) has been deprecated after v1.89.3 (use remoteAudioTrack, remoteVideoTrack instead)');
45
-
46
- // return if set or create a stream for backwards compatibility
47
- return MediaUtil.createMediaStream([this.remoteAudioTrack, this.remoteVideoTrack]);
48
- }
49
- });
50
32
  }
51
33
 
52
34
  /**
@@ -89,19 +71,6 @@ export default class MediaProperties {
89
71
  this.remoteQualityLevel = remoteQualityLevel;
90
72
  }
91
73
 
92
- /**
93
- * @deprecated after v1.89.3
94
- * @param {remoteStream} remoteStream Sets remote media stream
95
- * @returns {null}
96
- * Use setRemoteAudioTrack, setRemoteVideoTrack
97
- * and setRemoteShareTrack.
98
- */
99
- setRemoteStream(remoteStream) {
100
- LoggerProxy.logger.warn('Media:properties#setRemoteStream --> [DEPRECATION WARNING]: setRemoteStream has been deprecated after v1.89.3 (use setRemoteAudioTrack, setRemoteVideoTrack instead)');
101
- // calls setter
102
- this.remoteStream = remoteStream;
103
- }
104
-
105
74
  setRemoteShare(remoteShare) {
106
75
  this.remoteShare = remoteShare;
107
76
  }
@@ -24,12 +24,18 @@ const createMuteState = (type, meeting, mediaDirection) => {
24
24
  return new MuteState(type, meeting);
25
25
  };
26
26
 
27
- /* The purpose of this class is to manage the local and remote mute state and make sure that the server state always matches
27
+ /** The purpose of this class is to manage the local and remote mute state and make sure that the server state always matches
28
28
  the last requested state by the client.
29
29
 
30
30
  More info about Locus muting API: https://sqbu-github.cisco.com/pages/WebExSquared/locus/guides/mute.html#
31
31
  */
32
32
  class MuteState {
33
+ /**
34
+ * Constructor
35
+ *
36
+ * @param {String} type - audio or video
37
+ * @param {Object} meeting - the meeting object (used for reading current remote mute status)
38
+ */
33
39
  constructor(type, meeting) {
34
40
  if ((type !== AUDIO) && (type !== VIDEO)) {
35
41
  throw new ParameterError('Mute state is designed for handling audio or video only');