@webex/plugin-meetings 3.11.0-webex-services-ready.1 → 3.12.0-metrics-init-fix-2.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.
- package/AGENTS.md +9 -0
- package/dist/aiEnableRequest/index.js +197 -0
- package/dist/aiEnableRequest/index.js.map +1 -0
- package/dist/aiEnableRequest/utils.js +36 -0
- package/dist/aiEnableRequest/utils.js.map +1 -0
- package/dist/annotation/index.js +14 -5
- package/dist/annotation/index.js.map +1 -1
- package/dist/breakouts/breakout.js +8 -3
- package/dist/breakouts/breakout.js.map +1 -1
- package/dist/breakouts/events.js +29 -14
- package/dist/breakouts/events.js.map +1 -1
- package/dist/breakouts/index.js +90 -3
- package/dist/breakouts/index.js.map +1 -1
- package/dist/common/errors/webex-errors.js +49 -5
- package/dist/common/errors/webex-errors.js.map +1 -1
- package/dist/config.js +8 -3
- package/dist/config.js.map +1 -1
- package/dist/constants.js +60 -11
- package/dist/constants.js.map +1 -1
- package/dist/controls-options-manager/constants.js +11 -1
- package/dist/controls-options-manager/constants.js.map +1 -1
- package/dist/controls-options-manager/index.js +67 -29
- package/dist/controls-options-manager/index.js.map +1 -1
- package/dist/controls-options-manager/util.js +91 -0
- package/dist/controls-options-manager/util.js.map +1 -1
- package/dist/hashTree/constants.js +16 -2
- package/dist/hashTree/constants.js.map +1 -1
- package/dist/hashTree/hashTree.js +18 -0
- package/dist/hashTree/hashTree.js.map +1 -1
- package/dist/hashTree/hashTreeParser.js +1655 -538
- package/dist/hashTree/hashTreeParser.js.map +1 -1
- package/dist/hashTree/types.js +4 -2
- package/dist/hashTree/types.js.map +1 -1
- package/dist/hashTree/utils.js +52 -0
- package/dist/hashTree/utils.js.map +1 -1
- package/dist/index.js +18 -2
- package/dist/index.js.map +1 -1
- package/dist/interceptors/constant.js +12 -0
- package/dist/interceptors/constant.js.map +1 -0
- package/dist/interceptors/dataChannelAuthToken.js +350 -0
- package/dist/interceptors/dataChannelAuthToken.js.map +1 -0
- package/dist/interceptors/index.js +7 -0
- package/dist/interceptors/index.js.map +1 -1
- package/dist/interceptors/locusRetry.js +23 -8
- package/dist/interceptors/locusRetry.js.map +1 -1
- package/dist/interceptors/utils.js +27 -0
- package/dist/interceptors/utils.js.map +1 -0
- package/dist/interpretation/index.js +11 -2
- package/dist/interpretation/index.js.map +1 -1
- package/dist/interpretation/interpretation.types.js +7 -0
- package/dist/interpretation/interpretation.types.js.map +1 -0
- package/dist/interpretation/siLanguage.js +1 -1
- package/dist/locus-info/controlsUtils.js +9 -4
- package/dist/locus-info/controlsUtils.js.map +1 -1
- package/dist/locus-info/index.js +911 -211
- package/dist/locus-info/index.js.map +1 -1
- package/dist/locus-info/infoUtils.js +36 -5
- package/dist/locus-info/infoUtils.js.map +1 -1
- package/dist/locus-info/selfUtils.js +1 -0
- package/dist/locus-info/selfUtils.js.map +1 -1
- package/dist/locus-info/types.js +19 -0
- package/dist/locus-info/types.js.map +1 -1
- package/dist/media/MediaConnectionAwaiter.js +72 -3
- package/dist/media/MediaConnectionAwaiter.js.map +1 -1
- package/dist/media/index.js +8 -2
- package/dist/media/index.js.map +1 -1
- package/dist/media/properties.js +8 -7
- package/dist/media/properties.js.map +1 -1
- package/dist/meeting/in-meeting-actions.js +11 -1
- package/dist/meeting/in-meeting-actions.js.map +1 -1
- package/dist/meeting/index.js +2266 -1069
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting/locusMediaRequest.js +229 -82
- package/dist/meeting/locusMediaRequest.js.map +1 -1
- package/dist/meeting/muteState.js +10 -1
- package/dist/meeting/muteState.js.map +1 -1
- package/dist/meeting/request.js +55 -2
- package/dist/meeting/request.js.map +1 -1
- package/dist/meeting/request.type.js.map +1 -1
- package/dist/meeting/util.js +168 -5
- package/dist/meeting/util.js.map +1 -1
- package/dist/meeting-info/meeting-info-v2.js +2 -2
- package/dist/meeting-info/meeting-info-v2.js.map +1 -1
- package/dist/meetings/index.js +369 -162
- package/dist/meetings/index.js.map +1 -1
- package/dist/meetings/meetings.types.js +6 -1
- package/dist/meetings/meetings.types.js.map +1 -1
- package/dist/meetings/request.js +39 -0
- package/dist/meetings/request.js.map +1 -1
- package/dist/meetings/util.js +116 -18
- package/dist/meetings/util.js.map +1 -1
- package/dist/member/index.js +20 -0
- package/dist/member/index.js.map +1 -1
- package/dist/member/types.js.map +1 -1
- package/dist/member/util.js +40 -0
- package/dist/member/util.js.map +1 -1
- package/dist/members/index.js +101 -43
- package/dist/members/index.js.map +1 -1
- package/dist/members/util.js +8 -1
- package/dist/members/util.js.map +1 -1
- package/dist/metrics/constants.js +12 -1
- package/dist/metrics/constants.js.map +1 -1
- package/dist/multistream/codec/constants.js +63 -0
- package/dist/multistream/codec/constants.js.map +1 -0
- package/dist/multistream/mediaRequestManager.js +64 -68
- package/dist/multistream/mediaRequestManager.js.map +1 -1
- package/dist/multistream/receiveSlot.js +9 -0
- package/dist/multistream/receiveSlot.js.map +1 -1
- package/dist/multistream/remoteMediaManager.js +11 -0
- package/dist/multistream/remoteMediaManager.js.map +1 -1
- package/dist/multistream/sendSlotManager.js +116 -2
- package/dist/multistream/sendSlotManager.js.map +1 -1
- package/dist/reachability/clusterReachability.js.map +1 -1
- package/dist/reachability/index.js +121 -83
- package/dist/reachability/index.js.map +1 -1
- package/dist/reachability/reachability.types.js +2 -0
- package/dist/reachability/reachability.types.js.map +1 -1
- package/dist/reachability/util.js +45 -0
- package/dist/reachability/util.js.map +1 -1
- package/dist/reactions/reactions.type.js.map +1 -1
- package/dist/reconnection-manager/index.js +0 -1
- package/dist/reconnection-manager/index.js.map +1 -1
- package/dist/recording-controller/index.js +1 -3
- package/dist/recording-controller/index.js.map +1 -1
- package/dist/roap/turnDiscovery.js +8 -1
- package/dist/roap/turnDiscovery.js.map +1 -1
- package/dist/types/aiEnableRequest/index.d.ts +5 -0
- package/dist/types/aiEnableRequest/utils.d.ts +2 -0
- package/dist/types/common/errors/webex-errors.d.ts +32 -2
- package/dist/types/config.d.ts +6 -2
- package/dist/types/constants.d.ts +35 -1
- package/dist/types/controls-options-manager/constants.d.ts +6 -1
- package/dist/types/controls-options-manager/index.d.ts +16 -0
- package/dist/types/hashTree/constants.d.ts +3 -0
- package/dist/types/hashTree/hashTree.d.ts +7 -0
- package/dist/types/hashTree/hashTreeParser.d.ts +315 -30
- package/dist/types/hashTree/types.d.ts +3 -0
- package/dist/types/hashTree/utils.d.ts +24 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/interceptors/constant.d.ts +5 -0
- package/dist/types/interceptors/dataChannelAuthToken.d.ts +43 -0
- package/dist/types/interceptors/index.d.ts +2 -1
- package/dist/types/interceptors/locusRetry.d.ts +4 -4
- package/dist/types/interceptors/utils.d.ts +1 -0
- package/dist/types/interpretation/interpretation.types.d.ts +10 -0
- package/dist/types/locus-info/index.d.ts +126 -15
- package/dist/types/locus-info/infoUtils.d.ts +8 -0
- package/dist/types/locus-info/types.d.ts +28 -1
- package/dist/types/media/MediaConnectionAwaiter.d.ts +20 -2
- package/dist/types/media/properties.d.ts +8 -3
- package/dist/types/meeting/in-meeting-actions.d.ts +10 -0
- package/dist/types/meeting/index.d.ts +245 -16
- package/dist/types/meeting/locusMediaRequest.d.ts +12 -0
- package/dist/types/meeting/request.d.ts +17 -1
- package/dist/types/meeting/request.type.d.ts +5 -0
- package/dist/types/meeting/util.d.ts +40 -0
- package/dist/types/meetings/index.d.ts +42 -20
- package/dist/types/meetings/meetings.types.d.ts +15 -0
- package/dist/types/meetings/request.d.ts +14 -0
- package/dist/types/member/index.d.ts +2 -0
- package/dist/types/member/types.d.ts +1 -0
- package/dist/types/member/util.d.ts +14 -0
- package/dist/types/members/index.d.ts +15 -2
- package/dist/types/members/util.d.ts +1 -5
- package/dist/types/metrics/constants.d.ts +11 -0
- package/dist/types/multistream/codec/constants.d.ts +7 -0
- package/dist/types/multistream/mediaRequestManager.d.ts +20 -26
- package/dist/types/multistream/sendSlotManager.d.ts +23 -1
- package/dist/types/reachability/clusterReachability.d.ts +3 -3
- package/dist/types/reachability/index.d.ts +10 -3
- package/dist/types/reachability/reachability.types.d.ts +7 -0
- package/dist/types/reachability/util.d.ts +17 -0
- package/dist/types/reactions/reactions.type.d.ts +4 -0
- package/dist/types/webinar/utils.d.ts +6 -0
- package/dist/webinar/index.js +585 -164
- package/dist/webinar/index.js.map +1 -1
- package/dist/webinar/utils.js +25 -0
- package/dist/webinar/utils.js.map +1 -0
- package/package.json +24 -23
- package/src/aiEnableRequest/README.md +84 -0
- package/src/aiEnableRequest/index.ts +186 -0
- package/src/aiEnableRequest/utils.ts +25 -0
- package/src/annotation/index.ts +27 -7
- package/src/breakouts/breakout.ts +3 -1
- package/src/breakouts/events.ts +33 -11
- package/src/breakouts/index.ts +110 -1
- package/src/common/errors/webex-errors.ts +50 -3
- package/src/config.ts +6 -2
- package/src/constants.ts +49 -3
- package/src/controls-options-manager/constants.ts +14 -1
- package/src/controls-options-manager/index.ts +87 -28
- package/src/controls-options-manager/util.ts +81 -1
- package/src/hashTree/constants.ts +17 -0
- package/src/hashTree/hashTree.ts +17 -0
- package/src/hashTree/hashTreeParser.ts +1482 -361
- package/src/hashTree/types.ts +4 -0
- package/src/hashTree/utils.ts +45 -0
- package/src/index.ts +14 -1
- package/src/interceptors/constant.ts +6 -0
- package/src/interceptors/dataChannelAuthToken.ts +246 -0
- package/src/interceptors/index.ts +2 -1
- package/src/interceptors/locusRetry.ts +25 -4
- package/src/interceptors/utils.ts +16 -0
- package/src/interpretation/index.ts +29 -11
- package/src/interpretation/interpretation.types.ts +11 -0
- package/src/locus-info/controlsUtils.ts +14 -1
- package/src/locus-info/index.ts +975 -203
- package/src/locus-info/infoUtils.ts +41 -6
- package/src/locus-info/selfUtils.ts +1 -0
- package/src/locus-info/types.ts +33 -1
- package/src/media/MediaConnectionAwaiter.ts +62 -5
- package/src/media/index.ts +10 -1
- package/src/media/properties.ts +11 -4
- package/src/meeting/in-meeting-actions.ts +20 -0
- package/src/meeting/index.ts +1258 -166
- package/src/meeting/locusMediaRequest.ts +106 -6
- package/src/meeting/muteState.ts +10 -1
- package/src/meeting/request.ts +53 -0
- package/src/meeting/request.type.ts +6 -0
- package/src/meeting/util.ts +207 -7
- package/src/meeting-info/meeting-info-v2.ts +4 -2
- package/src/meetings/index.ts +319 -117
- package/src/meetings/meetings.types.ts +19 -0
- package/src/meetings/request.ts +43 -0
- package/src/meetings/util.ts +117 -4
- package/src/member/index.ts +20 -0
- package/src/member/types.ts +1 -0
- package/src/member/util.ts +41 -0
- package/src/members/index.ts +70 -7
- package/src/members/util.ts +12 -4
- package/src/metrics/constants.ts +12 -0
- package/src/multistream/codec/constants.ts +58 -0
- package/src/multistream/mediaRequestManager.ts +117 -76
- package/src/multistream/receiveSlot.ts +18 -0
- package/src/multistream/remoteMediaManager.ts +13 -0
- package/src/multistream/sendSlotManager.ts +97 -3
- package/src/reachability/clusterReachability.ts +3 -2
- package/src/reachability/index.ts +47 -16
- package/src/reachability/reachability.types.ts +11 -0
- package/src/reachability/util.ts +36 -0
- package/src/reactions/reactions.type.ts +4 -0
- package/src/reconnection-manager/index.ts +0 -1
- package/src/recording-controller/index.ts +1 -2
- package/src/roap/turnDiscovery.ts +9 -1
- package/src/webinar/index.ts +448 -11
- package/src/webinar/utils.ts +16 -0
- package/test/unit/spec/aiEnableRequest/index.ts +1067 -0
- package/test/unit/spec/aiEnableRequest/utils.ts +130 -0
- package/test/unit/spec/annotation/index.ts +69 -7
- package/test/unit/spec/breakouts/breakout.ts +9 -3
- package/test/unit/spec/breakouts/events.ts +120 -2
- package/test/unit/spec/breakouts/index.ts +191 -2
- package/test/unit/spec/common/errors/webex-errors.ts +78 -0
- package/test/unit/spec/controls-options-manager/index.js +244 -29
- package/test/unit/spec/controls-options-manager/util.js +165 -0
- package/test/unit/spec/hashTree/hashTree.ts +66 -0
- package/test/unit/spec/hashTree/hashTreeParser.ts +4528 -171
- package/test/unit/spec/hashTree/utils.ts +125 -1
- package/test/unit/spec/interceptors/dataChannelAuthToken.ts +406 -0
- package/test/unit/spec/interceptors/locusRetry.ts +205 -4
- package/test/unit/spec/interceptors/utils.ts +75 -0
- package/test/unit/spec/interpretation/index.ts +26 -4
- package/test/unit/spec/locus-info/controlsUtils.js +200 -56
- package/test/unit/spec/locus-info/index.js +1848 -164
- package/test/unit/spec/locus-info/infoUtils.js +184 -1
- package/test/unit/spec/media/MediaConnectionAwaiter.ts +96 -1
- package/test/unit/spec/media/index.ts +92 -0
- package/test/unit/spec/media/properties.ts +35 -26
- package/test/unit/spec/meeting/in-meeting-actions.ts +12 -2
- package/test/unit/spec/meeting/index.js +3611 -334
- package/test/unit/spec/meeting/locusMediaRequest.ts +406 -4
- package/test/unit/spec/meeting/muteState.js +81 -0
- package/test/unit/spec/meeting/request.js +82 -0
- package/test/unit/spec/meeting/utils.js +595 -27
- package/test/unit/spec/meeting-info/meetinginfov2.js +19 -10
- package/test/unit/spec/meetings/index.js +1138 -86
- package/test/unit/spec/meetings/request.js +141 -0
- package/test/unit/spec/meetings/utils.js +402 -51
- package/test/unit/spec/member/index.js +35 -4
- package/test/unit/spec/member/util.js +154 -27
- package/test/unit/spec/members/index.js +216 -0
- package/test/unit/spec/members/request.js +37 -1
- package/test/unit/spec/members/utils.js +63 -0
- package/test/unit/spec/multistream/mediaRequestManager.ts +503 -122
- package/test/unit/spec/multistream/remoteMediaManager.ts +30 -0
- package/test/unit/spec/multistream/sendSlotManager.ts +135 -36
- package/test/unit/spec/reachability/index.ts +128 -46
- package/test/unit/spec/reachability/util.ts +31 -0
- package/test/unit/spec/reconnection-manager/index.js +4 -8
- package/test/unit/spec/recording-controller/index.js +9 -8
- package/test/unit/spec/roap/turnDiscovery.ts +20 -0
- package/test/unit/spec/webinar/index.ts +837 -39
- package/test/unit/spec/webinar/utils.ts +39 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_internalMediaCore","require","SendSlotManager","exports","default","LoggerProxy","_classCallCheck2","_defineProperty2","_map","_createClass2","key","value","createSlot","mediaConnection","mediaType","active","arguments","length","undefined","slots","has","Error","concat","slot","createSendSlot","set","logger","info","getSlot","get","setNamedMediaGroups","namedMediaGroups","MediaType","AudioMain","setSourceStateOverride","state","VideoMain","currentStateOverride","getSourceStateOverride","sourceStateOverrides","clearSourceStateOverride","delete","_publishStream","_asyncToGenerator2","_regenerator","mark","_callee","stream","wrap","_context","prev","next","publishStream","label","muted","stop","_x","_x2","apply","_unpublishStream","_callee2","_context2","unpublishStream","_x3","setActive","_setCodecParameters","_callee3","codecParameters","_context3","setCodecParameters","_x4","_x5","_deleteCodecParameters","_callee4","parameters","_context4","deleteCodecParameters","_x6","_x7","reset","clear"],"sources":["sendSlotManager.ts"],"sourcesContent":["import {\n SendSlot,\n MediaType,\n LocalStream,\n MultistreamRoapMediaConnection,\n NamedMediaGroup,\n StreamState,\n} from '@webex/internal-media-core';\n\n/**\n * This class is used to manage the sendSlots for the given media types.\n */\nexport default class SendSlotManager {\n private readonly slots: Map<MediaType, SendSlot> = new Map();\n private readonly LoggerProxy: any;\n private readonly sourceStateOverrides: Map<MediaType, StreamState> = new Map();\n\n /**\n * Constructor for SendSlotManager\n *\n * @param {any} LoggerProxy is used to log the messages\n * @constructor\n */\n constructor(LoggerProxy: any) {\n this.LoggerProxy = LoggerProxy;\n }\n\n /**\n * This method is used to create a sendSlot for the given mediaType and returns the created sendSlot\n * @param {MultistreamRoapMediaConnection} mediaConnection MultistreamRoapMediaConnection for which a sendSlot needs to be created\n * @param {MediaType} mediaType MediaType for which a sendSlot needs to be created (AUDIO_MAIN/VIDEO_MAIN/AUDIO_SLIDES/VIDEO_SLIDES)\n * @param {boolean} active This is optional boolean to set the active state of the sendSlot. Default is true\n * @returns {SendSlot} slot The created sendSlot\n */\n public createSlot(\n mediaConnection: MultistreamRoapMediaConnection,\n mediaType: MediaType,\n active = true\n ): SendSlot {\n if (this.slots.has(mediaType)) {\n throw new Error(`Slot for ${mediaType} already exists`);\n }\n\n const slot: SendSlot = mediaConnection.createSendSlot(mediaType, active);\n\n this.slots.set(mediaType, slot);\n\n this.LoggerProxy.logger.info(\n `SendSlotsManager->createSlot#Created slot for ${mediaType} with active ${active}`\n );\n\n return slot;\n }\n\n /**\n * This method is used to retrieve the sendSlot for the given mediaType\n * @param {MediaType} mediaType of which the slot needs to be retrieved\n * @returns {SendSlot}\n */\n public getSlot(mediaType: MediaType): SendSlot {\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n return slot;\n }\n\n /**\n * Allow users to specify 'namedMediaGroups' to indicate which named media group its audio should be sent to.\n * @param {MediaType} mediaType MediaType of the sendSlot to which the audio stream needs to be send to the media group\n * @param {[]}namedMediaGroups - Allow users to specify 'namedMediaGroups'.If the value of 'namedMediaGroups' is zero,\n * named media group will be canceled and the audio stream will be sent to the floor.\n * @returns {void}\n */\n public setNamedMediaGroups(mediaType: MediaType, namedMediaGroups: NamedMediaGroup[]) {\n if (mediaType !== MediaType.AudioMain) {\n throw new Error(\n `sendSlotManager cannot set named media group which media type is ${mediaType}`\n );\n }\n\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n slot.setNamedMediaGroups(namedMediaGroups);\n\n this.LoggerProxy.logger.info(\n `SendSlotsManager->setNamedMediaGroups#set named media group ${namedMediaGroups}`\n );\n }\n\n /**\n * Sets the source state override for the given media type.\n * @param {MediaType} mediaType - The type of media (must be MediaType.VideoMain to apply source state changes).\n * @param {StreamState | null} state - The state to set or null to clear the override value.\n * @returns {void}\n */\n public setSourceStateOverride(mediaType: MediaType, state: StreamState | null) {\n if (mediaType !== MediaType.VideoMain) {\n throw new Error(\n `Invalid media type '${mediaType}'. Source state overrides are only applicable to ${MediaType.VideoMain}.`\n );\n }\n\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n const currentStateOverride = this.getSourceStateOverride(mediaType);\n if (currentStateOverride === state) {\n return;\n }\n\n if (state) {\n slot.setSourceStateOverride(state);\n this.sourceStateOverrides.set(mediaType, state);\n } else {\n slot.clearSourceStateOverride();\n this.sourceStateOverrides.delete(mediaType);\n }\n\n this.LoggerProxy.logger.info(\n `SendSlotManager->setSourceStateOverride#set source state override for ${mediaType} to ${state}`\n );\n }\n\n /**\n * Gets the source state override for the given media type.\n * @param {MediaType} mediaType - The type of media to get the source state override for.\n * @returns {StreamState | null} - The current source state override or null if not set.\n */\n private getSourceStateOverride(mediaType: MediaType): StreamState | null {\n if (mediaType !== MediaType.VideoMain) {\n throw new Error(\n `Invalid media type '${mediaType}'. Source state overrides are only applicable to ${MediaType.VideoMain}.`\n );\n }\n\n return this.sourceStateOverrides.get(mediaType) || null;\n }\n\n /**\n * This method publishes the given stream to the sendSlot for the given mediaType\n * @param {MediaType} mediaType MediaType of the sendSlot to which a stream needs to be published (AUDIO_MAIN/VIDEO_MAIN/AUDIO_SLIDES/VIDEO_SLIDES)\n * @param {LocalStream} stream LocalStream to be published\n * @returns {Promise<void>}\n */\n public async publishStream(mediaType: MediaType, stream: LocalStream): Promise<void> {\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n await slot.publishStream(stream);\n\n this.LoggerProxy.logger.info(\n `SendSlotsManager->publishStream#Published stream for ${mediaType} and stream with label ${stream.label} and muted ${stream.muted}`\n );\n }\n\n /**\n * This method unpublishes the stream from the sendSlot of the given mediaType\n * @param {MediaType} mediaType MediaType of the sendSlot from which a stream needs to be unpublished (AUDIO_MAIN/VIDEO_MAIN/AUDIO_SLIDES/VIDEO_SLIDES)\n * @returns {Promise<void>}\n */\n public async unpublishStream(mediaType: MediaType): Promise<void> {\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n await slot.unpublishStream();\n\n this.LoggerProxy.logger.info(\n `SendSlotsManager->unpublishStream#Unpublished stream for ${mediaType}`\n );\n }\n\n /**\n * This method is used to set the active state of the sendSlot for the given mediaType\n * @param {MediaType} mediaType The MediaType of the sendSlot for which the active state needs to be set (AUDIO_MAIN/VIDEO_MAIN/AUDIO_SLIDES/VIDEO_SLIDES)\n * @param {boolean} active The boolean to set the active state of the sendSlot. Default is true\n * @returns {void}\n */\n public setActive(mediaType: MediaType, active = true): void {\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n slot.active = active;\n\n this.LoggerProxy.logger.info(\n `SendSlotsManager->setActive#Set active for ${mediaType} to ${active}`\n );\n }\n\n /**\n * This method is used to set the codec parameters for the sendSlot of the given mediaType\n * @param {MediaType} mediaType MediaType of the sendSlot for which the codec parameters needs to be set (AUDIO_MAIN/VIDEO_MAIN/AUDIO_SLIDES/VIDEO_SLIDES)\n * @param {Object} codecParameters\n * @returns {Promise<void>}\n */\n public async setCodecParameters(\n mediaType: MediaType,\n codecParameters: {\n [key: string]: string | undefined; // As per ts-sdp undefined is considered as a valid value to be used for codec parameters\n }\n ): Promise<void> {\n // These codec parameter changes underneath are SDP value changes that are taken care by WCME automatically. So no need for any change in streams from the web sdk side\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n await slot.setCodecParameters(codecParameters);\n\n this.LoggerProxy.logger.info(\n `SendSlotsManager->setCodecParameters#Set codec parameters for ${mediaType} to ${codecParameters}`\n );\n }\n\n /**\n * This method is used to delete the codec parameters for the sendSlot of the given mediaType\n * @param {MediaType} mediaType MediaType of the sendSlot for which the codec parameters needs to be deleted (AUDIO_MAIN/VIDEO_MAIN/AUDIO_SLIDES/VIDEO_SLIDES)\n * @param {Array<String>} parameters Array of keys of the codec parameters to be deleted\n * @returns {Promise<void>}\n */\n public async deleteCodecParameters(mediaType: MediaType, parameters: string[]): Promise<void> {\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n await slot.deleteCodecParameters(parameters);\n\n this.LoggerProxy.logger.info(\n `SendSlotsManager->deleteCodecParameters#Deleted the following codec parameters -> ${parameters} for ${mediaType}`\n );\n }\n\n /**\n * This method is used to reset the SendSlotsManager by deleting all the sendSlots\n * @returns {undefined}\n */\n public reset(): void {\n this.slots.clear();\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,kBAAA,GAAAC,OAAA;AASA;AACA;AACA;AAFA,IAGqBC,eAAe,GAAAC,OAAA,CAAAC,OAAA;EAKlC;AACF;AACA;AACA;AACA;AACA;EACE,SAAAF,gBAAYG,WAAgB,EAAE;IAAA,IAAAC,gBAAA,CAAAF,OAAA,QAAAF,eAAA;IAAA,IAAAK,gBAAA,CAAAH,OAAA,iBAVqB,IAAAI,IAAA,CAAAJ,OAAA,CAAQ,CAAC;IAAA,IAAAG,gBAAA,CAAAH,OAAA;IAAA,IAAAG,gBAAA,CAAAH,OAAA,gCAES,IAAAI,IAAA,CAAAJ,OAAA,CAAQ,CAAC;IAS5E,IAAI,CAACC,WAAW,GAAGA,WAAW;EAChC;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EANE,WAAAI,aAAA,CAAAL,OAAA,EAAAF,eAAA;IAAAQ,GAAA;IAAAC,KAAA,EAOA,SAAOC,UAAUA,CACfC,eAA+C,EAC/CC,SAAoB,EAEV;MAAA,IADVC,MAAM,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,IAAI;MAEb,IAAI,IAAI,CAACG,KAAK,CAACC,GAAG,CAACN,SAAS,CAAC,EAAE;QAC7B,MAAM,IAAIO,KAAK,aAAAC,MAAA,CAAaR,SAAS,oBAAiB,CAAC;MACzD;MAEA,IAAMS,IAAc,GAAGV,eAAe,CAACW,cAAc,CAACV,SAAS,EAAEC,MAAM,CAAC;MAExE,IAAI,CAACI,KAAK,CAACM,GAAG,CAACX,SAAS,EAAES,IAAI,CAAC;MAE/B,IAAI,C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GAAAyB,SAAA,CAAAxB,IAAA;YAAA;cACrE5B,IAAI,GAAG,IAAI,CAACJ,KAAK,CAACU,GAAG,CAACf,SAAS,CAAC;cAAA,IAEjCS,IAAI;gBAAAoD,SAAA,CAAAxB,IAAA;gBAAA;cAAA;cAAA,MACD,IAAI9B,KAAK,aAAAC,MAAA,CAAaR,SAAS,oBAAiB,CAAC;YAAA;cAAA6D,SAAA,CAAAxB,IAAA;cAAA,OAGnD5B,IAAI,CAACqD,qBAAqB,CAACF,UAAU,CAAC;YAAA;cAE5C,IAAI,CAACrE,WAAW,CAACqB,MAAM,CAACC,IAAI,sFAAAL,MAAA,CAC2DoD,UAAU,WAAApD,MAAA,CAAQR,SAAS,CAClH,CAAC;YAAC;YAAA;cAAA,OAAA6D,SAAA,CAAApB,IAAA;UAAA;QAAA,GAAAkB,QAAA;MAAA,CACH;MAAA,SAZYG,qBAAqBA,CAAAC,GAAA,EAAAC,GAAA;QAAA,OAAAN,sBAAA,CAAAd,KAAA,OAAA1C,SAAA;MAAA;MAAA,OAArB4D,qBAAqB;IAAA;IAclC;AACF;AACA;AACA;IAHE;EAAA;IAAAlE,GAAA;IAAAC,KAAA,EAIA,SAAOoE,KAAKA,CAAA,EAAS;MACnB,IAAI,CAAC5D,KAAK,CAAC6D,KAAK,CAAC,CAAC;IACpB;EAAC;AAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_internalMediaCore","require","_metrics","_interopRequireDefault","_constants","SendSlotManager","exports","default","LoggerProxy","_classCallCheck2","_defineProperty2","_map","_createClass2","key","value","createSlot","mediaConnection","mediaType","active","arguments","length","undefined","slots","has","Error","concat","slot","createSendSlot","set","logger","info","getSlot","get","setNamedMediaGroups","namedMediaGroups","MediaType","AudioMain","setSourceStateOverride","state","VideoMain","currentStateOverride","getSourceStateOverride","sourceStateOverrides","clearSourceStateOverride","delete","_publishStream","_asyncToGenerator2","_regenerator","mark","_callee","stream","wrap","_context","prev","next","publishStream","label","muted","stop","_x","_x2","apply","_unpublishStream","_callee2","_context2","unpublishStream","_x3","setActive","_setCodecParameters","_callee3","codecParameters","_context3","setCodecParameters","warn","Metrics","sendBehavioralMetric","BEHAVIORAL_METRICS","DEPRECATED_SET_CODEC_PARAMETERS_USED","_x4","_x5","_deleteCodecParameters","_callee4","parameters","_context4","deleteCodecParameters","DEPRECATED_DELETE_CODEC_PARAMETERS_USED","_x6","_x7","_setCustomCodecParameters","_callee5","codecMimeType","_t","_context5","setCustomCodecParameters","_stringify","error","SET_CUSTOM_CODEC_PARAMETERS_USED","finish","_x8","_x9","_x0","_markCustomCodecParametersForDeletion","_callee6","_context6","markCustomCodecParametersForDeletion","MARK_CUSTOM_CODEC_PARAMETERS_FOR_DELETION_USED","_x1","_x10","_x11","reset","clear"],"sources":["sendSlotManager.ts"],"sourcesContent":["import {\n SendSlot,\n MediaType,\n LocalStream,\n MultistreamRoapMediaConnection,\n NamedMediaGroup,\n StreamState,\n MediaCodecMimeType,\n CodecParameters,\n} from '@webex/internal-media-core';\nimport Metrics from '../metrics';\nimport BEHAVIORAL_METRICS from '../metrics/constants';\n\n/**\n * This class is used to manage the sendSlots for the given media types.\n */\nexport default class SendSlotManager {\n private readonly slots: Map<MediaType, SendSlot> = new Map();\n private readonly LoggerProxy: any;\n private readonly sourceStateOverrides: Map<MediaType, StreamState> = new Map();\n\n /**\n * Constructor for SendSlotManager\n *\n * @param {any} LoggerProxy is used to log the messages\n * @constructor\n */\n constructor(LoggerProxy: any) {\n this.LoggerProxy = LoggerProxy;\n }\n\n /**\n * This method is used to create a sendSlot for the given mediaType and returns the created sendSlot\n * @param {MultistreamRoapMediaConnection} mediaConnection MultistreamRoapMediaConnection for which a sendSlot needs to be created\n * @param {MediaType} mediaType MediaType for which a sendSlot needs to be created (AUDIO_MAIN/VIDEO_MAIN/AUDIO_SLIDES/VIDEO_SLIDES)\n * @param {boolean} active This is optional boolean to set the active state of the sendSlot. Default is true\n * @returns {SendSlot} slot The created sendSlot\n */\n public createSlot(\n mediaConnection: MultistreamRoapMediaConnection,\n mediaType: MediaType,\n active = true\n ): SendSlot {\n if (this.slots.has(mediaType)) {\n throw new Error(`Slot for ${mediaType} already exists`);\n }\n\n const slot: SendSlot = mediaConnection.createSendSlot(mediaType, active);\n\n this.slots.set(mediaType, slot);\n\n this.LoggerProxy.logger.info(\n `SendSlotsManager->createSlot#Created slot for ${mediaType} with active ${active}`\n );\n\n return slot;\n }\n\n /**\n * This method is used to retrieve the sendSlot for the given mediaType\n * @param {MediaType} mediaType of which the slot needs to be retrieved\n * @returns {SendSlot}\n */\n public getSlot(mediaType: MediaType): SendSlot {\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n return slot;\n }\n\n /**\n * Allow users to specify 'namedMediaGroups' to indicate which named media group its audio should be sent to.\n * @param {MediaType} mediaType MediaType of the sendSlot to which the audio stream needs to be send to the media group\n * @param {[]}namedMediaGroups - Allow users to specify 'namedMediaGroups'.If the value of 'namedMediaGroups' is zero,\n * named media group will be canceled and the audio stream will be sent to the floor.\n * @returns {void}\n */\n public setNamedMediaGroups(mediaType: MediaType, namedMediaGroups: NamedMediaGroup[]) {\n if (mediaType !== MediaType.AudioMain) {\n throw new Error(\n `sendSlotManager cannot set named media group which media type is ${mediaType}`\n );\n }\n\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n slot.setNamedMediaGroups(namedMediaGroups);\n\n this.LoggerProxy.logger.info(\n `SendSlotsManager->setNamedMediaGroups#set named media group ${namedMediaGroups}`\n );\n }\n\n /**\n * Sets the source state override for the given media type.\n * @param {MediaType} mediaType - The type of media (must be MediaType.VideoMain to apply source state changes).\n * @param {StreamState | null} state - The state to set or null to clear the override value.\n * @returns {void}\n */\n public setSourceStateOverride(mediaType: MediaType, state: StreamState | null) {\n if (mediaType !== MediaType.VideoMain) {\n throw new Error(\n `Invalid media type '${mediaType}'. Source state overrides are only applicable to ${MediaType.VideoMain}.`\n );\n }\n\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n const currentStateOverride = this.getSourceStateOverride(mediaType);\n if (currentStateOverride === state) {\n return;\n }\n\n if (state) {\n slot.setSourceStateOverride(state);\n this.sourceStateOverrides.set(mediaType, state);\n } else {\n slot.clearSourceStateOverride();\n this.sourceStateOverrides.delete(mediaType);\n }\n\n this.LoggerProxy.logger.info(\n `SendSlotManager->setSourceStateOverride#set source state override for ${mediaType} to ${state}`\n );\n }\n\n /**\n * Gets the source state override for the given media type.\n * @param {MediaType} mediaType - The type of media to get the source state override for.\n * @returns {StreamState | null} - The current source state override or null if not set.\n */\n private getSourceStateOverride(mediaType: MediaType): StreamState | null {\n if (mediaType !== MediaType.VideoMain) {\n throw new Error(\n `Invalid media type '${mediaType}'. Source state overrides are only applicable to ${MediaType.VideoMain}.`\n );\n }\n\n return this.sourceStateOverrides.get(mediaType) || null;\n }\n\n /**\n * This method publishes the given stream to the sendSlot for the given mediaType\n * @param {MediaType} mediaType MediaType of the sendSlot to which a stream needs to be published (AUDIO_MAIN/VIDEO_MAIN/AUDIO_SLIDES/VIDEO_SLIDES)\n * @param {LocalStream} stream LocalStream to be published\n * @returns {Promise<void>}\n */\n public async publishStream(mediaType: MediaType, stream: LocalStream): Promise<void> {\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n await slot.publishStream(stream);\n\n this.LoggerProxy.logger.info(\n `SendSlotsManager->publishStream#Published stream for ${mediaType} and stream with label ${stream.label} and muted ${stream.muted}`\n );\n }\n\n /**\n * This method unpublishes the stream from the sendSlot of the given mediaType\n * @param {MediaType} mediaType MediaType of the sendSlot from which a stream needs to be unpublished (AUDIO_MAIN/VIDEO_MAIN/AUDIO_SLIDES/VIDEO_SLIDES)\n * @returns {Promise<void>}\n */\n public async unpublishStream(mediaType: MediaType): Promise<void> {\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n await slot.unpublishStream();\n\n this.LoggerProxy.logger.info(\n `SendSlotsManager->unpublishStream#Unpublished stream for ${mediaType}`\n );\n }\n\n /**\n * This method is used to set the active state of the sendSlot for the given mediaType\n * @param {MediaType} mediaType The MediaType of the sendSlot for which the active state needs to be set (AUDIO_MAIN/VIDEO_MAIN/AUDIO_SLIDES/VIDEO_SLIDES)\n * @param {boolean} active The boolean to set the active state of the sendSlot. Default is true\n * @returns {void}\n */\n public setActive(mediaType: MediaType, active = true): void {\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n slot.active = active;\n\n this.LoggerProxy.logger.info(\n `SendSlotsManager->setActive#Set active for ${mediaType} to ${active}`\n );\n }\n\n /**\n * @deprecated Use {@link setCustomCodecParameters} instead, which requires specifying the codec MIME type.\n *\n * This method is used to set the codec parameters for the sendSlot of the given mediaType\n * @param {MediaType} mediaType MediaType of the sendSlot for which the codec parameters needs to be set (AUDIO_MAIN/VIDEO_MAIN/AUDIO_SLIDES/VIDEO_SLIDES)\n * @param {Object} codecParameters\n * @returns {Promise<void>}\n */\n public async setCodecParameters(\n mediaType: MediaType,\n codecParameters: {\n [key: string]: string | undefined; // As per ts-sdp undefined is considered as a valid value to be used for codec parameters\n }\n ): Promise<void> {\n // These codec parameter changes underneath are SDP value changes that are taken care by WCME automatically. So no need for any change in streams from the web sdk side\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n await slot.setCodecParameters(codecParameters);\n\n this.LoggerProxy.logger.warn(\n 'SendSlotsManager->setCodecParameters --> [DEPRECATION WARNING]: setCodecParameters has been deprecated, use setCustomCodecParameters instead'\n );\n\n Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.DEPRECATED_SET_CODEC_PARAMETERS_USED, {\n mediaType,\n codecParameters,\n });\n }\n\n /**\n * @deprecated Use {@link markCustomCodecParametersForDeletion} instead, which requires specifying the codec MIME type.\n *\n * This method is used to delete the codec parameters for the sendSlot of the given mediaType\n * @param {MediaType} mediaType MediaType of the sendSlot for which the codec parameters needs to be deleted (AUDIO_MAIN/VIDEO_MAIN/AUDIO_SLIDES/VIDEO_SLIDES)\n * @param {Array<String>} parameters Array of keys of the codec parameters to be deleted\n * @returns {Promise<void>}\n */\n public async deleteCodecParameters(mediaType: MediaType, parameters: string[]): Promise<void> {\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n await slot.deleteCodecParameters(parameters);\n\n this.LoggerProxy.logger.warn(\n 'SendSlotsManager->deleteCodecParameters --> [DEPRECATION WARNING]: deleteCodecParameters has been deprecated, use markCustomCodecParametersForDeletion instead'\n );\n\n Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.DEPRECATED_DELETE_CODEC_PARAMETERS_USED, {\n mediaType,\n parameters,\n });\n }\n\n /**\n * Sets custom codec parameters for the sendSlot of the given mediaType, scoped to a specific codec MIME type.\n * Delegates to WCME's setCustomCodecParameters API.\n * @param {MediaType} mediaType MediaType of the sendSlot\n * @param {MediaCodecMimeType} codecMimeType The codec MIME type to apply parameters to (e.g. OPUS, H264, AV1)\n * @param {CodecParameters} parameters Key-value pairs of codec parameters to set\n * @returns {Promise<void>}\n */\n public async setCustomCodecParameters(\n mediaType: MediaType,\n codecMimeType: MediaCodecMimeType,\n parameters: CodecParameters\n ): Promise<void> {\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n try {\n await slot.setCustomCodecParameters(codecMimeType, parameters);\n\n this.LoggerProxy.logger.info(\n `SendSlotsManager->setCustomCodecParameters#Set custom codec parameters for ${mediaType} (codec: ${codecMimeType}) to ${JSON.stringify(\n parameters\n )}`\n );\n } catch (error) {\n this.LoggerProxy.logger.error(\n `SendSlotsManager->setCustomCodecParameters#Failed to set custom codec parameters for ${mediaType} (codec: ${codecMimeType}): ${error}`\n );\n throw error;\n } finally {\n Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.SET_CUSTOM_CODEC_PARAMETERS_USED, {\n mediaType,\n codecMimeType,\n parameters,\n });\n }\n }\n\n /**\n * Marks custom codec parameters for deletion on the sendSlot of the given mediaType, scoped to a specific codec MIME type.\n * Delegates to WCME's markCustomCodecParametersForDeletion API.\n * @param {MediaType} mediaType MediaType of the sendSlot\n * @param {MediaCodecMimeType} codecMimeType The codec MIME type whose parameters should be deleted (e.g. OPUS, H264, AV1)\n * @param {string[]} parameters Array of parameter keys to delete\n * @returns {Promise<void>}\n */\n public async markCustomCodecParametersForDeletion(\n mediaType: MediaType,\n codecMimeType: MediaCodecMimeType,\n parameters: string[]\n ): Promise<void> {\n const slot = this.slots.get(mediaType);\n\n if (!slot) {\n throw new Error(`Slot for ${mediaType} does not exist`);\n }\n\n await slot.markCustomCodecParametersForDeletion(codecMimeType, parameters);\n\n this.LoggerProxy.logger.info(\n `SendSlotsManager->markCustomCodecParametersForDeletion#Marked codec parameters for deletion -> ${parameters} for ${mediaType} (codec: ${codecMimeType})`\n );\n\n Metrics.sendBehavioralMetric(\n BEHAVIORAL_METRICS.MARK_CUSTOM_CODEC_PARAMETERS_FOR_DELETION_USED,\n {\n mediaType,\n codecMimeType,\n parameters,\n }\n );\n }\n\n /**\n * This method is used to reset the SendSlotsManager by deleting all the sendSlots\n * @returns {undefined}\n */\n public reset(): void {\n this.slots.clear();\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AAAA,IAAAA,kBAAA,GAAAC,OAAA;AAUA,IAAAC,QAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,UAAA,GAAAD,sBAAA,CAAAF,OAAA;AAEA;AACA;AACA;AAFA,IAGqBI,eAAe,GAAAC,OAAA,CAAAC,OAAA;EAKlC;AACF;AACA;AACA;AACA;AACA;EACE,SAAAF,gBAAYG,WAAgB,EAAE;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A,CAAAlD,IAAA,GAAAkD,SAAA,CAAAjD,IAAA;YAAA;cAEd5B,IAAI,GAAG,IAAI,CAACJ,KAAK,CAACU,GAAG,CAACf,SAAS,CAAC;cAAA,IAEjCS,IAAI;gBAAA6E,SAAA,CAAAjD,IAAA;gBAAA;cAAA;cAAA,MACD,IAAI9B,KAAK,aAAAC,MAAA,CAAaR,SAAS,oBAAiB,CAAC;YAAA;cAAAsF,SAAA,CAAAjD,IAAA;cAAA,OAGnD5B,IAAI,CAAC8E,oCAAoC,CAACd,aAAa,EAAER,UAAU,CAAC;YAAA;cAE1E,IAAI,CAAC1E,WAAW,CAACqB,MAAM,CAACC,IAAI,mGAAAL,MAAA,CACwEyD,UAAU,WAAAzD,MAAA,CAAQR,SAAS,eAAAQ,MAAA,CAAYiE,aAAa,MACxJ,CAAC;cAEDhB,gBAAO,CAACC,oBAAoB,CAC1BC,kBAAkB,CAAC6B,8CAA8C,EACjE;gBACExF,SAAS,EAATA,SAAS;gBACTyE,aAAa,EAAbA,aAAa;gBACbR,UAAU,EAAVA;cACF,CACF,CAAC;YAAC;YAAA;cAAA,OAAAqB,SAAA,CAAA7C,IAAA;UAAA;QAAA,GAAA4C,QAAA;MAAA,CACH;MAAA,SAzBYE,oCAAoCA,CAAAE,GAAA,EAAAC,IAAA,EAAAC,IAAA;QAAA,OAAAP,qCAAA,CAAAxC,KAAA,OAAA1C,SAAA;MAAA;MAAA,OAApCqF,oCAAoC;IAAA;IA2BjD;AACF;AACA;AACA;IAHE;EAAA;IAAA3F,GAAA;IAAAC,KAAA,EAIA,SAAO+F,KAAKA,CAAA,EAAS;MACnB,IAAI,CAACvF,KAAK,CAACwF,KAAK,CAAC,CAAC;IACpB;EAAC;AAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_eventsScope","_interopRequireDefault","require","_loggerProxy","_reachability","_reachabilityPeerConnection","_createForOfIteratorHelper","r","e","t","_Symbol","_Symbol$iterator","_Array$isArray","_unsupportedIterableToArray","length","_n","F","s","n","done","value","f","TypeError","o","a","u","call","next","return","_arrayLikeToArray","toString","slice","constructor","name","_Array$from","test","Array","_callSuper","_getPrototypeOf2","default","_possibleConstructorReturn2","_isNativeReflectConstruct","_Reflect$construct","apply","Boolean","prototype","valueOf","Events","exports","resultReady","clientMediaIpsUpdated","natTypeUpdated","ClusterReachability","_EventsScope","clusterInfo","_this","enablePerUdpUrlReachability","arguments","undefined","_classCallCheck2","_defineProperty2","_set","isVideoMesh","initializePerUdpUrlReachabilityCheck","initializeSingleReachabilityPeerConnection","_inherits2","_createClass2","key","reachabilityPeerConnection","ReachabilityPeerConnection","setupReachabilityPeerConnectionEventListeners","_this2","LoggerProxy","logger","log","concat","udp","forEach","udpUrl","singleUdpClusterInfo","tcp","xtls","rpc","reachabilityPeerConnectionsForUdp","push","tcpTlsClusterInfo","_this3","isUdpPerUrl","on","ReachabilityPeerConnectionEvents","data","protocol","udpResultEmitted","result","emit","file","function","reachedSubnets","subnets","subnet","add","getResult","_this$reachabilityPee","_this$reachabilityPee2","_iterator","_step","rpcResult","err","mainResult","_start","_asyncToGenerator2","_regenerator","mark","_callee","startPromises","wrap","_context","prev","start","_promise","all","abrupt","stop","abort","_this$reachabilityPee3","EventsScope"],"sources":["clusterReachability.ts"],"sourcesContent":["import {ClusterNode} from './request';\nimport EventsScope from '../common/events/events-scope';\nimport LoggerProxy from '../common/logs/logger-proxy';\n\nimport {Enum} from '../constants';\nimport {\n ClusterReachabilityResult,\n NatType,\n ReachabilityPeerConnectionEvents,\n} from './reachability.types';\nimport {ReachabilityPeerConnection} from './reachabilityPeerConnection';\n\n// data for the Events.resultReady event\nexport type ResultEventData = {\n protocol: 'udp' | 'tcp' | 'xtls';\n result: 'reachable' | 'unreachable' | 'untested';\n latencyInMilliseconds: number; // amount of time it took to get the ICE candidate\n clientMediaIPs?: string[];\n};\n\n// data for the Events.clientMediaIpsUpdated event\nexport type ClientMediaIpsUpdatedEventData = {\n protocol: 'udp' | 'tcp' | 'xtls';\n clientMediaIPs: string[];\n};\n\nexport type NatTypeUpdatedEventData = {\n natType: NatType;\n};\n\nexport const Events = {\n resultReady: 'resultReady', // emitted when a cluster is reached successfully using specific protocol\n clientMediaIpsUpdated: 'clientMediaIpsUpdated', // emitted when more public IPs are found after resultReady was already sent for a given protocol\n natTypeUpdated: 'natTypeUpdated', // emitted when NAT type is determined\n} as const;\n\nexport type Events = Enum<typeof Events>;\n\n/**\n * A class that handles reachability checks for a single cluster.\n * Creates and orchestrates ReachabilityPeerConnection instance(s).\n * Listens to events and emits them to consumers.\n *\n * When enablePerUdpUrlReachability is true:\n * - Creates one ReachabilityPeerConnection for each UDP URL\n * - Creates one ReachabilityPeerConnection for all TCP and TLS URLs together\n * Otherwise:\n * - Creates a single ReachabilityPeerConnection for all URLs\n */\nexport class ClusterReachability extends EventsScope {\n private reachabilityPeerConnection: ReachabilityPeerConnection | null = null;\n private reachabilityPeerConnectionsForUdp: ReachabilityPeerConnection[] = [];\n\n public readonly isVideoMesh: boolean;\n public readonly name;\n public readonly reachedSubnets: Set<string> = new Set();\n\n private enablePerUdpUrlReachability: boolean;\n private udpResultEmitted = false;\n\n /**\n * Constructor for ClusterReachability\n * @param {string} name cluster name\n * @param {ClusterNode} clusterInfo information about the media cluster\n * @param {boolean} enablePerUdpUrlReachability whether to create separate peer connections per UDP URL\n */\n constructor(name: string, clusterInfo: ClusterNode, enablePerUdpUrlReachability = false) {\n super();\n this.name = name;\n this.isVideoMesh = clusterInfo.isVideoMesh;\n this.enablePerUdpUrlReachability = enablePerUdpUrlReachability;\n\n if (this.enablePerUdpUrlReachability) {\n this.initializePerUdpUrlReachabilityCheck(clusterInfo);\n } else {\n this.initializeSingleReachabilityPeerConnection(clusterInfo);\n }\n }\n\n /**\n * Initializes a single ReachabilityPeerConnection for all protocols\n * @param {ClusterNode} clusterInfo information about the media cluster\n * @returns {void}\n */\n private initializeSingleReachabilityPeerConnection(clusterInfo: ClusterNode) {\n this.reachabilityPeerConnection = new ReachabilityPeerConnection(this.name, clusterInfo);\n this.setupReachabilityPeerConnectionEventListeners(this.reachabilityPeerConnection);\n }\n\n /**\n * Initializes per-URL UDP reachability checks:\n * - One ReachabilityPeerConnection per UDP URL\n * - One ReachabilityPeerConnection for all TCP and TLS URLs together\n * @param {ClusterNode} clusterInfo information about the media cluster\n * @returns {void}\n */\n private initializePerUdpUrlReachabilityCheck(clusterInfo: ClusterNode) {\n LoggerProxy.logger.log(\n `ClusterReachability#initializePerUdpUrlReachabilityCheck --> cluster: ${this.name}, performing per-URL UDP reachability for ${clusterInfo.udp.length} URLs`\n );\n\n // Create one ReachabilityPeerConnection for each UDP URL\n clusterInfo.udp.forEach((udpUrl) => {\n const singleUdpClusterInfo: ClusterNode = {\n isVideoMesh: clusterInfo.isVideoMesh,\n udp: [udpUrl],\n tcp: [],\n xtls: [],\n };\n const rpc = new ReachabilityPeerConnection(this.name, singleUdpClusterInfo);\n this.setupReachabilityPeerConnectionEventListeners(rpc, true);\n this.reachabilityPeerConnectionsForUdp.push(rpc);\n });\n\n // Create one ReachabilityPeerConnection for all TCP and TLS URLs together\n if (clusterInfo.tcp.length > 0 || clusterInfo.xtls.length > 0) {\n const tcpTlsClusterInfo: ClusterNode = {\n isVideoMesh: clusterInfo.isVideoMesh,\n udp: [],\n tcp: clusterInfo.tcp,\n xtls: clusterInfo.xtls,\n };\n this.reachabilityPeerConnection = new ReachabilityPeerConnection(\n this.name,\n tcpTlsClusterInfo\n );\n this.setupReachabilityPeerConnectionEventListeners(this.reachabilityPeerConnection);\n }\n }\n\n /**\n * Sets up event listeners for a ReachabilityPeerConnection instance\n * @param {ReachabilityPeerConnection} rpc the ReachabilityPeerConnection instance\n * @param {boolean} isUdpPerUrl whether this is a per-URL UDP instance\n * @returns {void}\n */\n private setupReachabilityPeerConnectionEventListeners(\n rpc: ReachabilityPeerConnection,\n isUdpPerUrl = false\n ) {\n rpc.on(ReachabilityPeerConnectionEvents.resultReady, (data) => {\n // For per-URL UDP checks, only emit the first successful UDP result\n if (isUdpPerUrl && data.protocol === 'udp') {\n if (this.udpResultEmitted) {\n return;\n }\n if (data.result === 'reachable') {\n this.udpResultEmitted = true;\n }\n }\n\n this.emit(\n {\n file: 'clusterReachability',\n function: 'setupReachabilityPeerConnectionEventListeners',\n },\n Events.resultReady,\n data\n );\n });\n\n rpc.on(ReachabilityPeerConnectionEvents.clientMediaIpsUpdated, (data) => {\n this.emit(\n {\n file: 'clusterReachability',\n function: 'setupReachabilityPeerConnectionEventListeners',\n },\n Events.clientMediaIpsUpdated,\n data\n );\n });\n\n rpc.on(ReachabilityPeerConnectionEvents.natTypeUpdated, (data) => {\n this.emit(\n {\n file: 'clusterReachability',\n function: 'setupReachabilityPeerConnectionEventListeners',\n },\n Events.natTypeUpdated,\n data\n );\n });\n\n rpc.on(ReachabilityPeerConnectionEvents.reachedSubnets, (data) => {\n data.subnets.forEach((subnet: string) => {\n this.reachedSubnets.add(subnet);\n });\n });\n }\n\n /**\n * Gets the aggregated reachability result for this cluster.\n * @returns {ClusterReachabilityResult} reachability result for this cluster\n */\n getResult(): ClusterReachabilityResult {\n if (!this.enablePerUdpUrlReachability) {\n return (\n this.reachabilityPeerConnection?.getResult() ?? {\n udp: {result: 'untested'},\n tcp: {result: 'untested'},\n xtls: {result: 'untested'},\n }\n );\n }\n\n const result: ClusterReachabilityResult = {\n udp: {result: 'untested'},\n tcp: {result: 'untested'},\n xtls: {result: 'untested'},\n };\n\n // Get the first reachable UDP result from per-URL instances\n for (const rpc of this.reachabilityPeerConnectionsForUdp) {\n const rpcResult = rpc.getResult();\n if (rpcResult.udp.result === 'reachable') {\n result.udp = rpcResult.udp;\n break;\n }\n if (rpcResult.udp.result === 'unreachable' && result.udp.result === 'untested') {\n result.udp = rpcResult.udp;\n }\n }\n\n // Get TCP and TLS results from the main peer connection\n if (this.reachabilityPeerConnection) {\n const mainResult = this.reachabilityPeerConnection.getResult();\n result.tcp = mainResult.tcp;\n result.xtls = mainResult.xtls;\n }\n\n return result;\n }\n\n /**\n * Starts the process of doing UDP, TCP, and XTLS reachability checks on the media cluster.\n * @returns {Promise<ClusterReachabilityResult>}\n */\n async start(): Promise<ClusterReachabilityResult> {\n const startPromises: Promise<ClusterReachabilityResult>[] = [];\n\n this.reachabilityPeerConnectionsForUdp.forEach((rpc) => {\n startPromises.push(rpc.start());\n });\n\n if (this.reachabilityPeerConnection) {\n startPromises.push(this.reachabilityPeerConnection.start());\n }\n\n await Promise.all(startPromises);\n\n return this.getResult();\n }\n\n /**\n * Aborts the cluster reachability checks\n * @returns {void}\n */\n public abort() {\n this.reachabilityPeerConnectionsForUdp.forEach((rpc) => rpc.abort());\n this.reachabilityPeerConnection?.abort();\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,YAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAF,sBAAA,CAAAC,OAAA;AAGA,IAAAE,aAAA,GAAAF,OAAA;AAKA,IAAAG,2BAAA,GAAAH,OAAA;AAAwE,SAAAI,2BAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,yBAAAC,OAAA,IAAAH,CAAA,CAAAI,gBAAA,KAAAJ,CAAA,qBAAAE,CAAA,QAAAG,cAAA,CAAAL,CAAA,MAAAE,CAAA,GAAAI,2BAAA,CAAAN,CAAA,MAAAC,CAAA,IAAAD,CAAA,uBAAAA,CAAA,CAAAO,MAAA,IAAAL,CAAA,KAAAF,CAAA,GAAAE,CAAA,OAAAM,EAAA,MAAAC,CAAA,YAAAA,EAAA,eAAAC,CAAA,EAAAD,CAAA,EAAAE,CAAA,WAAAA,EAAA,WAAAH,EAAA,IAAAR,CAAA,CAAAO,MAAA,KAAAK,IAAA,WAAAA,IAAA,MAAAC,KAAA,EAAAb,CAAA,CAAAQ,EAAA,UAAAP,CAAA,WAAAA,EAAAD,CAAA,UAAAA,CAAA,KAAAc,CAAA,EAAAL,CAAA,gBAAAM,SAAA,iJAAAC,CAAA,E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OAAL6D,KAAK;IAAA;IAgBX;AACF;AACA;AACA;IAHE;EAAA;IAAAnD,GAAA;IAAA/C,KAAA,EAIA,SAAOuG,KAAKA,CAAA,EAAG;MAAA,IAAAC,sBAAA;MACb,IAAI,CAACzC,iCAAiC,CAACN,OAAO,CAAC,UAACK,GAAG;QAAA,OAAKA,GAAG,CAACyC,KAAK,CAAC,CAAC;MAAA,EAAC;MACpE,CAAAC,sBAAA,OAAI,CAACxD,0BAA0B,cAAAwD,sBAAA,uBAA/BA,sBAAA,CAAiCD,KAAK,CAAC,CAAC;IAC1C;EAAC;AAAA,EAnNsCE,oBAAW","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_eventsScope","_interopRequireDefault","require","_loggerProxy","_reachability","_reachabilityPeerConnection","_createForOfIteratorHelper","r","e","t","_Symbol","_Symbol$iterator","_Array$isArray","_unsupportedIterableToArray","length","_n","F","s","n","done","value","f","TypeError","o","a","u","call","next","return","_arrayLikeToArray","toString","slice","constructor","name","_Array$from","test","Array","_callSuper","_getPrototypeOf2","default","_possibleConstructorReturn2","_isNativeReflectConstruct","_Reflect$construct","apply","Boolean","prototype","valueOf","Events","exports","resultReady","clientMediaIpsUpdated","natTypeUpdated","ClusterReachability","_EventsScope","clusterInfo","_this","enablePerUdpUrlReachability","arguments","undefined","_classCallCheck2","_defineProperty2","_set","isVideoMesh","initializePerUdpUrlReachabilityCheck","initializeSingleReachabilityPeerConnection","_inherits2","_createClass2","key","reachabilityPeerConnection","ReachabilityPeerConnection","setupReachabilityPeerConnectionEventListeners","_this2","LoggerProxy","logger","log","concat","udp","forEach","udpUrl","singleUdpClusterInfo","tcp","xtls","rpc","reachabilityPeerConnectionsForUdp","push","tcpTlsClusterInfo","_this3","isUdpPerUrl","on","ReachabilityPeerConnectionEvents","data","protocol","udpResultEmitted","result","emit","file","function","reachedSubnets","subnets","subnet","add","getResult","_this$reachabilityPee","_this$reachabilityPee2","_iterator","_step","rpcResult","err","mainResult","_start","_asyncToGenerator2","_regenerator","mark","_callee","startPromises","wrap","_context","prev","start","_promise","all","abrupt","stop","abort","_this$reachabilityPee3","EventsScope"],"sources":["clusterReachability.ts"],"sourcesContent":["import {ClusterNode} from './request';\nimport EventsScope from '../common/events/events-scope';\nimport LoggerProxy from '../common/logs/logger-proxy';\n\nimport {Enum} from '../constants';\nimport {\n ClusterReachabilityResult,\n NatType,\n Protocol,\n ReachabilityPeerConnectionEvents,\n} from './reachability.types';\nimport {ReachabilityPeerConnection} from './reachabilityPeerConnection';\n\n// data for the Events.resultReady event\nexport type ResultEventData = {\n protocol: Protocol;\n result: 'reachable' | 'unreachable' | 'untested';\n latencyInMilliseconds: number; // amount of time it took to get the ICE candidate\n clientMediaIPs?: string[];\n};\n\n// data for the Events.clientMediaIpsUpdated event\nexport type ClientMediaIpsUpdatedEventData = {\n protocol: Protocol;\n clientMediaIPs: string[];\n};\n\nexport type NatTypeUpdatedEventData = {\n natType: NatType;\n};\n\nexport const Events = {\n resultReady: 'resultReady', // emitted when a cluster is reached successfully using specific protocol\n clientMediaIpsUpdated: 'clientMediaIpsUpdated', // emitted when more public IPs are found after resultReady was already sent for a given protocol\n natTypeUpdated: 'natTypeUpdated', // emitted when NAT type is determined\n} as const;\n\nexport type Events = Enum<typeof Events>;\n\n/**\n * A class that handles reachability checks for a single cluster.\n * Creates and orchestrates ReachabilityPeerConnection instance(s).\n * Listens to events and emits them to consumers.\n *\n * When enablePerUdpUrlReachability is true:\n * - Creates one ReachabilityPeerConnection for each UDP URL\n * - Creates one ReachabilityPeerConnection for all TCP and TLS URLs together\n * Otherwise:\n * - Creates a single ReachabilityPeerConnection for all URLs\n */\nexport class ClusterReachability extends EventsScope {\n private reachabilityPeerConnection: ReachabilityPeerConnection | null = null;\n private reachabilityPeerConnectionsForUdp: ReachabilityPeerConnection[] = [];\n\n public readonly isVideoMesh: boolean;\n public readonly name;\n public readonly reachedSubnets: Set<string> = new Set();\n\n private enablePerUdpUrlReachability: boolean;\n private udpResultEmitted = false;\n\n /**\n * Constructor for ClusterReachability\n * @param {string} name cluster name\n * @param {ClusterNode} clusterInfo information about the media cluster\n * @param {boolean} enablePerUdpUrlReachability whether to create separate peer connections per UDP URL\n */\n constructor(name: string, clusterInfo: ClusterNode, enablePerUdpUrlReachability = false) {\n super();\n this.name = name;\n this.isVideoMesh = clusterInfo.isVideoMesh;\n this.enablePerUdpUrlReachability = enablePerUdpUrlReachability;\n\n if (this.enablePerUdpUrlReachability) {\n this.initializePerUdpUrlReachabilityCheck(clusterInfo);\n } else {\n this.initializeSingleReachabilityPeerConnection(clusterInfo);\n }\n }\n\n /**\n * Initializes a single ReachabilityPeerConnection for all protocols\n * @param {ClusterNode} clusterInfo information about the media cluster\n * @returns {void}\n */\n private initializeSingleReachabilityPeerConnection(clusterInfo: ClusterNode) {\n this.reachabilityPeerConnection = new ReachabilityPeerConnection(this.name, clusterInfo);\n this.setupReachabilityPeerConnectionEventListeners(this.reachabilityPeerConnection);\n }\n\n /**\n * Initializes per-URL UDP reachability checks:\n * - One ReachabilityPeerConnection per UDP URL\n * - One ReachabilityPeerConnection for all TCP and TLS URLs together\n * @param {ClusterNode} clusterInfo information about the media cluster\n * @returns {void}\n */\n private initializePerUdpUrlReachabilityCheck(clusterInfo: ClusterNode) {\n LoggerProxy.logger.log(\n `ClusterReachability#initializePerUdpUrlReachabilityCheck --> cluster: ${this.name}, performing per-URL UDP reachability for ${clusterInfo.udp.length} URLs`\n );\n\n // Create one ReachabilityPeerConnection for each UDP URL\n clusterInfo.udp.forEach((udpUrl) => {\n const singleUdpClusterInfo: ClusterNode = {\n isVideoMesh: clusterInfo.isVideoMesh,\n udp: [udpUrl],\n tcp: [],\n xtls: [],\n };\n const rpc = new ReachabilityPeerConnection(this.name, singleUdpClusterInfo);\n this.setupReachabilityPeerConnectionEventListeners(rpc, true);\n this.reachabilityPeerConnectionsForUdp.push(rpc);\n });\n\n // Create one ReachabilityPeerConnection for all TCP and TLS URLs together\n if (clusterInfo.tcp.length > 0 || clusterInfo.xtls.length > 0) {\n const tcpTlsClusterInfo: ClusterNode = {\n isVideoMesh: clusterInfo.isVideoMesh,\n udp: [],\n tcp: clusterInfo.tcp,\n xtls: clusterInfo.xtls,\n };\n this.reachabilityPeerConnection = new ReachabilityPeerConnection(\n this.name,\n tcpTlsClusterInfo\n );\n this.setupReachabilityPeerConnectionEventListeners(this.reachabilityPeerConnection);\n }\n }\n\n /**\n * Sets up event listeners for a ReachabilityPeerConnection instance\n * @param {ReachabilityPeerConnection} rpc the ReachabilityPeerConnection instance\n * @param {boolean} isUdpPerUrl whether this is a per-URL UDP instance\n * @returns {void}\n */\n private setupReachabilityPeerConnectionEventListeners(\n rpc: ReachabilityPeerConnection,\n isUdpPerUrl = false\n ) {\n rpc.on(ReachabilityPeerConnectionEvents.resultReady, (data) => {\n // For per-URL UDP checks, only emit the first successful UDP result\n if (isUdpPerUrl && data.protocol === 'udp') {\n if (this.udpResultEmitted) {\n return;\n }\n if (data.result === 'reachable') {\n this.udpResultEmitted = true;\n }\n }\n\n this.emit(\n {\n file: 'clusterReachability',\n function: 'setupReachabilityPeerConnectionEventListeners',\n },\n Events.resultReady,\n data\n );\n });\n\n rpc.on(ReachabilityPeerConnectionEvents.clientMediaIpsUpdated, (data) => {\n this.emit(\n {\n file: 'clusterReachability',\n function: 'setupReachabilityPeerConnectionEventListeners',\n },\n Events.clientMediaIpsUpdated,\n data\n );\n });\n\n rpc.on(ReachabilityPeerConnectionEvents.natTypeUpdated, (data) => {\n this.emit(\n {\n file: 'clusterReachability',\n function: 'setupReachabilityPeerConnectionEventListeners',\n },\n Events.natTypeUpdated,\n data\n );\n });\n\n rpc.on(ReachabilityPeerConnectionEvents.reachedSubnets, (data) => {\n data.subnets.forEach((subnet: string) => {\n this.reachedSubnets.add(subnet);\n });\n });\n }\n\n /**\n * Gets the aggregated reachability result for this cluster.\n * @returns {ClusterReachabilityResult} reachability result for this cluster\n */\n getResult(): ClusterReachabilityResult {\n if (!this.enablePerUdpUrlReachability) {\n return (\n this.reachabilityPeerConnection?.getResult() ?? {\n udp: {result: 'untested'},\n tcp: {result: 'untested'},\n xtls: {result: 'untested'},\n }\n );\n }\n\n const result: ClusterReachabilityResult = {\n udp: {result: 'untested'},\n tcp: {result: 'untested'},\n xtls: {result: 'untested'},\n };\n\n // Get the first reachable UDP result from per-URL instances\n for (const rpc of this.reachabilityPeerConnectionsForUdp) {\n const rpcResult = rpc.getResult();\n if (rpcResult.udp.result === 'reachable') {\n result.udp = rpcResult.udp;\n break;\n }\n if (rpcResult.udp.result === 'unreachable' && result.udp.result === 'untested') {\n result.udp = rpcResult.udp;\n }\n }\n\n // Get TCP and TLS results from the main peer connection\n if (this.reachabilityPeerConnection) {\n const mainResult = this.reachabilityPeerConnection.getResult();\n result.tcp = mainResult.tcp;\n result.xtls = mainResult.xtls;\n }\n\n return result;\n }\n\n /**\n * Starts the process of doing UDP, TCP, and XTLS reachability checks on the media cluster.\n * @returns {Promise<ClusterReachabilityResult>}\n */\n async start(): Promise<ClusterReachabilityResult> {\n const startPromises: Promise<ClusterReachabilityResult>[] = [];\n\n this.reachabilityPeerConnectionsForUdp.forEach((rpc) => {\n startPromises.push(rpc.start());\n });\n\n if (this.reachabilityPeerConnection) {\n startPromises.push(this.reachabilityPeerConnection.start());\n }\n\n await Promise.all(startPromises);\n\n return this.getResult();\n }\n\n /**\n * Aborts the cluster reachability checks\n * @returns {void}\n */\n public abort() {\n this.reachabilityPeerConnectionsForUdp.forEach((rpc) => rpc.abort());\n this.reachabilityPeerConnection?.abort();\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,YAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAF,sBAAA,CAAAC,OAAA;AAGA,IAAAE,aAAA,GAAAF,OAAA;AAMA,IAAAG,2BAAA,GAAAH,OAAA;AAAwE,SAAAI,2BAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,yBAAAC,OAAA,IAAAH,CAAA,CAA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CAAC,CAAC;cACjC,CAAC,CAAC;cAEF,IAAI,IAAI,CAAClD,0BAA0B,EAAE;gBACnC8C,aAAa,CAAC9B,IAAI,CAAC,IAAI,CAAChB,0BAA0B,CAACkD,KAAK,CAAC,CAAC,CAAC;cAC7D;cAACF,QAAA,CAAAzF,IAAA;cAAA,OAEK4F,QAAA,CAAAhF,OAAA,CAAQiF,GAAG,CAACN,aAAa,CAAC;YAAA;cAAA,OAAAE,QAAA,CAAAK,MAAA,WAEzB,IAAI,CAACpB,SAAS,CAAC,CAAC;YAAA;YAAA;cAAA,OAAAe,QAAA,CAAAM,IAAA;UAAA;QAAA,GAAAT,OAAA;MAAA,CACxB;MAAA,SAdKK,KAAKA,CAAA;QAAA,OAAAT,MAAA,CAAAlE,KAAA,OAAAc,SAAA;MAAA;MAAA,OAAL6D,KAAK;IAAA;IAgBX;AACF;AACA;AACA;IAHE;EAAA;IAAAnD,GAAA;IAAA/C,KAAA,EAIA,SAAOuG,KAAKA,CAAA,EAAG;MAAA,IAAAC,sBAAA;MACb,IAAI,CAACzC,iCAAiC,CAACN,OAAO,CAAC,UAACK,GAAG;QAAA,OAAKA,GAAG,CAACyC,KAAK,CAAC,CAAC;MAAA,EAAC;MACpE,CAAAC,sBAAA,OAAI,CAACxD,0BAA0B,cAAAwD,sBAAA,uBAA/BA,sBAAA,CAAiCD,KAAK,CAAC,CAAC;IAC1C;EAAC;AAAA,EAnNsCE,oBAAW","ignoreList":[]}
|
|
@@ -37,6 +37,7 @@ var _constants = require("../constants");
|
|
|
37
37
|
var _request = _interopRequireDefault(require("./request"));
|
|
38
38
|
var _reachability = require("./reachability.types");
|
|
39
39
|
var _clusterReachability = require("./clusterReachability");
|
|
40
|
+
var _util2 = require("./util");
|
|
40
41
|
var _eventsScope = _interopRequireDefault(require("../common/events/events-scope"));
|
|
41
42
|
var _constants2 = _interopRequireDefault(require("../metrics/constants"));
|
|
42
43
|
var _metrics = _interopRequireDefault(require("../metrics"));
|
|
@@ -227,7 +228,7 @@ var Reachability = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
227
228
|
return _regenerator.default.wrap(function (_context2) {
|
|
228
229
|
while (1) switch (_context2.prev = _context2.next) {
|
|
229
230
|
case 0:
|
|
230
|
-
if (this.webex.config.meetings.enableReachabilityChecks) {
|
|
231
|
+
if ((0, _util2.isReachabilityEnabled)(this.webex.config.meetings.enableReachabilityChecks)) {
|
|
231
232
|
_context2.next = 1;
|
|
232
233
|
break;
|
|
233
234
|
}
|
|
@@ -652,7 +653,7 @@ var Reachability = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
652
653
|
* Returns true only if ALL protocols (UDP, TCP and TLS) have been tested and none
|
|
653
654
|
* of the media clusters where reachable with any of the protocols. This is done
|
|
654
655
|
* irrespective of the config, so for example:
|
|
655
|
-
* if config.meetings.
|
|
656
|
+
* if config.meetings.enableReachabilityChecks disables TLS,
|
|
656
657
|
* it will return false, because TLS reachability won't be tested,
|
|
657
658
|
* so we can't say for sure that media backend is unreachable over TLS.
|
|
658
659
|
*
|
|
@@ -721,6 +722,47 @@ var Reachability = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
721
722
|
}
|
|
722
723
|
return isWebexMediaBackendUnreachable;
|
|
723
724
|
}()
|
|
725
|
+
/**
|
|
726
|
+
* Checks if any cluster is reachable via the given protocol based on stored reachability results.
|
|
727
|
+
*
|
|
728
|
+
* @param {string} protocol - the protocol to check ('udp', 'tcp', or 'xtls')
|
|
729
|
+
* @returns {Promise<boolean>} true if at least one cluster has a 'reachable' result for the given protocol
|
|
730
|
+
*/
|
|
731
|
+
)
|
|
732
|
+
}, {
|
|
733
|
+
key: "isAnyClusterReachableViaProtocol",
|
|
734
|
+
value: (function () {
|
|
735
|
+
var _isAnyClusterReachableViaProtocol = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee0(protocol) {
|
|
736
|
+
var resultsJson, results, _t6;
|
|
737
|
+
return _regenerator.default.wrap(function (_context0) {
|
|
738
|
+
while (1) switch (_context0.prev = _context0.next) {
|
|
739
|
+
case 0:
|
|
740
|
+
_context0.prev = 0;
|
|
741
|
+
_context0.next = 1;
|
|
742
|
+
return this.webex.boundedStorage.get(this.namespace, _constants.REACHABILITY.localStorageResult);
|
|
743
|
+
case 1:
|
|
744
|
+
resultsJson = _context0.sent;
|
|
745
|
+
results = JSON.parse(resultsJson);
|
|
746
|
+
return _context0.abrupt("return", (0, _values.default)(results).some(function (result) {
|
|
747
|
+
var _result$protocol3;
|
|
748
|
+
return ((_result$protocol3 = result[protocol]) === null || _result$protocol3 === void 0 ? void 0 : _result$protocol3.result) === 'reachable';
|
|
749
|
+
}));
|
|
750
|
+
case 2:
|
|
751
|
+
_context0.prev = 2;
|
|
752
|
+
_t6 = _context0["catch"](0);
|
|
753
|
+
_loggerProxy.default.logger.warn("Reachability:index#isAnyClusterReachableViaProtocol --> Error reading reachability data: ".concat(_t6));
|
|
754
|
+
return _context0.abrupt("return", false);
|
|
755
|
+
case 3:
|
|
756
|
+
case "end":
|
|
757
|
+
return _context0.stop();
|
|
758
|
+
}
|
|
759
|
+
}, _callee0, this, [[0, 2]]);
|
|
760
|
+
}));
|
|
761
|
+
function isAnyClusterReachableViaProtocol(_x4) {
|
|
762
|
+
return _isAnyClusterReachableViaProtocol.apply(this, arguments);
|
|
763
|
+
}
|
|
764
|
+
return isAnyClusterReachableViaProtocol;
|
|
765
|
+
}()
|
|
724
766
|
/**
|
|
725
767
|
* Get list of all unreachable clusters
|
|
726
768
|
* @returns {array} Unreachable clusters
|
|
@@ -900,15 +942,15 @@ var Reachability = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
900
942
|
}, {
|
|
901
943
|
key: "sendMetric",
|
|
902
944
|
value: (function () {
|
|
903
|
-
var _sendMetric = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
945
|
+
var _sendMetric = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee1() {
|
|
904
946
|
var aborted,
|
|
905
947
|
results,
|
|
906
948
|
stats,
|
|
907
|
-
|
|
908
|
-
return _regenerator.default.wrap(function (
|
|
909
|
-
while (1) switch (
|
|
949
|
+
_args1 = arguments;
|
|
950
|
+
return _regenerator.default.wrap(function (_context1) {
|
|
951
|
+
while (1) switch (_context1.prev = _context1.next) {
|
|
910
952
|
case 0:
|
|
911
|
-
aborted =
|
|
953
|
+
aborted = _args1.length > 0 && _args1[0] !== undefined ? _args1[0] : false;
|
|
912
954
|
results = [];
|
|
913
955
|
(0, _values.default)(this.clusterReachability).forEach(function (clusterReachability) {
|
|
914
956
|
results.push(_objectSpread(_objectSpread({}, clusterReachability.getResult()), {}, {
|
|
@@ -940,9 +982,9 @@ var Reachability = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
940
982
|
_metrics.default.sendBehavioralMetric(_constants2.default.REACHABILITY_COMPLETED, _metrics.default.prepareMetricFields(stats));
|
|
941
983
|
case 1:
|
|
942
984
|
case "end":
|
|
943
|
-
return
|
|
985
|
+
return _context1.stop();
|
|
944
986
|
}
|
|
945
|
-
},
|
|
987
|
+
}, _callee1, this);
|
|
946
988
|
}));
|
|
947
989
|
function sendMetric() {
|
|
948
990
|
return _sendMetric.apply(this, arguments);
|
|
@@ -998,19 +1040,19 @@ var Reachability = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
998
1040
|
}, {
|
|
999
1041
|
key: "storeResults",
|
|
1000
1042
|
value: (function () {
|
|
1001
|
-
var _storeResults = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1002
|
-
return _regenerator.default.wrap(function (
|
|
1003
|
-
while (1) switch (
|
|
1043
|
+
var _storeResults = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee10(results) {
|
|
1044
|
+
return _regenerator.default.wrap(function (_context10) {
|
|
1045
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
1004
1046
|
case 0:
|
|
1005
|
-
|
|
1047
|
+
_context10.next = 1;
|
|
1006
1048
|
return this.webex.boundedStorage.put(this.namespace, _constants.REACHABILITY.localStorageResult, (0, _stringify.default)(results));
|
|
1007
1049
|
case 1:
|
|
1008
1050
|
case "end":
|
|
1009
|
-
return
|
|
1051
|
+
return _context10.stop();
|
|
1010
1052
|
}
|
|
1011
|
-
},
|
|
1053
|
+
}, _callee10, this);
|
|
1012
1054
|
}));
|
|
1013
|
-
function storeResults(
|
|
1055
|
+
function storeResults(_x5) {
|
|
1014
1056
|
return _storeResults.apply(this, arguments);
|
|
1015
1057
|
}
|
|
1016
1058
|
return storeResults;
|
|
@@ -1071,20 +1113,20 @@ var Reachability = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
1071
1113
|
}, {
|
|
1072
1114
|
key: "performReachabilityChecks",
|
|
1073
1115
|
value: (function () {
|
|
1074
|
-
var _performReachabilityChecks = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1116
|
+
var _performReachabilityChecks = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee14(clusterList) {
|
|
1075
1117
|
var _this4 = this;
|
|
1076
|
-
var results, isFirstResult;
|
|
1077
|
-
return _regenerator.default.wrap(function (
|
|
1078
|
-
while (1) switch (
|
|
1118
|
+
var results, protocols, enabledProtocols, isFirstResult;
|
|
1119
|
+
return _regenerator.default.wrap(function (_context14) {
|
|
1120
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
1079
1121
|
case 0:
|
|
1080
1122
|
results = {};
|
|
1081
1123
|
this.clusterReachability = {};
|
|
1082
1124
|
this.startTime = performance.now();
|
|
1083
|
-
|
|
1125
|
+
protocols = (0, _util2.resolveReachabilityProtocols)(
|
|
1084
1126
|
// @ts-ignore
|
|
1085
|
-
this.webex.config.meetings.
|
|
1086
|
-
|
|
1087
|
-
|
|
1127
|
+
this.webex.config.meetings.enableReachabilityChecks);
|
|
1128
|
+
enabledProtocols = [protocols.udp && 'UDP', protocols.tcp && 'TCP', protocols.tls && 'TLS'].filter(Boolean);
|
|
1129
|
+
_loggerProxy.default.logger.log("Reachability:index#performReachabilityChecks --> doing ".concat(enabledProtocols.join(','), " reachability checks"));
|
|
1088
1130
|
this.resetResultCounters();
|
|
1089
1131
|
|
|
1090
1132
|
// sanitize the urls in the clusterList
|
|
@@ -1092,17 +1134,13 @@ var Reachability = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
1092
1134
|
var cluster = clusterList[key];
|
|
1093
1135
|
|
|
1094
1136
|
// Linus doesn't support TCP reachability checks on video mesh nodes
|
|
1095
|
-
var includeTcpReachability =
|
|
1096
|
-
// @ts-ignore
|
|
1097
|
-
_this4.webex.config.meetings.experimental.enableTcpReachability && !cluster.isVideoMesh;
|
|
1137
|
+
var includeTcpReachability = protocols.tcp && !cluster.isVideoMesh;
|
|
1098
1138
|
if (!includeTcpReachability) {
|
|
1099
1139
|
cluster.tcp = [];
|
|
1100
1140
|
}
|
|
1101
1141
|
|
|
1102
1142
|
// Linus doesn't support xTLS reachability checks on video mesh nodes
|
|
1103
|
-
var includeTlsReachability =
|
|
1104
|
-
// @ts-ignore
|
|
1105
|
-
_this4.webex.config.meetings.experimental.enableTlsReachability && !cluster.isVideoMesh;
|
|
1143
|
+
var includeTlsReachability = protocols.tls && !cluster.isVideoMesh;
|
|
1106
1144
|
if (!includeTlsReachability) {
|
|
1107
1145
|
cluster.xtls = [];
|
|
1108
1146
|
}
|
|
@@ -1133,11 +1171,11 @@ var Reachability = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
1133
1171
|
tcp: true,
|
|
1134
1172
|
xtls: true
|
|
1135
1173
|
}; // save the initialized results (in case we don't get any "resultReady" events at all)
|
|
1136
|
-
|
|
1174
|
+
_context14.next = 1;
|
|
1137
1175
|
return this.storeResults(results);
|
|
1138
1176
|
case 1:
|
|
1139
1177
|
if (!(!clusterList || !(0, _keys.default)(clusterList).length)) {
|
|
1140
|
-
|
|
1178
|
+
_context14.next = 2;
|
|
1141
1179
|
break;
|
|
1142
1180
|
}
|
|
1143
1181
|
// nothing to do, finish immediately
|
|
@@ -1146,7 +1184,7 @@ var Reachability = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
1146
1184
|
file: 'reachability',
|
|
1147
1185
|
function: 'performReachabilityChecks'
|
|
1148
1186
|
}, 'reachability:done', {});
|
|
1149
|
-
return
|
|
1187
|
+
return _context14.abrupt("return");
|
|
1150
1188
|
case 2:
|
|
1151
1189
|
this.startTimers();
|
|
1152
1190
|
|
|
@@ -1157,10 +1195,10 @@ var Reachability = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
1157
1195
|
// @ts-ignore
|
|
1158
1196
|
_this4.webex.config.meetings.enablePerUdpUrlReachability);
|
|
1159
1197
|
_this4.clusterReachability[key].on(_clusterReachability.Events.resultReady, /*#__PURE__*/function () {
|
|
1160
|
-
var _ref6 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1198
|
+
var _ref6 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee11(data) {
|
|
1161
1199
|
var protocol, result, clientMediaIPs, latencyInMilliseconds, areAllResultsReady;
|
|
1162
|
-
return _regenerator.default.wrap(function (
|
|
1163
|
-
while (1) switch (
|
|
1200
|
+
return _regenerator.default.wrap(function (_context11) {
|
|
1201
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
1164
1202
|
case 0:
|
|
1165
1203
|
protocol = data.protocol, result = data.result, clientMediaIPs = data.clientMediaIPs, latencyInMilliseconds = data.latencyInMilliseconds;
|
|
1166
1204
|
if (isFirstResult[protocol]) {
|
|
@@ -1177,7 +1215,7 @@ var Reachability = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
1177
1215
|
results[key][protocol].result = result;
|
|
1178
1216
|
results[key][protocol].clientMediaIPs = clientMediaIPs;
|
|
1179
1217
|
results[key][protocol].latencyInMilliseconds = latencyInMilliseconds;
|
|
1180
|
-
|
|
1218
|
+
_context11.next = 1;
|
|
1181
1219
|
return _this4.storeResults(results);
|
|
1182
1220
|
case 1:
|
|
1183
1221
|
if (areAllResultsReady) {
|
|
@@ -1192,47 +1230,47 @@ var Reachability = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
1192
1230
|
}
|
|
1193
1231
|
case 2:
|
|
1194
1232
|
case "end":
|
|
1195
|
-
return
|
|
1233
|
+
return _context11.stop();
|
|
1196
1234
|
}
|
|
1197
|
-
},
|
|
1235
|
+
}, _callee11);
|
|
1198
1236
|
}));
|
|
1199
|
-
return function (
|
|
1237
|
+
return function (_x7) {
|
|
1200
1238
|
return _ref6.apply(this, arguments);
|
|
1201
1239
|
};
|
|
1202
1240
|
}());
|
|
1203
1241
|
|
|
1204
1242
|
// clientMediaIps can be updated independently from the results, so we need to listen for them too
|
|
1205
1243
|
_this4.clusterReachability[key].on(_clusterReachability.Events.clientMediaIpsUpdated, /*#__PURE__*/function () {
|
|
1206
|
-
var _ref7 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1207
|
-
return _regenerator.default.wrap(function (
|
|
1208
|
-
while (1) switch (
|
|
1244
|
+
var _ref7 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee12(data) {
|
|
1245
|
+
return _regenerator.default.wrap(function (_context12) {
|
|
1246
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
1209
1247
|
case 0:
|
|
1210
1248
|
results[key][data.protocol].clientMediaIPs = data.clientMediaIPs;
|
|
1211
|
-
|
|
1249
|
+
_context12.next = 1;
|
|
1212
1250
|
return _this4.storeResults(results);
|
|
1213
1251
|
case 1:
|
|
1214
1252
|
case "end":
|
|
1215
|
-
return
|
|
1253
|
+
return _context12.stop();
|
|
1216
1254
|
}
|
|
1217
|
-
},
|
|
1255
|
+
}, _callee12);
|
|
1218
1256
|
}));
|
|
1219
|
-
return function (
|
|
1257
|
+
return function (_x8) {
|
|
1220
1258
|
return _ref7.apply(this, arguments);
|
|
1221
1259
|
};
|
|
1222
1260
|
}());
|
|
1223
1261
|
_this4.clusterReachability[key].on(_clusterReachability.Events.natTypeUpdated, /*#__PURE__*/function () {
|
|
1224
|
-
var _ref8 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1225
|
-
return _regenerator.default.wrap(function (
|
|
1226
|
-
while (1) switch (
|
|
1262
|
+
var _ref8 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee13(data) {
|
|
1263
|
+
return _regenerator.default.wrap(function (_context13) {
|
|
1264
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
1227
1265
|
case 0:
|
|
1228
1266
|
_this4.natType = data.natType;
|
|
1229
1267
|
case 1:
|
|
1230
1268
|
case "end":
|
|
1231
|
-
return
|
|
1269
|
+
return _context13.stop();
|
|
1232
1270
|
}
|
|
1233
|
-
},
|
|
1271
|
+
}, _callee13);
|
|
1234
1272
|
}));
|
|
1235
|
-
return function (
|
|
1273
|
+
return function (_x9) {
|
|
1236
1274
|
return _ref8.apply(this, arguments);
|
|
1237
1275
|
};
|
|
1238
1276
|
}());
|
|
@@ -1240,11 +1278,11 @@ var Reachability = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
1240
1278
|
});
|
|
1241
1279
|
case 3:
|
|
1242
1280
|
case "end":
|
|
1243
|
-
return
|
|
1281
|
+
return _context14.stop();
|
|
1244
1282
|
}
|
|
1245
|
-
},
|
|
1283
|
+
}, _callee14, this);
|
|
1246
1284
|
}));
|
|
1247
|
-
function performReachabilityChecks(
|
|
1285
|
+
function performReachabilityChecks(_x6) {
|
|
1248
1286
|
return _performReachabilityChecks.apply(this, arguments);
|
|
1249
1287
|
}
|
|
1250
1288
|
return performReachabilityChecks;
|
|
@@ -1261,42 +1299,42 @@ var Reachability = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
1261
1299
|
}, {
|
|
1262
1300
|
key: "getClientMediaPreferences",
|
|
1263
1301
|
value: (function () {
|
|
1264
|
-
var _getClientMediaPreferences = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1265
|
-
var reachabilityReport,
|
|
1266
|
-
return _regenerator.default.wrap(function (
|
|
1267
|
-
while (1) switch (
|
|
1302
|
+
var _getClientMediaPreferences = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee15(isMultistream, ipver) {
|
|
1303
|
+
var reachabilityReport, _t7, _t8, _t9;
|
|
1304
|
+
return _regenerator.default.wrap(function (_context15) {
|
|
1305
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
1268
1306
|
case 0:
|
|
1269
1307
|
if (this.orpheusApiVersion) {
|
|
1270
|
-
|
|
1308
|
+
_context15.next = 2;
|
|
1271
1309
|
break;
|
|
1272
1310
|
}
|
|
1273
|
-
|
|
1274
|
-
|
|
1311
|
+
_t7 = ipver;
|
|
1312
|
+
_context15.next = 1;
|
|
1275
1313
|
return this.getJoinCookie();
|
|
1276
1314
|
case 1:
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
return
|
|
1280
|
-
ipver:
|
|
1281
|
-
joinCookie:
|
|
1282
|
-
preferTranscoding:
|
|
1315
|
+
_t8 = _context15.sent;
|
|
1316
|
+
_t9 = !isMultistream;
|
|
1317
|
+
return _context15.abrupt("return", {
|
|
1318
|
+
ipver: _t7,
|
|
1319
|
+
joinCookie: _t8,
|
|
1320
|
+
preferTranscoding: _t9
|
|
1283
1321
|
});
|
|
1284
1322
|
case 2:
|
|
1285
|
-
|
|
1323
|
+
_context15.next = 3;
|
|
1286
1324
|
return this.getReachabilityReport();
|
|
1287
1325
|
case 3:
|
|
1288
|
-
reachabilityReport =
|
|
1289
|
-
return
|
|
1326
|
+
reachabilityReport = _context15.sent;
|
|
1327
|
+
return _context15.abrupt("return", _objectSpread({
|
|
1290
1328
|
ipver: ipver,
|
|
1291
1329
|
preferTranscoding: !isMultistream
|
|
1292
1330
|
}, reachabilityReport));
|
|
1293
1331
|
case 4:
|
|
1294
1332
|
case "end":
|
|
1295
|
-
return
|
|
1333
|
+
return _context15.stop();
|
|
1296
1334
|
}
|
|
1297
|
-
},
|
|
1335
|
+
}, _callee15, this);
|
|
1298
1336
|
}));
|
|
1299
|
-
function getClientMediaPreferences(
|
|
1337
|
+
function getClientMediaPreferences(_x0, _x1) {
|
|
1300
1338
|
return _getClientMediaPreferences.apply(this, arguments);
|
|
1301
1339
|
}
|
|
1302
1340
|
return getClientMediaPreferences;
|
|
@@ -1312,22 +1350,22 @@ var Reachability = exports.default = /*#__PURE__*/function (_EventsScope) {
|
|
|
1312
1350
|
}, {
|
|
1313
1351
|
key: "getReachabilityReportToAttachToRoap",
|
|
1314
1352
|
value: (function () {
|
|
1315
|
-
var _getReachabilityReportToAttachToRoap = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function
|
|
1316
|
-
return _regenerator.default.wrap(function (
|
|
1317
|
-
while (1) switch (
|
|
1353
|
+
var _getReachabilityReportToAttachToRoap = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee16() {
|
|
1354
|
+
return _regenerator.default.wrap(function (_context16) {
|
|
1355
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
1318
1356
|
case 0:
|
|
1319
1357
|
if (this.orpheusApiVersion) {
|
|
1320
|
-
|
|
1358
|
+
_context16.next = 1;
|
|
1321
1359
|
break;
|
|
1322
1360
|
}
|
|
1323
|
-
return
|
|
1361
|
+
return _context16.abrupt("return", this.getReachabilityResults());
|
|
1324
1362
|
case 1:
|
|
1325
|
-
return
|
|
1363
|
+
return _context16.abrupt("return", undefined);
|
|
1326
1364
|
case 2:
|
|
1327
1365
|
case "end":
|
|
1328
|
-
return
|
|
1366
|
+
return _context16.stop();
|
|
1329
1367
|
}
|
|
1330
|
-
},
|
|
1368
|
+
}, _callee16, this);
|
|
1331
1369
|
}));
|
|
1332
1370
|
function getReachabilityReportToAttachToRoap() {
|
|
1333
1371
|
return _getReachabilityReportToAttachToRoap.apply(this, arguments);
|