@webex/plugin-meetings 3.0.0-beta.250 → 3.0.0-beta.251
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/dist/breakouts/breakout.js +1 -1
- package/dist/breakouts/index.js +1 -1
- package/dist/constants.js +3 -1
- package/dist/constants.js.map +1 -1
- package/dist/index.js +30 -24
- package/dist/index.js.map +1 -1
- package/dist/interpretation/index.js +1 -1
- package/dist/interpretation/siLanguage.js +1 -1
- package/dist/media/index.js +18 -19
- package/dist/media/index.js.map +1 -1
- package/dist/media/properties.js +52 -52
- package/dist/media/properties.js.map +1 -1
- package/dist/meeting/index.js +408 -345
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting/muteState.js +39 -38
- package/dist/meeting/muteState.js.map +1 -1
- package/dist/meeting/util.js +9 -9
- package/dist/meeting/util.js.map +1 -1
- package/dist/multistream/sendSlotManager.js +233 -0
- package/dist/multistream/sendSlotManager.js.map +1 -0
- package/dist/reconnection-manager/index.js +10 -10
- package/dist/reconnection-manager/index.js.map +1 -1
- package/dist/types/constants.d.ts +2 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/media/index.d.ts +2 -2
- package/dist/types/media/properties.d.ts +24 -24
- package/dist/types/meeting/index.d.ts +56 -49
- package/dist/types/meeting/muteState.d.ts +16 -16
- package/dist/types/meeting/util.d.ts +2 -2
- package/dist/types/multistream/sendSlotManager.d.ts +61 -0
- package/dist/types/reconnection-manager/index.d.ts +2 -2
- package/package.json +20 -20
- package/src/constants.ts +2 -0
- package/src/index.ts +14 -13
- package/src/media/index.ts +32 -34
- package/src/media/properties.ts +47 -46
- package/src/meeting/index.ts +395 -312
- package/src/meeting/muteState.ts +35 -34
- package/src/meeting/util.ts +11 -10
- package/src/multistream/sendSlotManager.ts +170 -0
- package/src/reconnection-manager/index.ts +8 -8
- package/test/integration/spec/converged-space-meetings.js +7 -7
- package/test/integration/spec/journey.js +85 -103
- package/test/integration/spec/space-meeting.js +9 -9
- package/test/unit/spec/media/index.ts +23 -66
- package/test/unit/spec/meeting/index.js +768 -769
- package/test/unit/spec/meeting/muteState.js +113 -75
- package/test/unit/spec/meeting/utils.js +14 -16
- package/test/unit/spec/meetings/index.js +2 -2
- package/test/unit/spec/multistream/sendSlotManager.ts +242 -0
- package/test/unit/spec/reconnection-manager/index.js +4 -3
- package/test/utils/integrationTestUtils.js +4 -4
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
|
|
5
|
+
_Object$defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regenerator"));
|
|
10
|
+
var _map = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/map"));
|
|
11
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
|
|
12
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
|
|
13
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
|
|
14
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
|
|
15
|
+
var SendSlotManager = /*#__PURE__*/function () {
|
|
16
|
+
function SendSlotManager(LoggerProxy) {
|
|
17
|
+
(0, _classCallCheck2.default)(this, SendSlotManager);
|
|
18
|
+
(0, _defineProperty2.default)(this, "slots", new _map.default());
|
|
19
|
+
(0, _defineProperty2.default)(this, "LoggerProxy", void 0);
|
|
20
|
+
this.LoggerProxy = LoggerProxy;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* This method is used to create a sendSlot for the given mediaType and returns the created sendSlot
|
|
25
|
+
* @param {MultistreamRoapMediaConnection} mediaConnection MultistreamRoapMediaConnection for which a sendSlot needs to be created
|
|
26
|
+
* @param {MediaType} mediaType MediaType for which a sendSlot needs to be created (AUDIO_MAIN/VIDEO_MAIN/AUDIO_SLIDES/VIDEO_SLIDES)
|
|
27
|
+
* @param {boolean} active This is optional boolean to set the active state of the sendSlot. Default is true
|
|
28
|
+
* @returns {SendSlot} slot The created sendSlot
|
|
29
|
+
*/
|
|
30
|
+
(0, _createClass2.default)(SendSlotManager, [{
|
|
31
|
+
key: "createSlot",
|
|
32
|
+
value: function createSlot(mediaConnection, mediaType) {
|
|
33
|
+
var active = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
34
|
+
if (this.slots.has(mediaType)) {
|
|
35
|
+
throw new Error("Slot for ".concat(mediaType, " already exists"));
|
|
36
|
+
}
|
|
37
|
+
var slot = mediaConnection.createSendSlot(mediaType, active);
|
|
38
|
+
this.slots.set(mediaType, slot);
|
|
39
|
+
this.LoggerProxy.logger.info("SendSlotsManager->createSlot#Created slot for ".concat(mediaType, " with active ").concat(active));
|
|
40
|
+
return slot;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* This method is used to retrieve the sendSlot for the given mediaType
|
|
45
|
+
* @param {MediaType} mediaType of which the slot needs to be retrieved
|
|
46
|
+
* @returns {SendSlot}
|
|
47
|
+
*/
|
|
48
|
+
}, {
|
|
49
|
+
key: "getSlot",
|
|
50
|
+
value: function getSlot(mediaType) {
|
|
51
|
+
var slot = this.slots.get(mediaType);
|
|
52
|
+
if (!slot) {
|
|
53
|
+
throw new Error("Slot for ".concat(mediaType, " does not exist"));
|
|
54
|
+
}
|
|
55
|
+
return slot;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* This method publishes the given stream to the sendSlot for the given mediaType
|
|
60
|
+
* @param {MediaType} mediaType MediaType of the sendSlot to which a stream needs to be published (AUDIO_MAIN/VIDEO_MAIN/AUDIO_SLIDES/VIDEO_SLIDES)
|
|
61
|
+
* @param {LocalStream} stream LocalStream to be published
|
|
62
|
+
* @returns {Promise<void>}
|
|
63
|
+
*/
|
|
64
|
+
}, {
|
|
65
|
+
key: "publishStream",
|
|
66
|
+
value: function () {
|
|
67
|
+
var _publishStream = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(mediaType, stream) {
|
|
68
|
+
var slot;
|
|
69
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
70
|
+
while (1) switch (_context.prev = _context.next) {
|
|
71
|
+
case 0:
|
|
72
|
+
slot = this.slots.get(mediaType);
|
|
73
|
+
if (slot) {
|
|
74
|
+
_context.next = 3;
|
|
75
|
+
break;
|
|
76
|
+
}
|
|
77
|
+
throw new Error("Slot for ".concat(mediaType, " does not exist"));
|
|
78
|
+
case 3:
|
|
79
|
+
_context.next = 5;
|
|
80
|
+
return slot.publishStream(stream);
|
|
81
|
+
case 5:
|
|
82
|
+
this.LoggerProxy.logger.info("SendSlotsManager->publishStream#Published stream for ".concat(mediaType, " and stream with label ").concat(stream.label, " and muted ").concat(stream.muted));
|
|
83
|
+
case 6:
|
|
84
|
+
case "end":
|
|
85
|
+
return _context.stop();
|
|
86
|
+
}
|
|
87
|
+
}, _callee, this);
|
|
88
|
+
}));
|
|
89
|
+
function publishStream(_x, _x2) {
|
|
90
|
+
return _publishStream.apply(this, arguments);
|
|
91
|
+
}
|
|
92
|
+
return publishStream;
|
|
93
|
+
}()
|
|
94
|
+
/**
|
|
95
|
+
* This method unpublishes the stream from the sendSlot of the given mediaType
|
|
96
|
+
* @param {MediaType} mediaType MediaType of the sendSlot from which a stream needs to be unpublished (AUDIO_MAIN/VIDEO_MAIN/AUDIO_SLIDES/VIDEO_SLIDES)
|
|
97
|
+
* @returns {Promise<void>}
|
|
98
|
+
*/
|
|
99
|
+
}, {
|
|
100
|
+
key: "unpublishStream",
|
|
101
|
+
value: function () {
|
|
102
|
+
var _unpublishStream = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(mediaType) {
|
|
103
|
+
var slot;
|
|
104
|
+
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
105
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
106
|
+
case 0:
|
|
107
|
+
slot = this.slots.get(mediaType);
|
|
108
|
+
if (slot) {
|
|
109
|
+
_context2.next = 3;
|
|
110
|
+
break;
|
|
111
|
+
}
|
|
112
|
+
throw new Error("Slot for ".concat(mediaType, " does not exist"));
|
|
113
|
+
case 3:
|
|
114
|
+
_context2.next = 5;
|
|
115
|
+
return slot.unpublishStream();
|
|
116
|
+
case 5:
|
|
117
|
+
this.LoggerProxy.logger.info("SendSlotsManager->unpublishStream#Unpublished stream for ".concat(mediaType));
|
|
118
|
+
case 6:
|
|
119
|
+
case "end":
|
|
120
|
+
return _context2.stop();
|
|
121
|
+
}
|
|
122
|
+
}, _callee2, this);
|
|
123
|
+
}));
|
|
124
|
+
function unpublishStream(_x3) {
|
|
125
|
+
return _unpublishStream.apply(this, arguments);
|
|
126
|
+
}
|
|
127
|
+
return unpublishStream;
|
|
128
|
+
}()
|
|
129
|
+
/**
|
|
130
|
+
* This method is used to set the active state of the sendSlot for the given mediaType
|
|
131
|
+
* @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)
|
|
132
|
+
* @param {boolean} active The boolean to set the active state of the sendSlot. Default is true
|
|
133
|
+
* @returns {void}
|
|
134
|
+
*/
|
|
135
|
+
}, {
|
|
136
|
+
key: "setActive",
|
|
137
|
+
value: function setActive(mediaType) {
|
|
138
|
+
var active = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
139
|
+
var slot = this.slots.get(mediaType);
|
|
140
|
+
if (!slot) {
|
|
141
|
+
throw new Error("Slot for ".concat(mediaType, " does not exist"));
|
|
142
|
+
}
|
|
143
|
+
slot.active = active;
|
|
144
|
+
this.LoggerProxy.logger.info("SendSlotsManager->setActive#Set active for ".concat(mediaType, " to ").concat(active));
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* This method is used to set the codec parameters for the sendSlot of the given mediaType
|
|
149
|
+
* @param {MediaType} mediaType MediaType of the sendSlot for which the codec parameters needs to be set (AUDIO_MAIN/VIDEO_MAIN/AUDIO_SLIDES/VIDEO_SLIDES)
|
|
150
|
+
* @param {Object} codecParameters
|
|
151
|
+
* @returns {Promise<void>}
|
|
152
|
+
*/
|
|
153
|
+
}, {
|
|
154
|
+
key: "setCodecParameters",
|
|
155
|
+
value: function () {
|
|
156
|
+
var _setCodecParameters = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(mediaType, codecParameters) {
|
|
157
|
+
var slot;
|
|
158
|
+
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
159
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
160
|
+
case 0:
|
|
161
|
+
// 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
|
|
162
|
+
slot = this.slots.get(mediaType);
|
|
163
|
+
if (slot) {
|
|
164
|
+
_context3.next = 3;
|
|
165
|
+
break;
|
|
166
|
+
}
|
|
167
|
+
throw new Error("Slot for ".concat(mediaType, " does not exist"));
|
|
168
|
+
case 3:
|
|
169
|
+
_context3.next = 5;
|
|
170
|
+
return slot.setCodecParameters(codecParameters);
|
|
171
|
+
case 5:
|
|
172
|
+
this.LoggerProxy.logger.info("SendSlotsManager->setCodecParameters#Set codec parameters for ".concat(mediaType, " to ").concat(codecParameters));
|
|
173
|
+
case 6:
|
|
174
|
+
case "end":
|
|
175
|
+
return _context3.stop();
|
|
176
|
+
}
|
|
177
|
+
}, _callee3, this);
|
|
178
|
+
}));
|
|
179
|
+
function setCodecParameters(_x4, _x5) {
|
|
180
|
+
return _setCodecParameters.apply(this, arguments);
|
|
181
|
+
}
|
|
182
|
+
return setCodecParameters;
|
|
183
|
+
}()
|
|
184
|
+
/**
|
|
185
|
+
* This method is used to delete the codec parameters for the sendSlot of the given mediaType
|
|
186
|
+
* @param {MediaType} mediaType MediaType of the sendSlot for which the codec parameters needs to be deleted (AUDIO_MAIN/VIDEO_MAIN/AUDIO_SLIDES/VIDEO_SLIDES)
|
|
187
|
+
* @param {Array<String>} parameters Array of keys of the codec parameters to be deleted
|
|
188
|
+
* @returns {Promise<void>}
|
|
189
|
+
*/
|
|
190
|
+
}, {
|
|
191
|
+
key: "deleteCodecParameters",
|
|
192
|
+
value: function () {
|
|
193
|
+
var _deleteCodecParameters = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(mediaType, parameters) {
|
|
194
|
+
var slot;
|
|
195
|
+
return _regenerator.default.wrap(function _callee4$(_context4) {
|
|
196
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
197
|
+
case 0:
|
|
198
|
+
slot = this.slots.get(mediaType);
|
|
199
|
+
if (slot) {
|
|
200
|
+
_context4.next = 3;
|
|
201
|
+
break;
|
|
202
|
+
}
|
|
203
|
+
throw new Error("Slot for ".concat(mediaType, " does not exist"));
|
|
204
|
+
case 3:
|
|
205
|
+
_context4.next = 5;
|
|
206
|
+
return slot.deleteCodecParameters(parameters);
|
|
207
|
+
case 5:
|
|
208
|
+
this.LoggerProxy.logger.info("SendSlotsManager->deleteCodecParameters#Deleted the following codec parameters -> ".concat(parameters, " for ").concat(mediaType));
|
|
209
|
+
case 6:
|
|
210
|
+
case "end":
|
|
211
|
+
return _context4.stop();
|
|
212
|
+
}
|
|
213
|
+
}, _callee4, this);
|
|
214
|
+
}));
|
|
215
|
+
function deleteCodecParameters(_x6, _x7) {
|
|
216
|
+
return _deleteCodecParameters.apply(this, arguments);
|
|
217
|
+
}
|
|
218
|
+
return deleteCodecParameters;
|
|
219
|
+
}()
|
|
220
|
+
/**
|
|
221
|
+
* This method is used to reset the SendSlotsManager by deleting all the sendSlots
|
|
222
|
+
* @returns {undefined}
|
|
223
|
+
*/
|
|
224
|
+
}, {
|
|
225
|
+
key: "reset",
|
|
226
|
+
value: function reset() {
|
|
227
|
+
this.slots.clear();
|
|
228
|
+
}
|
|
229
|
+
}]);
|
|
230
|
+
return SendSlotManager;
|
|
231
|
+
}();
|
|
232
|
+
exports.default = SendSlotManager;
|
|
233
|
+
//# sourceMappingURL=sendSlotManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["SendSlotManager","LoggerProxy","mediaConnection","mediaType","active","slots","has","Error","slot","createSendSlot","set","logger","info","get","stream","publishStream","label","muted","unpublishStream","codecParameters","setCodecParameters","parameters","deleteCodecParameters","clear"],"sources":["sendSlotManager.ts"],"sourcesContent":["import {\n SendSlot,\n MediaType,\n LocalStream,\n MultistreamRoapMediaConnection,\n} from '@webex/internal-media-core';\n\nexport default class SendSlotManager {\n private readonly slots: Map<MediaType, SendSlot> = new Map();\n private readonly LoggerProxy: any;\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 * 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":";;;;;;;;;;;;;;IAOqBA,eAAe;E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AAA;cAAA;cAAA,MACD,IAAID,KAAK,oBAAaJ,SAAS,qBAAkB;YAAA;cAAA;cAAA,OAGnDK,IAAI,CAACY,kBAAkB,CAACD,eAAe,CAAC;YAAA;cAE9C,IAAI,CAAClB,WAAW,CAACU,MAAM,CAACC,IAAI,yEACuCT,SAAS,iBAAOgB,eAAe,EACjG;YAAC;YAAA;cAAA;UAAA;QAAA;MAAA,CACH;MAAA;QAAA;MAAA;MAAA;IAAA;IAED;AACF;AACA;AACA;AACA;AACA;EALE;IAAA;IAAA;MAAA,qGAMA,kBAAmChB,SAAoB,EAAEkB,UAAoB;QAAA;QAAA;UAAA;YAAA;cACrEb,IAAI,GAAG,IAAI,CAACH,KAAK,CAACQ,GAAG,CAACV,SAAS,CAAC;cAAA,IAEjCK,IAAI;gBAAA;gBAAA;cAAA;cAAA,MACD,IAAID,KAAK,oBAAaJ,SAAS,qBAAkB;YAAA;cAAA;cAAA,OAGnDK,IAAI,CAACc,qBAAqB,CAACD,UAAU,CAAC;YAAA;cAE5C,IAAI,CAACpB,WAAW,CAACU,MAAM,CAACC,IAAI,6FAC2DS,UAAU,kBAAQlB,SAAS,EACjH;YAAC;YAAA;cAAA;UAAA;QAAA;MAAA,CACH;MAAA;QAAA;MAAA;MAAA;IAAA;IAED;AACF;AACA;AACA;EAHE;IAAA;IAAA,OAIA,iBAAqB;MACnB,IAAI,CAACE,KAAK,CAACkB,KAAK,EAAE;IACpB;EAAC;EAAA;AAAA;AAAA"}
|
|
@@ -246,7 +246,7 @@ var ReconnectionManager = /*#__PURE__*/function () {
|
|
|
246
246
|
}
|
|
247
247
|
|
|
248
248
|
/**
|
|
249
|
-
* Stop the local share
|
|
249
|
+
* Stop the local share stream.
|
|
250
250
|
*
|
|
251
251
|
* @param {string} reason a {@link SHARE_STOPPED_REASON}
|
|
252
252
|
* @returns {undefined}
|
|
@@ -254,18 +254,18 @@ var ReconnectionManager = /*#__PURE__*/function () {
|
|
|
254
254
|
* @memberof ReconnectionManager
|
|
255
255
|
*/
|
|
256
256
|
}, {
|
|
257
|
-
key: "
|
|
257
|
+
key: "stopLocalShareStream",
|
|
258
258
|
value: function () {
|
|
259
|
-
var
|
|
259
|
+
var _stopLocalShareStream = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(reason) {
|
|
260
260
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
261
261
|
while (1) switch (_context.prev = _context.next) {
|
|
262
262
|
case 0:
|
|
263
263
|
_context.next = 2;
|
|
264
|
-
return this.meeting.
|
|
264
|
+
return this.meeting.unpublishStreams([this.meeting.mediaProperties.shareVideoStream, this.meeting.mediaProperties.shareAudioStream]);
|
|
265
265
|
case 2:
|
|
266
266
|
_triggerProxy.default.trigger(this.meeting, {
|
|
267
267
|
file: 'reconnection-manager/index',
|
|
268
|
-
function: '
|
|
268
|
+
function: 'stopLocalShareStream'
|
|
269
269
|
}, _constants.EVENT_TRIGGERS.MEETING_STOPPED_SHARING_LOCAL, {
|
|
270
270
|
reason: reason
|
|
271
271
|
});
|
|
@@ -275,10 +275,10 @@ var ReconnectionManager = /*#__PURE__*/function () {
|
|
|
275
275
|
}
|
|
276
276
|
}, _callee, this);
|
|
277
277
|
}));
|
|
278
|
-
function
|
|
279
|
-
return
|
|
278
|
+
function stopLocalShareStream(_x) {
|
|
279
|
+
return _stopLocalShareStream.apply(this, arguments);
|
|
280
280
|
}
|
|
281
|
-
return
|
|
281
|
+
return stopLocalShareStream;
|
|
282
282
|
}()
|
|
283
283
|
/**
|
|
284
284
|
* @public
|
|
@@ -453,7 +453,7 @@ var ReconnectionManager = /*#__PURE__*/function () {
|
|
|
453
453
|
break;
|
|
454
454
|
}
|
|
455
455
|
_context3.next = 7;
|
|
456
|
-
return this.
|
|
456
|
+
return this.stopLocalShareStream(_constants.SHARE_STOPPED_REASON.MEDIA_RECONNECTION);
|
|
457
457
|
case 7:
|
|
458
458
|
if (!networkDisconnect) {
|
|
459
459
|
_context3.next = 19;
|
|
@@ -569,7 +569,7 @@ var ReconnectionManager = /*#__PURE__*/function () {
|
|
|
569
569
|
break;
|
|
570
570
|
}
|
|
571
571
|
_context4.next = 9;
|
|
572
|
-
return this.
|
|
572
|
+
return this.stopLocalShareStream(_constants.SHARE_STOPPED_REASON.MEETING_REJOIN);
|
|
573
573
|
case 9:
|
|
574
574
|
_context4.next = 23;
|
|
575
575
|
break;
|
|
@@ -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","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","credentials","isUnverifiedGuest","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 if (!this.webex.credentials.isUnverifiedGuest) {\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\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,U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AK,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","unpublishStreams","mediaProperties","shareVideoStream","shareAudioStream","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","stopLocalShareStream","SHARE_STOPPED_REASON","MEDIA_RECONNECTION","reconnectMercuryWebSocket","device","url","FAILURE","credentials","isUnverifiedGuest","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 stream.\n *\n * @param {string} reason a {@link SHARE_STOPPED_REASON}\n * @returns {undefined}\n * @private\n * @memberof ReconnectionManager\n */\n private async stopLocalShareStream(reason: string) {\n await this.meeting.unpublishStreams([\n this.meeting.mediaProperties.shareVideoStream,\n this.meeting.mediaProperties.shareAudioStream,\n ]);\n Trigger.trigger(\n this.meeting,\n {\n file: 'reconnection-manager/index',\n function: 'stopLocalShareStream',\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.stopLocalShareStream(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 if (!this.webex.credentials.isUnverifiedGuest) {\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\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.stopLocalShareStream(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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@@ -256,6 +256,7 @@ export declare const EVENT_TRIGGERS: {
|
|
|
256
256
|
MEETING_CONTROLS_RAISE_HAND_UPDATED: string;
|
|
257
257
|
MEETING_CONTROLS_VIDEO_UPDATED: string;
|
|
258
258
|
MEETING_LOCUS_URL_UPDATE: string;
|
|
259
|
+
MEETING_STREAM_PUBLISH_STATE_CHANGED: string;
|
|
259
260
|
};
|
|
260
261
|
export declare const EVENT_TYPES: {
|
|
261
262
|
SELF: string;
|
|
@@ -264,6 +265,7 @@ export declare const EVENT_TYPES: {
|
|
|
264
265
|
REMOTE_AUDIO: string;
|
|
265
266
|
REMOTE_VIDEO: string;
|
|
266
267
|
REMOTE_SHARE: string;
|
|
268
|
+
REMOTE_SHARE_AUDIO: string;
|
|
267
269
|
ERROR: string;
|
|
268
270
|
};
|
|
269
271
|
export declare const MEETING_REMOVED_REASON: {
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Meetings from './meetings';
|
|
2
|
-
export { getDevices,
|
|
2
|
+
export { getDevices, LocalStream, LocalDisplayStream, LocalSystemAudioStream, LocalStreamEventNames, StreamEventNames, type ServerMuteReason, LocalMicrophoneStreamEventNames, LocalCameraStreamEventNames, LocalMicrophoneStream, LocalCameraStream, createMicrophoneStream, createCameraStream, createDisplayStream, createDisplayStreamWithAudio, FacingMode, DisplaySurface, PresetCameraConstraints, type VideoContentHint, } 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,8 +1,8 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
5
|
-
export type BundlePolicy =
|
|
4
|
+
import { type MultistreamConnectionConfig } from '@webex/internal-media-core';
|
|
5
|
+
export type BundlePolicy = MultistreamConnectionConfig['bundlePolicy'];
|
|
6
6
|
/**
|
|
7
7
|
* MediaDirection
|
|
8
8
|
* @typedef {Object} MediaDirection
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LocalCameraStream, LocalMicrophoneStream, LocalDisplayStream, LocalSystemAudioStream, RemoteStream } from '@webex/media-helpers';
|
|
2
2
|
export type MediaDirection = {
|
|
3
3
|
sendAudio: boolean;
|
|
4
4
|
sendVideo: boolean;
|
|
@@ -11,18 +11,18 @@ export type MediaDirection = {
|
|
|
11
11
|
* @class MediaProperties
|
|
12
12
|
*/
|
|
13
13
|
export default class MediaProperties {
|
|
14
|
-
|
|
14
|
+
audioStream?: LocalMicrophoneStream;
|
|
15
15
|
mediaDirection: MediaDirection;
|
|
16
16
|
mediaSettings: any;
|
|
17
17
|
webrtcMediaConnection: any;
|
|
18
|
-
|
|
18
|
+
remoteAudioStream: RemoteStream;
|
|
19
19
|
remoteQualityLevel: any;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
remoteShareStream: RemoteStream;
|
|
21
|
+
remoteVideoStream: RemoteStream;
|
|
22
|
+
shareVideoStream?: LocalDisplayStream;
|
|
23
|
+
shareAudioStream?: LocalSystemAudioStream;
|
|
24
24
|
videoDeviceId: any;
|
|
25
|
-
|
|
25
|
+
videoStream?: LocalCameraStream;
|
|
26
26
|
namespace: string;
|
|
27
27
|
/**
|
|
28
28
|
* @param {Object} [options] -- to auto construct
|
|
@@ -37,24 +37,24 @@ export default class MediaProperties {
|
|
|
37
37
|
setMediaDirection(mediaDirection: any): void;
|
|
38
38
|
setMediaSettings(type: any, values: any): void;
|
|
39
39
|
setMediaPeerConnection(mediaPeerConnection: any): void;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
setLocalVideoStream(videoStream?: LocalCameraStream): void;
|
|
41
|
+
setLocalAudioStream(audioStream?: LocalMicrophoneStream): void;
|
|
42
|
+
setLocalShareVideoStream(shareVideoStream?: LocalDisplayStream): void;
|
|
43
|
+
setLocalShareAudioStream(shareAudioStream?: LocalSystemAudioStream): void;
|
|
44
44
|
setRemoteQualityLevel(remoteQualityLevel: any): void;
|
|
45
|
-
|
|
45
|
+
setRemoteShareStream(remoteShareStream: RemoteStream): void;
|
|
46
46
|
/**
|
|
47
|
-
* Sets the remote audio
|
|
48
|
-
* @param {
|
|
47
|
+
* Sets the remote audio stream
|
|
48
|
+
* @param {RemoteStream} remoteAudioStream RemoteStream to save
|
|
49
49
|
* @returns {void}
|
|
50
50
|
*/
|
|
51
|
-
|
|
51
|
+
setRemoteAudioStream(remoteAudioStream: RemoteStream): void;
|
|
52
52
|
/**
|
|
53
|
-
* Sets the remote video
|
|
54
|
-
* @param {
|
|
53
|
+
* Sets the remote video stream
|
|
54
|
+
* @param {RemoteStream} remoteVideoStream RemoteStream to save
|
|
55
55
|
* @returns {void}
|
|
56
56
|
*/
|
|
57
|
-
|
|
57
|
+
setRemoteVideoStream(remoteVideoStream: RemoteStream): void;
|
|
58
58
|
/**
|
|
59
59
|
* Stores the preferred video input device
|
|
60
60
|
* @param {string} deviceId Preferred video input device
|
|
@@ -67,17 +67,17 @@ export default class MediaProperties {
|
|
|
67
67
|
* @returns {void}
|
|
68
68
|
*/
|
|
69
69
|
unsetRemoteMedia(): void;
|
|
70
|
-
|
|
70
|
+
unsetRemoteShareStream(): void;
|
|
71
71
|
/**
|
|
72
|
-
* Unsets all remote
|
|
72
|
+
* Unsets all remote streams
|
|
73
73
|
* @returns {void}
|
|
74
74
|
*/
|
|
75
|
-
|
|
75
|
+
unsetRemoteStreams(): void;
|
|
76
76
|
/**
|
|
77
|
-
* Returns if we have at least one local share
|
|
77
|
+
* Returns if we have at least one local share stream or not.
|
|
78
78
|
* @returns {Boolean}
|
|
79
79
|
*/
|
|
80
|
-
|
|
80
|
+
hasLocalShareStream(): boolean;
|
|
81
81
|
/**
|
|
82
82
|
* Waits for the webrtc media connection to be connected.
|
|
83
83
|
*
|