@webex/plugin-meetings 3.0.0-beta.170 → 3.0.0-beta.171

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.
@@ -261,9 +261,8 @@ var ReconnectionManager = /*#__PURE__*/function () {
261
261
  while (1) switch (_context.prev = _context.next) {
262
262
  case 0:
263
263
  _context.next = 2;
264
- return this.meeting.unpublishTracks([this.meeting.mediaProperties.shareTrack]);
264
+ return this.meeting.unpublishTracks([this.meeting.mediaProperties.shareVideoTrack, this.meeting.mediaProperties.shareAudioTrack]);
265
265
  case 2:
266
- // todo screen share audio SPARK-399690
267
266
  _triggerProxy.default.trigger(this.meeting, {
268
267
  file: 'reconnection-manager/index',
269
268
  function: 'stopLocalShareTrack'
@@ -1 +1 @@
1
- {"version":3,"names":["NeedsRetryError","Error","NeedsRejoinError","wasSharing","error","ReconnectionManager","meeting","iceState","disconnected","resolve","timer","undefined","timeoutDuration","config","reconnection","iceReconnectionTimeout","status","RECONNECTION","STATE","DEFAULT_STATUS","tryCount","DEFAULT_TRY_COUNT","webex","maxRejoinAttempts","rejoinAttempts","autoRejoinEnabled","autoRejoin","reset","clearTimeout","LoggerProxy","logger","log","resetReconnectionTimer","reject","setTimeout","reason","unpublishTracks","mediaProperties","shareTrack","Trigger","trigger","file","function","EVENT_TRIGGERS","MEETING_STOPPED_SHARING_LOCAL","IN_PROGRESS","enabled","COMPLETE","info","ReconnectInProgress","ReconnectionError","networkDisconnect","networkRetry","id","validate","internal","newMetrics","submitClientEvent","name","options","meetingId","executeReconnection","then","payload","recoveredBy","catch","reconnectError","reconnect","message","errors","category","errorCode","fatal","shownToUser","rejoinMeeting","shareStatus","SHARE_STATUS","LOCAL_SHARE_ACTIVE","stopLocalShareTrack","SHARE_STOPPED_REASON","MEDIA_RECONNECTION","reconnectMercuryWebSocket","device","url","FAILURE","meetings","syncMeetings","getMeetingByType","_ID_","state","_LEFT_","type","_CALL_","reconnectMedia","media","join","rejoin","MEETING_REJOIN","Metrics","sendBehavioralMetric","BEHAVIORAL_METRICS","MEETING_MAX_REJOIN_FAILURE","locus_id","locusUrl","split","pop","stack","roap","doTurnDiscovery","turnServerResult","iceServers","turnServerInfo","push","urls","username","credential","password","webrtcMediaConnection","isMultistream","mediaRequestManagers","forEach","mediaRequestManager","clearPreviousRequests","commit","mercury","connected","disconnect","connect"],"sources":["index.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\n/* eslint-disable no-warning-comments */\n\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport Trigger from '../common/events/trigger-proxy';\nimport {\n EVENT_TRIGGERS,\n RECONNECTION,\n SHARE_STATUS,\n SHARE_STOPPED_REASON,\n _CALL_,\n _LEFT_,\n _ID_,\n} from '../constants';\nimport BEHAVIORAL_METRICS from '../metrics/constants';\nimport ReconnectionError from '../common/errors/reconnection';\nimport ReconnectInProgress from '../common/errors/reconnection-in-progress';\nimport Metrics from '../metrics';\nimport Meeting from '../meeting';\nimport {MediaRequestManager} from '../multistream/mediaRequestManager';\n\n/**\n * Used to indicate that the reconnect logic needs to be retried.\n *\n * @class NeedsRetryError\n * @extends {Error}\n */\nclass NeedsRetryError extends Error {}\n\n/**\n * Used to indicate that the meeting needs to be rejoined, not just media reconnected\n *\n * @class NeedsRejoinError\n * @extends {Error}\n */\nclass NeedsRejoinError extends Error {\n wasSharing: any;\n\n /**\n * Creates an instance of NeedsRejoinError.\n * @param {Object} params\n * @param {boolean} params.wasSharing\n * @param {Error} params.error\n * @memberof NeedsRejoinError\n */\n constructor({\n wasSharing,\n error = new Error('Meeting needs to be rejoined'),\n }: {\n wasSharing?: boolean;\n error?: Error;\n }) {\n // @ts-ignore\n super(error);\n\n this.wasSharing = wasSharing;\n }\n}\n\n/**\n * @export\n * @class ReconnectionManager\n */\nexport default class ReconnectionManager {\n autoRejoinEnabled: any;\n iceState: any;\n maxRejoinAttempts: any;\n meeting: any;\n rejoinAttempts: any;\n shareStatus: any;\n status: any;\n tryCount: any;\n webex: any;\n /**\n * @param {Meeting} meeting\n */\n constructor(meeting: Meeting) {\n /**\n * Stores ICE reconnection state data.\n *\n * @instance\n * @type {Object}\n * @private\n * @memberof ReconnectionManager\n */\n this.iceState = {\n disconnected: false,\n resolve: () => {},\n timer: undefined,\n // @ts-ignore\n timeoutDuration: meeting.config.reconnection.iceReconnectionTimeout,\n };\n\n /**\n * @instance\n * @type {String}\n * @private\n * @memberof ReconnectionManager\n */\n this.status = RECONNECTION.STATE.DEFAULT_STATUS;\n /**\n * @instance\n * @type {Number}\n * @private\n * @memberof ReconnectionManager\n */\n this.tryCount = RECONNECTION.STATE.DEFAULT_TRY_COUNT;\n /**\n * @instance\n * @type {Object}\n * @private\n * @memberof ReconnectionManager\n */\n // TODO : change this logic to not save the meeting instance\n // It gets complicated when meeting ends on remote side , We have a old meeting instance which is not up to date\n // @ts-ignore\n this.webex = meeting.webex;\n /**\n * @instance\n * @type {Meeting}\n * @private\n * @memberof ReconnectionManager\n */\n // TODO: try removing the circular dependency for meeting and reconnection manager\n // try moving this to meetings collection\n this.meeting = meeting;\n\n // @ts-ignore\n this.maxRejoinAttempts = meeting.config.reconnection.maxRejoinAttempts;\n this.rejoinAttempts = RECONNECTION.STATE.DEFAULT_TRY_COUNT;\n // @ts-ignore\n this.autoRejoinEnabled = meeting.config.reconnection.autoRejoin;\n\n // Make sure reconnection state is in default\n this.reset();\n }\n\n /**\n * @public\n * @memberof ReconnectionManager\n * @returns {void}\n */\n resetReconnectionTimer() {\n this.iceState.resolve();\n this.iceState.resolve = () => {};\n\n if (this.iceState.timer) {\n clearTimeout(this.iceState.timer);\n delete this.iceState.timer;\n }\n }\n\n /**\n * Sets the iceState to connected and clears any disconnect timeouts and\n * related timeout data within the iceState.\n *\n * @returns {undefined}\n * @public\n * @memberof ReconnectionManager\n */\n public iceReconnected() {\n if (this.iceState.disconnected) {\n LoggerProxy.logger.log('ReconnectionManager:index#iceReconnected --> ice has reconnected');\n\n this.resetReconnectionTimer();\n\n this.iceState.disconnected = false;\n }\n }\n\n /**\n * Set the iceState to disconnected and generates a timeout that waits for the\n * iceState to reconnect and then resolves. If the ice state is already\n * processing a reconnect, it immediately resolves. Rejects if the timeout\n * duration is reached.\n *\n * @returns {Promise<undefined>}\n * @public\n * @memberof ReconnectionManager\n */\n public waitForIceReconnect() {\n if (!this.iceState.disconnected) {\n LoggerProxy.logger.log(\n 'ReconnectionManager:index#waitForIceReconnect --> waiting for ice reconnect'\n );\n\n this.iceState.disconnected = true;\n\n return new Promise<void>((resolve, reject) => {\n this.iceState.timer = setTimeout(() => {\n if (this.iceState.disconnected === false) {\n resolve();\n } else {\n this.iceState.disconnected = false;\n reject(\n new Error(`ice reconnection did not occur in ${this.iceState.timeoutDuration}ms`)\n );\n }\n }, this.iceState.timeoutDuration);\n\n this.iceState.resolve = resolve;\n });\n }\n\n // return a resolved promise to prevent multiple catch executions of reconnect\n return Promise.resolve();\n }\n\n /**\n * @returns {undefined}\n * @public\n * @memberof ReconnectionManager\n */\n public reset() {\n this.status = RECONNECTION.STATE.DEFAULT_STATUS;\n this.tryCount = RECONNECTION.STATE.DEFAULT_TRY_COUNT;\n this.rejoinAttempts = RECONNECTION.STATE.DEFAULT_TRY_COUNT;\n }\n\n /**\n * @returns {undefined}\n * @public\n * @memberof ReconnectionManager\n */\n public cleanUp() {\n this.reset();\n this.meeting = null;\n }\n\n /**\n * Stop the local share track.\n *\n * @param {string} reason a {@link SHARE_STOPPED_REASON}\n * @returns {undefined}\n * @private\n * @memberof ReconnectionManager\n */\n private async stopLocalShareTrack(reason: string) {\n await this.meeting.unpublishTracks([this.meeting.mediaProperties.shareTrack]); // todo screen share audio SPARK-399690\n Trigger.trigger(\n this.meeting,\n {\n file: 'reconnection-manager/index',\n function: 'stopLocalShareTrack',\n },\n EVENT_TRIGGERS.MEETING_STOPPED_SHARING_LOCAL,\n {\n reason,\n }\n );\n }\n\n /**\n * @public\n * @memberof ReconnectionManager\n * @returns {Boolean} true if reconnection operation is in progress\n */\n isReconnectInProgress() {\n return this.status === RECONNECTION.STATE.IN_PROGRESS;\n }\n\n /**\n * @returns {Boolean}\n * @throws {ReconnectionError}\n * @private\n * @memberof ReconnectionManager\n */\n private validate() {\n if (this.meeting.config.reconnection.enabled) {\n if (\n this.status === RECONNECTION.STATE.DEFAULT_STATUS ||\n this.status === RECONNECTION.STATE.COMPLETE\n ) {\n return true;\n }\n\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#validate --> Reconnection already in progress.'\n );\n\n throw new ReconnectInProgress('Reconnection already in progress.');\n }\n\n LoggerProxy.logger.info('ReconnectionManager:index#validate --> Reconnection is not enabled.');\n\n throw new ReconnectionError('Reconnection is not enabled.');\n }\n\n /**\n * Initiates a media reconnect for the active meeting\n * @param {Object} reconnectOptions\n * @param {boolean} [reconnectOptions.networkDisconnect=false] indicates if a network disconnect event happened\n * @param {boolean} [reconnectOptions.networkRetry=false] indicates if we are retrying the reconnect\n * @returns {Promise}\n * @public\n * @memberof ReconnectionManager\n */\n public async reconnect({\n networkDisconnect = false,\n networkRetry = false,\n }: {\n networkDisconnect?: boolean;\n networkRetry?: boolean;\n } = {}) {\n LoggerProxy.logger.info(\n `ReconnectionManager:index#reconnect --> Reconnection start for meeting ${this.meeting.id}.`\n );\n // First, validate that we can reconnect, if not, it will throw an error\n try {\n this.validate();\n } catch (error) {\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#reconnect --> Reconnection unable to begin.',\n error\n );\n throw error;\n }\n\n if (!networkRetry) {\n // Only log START metrics on the initial reconnect\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#reconnect --> Sending reconnect start metric.'\n );\n\n // @ts-ignore\n this.webex.internal.newMetrics.submitClientEvent({\n name: 'client.media.reconnecting',\n options: {\n meetingId: this.meeting.id,\n },\n });\n }\n\n return this.executeReconnection({networkDisconnect})\n .then(() => {\n LoggerProxy.logger.info('ReconnectionManager:index#reconnect --> Reconnection successful.');\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#reconnect --> Sending reconnect success metric.'\n );\n\n // @ts-ignore\n this.webex.internal.newMetrics.submitClientEvent({\n name: 'client.media.recovered',\n payload: {\n recoveredBy: 'new',\n },\n options: {\n meetingId: this.meeting.id,\n },\n });\n })\n .catch((reconnectError) => {\n if (reconnectError instanceof NeedsRetryError) {\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#reconnect --> Reconnection not successful, retrying.'\n );\n // Reset our reconnect status since we are looping back to the beginning\n this.status = RECONNECTION.STATE.DEFAULT_STATUS;\n\n // This is a network retry, so we should not log START metrics again\n return this.reconnect({networkDisconnect: true, networkRetry: true});\n }\n\n // Reconnect has failed\n LoggerProxy.logger.error(\n 'ReconnectionManager:index#reconnect --> Reconnection failed.',\n reconnectError.message\n );\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#reconnect --> Sending reconnect abort metric.'\n );\n\n // @ts-ignore\n this.webex.internal.newMetrics.submitClientEvent({\n name: 'client.call.aborted',\n payload: {\n errors: [\n {\n category: 'expected',\n errorCode: 2008,\n fatal: true,\n name: 'media-engine',\n shownToUser: false,\n },\n ],\n },\n options: {\n meetingId: this.meeting.id,\n },\n });\n if (reconnectError instanceof NeedsRejoinError) {\n // send call aborded event with catogery as expected as we are trying to rejoin\n\n if (this.autoRejoinEnabled) {\n return this.rejoinMeeting(reconnectError.wasSharing);\n }\n }\n\n throw reconnectError;\n });\n }\n\n /**\n * @param {Object} reconnectOptions\n * @param {boolean} [reconnectOptions.networkDisconnect=false] indicates if a network disconnect event happened\n * @returns {Promise}\n * @throws {NeedsRetryError}\n * @private\n * @memberof ReconnectionManager\n */\n private async executeReconnection({networkDisconnect = false}: {networkDisconnect?: boolean}) {\n this.status = RECONNECTION.STATE.IN_PROGRESS;\n\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#executeReconnection --> Attempting to reconnect to meeting.'\n );\n\n const wasSharing = this.meeting.shareStatus === SHARE_STATUS.LOCAL_SHARE_ACTIVE;\n\n if (wasSharing) {\n await this.stopLocalShareTrack(SHARE_STOPPED_REASON.MEDIA_RECONNECTION);\n }\n\n if (networkDisconnect) {\n try {\n await this.reconnectMercuryWebSocket();\n LoggerProxy.logger.error(\n 'ReconnectionManager:index#executeReconnection --> Websocket reconnected.',\n this.webex.internal.device.url\n );\n } catch (error) {\n LoggerProxy.logger.error(\n 'ReconnectionManager:index#executeReconnection --> Unable to reconnect to websocket, giving up.'\n );\n this.status = RECONNECTION.STATE.FAILURE;\n throw error;\n }\n }\n\n try {\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#executeReconnection --> Updating meeting data from server.'\n );\n await this.webex.meetings.syncMeetings();\n } catch (syncError) {\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#executeReconnection --> Unable to sync meetings, reconnecting.',\n syncError\n );\n throw new NeedsRetryError(syncError);\n }\n\n // TODO: try to improve this logic as the reconnection manager saves the instance of deleted meeting object\n // So that on rejoin it known what parametrs it was using\n if (!this.meeting || !this.webex.meetings.getMeetingByType(_ID_, this.meeting.id)) {\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#executeReconnection --> Meeting got deleted due to inactivity or ended remotely.'\n );\n\n throw new Error('Unable to rejoin a meeting already ended or inactive.');\n }\n\n LoggerProxy.logger.info(\n `ReconnectionManager:index#executeReconnection --> Current state of meeting is ${this.meeting.state}`\n );\n\n // If the meeting state was left, no longer reconnect media\n if (this.meeting.state === _LEFT_) {\n if (this.meeting.type === _CALL_) {\n throw new Error('Unable to rejoin a call in LEFT state.');\n }\n\n throw new NeedsRejoinError({wasSharing});\n }\n\n try {\n const media = await this.reconnectMedia();\n\n LoggerProxy.logger.log(\n 'ReconnectionManager:index#executeReconnection --> Media reestablished'\n );\n this.status = RECONNECTION.STATE.COMPLETE;\n\n return media;\n } catch (error) {\n LoggerProxy.logger.error(\n 'ReconnectionManager:index#executeReconnection --> Media reestablishment failed'\n );\n this.status = RECONNECTION.STATE.FAILURE;\n\n throw error;\n }\n }\n\n /**\n * Rejoins a meeting after detecting the member was in a LEFT state\n *\n * @async\n * @param {boolean} wasSharing\n * @returns {Promise}\n */\n async rejoinMeeting(wasSharing = false) {\n try {\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#rejoinMeeting --> attemping meeting rejoin'\n );\n\n await this.meeting.join({rejoin: true});\n LoggerProxy.logger.info('ReconnectionManager:index#rejoinMeeting --> meeting rejoined');\n\n if (wasSharing) {\n await this.stopLocalShareTrack(SHARE_STOPPED_REASON.MEETING_REJOIN);\n }\n } catch (joinError) {\n this.rejoinAttempts += 1;\n if (this.rejoinAttempts <= this.maxRejoinAttempts) {\n LoggerProxy.logger.info(\n `ReconnectionManager:index#rejoinMeeting --> Unable to rejoin meeting, attempt #${this.rejoinAttempts}, retrying.`,\n joinError\n );\n this.rejoinMeeting();\n } else {\n LoggerProxy.logger.error(\n 'ReconnectionManager:index#rejoinMeeting --> Unable to rejoin meeting after max attempts.',\n joinError\n );\n Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.MEETING_MAX_REJOIN_FAILURE, {\n locus_id: this.meeting.locusUrl.split('/').pop(),\n reason: joinError.message,\n stack: joinError.stack,\n });\n this.status = RECONNECTION.STATE.FAILURE;\n throw joinError;\n }\n }\n\n try {\n await this.reconnectMedia();\n } catch (mediaError) {\n LoggerProxy.logger.error(\n 'ReconnectionManager:index#rejoinMeeting --> Unable to reestablish media after rejoining.',\n mediaError\n );\n throw mediaError;\n }\n }\n\n /**\n * @returns {Promise}\n * @private\n * @memberof ReconnectionManager\n */\n async reconnectMedia() {\n LoggerProxy.logger.log(\n 'ReconnectionManager:index#reconnectMedia --> Begin reestablishment of media'\n );\n\n // do the TURN server discovery again since the TURN server might change\n const turnServerResult = await this.meeting.roap.doTurnDiscovery(this.meeting, true);\n\n const iceServers = [];\n\n if (turnServerResult.turnServerInfo) {\n iceServers.push({\n urls: turnServerResult.turnServerInfo.url,\n username: turnServerResult.turnServerInfo.username || '',\n credential: turnServerResult.turnServerInfo.password || '',\n });\n }\n\n await this.meeting.mediaProperties.webrtcMediaConnection.reconnect(iceServers);\n\n // resend media requests\n if (this.meeting.isMultistream) {\n Object.values(this.meeting.mediaRequestManagers).forEach(\n (mediaRequestManager: MediaRequestManager) => {\n mediaRequestManager.clearPreviousRequests();\n mediaRequestManager.commit();\n }\n );\n }\n }\n\n /**\n * Attempt to Reconnect Mercury Websocket\n * @returns {Promise}\n * @private\n * @memberof ReconnectionManager\n */\n private async reconnectMercuryWebSocket() {\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#reconnectMercuryWebSocket --> Reconnecting websocket.'\n );\n // First, attempt to disconnect if we think we are already connected.\n if (this.webex.internal.mercury.connected) {\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#reconnectMercuryWebSocket --> Disconnecting existing websocket.'\n );\n try {\n await this.webex.internal.mercury.disconnect();\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#reconnectMercuryWebSocket --> Websocket disconnected successfully.'\n );\n } catch (disconnectError) {\n // If we can't disconnect, the sdk is in such a bad state that reconnecting is not going to happen.\n LoggerProxy.logger.error(\n 'ReconnectionManager:index#reconnectMercuryWebSocket --> Unable to disconnect from websocket, giving up.',\n disconnectError\n );\n throw disconnectError;\n }\n }\n\n try {\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#reconnectMercuryWebSocket --> Connecting websocket.'\n );\n await this.webex.internal.mercury.connect();\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#reconnectMercuryWebSocket --> Websocket connected successfully.'\n );\n } catch (connectError) {\n LoggerProxy.logger.error(\n 'ReconnectionManager:index#reconnectMercuryWebSocket --> Unable to connect to websocket, giving up.',\n connectError\n );\n\n throw connectError;\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAMA;AACA;AACA;AASA;AACA;AACA;AACA;AAAiC;AAAA;AAIjC;AACA;AACA;AACA;AACA;AACA;AALA,IAMMA,eAAe;EAAA;EAAA;EAAA;IAAA;IAAA;EAAA;EAAA;AAAA,+CAASC,KAAK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CAAC1B,KAAK,CACtB,oGAAoG,eAErG;cAAC;YAAA;YAAA;cAAA;UAAA;QAAA;MAAA,CAIL;MAAA;QAAA;MAAA;MAAA;IAAA;EAAA;EAAA;AAAA;AAAA"}
1
+ {"version":3,"names":["NeedsRetryError","Error","NeedsRejoinError","wasSharing","error","ReconnectionManager","meeting","iceState","disconnected","resolve","timer","undefined","timeoutDuration","config","reconnection","iceReconnectionTimeout","status","RECONNECTION","STATE","DEFAULT_STATUS","tryCount","DEFAULT_TRY_COUNT","webex","maxRejoinAttempts","rejoinAttempts","autoRejoinEnabled","autoRejoin","reset","clearTimeout","LoggerProxy","logger","log","resetReconnectionTimer","reject","setTimeout","reason","unpublishTracks","mediaProperties","shareVideoTrack","shareAudioTrack","Trigger","trigger","file","function","EVENT_TRIGGERS","MEETING_STOPPED_SHARING_LOCAL","IN_PROGRESS","enabled","COMPLETE","info","ReconnectInProgress","ReconnectionError","networkDisconnect","networkRetry","id","validate","internal","newMetrics","submitClientEvent","name","options","meetingId","executeReconnection","then","payload","recoveredBy","catch","reconnectError","reconnect","message","errors","category","errorCode","fatal","shownToUser","rejoinMeeting","shareStatus","SHARE_STATUS","LOCAL_SHARE_ACTIVE","stopLocalShareTrack","SHARE_STOPPED_REASON","MEDIA_RECONNECTION","reconnectMercuryWebSocket","device","url","FAILURE","meetings","syncMeetings","getMeetingByType","_ID_","state","_LEFT_","type","_CALL_","reconnectMedia","media","join","rejoin","MEETING_REJOIN","Metrics","sendBehavioralMetric","BEHAVIORAL_METRICS","MEETING_MAX_REJOIN_FAILURE","locus_id","locusUrl","split","pop","stack","roap","doTurnDiscovery","turnServerResult","iceServers","turnServerInfo","push","urls","username","credential","password","webrtcMediaConnection","isMultistream","mediaRequestManagers","forEach","mediaRequestManager","clearPreviousRequests","commit","mercury","connected","disconnect","connect"],"sources":["index.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\n/* eslint-disable no-warning-comments */\n\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport Trigger from '../common/events/trigger-proxy';\nimport {\n EVENT_TRIGGERS,\n RECONNECTION,\n SHARE_STATUS,\n SHARE_STOPPED_REASON,\n _CALL_,\n _LEFT_,\n _ID_,\n} from '../constants';\nimport BEHAVIORAL_METRICS from '../metrics/constants';\nimport ReconnectionError from '../common/errors/reconnection';\nimport ReconnectInProgress from '../common/errors/reconnection-in-progress';\nimport Metrics from '../metrics';\nimport Meeting from '../meeting';\nimport {MediaRequestManager} from '../multistream/mediaRequestManager';\n\n/**\n * Used to indicate that the reconnect logic needs to be retried.\n *\n * @class NeedsRetryError\n * @extends {Error}\n */\nclass NeedsRetryError extends Error {}\n\n/**\n * Used to indicate that the meeting needs to be rejoined, not just media reconnected\n *\n * @class NeedsRejoinError\n * @extends {Error}\n */\nclass NeedsRejoinError extends Error {\n wasSharing: any;\n\n /**\n * Creates an instance of NeedsRejoinError.\n * @param {Object} params\n * @param {boolean} params.wasSharing\n * @param {Error} params.error\n * @memberof NeedsRejoinError\n */\n constructor({\n wasSharing,\n error = new Error('Meeting needs to be rejoined'),\n }: {\n wasSharing?: boolean;\n error?: Error;\n }) {\n // @ts-ignore\n super(error);\n\n this.wasSharing = wasSharing;\n }\n}\n\n/**\n * @export\n * @class ReconnectionManager\n */\nexport default class ReconnectionManager {\n autoRejoinEnabled: any;\n iceState: any;\n maxRejoinAttempts: any;\n meeting: any;\n rejoinAttempts: any;\n shareStatus: any;\n status: any;\n tryCount: any;\n webex: any;\n /**\n * @param {Meeting} meeting\n */\n constructor(meeting: Meeting) {\n /**\n * Stores ICE reconnection state data.\n *\n * @instance\n * @type {Object}\n * @private\n * @memberof ReconnectionManager\n */\n this.iceState = {\n disconnected: false,\n resolve: () => {},\n timer: undefined,\n // @ts-ignore\n timeoutDuration: meeting.config.reconnection.iceReconnectionTimeout,\n };\n\n /**\n * @instance\n * @type {String}\n * @private\n * @memberof ReconnectionManager\n */\n this.status = RECONNECTION.STATE.DEFAULT_STATUS;\n /**\n * @instance\n * @type {Number}\n * @private\n * @memberof ReconnectionManager\n */\n this.tryCount = RECONNECTION.STATE.DEFAULT_TRY_COUNT;\n /**\n * @instance\n * @type {Object}\n * @private\n * @memberof ReconnectionManager\n */\n // TODO : change this logic to not save the meeting instance\n // It gets complicated when meeting ends on remote side , We have a old meeting instance which is not up to date\n // @ts-ignore\n this.webex = meeting.webex;\n /**\n * @instance\n * @type {Meeting}\n * @private\n * @memberof ReconnectionManager\n */\n // TODO: try removing the circular dependency for meeting and reconnection manager\n // try moving this to meetings collection\n this.meeting = meeting;\n\n // @ts-ignore\n this.maxRejoinAttempts = meeting.config.reconnection.maxRejoinAttempts;\n this.rejoinAttempts = RECONNECTION.STATE.DEFAULT_TRY_COUNT;\n // @ts-ignore\n this.autoRejoinEnabled = meeting.config.reconnection.autoRejoin;\n\n // Make sure reconnection state is in default\n this.reset();\n }\n\n /**\n * @public\n * @memberof ReconnectionManager\n * @returns {void}\n */\n resetReconnectionTimer() {\n this.iceState.resolve();\n this.iceState.resolve = () => {};\n\n if (this.iceState.timer) {\n clearTimeout(this.iceState.timer);\n delete this.iceState.timer;\n }\n }\n\n /**\n * Sets the iceState to connected and clears any disconnect timeouts and\n * related timeout data within the iceState.\n *\n * @returns {undefined}\n * @public\n * @memberof ReconnectionManager\n */\n public iceReconnected() {\n if (this.iceState.disconnected) {\n LoggerProxy.logger.log('ReconnectionManager:index#iceReconnected --> ice has reconnected');\n\n this.resetReconnectionTimer();\n\n this.iceState.disconnected = false;\n }\n }\n\n /**\n * Set the iceState to disconnected and generates a timeout that waits for the\n * iceState to reconnect and then resolves. If the ice state is already\n * processing a reconnect, it immediately resolves. Rejects if the timeout\n * duration is reached.\n *\n * @returns {Promise<undefined>}\n * @public\n * @memberof ReconnectionManager\n */\n public waitForIceReconnect() {\n if (!this.iceState.disconnected) {\n LoggerProxy.logger.log(\n 'ReconnectionManager:index#waitForIceReconnect --> waiting for ice reconnect'\n );\n\n this.iceState.disconnected = true;\n\n return new Promise<void>((resolve, reject) => {\n this.iceState.timer = setTimeout(() => {\n if (this.iceState.disconnected === false) {\n resolve();\n } else {\n this.iceState.disconnected = false;\n reject(\n new Error(`ice reconnection did not occur in ${this.iceState.timeoutDuration}ms`)\n );\n }\n }, this.iceState.timeoutDuration);\n\n this.iceState.resolve = resolve;\n });\n }\n\n // return a resolved promise to prevent multiple catch executions of reconnect\n return Promise.resolve();\n }\n\n /**\n * @returns {undefined}\n * @public\n * @memberof ReconnectionManager\n */\n public reset() {\n this.status = RECONNECTION.STATE.DEFAULT_STATUS;\n this.tryCount = RECONNECTION.STATE.DEFAULT_TRY_COUNT;\n this.rejoinAttempts = RECONNECTION.STATE.DEFAULT_TRY_COUNT;\n }\n\n /**\n * @returns {undefined}\n * @public\n * @memberof ReconnectionManager\n */\n public cleanUp() {\n this.reset();\n this.meeting = null;\n }\n\n /**\n * Stop the local share track.\n *\n * @param {string} reason a {@link SHARE_STOPPED_REASON}\n * @returns {undefined}\n * @private\n * @memberof ReconnectionManager\n */\n private async stopLocalShareTrack(reason: string) {\n await this.meeting.unpublishTracks([\n this.meeting.mediaProperties.shareVideoTrack,\n this.meeting.mediaProperties.shareAudioTrack,\n ]);\n Trigger.trigger(\n this.meeting,\n {\n file: 'reconnection-manager/index',\n function: 'stopLocalShareTrack',\n },\n EVENT_TRIGGERS.MEETING_STOPPED_SHARING_LOCAL,\n {\n reason,\n }\n );\n }\n\n /**\n * @public\n * @memberof ReconnectionManager\n * @returns {Boolean} true if reconnection operation is in progress\n */\n isReconnectInProgress() {\n return this.status === RECONNECTION.STATE.IN_PROGRESS;\n }\n\n /**\n * @returns {Boolean}\n * @throws {ReconnectionError}\n * @private\n * @memberof ReconnectionManager\n */\n private validate() {\n if (this.meeting.config.reconnection.enabled) {\n if (\n this.status === RECONNECTION.STATE.DEFAULT_STATUS ||\n this.status === RECONNECTION.STATE.COMPLETE\n ) {\n return true;\n }\n\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#validate --> Reconnection already in progress.'\n );\n\n throw new ReconnectInProgress('Reconnection already in progress.');\n }\n\n LoggerProxy.logger.info('ReconnectionManager:index#validate --> Reconnection is not enabled.');\n\n throw new ReconnectionError('Reconnection is not enabled.');\n }\n\n /**\n * Initiates a media reconnect for the active meeting\n * @param {Object} reconnectOptions\n * @param {boolean} [reconnectOptions.networkDisconnect=false] indicates if a network disconnect event happened\n * @param {boolean} [reconnectOptions.networkRetry=false] indicates if we are retrying the reconnect\n * @returns {Promise}\n * @public\n * @memberof ReconnectionManager\n */\n public async reconnect({\n networkDisconnect = false,\n networkRetry = false,\n }: {\n networkDisconnect?: boolean;\n networkRetry?: boolean;\n } = {}) {\n LoggerProxy.logger.info(\n `ReconnectionManager:index#reconnect --> Reconnection start for meeting ${this.meeting.id}.`\n );\n // First, validate that we can reconnect, if not, it will throw an error\n try {\n this.validate();\n } catch (error) {\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#reconnect --> Reconnection unable to begin.',\n error\n );\n throw error;\n }\n\n if (!networkRetry) {\n // Only log START metrics on the initial reconnect\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#reconnect --> Sending reconnect start metric.'\n );\n\n // @ts-ignore\n this.webex.internal.newMetrics.submitClientEvent({\n name: 'client.media.reconnecting',\n options: {\n meetingId: this.meeting.id,\n },\n });\n }\n\n return this.executeReconnection({networkDisconnect})\n .then(() => {\n LoggerProxy.logger.info('ReconnectionManager:index#reconnect --> Reconnection successful.');\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#reconnect --> Sending reconnect success metric.'\n );\n\n // @ts-ignore\n this.webex.internal.newMetrics.submitClientEvent({\n name: 'client.media.recovered',\n payload: {\n recoveredBy: 'new',\n },\n options: {\n meetingId: this.meeting.id,\n },\n });\n })\n .catch((reconnectError) => {\n if (reconnectError instanceof NeedsRetryError) {\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#reconnect --> Reconnection not successful, retrying.'\n );\n // Reset our reconnect status since we are looping back to the beginning\n this.status = RECONNECTION.STATE.DEFAULT_STATUS;\n\n // This is a network retry, so we should not log START metrics again\n return this.reconnect({networkDisconnect: true, networkRetry: true});\n }\n\n // Reconnect has failed\n LoggerProxy.logger.error(\n 'ReconnectionManager:index#reconnect --> Reconnection failed.',\n reconnectError.message\n );\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#reconnect --> Sending reconnect abort metric.'\n );\n\n // @ts-ignore\n this.webex.internal.newMetrics.submitClientEvent({\n name: 'client.call.aborted',\n payload: {\n errors: [\n {\n category: 'expected',\n errorCode: 2008,\n fatal: true,\n name: 'media-engine',\n shownToUser: false,\n },\n ],\n },\n options: {\n meetingId: this.meeting.id,\n },\n });\n if (reconnectError instanceof NeedsRejoinError) {\n // send call aborded event with catogery as expected as we are trying to rejoin\n\n if (this.autoRejoinEnabled) {\n return this.rejoinMeeting(reconnectError.wasSharing);\n }\n }\n\n throw reconnectError;\n });\n }\n\n /**\n * @param {Object} reconnectOptions\n * @param {boolean} [reconnectOptions.networkDisconnect=false] indicates if a network disconnect event happened\n * @returns {Promise}\n * @throws {NeedsRetryError}\n * @private\n * @memberof ReconnectionManager\n */\n private async executeReconnection({networkDisconnect = false}: {networkDisconnect?: boolean}) {\n this.status = RECONNECTION.STATE.IN_PROGRESS;\n\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#executeReconnection --> Attempting to reconnect to meeting.'\n );\n\n const wasSharing = this.meeting.shareStatus === SHARE_STATUS.LOCAL_SHARE_ACTIVE;\n\n if (wasSharing) {\n await this.stopLocalShareTrack(SHARE_STOPPED_REASON.MEDIA_RECONNECTION);\n }\n\n if (networkDisconnect) {\n try {\n await this.reconnectMercuryWebSocket();\n LoggerProxy.logger.error(\n 'ReconnectionManager:index#executeReconnection --> Websocket reconnected.',\n this.webex.internal.device.url\n );\n } catch (error) {\n LoggerProxy.logger.error(\n 'ReconnectionManager:index#executeReconnection --> Unable to reconnect to websocket, giving up.'\n );\n this.status = RECONNECTION.STATE.FAILURE;\n throw error;\n }\n }\n\n try {\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#executeReconnection --> Updating meeting data from server.'\n );\n await this.webex.meetings.syncMeetings();\n } catch (syncError) {\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#executeReconnection --> Unable to sync meetings, reconnecting.',\n syncError\n );\n throw new NeedsRetryError(syncError);\n }\n\n // TODO: try to improve this logic as the reconnection manager saves the instance of deleted meeting object\n // So that on rejoin it known what parametrs it was using\n if (!this.meeting || !this.webex.meetings.getMeetingByType(_ID_, this.meeting.id)) {\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#executeReconnection --> Meeting got deleted due to inactivity or ended remotely.'\n );\n\n throw new Error('Unable to rejoin a meeting already ended or inactive.');\n }\n\n LoggerProxy.logger.info(\n `ReconnectionManager:index#executeReconnection --> Current state of meeting is ${this.meeting.state}`\n );\n\n // If the meeting state was left, no longer reconnect media\n if (this.meeting.state === _LEFT_) {\n if (this.meeting.type === _CALL_) {\n throw new Error('Unable to rejoin a call in LEFT state.');\n }\n\n throw new NeedsRejoinError({wasSharing});\n }\n\n try {\n const media = await this.reconnectMedia();\n\n LoggerProxy.logger.log(\n 'ReconnectionManager:index#executeReconnection --> Media reestablished'\n );\n this.status = RECONNECTION.STATE.COMPLETE;\n\n return media;\n } catch (error) {\n LoggerProxy.logger.error(\n 'ReconnectionManager:index#executeReconnection --> Media reestablishment failed'\n );\n this.status = RECONNECTION.STATE.FAILURE;\n\n throw error;\n }\n }\n\n /**\n * Rejoins a meeting after detecting the member was in a LEFT state\n *\n * @async\n * @param {boolean} wasSharing\n * @returns {Promise}\n */\n async rejoinMeeting(wasSharing = false) {\n try {\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#rejoinMeeting --> attemping meeting rejoin'\n );\n\n await this.meeting.join({rejoin: true});\n LoggerProxy.logger.info('ReconnectionManager:index#rejoinMeeting --> meeting rejoined');\n\n if (wasSharing) {\n await this.stopLocalShareTrack(SHARE_STOPPED_REASON.MEETING_REJOIN);\n }\n } catch (joinError) {\n this.rejoinAttempts += 1;\n if (this.rejoinAttempts <= this.maxRejoinAttempts) {\n LoggerProxy.logger.info(\n `ReconnectionManager:index#rejoinMeeting --> Unable to rejoin meeting, attempt #${this.rejoinAttempts}, retrying.`,\n joinError\n );\n this.rejoinMeeting();\n } else {\n LoggerProxy.logger.error(\n 'ReconnectionManager:index#rejoinMeeting --> Unable to rejoin meeting after max attempts.',\n joinError\n );\n Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.MEETING_MAX_REJOIN_FAILURE, {\n locus_id: this.meeting.locusUrl.split('/').pop(),\n reason: joinError.message,\n stack: joinError.stack,\n });\n this.status = RECONNECTION.STATE.FAILURE;\n throw joinError;\n }\n }\n\n try {\n await this.reconnectMedia();\n } catch (mediaError) {\n LoggerProxy.logger.error(\n 'ReconnectionManager:index#rejoinMeeting --> Unable to reestablish media after rejoining.',\n mediaError\n );\n throw mediaError;\n }\n }\n\n /**\n * @returns {Promise}\n * @private\n * @memberof ReconnectionManager\n */\n async reconnectMedia() {\n LoggerProxy.logger.log(\n 'ReconnectionManager:index#reconnectMedia --> Begin reestablishment of media'\n );\n\n // do the TURN server discovery again since the TURN server might change\n const turnServerResult = await this.meeting.roap.doTurnDiscovery(this.meeting, true);\n\n const iceServers = [];\n\n if (turnServerResult.turnServerInfo) {\n iceServers.push({\n urls: turnServerResult.turnServerInfo.url,\n username: turnServerResult.turnServerInfo.username || '',\n credential: turnServerResult.turnServerInfo.password || '',\n });\n }\n\n await this.meeting.mediaProperties.webrtcMediaConnection.reconnect(iceServers);\n\n // resend media requests\n if (this.meeting.isMultistream) {\n Object.values(this.meeting.mediaRequestManagers).forEach(\n (mediaRequestManager: MediaRequestManager) => {\n mediaRequestManager.clearPreviousRequests();\n mediaRequestManager.commit();\n }\n );\n }\n }\n\n /**\n * Attempt to Reconnect Mercury Websocket\n * @returns {Promise}\n * @private\n * @memberof ReconnectionManager\n */\n private async reconnectMercuryWebSocket() {\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#reconnectMercuryWebSocket --> Reconnecting websocket.'\n );\n // First, attempt to disconnect if we think we are already connected.\n if (this.webex.internal.mercury.connected) {\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#reconnectMercuryWebSocket --> Disconnecting existing websocket.'\n );\n try {\n await this.webex.internal.mercury.disconnect();\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#reconnectMercuryWebSocket --> Websocket disconnected successfully.'\n );\n } catch (disconnectError) {\n // If we can't disconnect, the sdk is in such a bad state that reconnecting is not going to happen.\n LoggerProxy.logger.error(\n 'ReconnectionManager:index#reconnectMercuryWebSocket --> Unable to disconnect from websocket, giving up.',\n disconnectError\n );\n throw disconnectError;\n }\n }\n\n try {\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#reconnectMercuryWebSocket --> Connecting websocket.'\n );\n await this.webex.internal.mercury.connect();\n LoggerProxy.logger.info(\n 'ReconnectionManager:index#reconnectMercuryWebSocket --> Websocket connected successfully.'\n );\n } catch (connectError) {\n LoggerProxy.logger.error(\n 'ReconnectionManager:index#reconnectMercuryWebSocket --> Unable to connect to websocket, giving up.',\n connectError\n );\n\n throw connectError;\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAMA;AACA;AACA;AASA;AACA;AACA;AACA;AAAiC;AAAA;AAIjC;AACA;AACA;AACA;AACA;AACA;AALA,IAMMA,eAAe;EAAA;EAAA;EAAA;IAAA;IAAA;EAAA;EAAA;AAAA,+CAASC,KAAK;AAEnC;AACA;AACA;AACA;AACA;AACA;AALA,IAMMC,gBAAgB;EAAA;EAAA;EAGpB;AACF;AACA;AACA;AACA;AACA;AACA;EACE,gCAMG;IAAA;IAAA,IALDC,UAAU,QAAVA,UAAU;MAAA,kBACVC,KAAK;MAALA,KAAK,2BAAG,IAAIH,KAAK,CAAC,8BAA8B,CAAC;IAAA;IAKjD;IACA,2BAAMG,KAAK;IAAE;IAEb,MAAKD,UAAU,GAAGA,UAAU;IAAC;EAC/B;EAAC;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B,CAACE,MAAM,EAAE;gBAC9B,CAAC,CACF;cACH;YAAC;YAAA;cAAA;UAAA;QAAA;MAAA,CACF;MAAA;QAAA;MAAA;MAAA;IAAA;IAED;AACF;AACA;AACA;AACA;AACA;EALE;IAAA;IAAA;MAAA,yGAMA;QAAA;UAAA;YAAA;cACE/F,oBAAW,CAACC,MAAM,CAACmB,IAAI,CACrB,iFAAiF,CAClF;cACD;cAAA,KACI,IAAI,CAAC3B,KAAK,CAACkC,QAAQ,CAACqE,OAAO,CAACC,SAAS;gBAAA;gBAAA;cAAA;cACvCjG,oBAAW,CAACC,MAAM,CAACmB,IAAI,CACrB,2FAA2F,CAC5F;cAAC;cAAA;cAAA,OAEM,IAAI,CAAC3B,KAAK,CAACkC,QAAQ,CAACqE,OAAO,CAACE,UAAU,EAAE;YAAA;cAC9ClG,oBAAW,CAACC,MAAM,CAACmB,IAAI,CACrB,8FAA8F,CAC/F;cAAC;cAAA;YAAA;cAAA;cAAA;cAEF;cACApB,oBAAW,CAACC,MAAM,CAAC1B,KAAK,CACtB,yGAAyG,eAE1G;cAAC;YAAA;cAAA;cAMJyB,oBAAW,CAACC,MAAM,CAACmB,IAAI,CACrB,+EAA+E,CAChF;cAAC;cAAA,OACI,IAAI,CAAC3B,KAAK,CAACkC,QAAQ,CAACqE,OAAO,CAACG,OAAO,EAAE;YAAA;cAC3CnG,oBAAW,CAACC,MAAM,CAACmB,IAAI,CACrB,2FAA2F,CAC5F;cAAC;cAAA;YAAA;cAAA;cAAA;cAEFpB,oBAAW,CAACC,MAAM,CAAC1B,KAAK,CACtB,oGAAoG,eAErG;cAAC;YAAA;YAAA;cAAA;UAAA;QAAA;MAAA,CAIL;MAAA;QAAA;MAAA;MAAA;IAAA;EAAA;EAAA;AAAA;AAAA"}
@@ -1,5 +1,5 @@
1
1
  import Meetings from './meetings';
2
- export { getDevices, LocalTrack, LocalDisplayTrack, LocalTrackEvents, type TrackMuteEvent, type ServerMuteReason, LocalMicrophoneTrackEvents, LocalCameraTrackEvents, LocalMicrophoneTrack, LocalCameraTrack, createMicrophoneTrack, createCameraTrack, createDisplayTrack, FacingMode, DisplaySurface, PresetCameraConstraints, } from '@webex/media-helpers';
2
+ export { getDevices, LocalTrack, LocalDisplayTrack, LocalSystemAudioTrack, LocalTrackEvents, type TrackMuteEvent, type ServerMuteReason, LocalMicrophoneTrackEvents, LocalCameraTrackEvents, LocalMicrophoneTrack, LocalCameraTrack, createMicrophoneTrack, createCameraTrack, createDisplayTrack, createDisplayTrackWithAudio, FacingMode, DisplaySurface, PresetCameraConstraints, } from '@webex/media-helpers';
3
3
  export default Meetings;
4
4
  export * as CONSTANTS from './constants';
5
5
  export * as REACTIONS from './reactions/reactions';
@@ -1,4 +1,4 @@
1
- import { LocalCameraTrack, LocalMicrophoneTrack, LocalDisplayTrack } from '@webex/media-helpers';
1
+ import { LocalCameraTrack, LocalMicrophoneTrack, LocalDisplayTrack, LocalSystemAudioTrack } from '@webex/media-helpers';
2
2
  export type MediaDirection = {
3
3
  sendAudio: boolean;
4
4
  sendVideo: boolean;
@@ -19,7 +19,8 @@ export default class MediaProperties {
19
19
  remoteQualityLevel: any;
20
20
  remoteShare: any;
21
21
  remoteVideoTrack: any;
22
- shareTrack?: LocalDisplayTrack;
22
+ shareVideoTrack?: LocalDisplayTrack;
23
+ shareAudioTrack?: LocalSystemAudioTrack;
23
24
  videoDeviceId: any;
24
25
  videoTrack?: LocalCameraTrack;
25
26
  namespace: string;
@@ -38,7 +39,8 @@ export default class MediaProperties {
38
39
  setMediaPeerConnection(mediaPeerConnection: any): void;
39
40
  setLocalVideoTrack(videoTrack?: LocalCameraTrack): void;
40
41
  setLocalAudioTrack(audioTrack?: LocalMicrophoneTrack): void;
41
- setLocalShareTrack(shareTrack?: LocalDisplayTrack): void;
42
+ setLocalShareVideoTrack(shareVideoTrack?: LocalDisplayTrack): void;
43
+ setLocalShareAudioTrack(shareAudioTrack?: LocalSystemAudioTrack): void;
42
44
  setRemoteQualityLevel(remoteQualityLevel: any): void;
43
45
  setRemoteShare(remoteShare: any): void;
44
46
  /**
@@ -71,6 +73,11 @@ export default class MediaProperties {
71
73
  * @returns {void}
72
74
  */
73
75
  unsetRemoteTracks(): void;
76
+ /**
77
+ * Returns if we have at least one local share track or not.
78
+ * @returns {Boolean}
79
+ */
80
+ hasLocalShareTrack(): boolean;
74
81
  /**
75
82
  * Waits for the webrtc media connection to be connected.
76
83
  *
@@ -1,7 +1,7 @@
1
1
  /// <reference types="node" />
2
2
  import { StatelessWebexPlugin } from '@webex/webex-core';
3
3
  import { ClientEvent } from '@webex/internal-plugin-metrics';
4
- import { LocalTrack, LocalCameraTrack, LocalDisplayTrack, LocalMicrophoneTrack, TrackMuteEvent } from '@webex/media-helpers';
4
+ import { LocalTrack, LocalCameraTrack, LocalDisplayTrack, LocalSystemAudioTrack, LocalMicrophoneTrack, TrackMuteEvent } from '@webex/media-helpers';
5
5
  import { StatsAnalyzer } from '../statsAnalyzer';
6
6
  import NetworkQualityMonitor from '../networkQualityMonitor';
7
7
  import Roap from '../roap/index';
@@ -24,7 +24,7 @@ export type LocalTracks = {
24
24
  microphone?: LocalMicrophoneTrack;
25
25
  camera?: LocalCameraTrack;
26
26
  screenShare?: {
27
- audio?: LocalTrack;
27
+ audio?: LocalSystemAudioTrack;
28
28
  video?: LocalDisplayTrack;
29
29
  };
30
30
  annotationInfo?: AnnotationInfo;
@@ -43,6 +43,11 @@ export declare const MEDIA_UPDATE_TYPE: {
43
43
  SHARE_FLOOR_REQUEST: string;
44
44
  UPDATE_MEDIA: string;
45
45
  };
46
+ export declare enum ScreenShareFloorStatus {
47
+ PENDING = "floor_request_pending",
48
+ GRANTED = "floor_request_granted",
49
+ RELEASED = "floor_released"
50
+ }
46
51
  /**
47
52
  * MediaDirection
48
53
  * @typedef {Object} MediaDirection
@@ -334,7 +339,6 @@ export default class Meeting extends StatelessWebexPlugin {
334
339
  inMeetingActions: InMeetingActions;
335
340
  isLocalShareLive: boolean;
336
341
  isRoapInProgress: boolean;
337
- isSharing: boolean;
338
342
  keepAliveTimerId: NodeJS.Timeout;
339
343
  lastVideoLayoutInfo: any;
340
344
  locusInfo: any;
@@ -360,6 +364,7 @@ export default class Meeting extends StatelessWebexPlugin {
360
364
  receiveSlotManager: ReceiveSlotManager;
361
365
  selfUserPolicies: any;
362
366
  shareStatus: string;
367
+ screenShareFloorState: ScreenShareFloorStatus;
363
368
  statsAnalyzer: StatsAnalyzer;
364
369
  transcription: Transcription;
365
370
  updateMediaConnections: (mediaConnections: any[]) => void;
@@ -811,14 +816,21 @@ export default class Meeting extends StatelessWebexPlugin {
811
816
  */
812
817
  private setLocalVideoTrack;
813
818
  /**
814
- * Stores the reference to a new screen share track, sets up the required event listeners
819
+ * Stores the reference to a new screen share video track, sets up the required event listeners
815
820
  * on it, cleans up previous track, etc.
816
- * It also sends the floor grant/release request.
817
821
  *
818
822
  * @param {LocalDisplayTrack | undefined} localDisplayTrack local camera track
819
823
  * @returns {Promise<void>}
820
824
  */
821
- private setLocalShareTrack;
825
+ private setLocalShareVideoTrack;
826
+ /**
827
+ * Stores the reference to a new screen share audio track, sets up the required event listeners
828
+ * on it, cleans up previous track, etc.
829
+ *
830
+ * @param {LocalSystemAudioTrack | undefined} localSystemAudioTrack local system audio track
831
+ * @returns {Promise<void>}
832
+ */
833
+ private setLocalShareAudioTrack;
822
834
  /**
823
835
  * sets up listner for mercury event
824
836
  * @returns {undefined}
@@ -851,6 +863,13 @@ export default class Meeting extends StatelessWebexPlugin {
851
863
  * @memberof Meeting
852
864
  */
853
865
  private setCorrelationId;
866
+ /**
867
+ * Enqueue request for screenshare floor and set the status to pending
868
+ * @returns {Promise}
869
+ * @private
870
+ * @memberof Meeting
871
+ */
872
+ private enqueueScreenShareFloorRequest;
854
873
  /**
855
874
  * Mute the audio for a meeting
856
875
  * @returns {Promise} resolves the data from muting audio {mute, self} or rejects if there is no audio set
@@ -1303,13 +1322,26 @@ export default class Meeting extends StatelessWebexPlugin {
1303
1322
  */
1304
1323
  setRemoteQualityLevel(level: string): Promise<void>;
1305
1324
  /**
1306
- * Functionality for when a share is ended.
1325
+ * Functionality for when a share audio is ended.
1307
1326
  * @private
1308
1327
  * @memberof Meeting
1309
- * @param {MediaStream} localShare
1310
1328
  * @returns {undefined}
1311
1329
  */
1312
- private handleShareTrackEnded;
1330
+ private handleShareAudioTrackEnded;
1331
+ /**
1332
+ * Functionality for when a share video is ended.
1333
+ * @private
1334
+ * @memberof Meeting
1335
+ * @returns {undefined}
1336
+ */
1337
+ private handleShareVideoTrackEnded;
1338
+ /**
1339
+ * Emits meeting:stoppedSharingLocal
1340
+ * @private
1341
+ * @returns {undefined}
1342
+ * @memberof Meeting
1343
+ */
1344
+ private triggerStoppedSharing;
1313
1345
  /**
1314
1346
  * Emits the 'network:quality' event
1315
1347
  * 1 indicates an acceptable uplink network.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webex/plugin-meetings",
3
- "version": "3.0.0-beta.170",
3
+ "version": "3.0.0-beta.171",
4
4
  "description": "",
5
5
  "license": "Cisco EULA (https://www.cisco.com/c/en/us/products/end-user-license-agreement.html)",
6
6
  "contributors": [
@@ -32,12 +32,12 @@
32
32
  "build": "yarn run -T tsc --declaration true --declarationDir ./dist/types"
33
33
  },
34
34
  "devDependencies": {
35
- "@webex/plugin-meetings": "3.0.0-beta.170",
36
- "@webex/test-helper-chai": "3.0.0-beta.170",
37
- "@webex/test-helper-mocha": "3.0.0-beta.170",
38
- "@webex/test-helper-mock-webex": "3.0.0-beta.170",
39
- "@webex/test-helper-retry": "3.0.0-beta.170",
40
- "@webex/test-helper-test-users": "3.0.0-beta.170",
35
+ "@webex/plugin-meetings": "3.0.0-beta.171",
36
+ "@webex/test-helper-chai": "3.0.0-beta.171",
37
+ "@webex/test-helper-mocha": "3.0.0-beta.171",
38
+ "@webex/test-helper-mock-webex": "3.0.0-beta.171",
39
+ "@webex/test-helper-retry": "3.0.0-beta.171",
40
+ "@webex/test-helper-test-users": "3.0.0-beta.171",
41
41
  "chai": "^4.3.4",
42
42
  "chai-as-promised": "^7.1.1",
43
43
  "jsdom-global": "3.0.2",
@@ -46,19 +46,19 @@
46
46
  "typescript": "^4.7.4"
47
47
  },
48
48
  "dependencies": {
49
- "@webex/common": "3.0.0-beta.170",
50
- "@webex/internal-media-core": "1.38.6",
51
- "@webex/internal-plugin-conversation": "3.0.0-beta.170",
52
- "@webex/internal-plugin-device": "3.0.0-beta.170",
53
- "@webex/internal-plugin-llm": "3.0.0-beta.170",
54
- "@webex/internal-plugin-mercury": "3.0.0-beta.170",
55
- "@webex/internal-plugin-metrics": "3.0.0-beta.170",
56
- "@webex/internal-plugin-support": "3.0.0-beta.170",
57
- "@webex/internal-plugin-user": "3.0.0-beta.170",
58
- "@webex/media-helpers": "3.0.0-beta.170",
59
- "@webex/plugin-people": "3.0.0-beta.170",
60
- "@webex/plugin-rooms": "3.0.0-beta.170",
61
- "@webex/webex-core": "3.0.0-beta.170",
49
+ "@webex/common": "3.0.0-beta.171",
50
+ "@webex/internal-media-core": "1.39.1",
51
+ "@webex/internal-plugin-conversation": "3.0.0-beta.171",
52
+ "@webex/internal-plugin-device": "3.0.0-beta.171",
53
+ "@webex/internal-plugin-llm": "3.0.0-beta.171",
54
+ "@webex/internal-plugin-mercury": "3.0.0-beta.171",
55
+ "@webex/internal-plugin-metrics": "3.0.0-beta.171",
56
+ "@webex/internal-plugin-support": "3.0.0-beta.171",
57
+ "@webex/internal-plugin-user": "3.0.0-beta.171",
58
+ "@webex/media-helpers": "3.0.0-beta.171",
59
+ "@webex/plugin-people": "3.0.0-beta.171",
60
+ "@webex/plugin-rooms": "3.0.0-beta.171",
61
+ "@webex/webex-core": "3.0.0-beta.171",
62
62
  "ampersand-collection": "^2.0.2",
63
63
  "bowser": "^2.11.0",
64
64
  "btoa": "^1.2.1",
package/src/index.ts CHANGED
@@ -12,6 +12,7 @@ export {
12
12
  getDevices,
13
13
  LocalTrack,
14
14
  LocalDisplayTrack,
15
+ LocalSystemAudioTrack,
15
16
  LocalTrackEvents,
16
17
  type TrackMuteEvent,
17
18
  type ServerMuteReason,
@@ -22,6 +23,7 @@ export {
22
23
  createMicrophoneTrack,
23
24
  createCameraTrack,
24
25
  createDisplayTrack,
26
+ createDisplayTrackWithAudio,
25
27
  FacingMode,
26
28
  DisplaySurface,
27
29
  PresetCameraConstraints,
@@ -4,7 +4,12 @@
4
4
  /* globals navigator */
5
5
 
6
6
  import {RoapMediaConnection, MultistreamRoapMediaConnection} from '@webex/internal-media-core';
7
- import {LocalCameraTrack, LocalDisplayTrack, LocalMicrophoneTrack} from '@webex/media-helpers';
7
+ import {
8
+ LocalCameraTrack,
9
+ LocalDisplayTrack,
10
+ LocalSystemAudioTrack,
11
+ LocalMicrophoneTrack,
12
+ } from '@webex/media-helpers';
8
13
  import LoggerProxy from '../common/logs/logger-proxy';
9
14
  import {MEDIA_TRACK_CONSTRAINT} from '../constants';
10
15
  import Config from '../config';
@@ -99,7 +104,7 @@ Media.getDirection = (forceSendRecv: boolean, receive: boolean, send: boolean) =
99
104
  * @param {string} debugId string useful for debugging (will appear in media connection logs)
100
105
  * @param {Object} options
101
106
  * @param {Object} [options.mediaProperties] contains mediaDirection and local tracks:
102
- * audioTrack, videoTrack and shareTrack
107
+ * audioTrack, videoTrack, shareVideoTrack, and shareAudioTrack
103
108
  * @param {string} [options.remoteQualityLevel] LOW|MEDIUM|HIGH applicable only to non-multistream connections
104
109
  * @param {boolean} [options.enableRtx] applicable only to non-multistream connections
105
110
  * @param {boolean} [options.enableExtmap] applicable only to non-multistream connections
@@ -122,7 +127,8 @@ Media.createMediaConnection = (
122
127
  };
123
128
  audioTrack?: LocalMicrophoneTrack;
124
129
  videoTrack?: LocalCameraTrack;
125
- shareTrack?: LocalDisplayTrack;
130
+ shareVideoTrack?: LocalDisplayTrack;
131
+ shareAudioTrack?: LocalSystemAudioTrack;
126
132
  };
127
133
  remoteQualityLevel?: 'LOW' | 'MEDIUM' | 'HIGH';
128
134
  enableRtx?: boolean;
@@ -174,7 +180,7 @@ Media.createMediaConnection = (
174
180
  throw new Error('mediaProperties have to be provided for non-multistream media connections');
175
181
  }
176
182
 
177
- const {mediaDirection, audioTrack, videoTrack, shareTrack} = mediaProperties;
183
+ const {mediaDirection, audioTrack, videoTrack, shareVideoTrack} = mediaProperties;
178
184
 
179
185
  return new RoapMediaConnection(
180
186
  {
@@ -198,7 +204,7 @@ Media.createMediaConnection = (
198
204
  localTracks: {
199
205
  audio: audioTrack?.underlyingTrack,
200
206
  video: videoTrack?.underlyingTrack,
201
- screenShareVideo: shareTrack?.underlyingTrack,
207
+ screenShareVideo: shareVideoTrack?.underlyingTrack,
202
208
  },
203
209
  direction: {
204
210
  audio: Media.getDirection(true, mediaDirection.receiveAudio, mediaDirection.sendAudio),
@@ -1,6 +1,11 @@
1
1
  import {ConnectionState, Event} from '@webex/internal-media-core';
2
2
 
3
- import {LocalCameraTrack, LocalMicrophoneTrack, LocalDisplayTrack} from '@webex/media-helpers';
3
+ import {
4
+ LocalCameraTrack,
5
+ LocalMicrophoneTrack,
6
+ LocalDisplayTrack,
7
+ LocalSystemAudioTrack,
8
+ } from '@webex/media-helpers';
4
9
 
5
10
  import {MEETINGS, PC_BAIL_TIMEOUT, QUALITY_LEVELS} from '../constants';
6
11
  import LoggerProxy from '../common/logs/logger-proxy';
@@ -26,7 +31,8 @@ export default class MediaProperties {
26
31
  remoteQualityLevel: any;
27
32
  remoteShare: any;
28
33
  remoteVideoTrack: any;
29
- shareTrack?: LocalDisplayTrack;
34
+ shareVideoTrack?: LocalDisplayTrack;
35
+ shareAudioTrack?: LocalSystemAudioTrack;
30
36
  videoDeviceId: any;
31
37
  videoTrack?: LocalCameraTrack;
32
38
  namespace = MEETINGS;
@@ -47,7 +53,8 @@ export default class MediaProperties {
47
53
  };
48
54
  this.videoTrack = null;
49
55
  this.audioTrack = null;
50
- this.shareTrack = null;
56
+ this.shareVideoTrack = null;
57
+ this.shareAudioTrack = null;
51
58
  this.remoteShare = undefined;
52
59
  this.remoteAudioTrack = undefined;
53
60
  this.remoteVideoTrack = undefined;
@@ -84,8 +91,12 @@ export default class MediaProperties {
84
91
  this.audioTrack = audioTrack;
85
92
  }
86
93
 
87
- setLocalShareTrack(shareTrack?: LocalDisplayTrack) {
88
- this.shareTrack = shareTrack;
94
+ setLocalShareVideoTrack(shareVideoTrack?: LocalDisplayTrack) {
95
+ this.shareVideoTrack = shareVideoTrack;
96
+ }
97
+
98
+ setLocalShareAudioTrack(shareAudioTrack?: LocalSystemAudioTrack) {
99
+ this.shareAudioTrack = shareAudioTrack;
89
100
  }
90
101
 
91
102
  setRemoteQualityLevel(remoteQualityLevel) {
@@ -149,6 +160,14 @@ export default class MediaProperties {
149
160
  this.unsetRemoteShare();
150
161
  }
151
162
 
163
+ /**
164
+ * Returns if we have at least one local share track or not.
165
+ * @returns {Boolean}
166
+ */
167
+ hasLocalShareTrack() {
168
+ return !!(this.shareAudioTrack || this.shareVideoTrack);
169
+ }
170
+
152
171
  /**
153
172
  * Waits for the webrtc media connection to be connected.
154
173
  *