@techsee/techsee-media-service 18.6.1 → 19.0.0
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/lib/LocalStreamManager.d.ts +1 -0
- package/lib/LocalStreamManager.d.ts.map +1 -1
- package/lib/LocalStreamManager.js +320 -441
- package/lib/LocalStreamManager.js.map +1 -1
- package/lib/MediaConstants.d.ts +1 -0
- package/lib/MediaConstants.d.ts.map +1 -1
- package/lib/MediaConstants.js +53 -95
- package/lib/MediaConstants.js.map +1 -1
- package/lib/MediaContracts.d.ts +1 -0
- package/lib/MediaContracts.d.ts.map +1 -1
- package/lib/MediaContracts.js +2 -5
- package/lib/MediaContracts.js.map +1 -1
- package/lib/MediaPublisher.d.ts +1 -0
- package/lib/MediaPublisher.d.ts.map +1 -1
- package/lib/MediaPublisher.js +36 -49
- package/lib/MediaPublisher.js.map +1 -1
- package/lib/MediaServiceBase.d.ts +1 -0
- package/lib/MediaServiceBase.d.ts.map +1 -1
- package/lib/MediaServiceBase.js +687 -937
- package/lib/MediaServiceBase.js.map +1 -1
- package/lib/MediaSession/MediaServer.d.ts +1 -0
- package/lib/MediaSession/MediaServer.d.ts.map +1 -1
- package/lib/MediaSession/MediaServer.js +372 -517
- package/lib/MediaSession/MediaServer.js.map +1 -1
- package/lib/MediaSession/MediaSessionBase.d.ts +1 -0
- package/lib/MediaSession/MediaSessionBase.d.ts.map +1 -1
- package/lib/MediaSession/MediaSessionBase.js +88 -127
- package/lib/MediaSession/MediaSessionBase.js.map +1 -1
- package/lib/MediaSession/SessionOpentok.d.ts +1 -0
- package/lib/MediaSession/SessionOpentok.d.ts.map +1 -1
- package/lib/MediaSession/SessionOpentok.js +357 -503
- package/lib/MediaSession/SessionOpentok.js.map +1 -1
- package/lib/MediaSession/SessionTurn.d.ts +1 -0
- package/lib/MediaSession/SessionTurn.d.ts.map +1 -1
- package/lib/MediaSession/SessionTurn.js +431 -613
- package/lib/MediaSession/SessionTurn.js.map +1 -1
- package/lib/MediaSession/TurnConstants.d.ts +1 -0
- package/lib/MediaSession/TurnConstants.d.ts.map +1 -1
- package/lib/MediaSession/TurnConstants.js +17 -32
- package/lib/MediaSession/TurnConstants.js.map +1 -1
- package/lib/MediaSubscriber.d.ts +1 -0
- package/lib/MediaSubscriber.d.ts.map +1 -1
- package/lib/MediaSubscriber.js +189 -245
- package/lib/MediaSubscriber.js.map +1 -1
- package/lib/MediaUtils/Compatibility.d.ts +1 -0
- package/lib/MediaUtils/Compatibility.d.ts.map +1 -1
- package/lib/MediaUtils/Compatibility.js +129 -283
- package/lib/MediaUtils/Compatibility.js.map +1 -1
- package/lib/MediaUtils/MediaDomUtils.d.ts +1 -0
- package/lib/MediaUtils/MediaDomUtils.d.ts.map +1 -1
- package/lib/MediaUtils/MediaDomUtils.js +184 -252
- package/lib/MediaUtils/MediaDomUtils.js.map +1 -1
- package/lib/MediaUtils/MediaTracer.d.ts +1 -0
- package/lib/MediaUtils/MediaTracer.d.ts.map +1 -1
- package/lib/MediaUtils/MediaTracer.js +3 -10
- package/lib/MediaUtils/MediaTracer.js.map +1 -1
- package/lib/MediaUtils/index.d.ts +1 -0
- package/lib/MediaUtils/index.d.ts.map +1 -1
- package/lib/MediaUtils/index.js +3 -13
- package/lib/MediaUtils/index.js.map +1 -1
- package/lib/MultiParty/DetectWebRtcService.d.ts +1 -0
- package/lib/MultiParty/DetectWebRtcService.d.ts.map +1 -1
- package/lib/MultiParty/DetectWebRtcService.js +92 -241
- package/lib/MultiParty/DetectWebRtcService.js.map +1 -1
- package/lib/MultiParty/MediaCapabilitiesService.d.ts +1 -0
- package/lib/MultiParty/MediaCapabilitiesService.d.ts.map +1 -1
- package/lib/MultiParty/MediaCapabilitiesService.js +143 -312
- package/lib/MultiParty/MediaCapabilitiesService.js.map +1 -1
- package/lib/MultiParty/MediaCapabilitiesUtils.d.ts +1 -0
- package/lib/MultiParty/MediaCapabilitiesUtils.d.ts.map +1 -1
- package/lib/MultiParty/MediaCapabilitiesUtils.js +95 -277
- package/lib/MultiParty/MediaCapabilitiesUtils.js.map +1 -1
- package/lib/MultiParty/MediaTracer.d.ts +1 -0
- package/lib/MultiParty/MediaTracer.d.ts.map +1 -1
- package/lib/MultiParty/MediaTracer.js +3 -10
- package/lib/MultiParty/MediaTracer.js.map +1 -1
- package/lib/MultiParty/MultiPartyService.d.ts +1 -0
- package/lib/MultiParty/MultiPartyService.d.ts.map +1 -1
- package/lib/MultiParty/MultiPartyService.js +24 -47
- package/lib/MultiParty/MultiPartyService.js.map +1 -1
- package/lib/MultiParty/MultiPartyServiceFactory.d.ts +2 -1
- package/lib/MultiParty/MultiPartyServiceFactory.d.ts.map +1 -1
- package/lib/MultiParty/MultiPartyServiceFactory.js +7 -15
- package/lib/MultiParty/MultiPartyServiceFactory.js.map +1 -1
- package/lib/MultiParty/MultipartyServiceEventTypes.d.ts +1 -0
- package/lib/MultiParty/MultipartyServiceEventTypes.d.ts.map +1 -1
- package/lib/MultiParty/MultipartyServiceEventTypes.js +11 -15
- package/lib/MultiParty/MultipartyServiceEventTypes.js.map +1 -1
- package/lib/MultiParty/index.d.ts +1 -0
- package/lib/MultiParty/index.d.ts.map +1 -1
- package/lib/MultiParty/index.js +15 -35
- package/lib/MultiParty/index.js.map +1 -1
- package/lib/MultiParty/opentok/OpentokMultiPartyService.d.ts +2 -1
- package/lib/MultiParty/opentok/OpentokMultiPartyService.d.ts.map +1 -1
- package/lib/MultiParty/opentok/OpentokMultiPartyService.js +457 -839
- package/lib/MultiParty/opentok/OpentokMultiPartyService.js.map +1 -1
- package/lib/MultiParty/opentok/OpentokPublisher.d.ts +1 -0
- package/lib/MultiParty/opentok/OpentokPublisher.d.ts.map +1 -1
- package/lib/MultiParty/opentok/OpentokPublisher.js +107 -269
- package/lib/MultiParty/opentok/OpentokPublisher.js.map +1 -1
- package/lib/MultiParty/opentok/OpentokPublisherEventMapper.d.ts +1 -0
- package/lib/MultiParty/opentok/OpentokPublisherEventMapper.d.ts.map +1 -1
- package/lib/MultiParty/opentok/OpentokPublisherEventMapper.js +34 -54
- package/lib/MultiParty/opentok/OpentokPublisherEventMapper.js.map +1 -1
- package/lib/MultiParty/opentok/OpentokScreenPublisher.d.ts +1 -0
- package/lib/MultiParty/opentok/OpentokScreenPublisher.d.ts.map +1 -1
- package/lib/MultiParty/opentok/OpentokScreenPublisher.js +40 -77
- package/lib/MultiParty/opentok/OpentokScreenPublisher.js.map +1 -1
- package/lib/MultiParty/opentok/OpentokSubscriber.d.ts +1 -0
- package/lib/MultiParty/opentok/OpentokSubscriber.d.ts.map +1 -1
- package/lib/MultiParty/opentok/OpentokSubscriber.js +20 -28
- package/lib/MultiParty/opentok/OpentokSubscriber.js.map +1 -1
- package/lib/MultiParty/opentok/OpentokVideoPublisher.d.ts +1 -0
- package/lib/MultiParty/opentok/OpentokVideoPublisher.d.ts.map +1 -1
- package/lib/MultiParty/opentok/OpentokVideoPublisher.js +150 -355
- package/lib/MultiParty/opentok/OpentokVideoPublisher.js.map +1 -1
- package/lib/MultiParty/opentok/trace.d.ts +1 -0
- package/lib/MultiParty/opentok/trace.d.ts.map +1 -1
- package/lib/MultiParty/opentok/trace.js +11 -24
- package/lib/MultiParty/opentok/trace.js.map +1 -1
- package/lib/MultiParty/types.d.ts +1 -0
- package/lib/MultiParty/types.d.ts.map +1 -1
- package/lib/MultiParty/types.js +2 -5
- package/lib/MultiParty/types.js.map +1 -1
- package/lib/MultiParty/utils.d.ts +1 -0
- package/lib/MultiParty/utils.d.ts.map +1 -1
- package/lib/MultiParty/utils.js +5 -15
- package/lib/MultiParty/utils.js.map +1 -1
- package/lib/TechseeMediaStream.d.ts +1 -0
- package/lib/TechseeMediaStream.d.ts.map +1 -1
- package/lib/TechseeMediaStream.js +53 -61
- package/lib/TechseeMediaStream.js.map +1 -1
- package/lib/qos/raw-qos.d.ts +29 -0
- package/lib/qos/raw-qos.d.ts.map +1 -0
- package/lib/qos/raw-qos.js +247 -382
- package/lib/qos/raw-qos.js.map +1 -1
- package/lib/webrtc-ie-shim.d.ts +4 -0
- package/lib/webrtc-ie-shim.d.ts.map +1 -0
- package/lib/webrtc-ie-shim.js +1999 -3454
- package/lib/webrtc-ie-shim.js.map +1 -1
- package/package.json +42 -45
|
@@ -1,872 +1,490 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
d.__proto__ = b;
|
|
9
|
-
} || function (d, b) {
|
|
10
|
-
for (var p in b) {
|
|
11
|
-
if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
|
12
|
-
}
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
13
8
|
};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
s = arguments[i];
|
|
33
|
-
|
|
34
|
-
for (var p in s) {
|
|
35
|
-
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
return t;
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
return __assign.apply(this, arguments);
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __assign = (this && this.__assign) || function () {
|
|
18
|
+
__assign = Object.assign || function(t) {
|
|
19
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
20
|
+
s = arguments[i];
|
|
21
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
22
|
+
t[p] = s[p];
|
|
23
|
+
}
|
|
24
|
+
return t;
|
|
25
|
+
};
|
|
26
|
+
return __assign.apply(this, arguments);
|
|
43
27
|
};
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
28
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
29
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
30
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
31
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
32
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
33
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
34
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
49
35
|
});
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
53
|
-
function fulfilled(value) {
|
|
54
|
-
try {
|
|
55
|
-
step(generator.next(value));
|
|
56
|
-
} catch (e) {
|
|
57
|
-
reject(e);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
function rejected(value) {
|
|
62
|
-
try {
|
|
63
|
-
step(generator["throw"](value));
|
|
64
|
-
} catch (e) {
|
|
65
|
-
reject(e);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
function step(result) {
|
|
70
|
-
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
74
|
-
});
|
|
75
36
|
};
|
|
76
|
-
|
|
77
|
-
var
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
}), g;
|
|
98
|
-
|
|
99
|
-
function verb(n) {
|
|
100
|
-
return function (v) {
|
|
101
|
-
return step([n, v]);
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
function step(op) {
|
|
106
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
107
|
-
|
|
108
|
-
while (_) {
|
|
109
|
-
try {
|
|
110
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
111
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
112
|
-
|
|
113
|
-
switch (op[0]) {
|
|
114
|
-
case 0:
|
|
115
|
-
case 1:
|
|
116
|
-
t = op;
|
|
117
|
-
break;
|
|
118
|
-
|
|
119
|
-
case 4:
|
|
120
|
-
_.label++;
|
|
121
|
-
return {
|
|
122
|
-
value: op[1],
|
|
123
|
-
done: false
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
case 5:
|
|
127
|
-
_.label++;
|
|
128
|
-
y = op[1];
|
|
129
|
-
op = [0];
|
|
130
|
-
continue;
|
|
131
|
-
|
|
132
|
-
case 7:
|
|
133
|
-
op = _.ops.pop();
|
|
134
|
-
|
|
135
|
-
_.trys.pop();
|
|
136
|
-
|
|
137
|
-
continue;
|
|
138
|
-
|
|
139
|
-
default:
|
|
140
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
141
|
-
_ = 0;
|
|
142
|
-
continue;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
146
|
-
_.label = op[1];
|
|
147
|
-
break;
|
|
37
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
38
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
39
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
40
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
41
|
+
function step(op) {
|
|
42
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
43
|
+
while (_) try {
|
|
44
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
45
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
46
|
+
switch (op[0]) {
|
|
47
|
+
case 0: case 1: t = op; break;
|
|
48
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
49
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
50
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
51
|
+
default:
|
|
52
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
53
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
54
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
55
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
56
|
+
if (t[2]) _.ops.pop();
|
|
57
|
+
_.trys.pop(); continue;
|
|
148
58
|
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
t = op;
|
|
153
|
-
break;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
if (t && _.label < t[2]) {
|
|
157
|
-
_.label = t[2];
|
|
158
|
-
|
|
159
|
-
_.ops.push(op);
|
|
160
|
-
|
|
161
|
-
break;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
if (t[2]) _.ops.pop();
|
|
165
|
-
|
|
166
|
-
_.trys.pop();
|
|
167
|
-
|
|
168
|
-
continue;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
op = body.call(thisArg, _);
|
|
172
|
-
} catch (e) {
|
|
173
|
-
op = [6, e];
|
|
174
|
-
y = 0;
|
|
175
|
-
} finally {
|
|
176
|
-
f = t = 0;
|
|
177
|
-
}
|
|
59
|
+
op = body.call(thisArg, _);
|
|
60
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
61
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
178
62
|
}
|
|
179
|
-
|
|
180
|
-
if (op[0] & 5) throw op[1];
|
|
181
|
-
return {
|
|
182
|
-
value: op[0] ? op[1] : void 0,
|
|
183
|
-
done: true
|
|
184
|
-
};
|
|
185
|
-
}
|
|
186
63
|
};
|
|
187
|
-
|
|
188
|
-
var
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
for (var r = Array(s), k = 0, i = 0; i < il; i++) {
|
|
194
|
-
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) {
|
|
195
|
-
r[k] = a[j];
|
|
64
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
65
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
66
|
+
if (ar || !(i in from)) {
|
|
67
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
68
|
+
ar[i] = from[i];
|
|
69
|
+
}
|
|
196
70
|
}
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
return r;
|
|
71
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
200
72
|
};
|
|
201
|
-
|
|
202
|
-
Object.defineProperty(exports, "__esModule", {
|
|
203
|
-
value: true
|
|
204
|
-
});
|
|
73
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
205
74
|
exports.OpentokMultiPartyService = void 0;
|
|
206
|
-
|
|
207
75
|
var MediaTracer_1 = require("../MediaTracer");
|
|
208
|
-
|
|
209
76
|
var MediaCapabilitiesService_1 = require("../MediaCapabilitiesService");
|
|
210
|
-
|
|
211
77
|
var MediaCapabilitiesUtils_1 = require("../MediaCapabilitiesUtils");
|
|
212
|
-
|
|
213
78
|
var MultiPartyService_1 = require("../MultiPartyService");
|
|
214
|
-
|
|
215
79
|
var MultipartyServiceEventTypes_1 = require("../MultipartyServiceEventTypes");
|
|
216
|
-
|
|
217
80
|
var OpentokVideoPublisher_1 = require("./OpentokVideoPublisher");
|
|
218
|
-
|
|
219
81
|
var OpentokScreenPublisher_1 = require("./OpentokScreenPublisher");
|
|
220
|
-
|
|
221
82
|
var OpentokSubscriber_1 = require("./OpentokSubscriber");
|
|
222
|
-
|
|
223
83
|
var utils_1 = require("../utils");
|
|
224
|
-
|
|
225
84
|
var trace_1 = require("./trace");
|
|
226
|
-
|
|
227
85
|
var MediaConstants_1 = require("../../MediaConstants");
|
|
228
|
-
|
|
229
|
-
var
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
86
|
+
var trace = (0, MediaTracer_1.getMediaTracer)('Multiparty');
|
|
87
|
+
var OpentokMultiPartyService = (function (_super) {
|
|
88
|
+
__extends(OpentokMultiPartyService, _super);
|
|
89
|
+
function OpentokMultiPartyService(getParticipantId) {
|
|
90
|
+
var _this = _super.call(this) || this;
|
|
91
|
+
_this.getParticipantId = getParticipantId;
|
|
92
|
+
_this.enableDesktopSharing = false;
|
|
93
|
+
_this.backgroundImageURI = MultiPartyService_1.DEFAULT_AVATAR_URI;
|
|
94
|
+
_this.subscriberList = [];
|
|
95
|
+
_this.setBackgroundImageURI = function (uri) {
|
|
96
|
+
_this.backgroundImageURI = uri || MultiPartyService_1.DEFAULT_AVATAR_URI;
|
|
97
|
+
};
|
|
98
|
+
_this.connect = function (sessionSettings, credentials) {
|
|
99
|
+
try {
|
|
100
|
+
_this.session = OT.initSession(credentials.apiKey, credentials.sessionId);
|
|
101
|
+
_this.session.on('connectionCreated', _this.connectionCreatedHandler);
|
|
102
|
+
_this.session.on('connectionDestroyed', _this.connectionDestroyedHandler);
|
|
103
|
+
_this.session.on('streamCreated', _this.streamCreatedHandler);
|
|
104
|
+
_this.session.on('streamDestroyed', _this.streamDestroyedHandler);
|
|
105
|
+
_this.session.on('streamPropertyChanged', _this.streamPropertyChangedHandler);
|
|
106
|
+
_this.session.on('sessionDisconnected', _this.sessionDisconnectedHandler);
|
|
107
|
+
_this.prepareVideoPublisherSettings().then(function () {
|
|
108
|
+
var _a;
|
|
109
|
+
_this.initVideoPublisher(sessionSettings);
|
|
110
|
+
(_a = _this === null || _this === void 0 ? void 0 : _this.session) === null || _a === void 0 ? void 0 : _a.connect(credentials.token, function (error) {
|
|
111
|
+
var _a, _b, _c;
|
|
112
|
+
if (error) {
|
|
113
|
+
(_a = _this === null || _this === void 0 ? void 0 : _this.videoPublisher) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
114
|
+
(_b = _this.session) === null || _b === void 0 ? void 0 : _b.off();
|
|
115
|
+
_this.session = undefined;
|
|
116
|
+
(0, trace_1.traceError)(error);
|
|
117
|
+
_this.emit(MultipartyServiceEventTypes_1.MultiPartyServiceEventTypes.connectFailed, {
|
|
118
|
+
meta: { err: JSON.stringify(error) }
|
|
119
|
+
});
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
if (_this.videoPublisher) {
|
|
123
|
+
(_c = _this.session) === null || _c === void 0 ? void 0 : _c.publish(_this.videoPublisher.get(), trace_1.traceError);
|
|
124
|
+
}
|
|
125
|
+
_this.isScreenSharingSupported(sessionSettings.isScreenSharingCapabilitiesEnabled).then(function () {
|
|
126
|
+
var _a;
|
|
127
|
+
if (_this.screenPublisher) {
|
|
128
|
+
(_a = _this.session) === null || _a === void 0 ? void 0 : _a.publish(_this.screenPublisher.get(), trace_1.traceError);
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
catch (err) {
|
|
135
|
+
trace.error(JSON.stringify(err));
|
|
136
|
+
_this.emit(MultipartyServiceEventTypes_1.MultiPartyServiceEventTypes.connectFailed, {
|
|
137
|
+
meta: { err: JSON.stringify(err) }
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
_this.disconnect = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
142
|
+
var err_1;
|
|
143
|
+
var _a, _b;
|
|
144
|
+
return __generator(this, function (_c) {
|
|
145
|
+
switch (_c.label) {
|
|
146
|
+
case 0:
|
|
147
|
+
_c.trys.push([0, 3, , 4]);
|
|
148
|
+
if (!((_a = this.videoPublisher) === null || _a === void 0 ? void 0 : _a.getVideoFilter)) return [3, 2];
|
|
149
|
+
return [4, ((_b = this.videoPublisher) === null || _b === void 0 ? void 0 : _b.clearVideoFilter())];
|
|
150
|
+
case 1:
|
|
151
|
+
_c.sent();
|
|
152
|
+
_c.label = 2;
|
|
153
|
+
case 2:
|
|
154
|
+
trace.info('Disconnecting from session');
|
|
155
|
+
if (this.session) {
|
|
156
|
+
this.session.disconnect();
|
|
157
|
+
trace.info('Disconnection from session completed');
|
|
158
|
+
}
|
|
159
|
+
return [3, 4];
|
|
160
|
+
case 3:
|
|
161
|
+
err_1 = _c.sent();
|
|
162
|
+
trace.error(JSON.stringify(err_1));
|
|
163
|
+
return [3, 4];
|
|
164
|
+
case 4: return [2];
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
}); };
|
|
168
|
+
_this.takeSnapshot = function (connectionId, videoType) {
|
|
271
169
|
var _a, _b, _c;
|
|
272
|
-
|
|
273
|
-
if (
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
_this.emit(MultipartyServiceEventTypes_1.MultiPartyServiceEventTypes.connectFailed, {
|
|
280
|
-
meta: {
|
|
281
|
-
err: JSON.stringify(error)
|
|
170
|
+
if (videoType === void 0) { videoType = MediaConstants_1.VideoTypesEnum.CAMERA; }
|
|
171
|
+
if (!connectionId) {
|
|
172
|
+
return null;
|
|
173
|
+
}
|
|
174
|
+
if (connectionId === _this.ownConnectionId) {
|
|
175
|
+
if (videoType === MediaConstants_1.VideoTypesEnum.CAMERA) {
|
|
176
|
+
return ((_a = _this.videoPublisher) === null || _a === void 0 ? void 0 : _a.getImgData()) || null;
|
|
282
177
|
}
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
178
|
+
return ((_b = _this.screenPublisher) === null || _b === void 0 ? void 0 : _b.getImgData()) || null;
|
|
179
|
+
}
|
|
180
|
+
return (((_c = _this.subscribers
|
|
181
|
+
.find(function (s) { return s.connectionId === connectionId && s.videoType === videoType; })) === null || _c === void 0 ? void 0 : _c.subscriber.getImgData()) || null);
|
|
182
|
+
};
|
|
183
|
+
_this.prepareVideoPublisherSettings = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
184
|
+
var canStartWithAudio, canStartWithVideo, capabilitiesService, publisherOptions;
|
|
185
|
+
return __generator(this, function (_a) {
|
|
186
|
+
switch (_a.label) {
|
|
187
|
+
case 0:
|
|
188
|
+
if (!this.session) {
|
|
189
|
+
return [2];
|
|
190
|
+
}
|
|
191
|
+
return [4, (0, MediaCapabilitiesUtils_1.checkAudioCapabilities)()];
|
|
192
|
+
case 1:
|
|
193
|
+
canStartWithAudio = _a.sent();
|
|
194
|
+
return [4, (0, MediaCapabilitiesUtils_1.checkVideoCapabilities)()];
|
|
195
|
+
case 2:
|
|
196
|
+
canStartWithVideo = _a.sent();
|
|
197
|
+
return [4, MediaCapabilitiesService_1.MediaCapabilitiesService.getInstance()];
|
|
198
|
+
case 3:
|
|
199
|
+
capabilitiesService = _a.sent();
|
|
200
|
+
if (!canStartWithAudio && !canStartWithVideo) {
|
|
201
|
+
throw new Error('Creating session requires initialized publisher');
|
|
202
|
+
}
|
|
203
|
+
publisherOptions = {
|
|
204
|
+
backgroundImageURI: this.backgroundImageURI,
|
|
205
|
+
participantId: this.getParticipantId(this.ownConnectionId, MediaConstants_1.VideoTypesEnum.CAMERA)
|
|
206
|
+
};
|
|
207
|
+
this.videoPublisherOptions = {
|
|
208
|
+
publisherOptions: publisherOptions,
|
|
209
|
+
canStartWithAudio: canStartWithAudio,
|
|
210
|
+
canStartWithVideo: canStartWithVideo,
|
|
211
|
+
capabilitiesService: capabilitiesService
|
|
212
|
+
};
|
|
213
|
+
return [2];
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
}); };
|
|
217
|
+
_this.initVideoPublisher = function (settings) {
|
|
218
|
+
var _a, _b;
|
|
219
|
+
if (!(((_a = _this.videoPublisherOptions) === null || _a === void 0 ? void 0 : _a.canStartWithAudio) && ((_b = _this.videoPublisherOptions) === null || _b === void 0 ? void 0 : _b.canStartWithVideo))) {
|
|
220
|
+
throw new Error('could not init publisher');
|
|
286
221
|
}
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
222
|
+
try {
|
|
223
|
+
_this.videoPublisher = new OpentokVideoPublisher_1.OpentokVideoPublisher(__assign(__assign({}, settings.videoSettings), { cameraEnabled: settings.videoSettings.cameraEnabled && _this.videoPublisherOptions.canStartWithVideo, startWithAudioMuted: settings.videoSettings.startWithAudioMuted && _this.videoPublisherOptions.canStartWithAudio }), _this.videoPublisherOptions.publisherOptions, _this.videoPublisherOptions.capabilitiesService);
|
|
224
|
+
_this.forwardPublisherEvents(_this.videoPublisher);
|
|
290
225
|
}
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
226
|
+
catch (error) {
|
|
227
|
+
trace.error('could not init publisher');
|
|
228
|
+
}
|
|
229
|
+
};
|
|
230
|
+
_this.isScreenSharingSupported = function (isScreenSharingCapabilitiesEnabled) { return __awaiter(_this, void 0, void 0, function () {
|
|
231
|
+
var _this = this;
|
|
232
|
+
return __generator(this, function (_a) {
|
|
233
|
+
switch (_a.label) {
|
|
234
|
+
case 0:
|
|
235
|
+
if (!(isScreenSharingCapabilitiesEnabled && !(0, MediaCapabilitiesUtils_1.checkIsMobile)())) return [3, 2];
|
|
236
|
+
return [4, OT.checkScreenSharingCapability(function (res) {
|
|
237
|
+
if (!res.supported || res.extensionRegistered === false) {
|
|
238
|
+
trace.error('no screen sharing support found');
|
|
239
|
+
_this.enableDesktopSharing = false;
|
|
240
|
+
}
|
|
241
|
+
else {
|
|
242
|
+
_this.enableDesktopSharing = true;
|
|
243
|
+
}
|
|
244
|
+
})];
|
|
245
|
+
case 1:
|
|
246
|
+
_a.sent();
|
|
247
|
+
return [3, 3];
|
|
248
|
+
case 2:
|
|
249
|
+
this.enableDesktopSharing = false;
|
|
250
|
+
_a.label = 3;
|
|
251
|
+
case 3: return [2, Promise.resolve(this.enableDesktopSharing)];
|
|
252
|
+
}
|
|
298
253
|
});
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
if (!((_a = this.videoPublisher) === null || _a === void 0 ? void 0 : _a.getVideoFilter)) return [3
|
|
324
|
-
/*break*/
|
|
325
|
-
, 2];
|
|
326
|
-
return [4
|
|
327
|
-
/*yield*/
|
|
328
|
-
, (_b = this.videoPublisher) === null || _b === void 0 ? void 0 : _b.clearVideoFilter()];
|
|
329
|
-
|
|
330
|
-
case 1:
|
|
331
|
-
_c.sent();
|
|
332
|
-
|
|
333
|
-
_c.label = 2;
|
|
334
|
-
|
|
335
|
-
case 2:
|
|
336
|
-
trace.info('Disconnecting from session');
|
|
337
|
-
|
|
338
|
-
if (this.session) {
|
|
339
|
-
this.session.disconnect();
|
|
340
|
-
trace.info('Disconnection from session completed');
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
return [3
|
|
344
|
-
/*break*/
|
|
345
|
-
, 4];
|
|
346
|
-
|
|
347
|
-
case 3:
|
|
348
|
-
err_1 = _c.sent();
|
|
349
|
-
trace.error(JSON.stringify(err_1));
|
|
350
|
-
return [3
|
|
351
|
-
/*break*/
|
|
352
|
-
, 4];
|
|
353
|
-
|
|
354
|
-
case 4:
|
|
355
|
-
return [2
|
|
356
|
-
/*return*/
|
|
357
|
-
];
|
|
358
|
-
}
|
|
359
|
-
});
|
|
360
|
-
});
|
|
361
|
-
};
|
|
362
|
-
|
|
363
|
-
_this.takeSnapshot = function (connectionId, videoType) {
|
|
364
|
-
var _a, _b, _c;
|
|
365
|
-
|
|
366
|
-
if (videoType === void 0) {
|
|
367
|
-
videoType = MediaConstants_1.VideoTypesEnum.CAMERA;
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
if (!connectionId) {
|
|
371
|
-
return null;
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
if (connectionId === _this.ownConnectionId) {
|
|
375
|
-
if (videoType === MediaConstants_1.VideoTypesEnum.CAMERA) {
|
|
376
|
-
return ((_a = _this.videoPublisher) === null || _a === void 0 ? void 0 : _a.getImgData()) || null;
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
return ((_b = _this.screenPublisher) === null || _b === void 0 ? void 0 : _b.getImgData()) || null;
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
return ((_c = _this.subscribers.find(function (s) {
|
|
383
|
-
return s.connectionId === connectionId && s.videoType === videoType;
|
|
384
|
-
})) === null || _c === void 0 ? void 0 : _c.subscriber.getImgData()) || null;
|
|
385
|
-
};
|
|
386
|
-
|
|
387
|
-
_this.prepareVideoPublisherSettings = function () {
|
|
388
|
-
return __awaiter(_this, void 0, void 0, function () {
|
|
389
|
-
var canStartWithAudio, canStartWithVideo, capabilitiesService, publisherOptions;
|
|
390
|
-
return __generator(this, function (_a) {
|
|
391
|
-
switch (_a.label) {
|
|
392
|
-
case 0:
|
|
393
|
-
if (!this.session) {
|
|
394
|
-
return [2
|
|
395
|
-
/*return*/
|
|
396
|
-
];
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
return [4
|
|
400
|
-
/*yield*/
|
|
401
|
-
, MediaCapabilitiesUtils_1.checkAudioCapabilities()];
|
|
402
|
-
|
|
403
|
-
case 1:
|
|
404
|
-
canStartWithAudio = _a.sent();
|
|
405
|
-
return [4
|
|
406
|
-
/*yield*/
|
|
407
|
-
, MediaCapabilitiesUtils_1.checkVideoCapabilities()];
|
|
408
|
-
|
|
409
|
-
case 2:
|
|
410
|
-
canStartWithVideo = _a.sent();
|
|
411
|
-
return [4
|
|
412
|
-
/*yield*/
|
|
413
|
-
, MediaCapabilitiesService_1.MediaCapabilitiesService.getInstance()];
|
|
414
|
-
|
|
415
|
-
case 3:
|
|
416
|
-
capabilitiesService = _a.sent();
|
|
417
|
-
|
|
418
|
-
if (!canStartWithAudio && !canStartWithVideo) {
|
|
419
|
-
throw new Error('Creating session requires initialized publisher');
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
publisherOptions = {
|
|
423
|
-
backgroundImageURI: this.backgroundImageURI,
|
|
424
|
-
participantId: this.getParticipantId(this.ownConnectionId, MediaConstants_1.VideoTypesEnum.CAMERA)
|
|
425
|
-
};
|
|
426
|
-
this.videoPublisherOptions = {
|
|
427
|
-
publisherOptions: publisherOptions,
|
|
428
|
-
canStartWithAudio: canStartWithAudio,
|
|
429
|
-
canStartWithVideo: canStartWithVideo,
|
|
430
|
-
capabilitiesService: capabilitiesService
|
|
431
|
-
};
|
|
432
|
-
return [2
|
|
433
|
-
/*return*/
|
|
434
|
-
];
|
|
435
|
-
}
|
|
436
|
-
});
|
|
437
|
-
});
|
|
438
|
-
};
|
|
439
|
-
|
|
440
|
-
_this.initVideoPublisher = function (settings) {
|
|
441
|
-
var _a, _b;
|
|
442
|
-
|
|
443
|
-
if (!(((_a = _this.videoPublisherOptions) === null || _a === void 0 ? void 0 : _a.canStartWithAudio) && ((_b = _this.videoPublisherOptions) === null || _b === void 0 ? void 0 : _b.canStartWithVideo))) {
|
|
444
|
-
throw new Error('could not init publisher');
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
try {
|
|
448
|
-
_this.videoPublisher = new OpentokVideoPublisher_1.OpentokVideoPublisher(__assign(__assign({}, settings.videoSettings), {
|
|
449
|
-
cameraEnabled: settings.videoSettings.cameraEnabled && _this.videoPublisherOptions.canStartWithVideo,
|
|
450
|
-
startWithAudioMuted: settings.videoSettings.startWithAudioMuted && _this.videoPublisherOptions.canStartWithAudio
|
|
451
|
-
}), _this.videoPublisherOptions.publisherOptions, _this.videoPublisherOptions.capabilitiesService);
|
|
452
|
-
|
|
453
|
-
_this.forwardPublisherEvents(_this.videoPublisher);
|
|
454
|
-
} catch (error) {
|
|
455
|
-
trace.error('could not init publisher');
|
|
456
|
-
}
|
|
457
|
-
};
|
|
458
|
-
|
|
459
|
-
_this.isScreenSharingSupported = function (isScreenSharingCapabilitiesEnabled) {
|
|
460
|
-
return __awaiter(_this, void 0, void 0, function () {
|
|
461
|
-
var _this = this;
|
|
462
|
-
|
|
463
|
-
return __generator(this, function (_a) {
|
|
464
|
-
switch (_a.label) {
|
|
465
|
-
case 0:
|
|
466
|
-
if (!(isScreenSharingCapabilitiesEnabled && !MediaCapabilitiesUtils_1.checkIsMobile())) return [3
|
|
467
|
-
/*break*/
|
|
468
|
-
, 2];
|
|
469
|
-
return [4
|
|
470
|
-
/*yield*/
|
|
471
|
-
, OT.checkScreenSharingCapability(function (res) {
|
|
472
|
-
if (!res.supported || res.extensionRegistered === false) {
|
|
473
|
-
// This browser does not support screen sharing.
|
|
474
|
-
trace.error('no screen sharing support found');
|
|
475
|
-
_this.enableDesktopSharing = false;
|
|
476
|
-
} else {
|
|
477
|
-
_this.enableDesktopSharing = true;
|
|
254
|
+
}); };
|
|
255
|
+
_this.forwardPublisherEvents = function (publisher) {
|
|
256
|
+
publisher.on('cameraSourceChanged', function (e) { return _this.emit(MultipartyServiceEventTypes_1.MultiPartyServiceEventTypes.cameraSourceChanged, e); });
|
|
257
|
+
publisher.on('streamCreated', function (e) { return _this.emit(MultipartyServiceEventTypes_1.MultiPartyServiceEventTypes.streamCreated, e); });
|
|
258
|
+
publisher.on('streamDestroyed', function (e) { return _this.emit(MultipartyServiceEventTypes_1.MultiPartyServiceEventTypes.streamDestroyed, e); });
|
|
259
|
+
publisher.on('mediaDeviceAccessDenied', function (e) {
|
|
260
|
+
return _this.emit(MultipartyServiceEventTypes_1.MultiPartyServiceEventTypes.mediaDeviceAccessDenied, e);
|
|
261
|
+
});
|
|
262
|
+
publisher.on('videoElementCreated', function (e) { return _this.emit(MultipartyServiceEventTypes_1.MultiPartyServiceEventTypes.videoElementCreated, e); });
|
|
263
|
+
};
|
|
264
|
+
_this.publishAudio = function (shouldMute) { return __awaiter(_this, void 0, void 0, function () {
|
|
265
|
+
var canPublishAudio;
|
|
266
|
+
var _a;
|
|
267
|
+
return __generator(this, function (_b) {
|
|
268
|
+
switch (_b.label) {
|
|
269
|
+
case 0: return [4, (0, MediaCapabilitiesUtils_1.checkAudioCapabilities)()];
|
|
270
|
+
case 1:
|
|
271
|
+
canPublishAudio = _b.sent();
|
|
272
|
+
if (shouldMute && !canPublishAudio) {
|
|
273
|
+
trace.error('could not publish audio');
|
|
274
|
+
return [2];
|
|
275
|
+
}
|
|
276
|
+
(_a = this.videoPublisher) === null || _a === void 0 ? void 0 : _a.publishAudio(shouldMute);
|
|
277
|
+
return [2];
|
|
478
278
|
}
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
});
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
return
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
case 1:
|
|
603
|
-
capabilitiesService = _a.sent();
|
|
604
|
-
_a.label = 2;
|
|
605
|
-
|
|
606
|
-
case 2:
|
|
607
|
-
_a.trys.push([2, 4,, 5]);
|
|
608
|
-
|
|
609
|
-
this.screenPublisher = new OpentokScreenPublisher_1.OpentokScreenPublisher(__assign(__assign({}, publisherOptions), {
|
|
610
|
-
participantId: this.getParticipantId(this.ownConnectionId, MediaConstants_1.VideoTypesEnum.SCREEN)
|
|
611
|
-
}), capabilitiesService);
|
|
612
|
-
this.forwardPublisherEvents(this.screenPublisher);
|
|
613
|
-
return [4
|
|
614
|
-
/*yield*/
|
|
615
|
-
, new Promise(function (resolve, reject) {
|
|
616
|
-
var _a, _b;
|
|
617
|
-
|
|
618
|
-
_this.screenPublisher && ((_a = _this.session) === null || _a === void 0 ? void 0 : _a.connection) && ((_b = _this.session) === null || _b === void 0 ? void 0 : _b.publish(_this.screenPublisher.get(), function (err) {
|
|
619
|
-
if (err) {
|
|
620
|
-
trace.error('Failed to publish screen', err);
|
|
621
|
-
return reject(err);
|
|
622
|
-
}
|
|
623
|
-
|
|
624
|
-
return resolve();
|
|
625
|
-
}));
|
|
626
|
-
})];
|
|
627
|
-
|
|
628
|
-
case 3:
|
|
629
|
-
return [2
|
|
630
|
-
/*return*/
|
|
631
|
-
, _a.sent()];
|
|
632
|
-
|
|
633
|
-
case 4:
|
|
634
|
-
e_1 = _a.sent();
|
|
635
|
-
trace.error('Failed to publish screen', e_1);
|
|
636
|
-
return [2
|
|
637
|
-
/*return*/
|
|
638
|
-
, Promise.reject(e_1)];
|
|
639
|
-
|
|
640
|
-
case 5:
|
|
641
|
-
return [2
|
|
642
|
-
/*return*/
|
|
643
|
-
];
|
|
644
|
-
}
|
|
645
|
-
});
|
|
646
|
-
});
|
|
647
|
-
};
|
|
648
|
-
|
|
649
|
-
_this.switchCamera = function () {
|
|
650
|
-
return __awaiter(_this, void 0, void 0, function () {
|
|
651
|
-
var _a;
|
|
652
|
-
|
|
653
|
-
return __generator(this, function (_b) {
|
|
654
|
-
return [2
|
|
655
|
-
/*return*/
|
|
656
|
-
, (_a = this.videoPublisher) === null || _a === void 0 ? void 0 : _a.switchCamera()];
|
|
657
|
-
});
|
|
658
|
-
});
|
|
659
|
-
};
|
|
660
|
-
|
|
661
|
-
_this.reinitializeStreams = function (settings) {
|
|
662
|
-
var _a, _b, _c;
|
|
663
|
-
|
|
664
|
-
var promises = [];
|
|
665
|
-
|
|
666
|
-
if (!_this.session) {
|
|
667
|
-
return Promise.resolve([]);
|
|
668
|
-
}
|
|
669
|
-
|
|
670
|
-
var shouldPublishScreen = !!_this.screenPublisher;
|
|
671
|
-
|
|
672
|
-
_this.subscriberList.map(function (s) {
|
|
673
|
-
return s.subscriber;
|
|
674
|
-
}).forEach((_a = _this.session) === null || _a === void 0 ? void 0 : _a.unsubscribe);
|
|
675
|
-
|
|
676
|
-
_this.subscriberList = [];
|
|
677
|
-
(_b = _this.videoPublisher) === null || _b === void 0 ? void 0 : _b.destroy();
|
|
678
|
-
(_c = _this.screenPublisher) === null || _c === void 0 ? void 0 : _c.destroy();
|
|
679
|
-
|
|
680
|
-
_this.initVideoPublisher(settings);
|
|
681
|
-
|
|
682
|
-
if (shouldPublishScreen) {
|
|
683
|
-
promises.push(_this.publishScreen());
|
|
684
|
-
}
|
|
685
|
-
|
|
686
|
-
return Promise.all(promises);
|
|
687
|
-
};
|
|
688
|
-
|
|
689
|
-
_this.streamCreatedHandler = function (event) {
|
|
690
|
-
return __awaiter(_this, void 0, void 0, function () {
|
|
691
|
-
var stream, connection, hasAudio, hasVideo, videoDimensions, videoType, connectionId, data, participantId, clientRole, subscriber;
|
|
692
|
-
return __generator(this, function (_a) {
|
|
693
|
-
trace.info('streamCreatedHandler', event.stream);
|
|
694
|
-
stream = event.stream;
|
|
695
|
-
connection = stream.connection, hasAudio = stream.hasAudio, hasVideo = stream.hasVideo, videoDimensions = stream.videoDimensions, videoType = stream.videoType;
|
|
696
|
-
connectionId = connection.connectionId, data = connection.data;
|
|
697
|
-
participantId = this.getParticipantId(connectionId, videoType);
|
|
698
|
-
clientRole = utils_1.decodeClientRole(data);
|
|
699
|
-
|
|
700
|
-
if (this.ownConnectionId && stream && connectionId !== this.ownConnectionId) {
|
|
701
|
-
if (this.subscriberList.length < MultiPartyService_1.maxParticipantsNumber - 1) {
|
|
702
|
-
subscriber = OpentokSubscriber_1.createSubscriber(this.session, stream, this.getParticipantId(connectionId, videoType), this.backgroundImageURI);
|
|
703
|
-
this.subscriberList.push({
|
|
704
|
-
subscriber: subscriber,
|
|
279
|
+
});
|
|
280
|
+
}); };
|
|
281
|
+
_this.publishVideo = function (shouldPublishVideo) { return __awaiter(_this, void 0, void 0, function () {
|
|
282
|
+
var canPublishVideo;
|
|
283
|
+
var _a;
|
|
284
|
+
return __generator(this, function (_b) {
|
|
285
|
+
switch (_b.label) {
|
|
286
|
+
case 0: return [4, (0, MediaCapabilitiesUtils_1.checkVideoCapabilities)()];
|
|
287
|
+
case 1:
|
|
288
|
+
canPublishVideo = _b.sent();
|
|
289
|
+
if (shouldPublishVideo && !canPublishVideo) {
|
|
290
|
+
trace.error('could not publish video');
|
|
291
|
+
return [2];
|
|
292
|
+
}
|
|
293
|
+
(_a = this.videoPublisher) === null || _a === void 0 ? void 0 : _a.publishVideo(shouldPublishVideo);
|
|
294
|
+
return [2];
|
|
295
|
+
}
|
|
296
|
+
});
|
|
297
|
+
}); };
|
|
298
|
+
_this.publishScreen = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
299
|
+
var publisherOptions, capabilitiesService, e_1;
|
|
300
|
+
var _this = this;
|
|
301
|
+
return __generator(this, function (_a) {
|
|
302
|
+
switch (_a.label) {
|
|
303
|
+
case 0:
|
|
304
|
+
if (!this.enableDesktopSharing) return [3, 5];
|
|
305
|
+
publisherOptions = {
|
|
306
|
+
backgroundImageURI: this.backgroundImageURI
|
|
307
|
+
};
|
|
308
|
+
return [4, MediaCapabilitiesService_1.MediaCapabilitiesService.getInstance()];
|
|
309
|
+
case 1:
|
|
310
|
+
capabilitiesService = _a.sent();
|
|
311
|
+
_a.label = 2;
|
|
312
|
+
case 2:
|
|
313
|
+
_a.trys.push([2, 4, , 5]);
|
|
314
|
+
this.screenPublisher = new OpentokScreenPublisher_1.OpentokScreenPublisher(__assign(__assign({}, publisherOptions), { participantId: this.getParticipantId(this.ownConnectionId, MediaConstants_1.VideoTypesEnum.SCREEN) }), capabilitiesService);
|
|
315
|
+
this.forwardPublisherEvents(this.screenPublisher);
|
|
316
|
+
return [4, new Promise(function (resolve, reject) {
|
|
317
|
+
var _a, _b;
|
|
318
|
+
_this.screenPublisher &&
|
|
319
|
+
((_a = _this.session) === null || _a === void 0 ? void 0 : _a.connection) &&
|
|
320
|
+
((_b = _this.session) === null || _b === void 0 ? void 0 : _b.publish(_this.screenPublisher.get(), function (err) {
|
|
321
|
+
if (err) {
|
|
322
|
+
trace.error('Failed to publish screen', err);
|
|
323
|
+
return reject(err);
|
|
324
|
+
}
|
|
325
|
+
return resolve();
|
|
326
|
+
}));
|
|
327
|
+
})];
|
|
328
|
+
case 3: return [2, _a.sent()];
|
|
329
|
+
case 4:
|
|
330
|
+
e_1 = _a.sent();
|
|
331
|
+
trace.error('Failed to publish screen', e_1);
|
|
332
|
+
return [2, Promise.reject(e_1)];
|
|
333
|
+
case 5: return [2];
|
|
334
|
+
}
|
|
335
|
+
});
|
|
336
|
+
}); };
|
|
337
|
+
_this.switchCamera = function () { return __awaiter(_this, void 0, void 0, function () { var _a; return __generator(this, function (_b) {
|
|
338
|
+
return [2, (_a = this.videoPublisher) === null || _a === void 0 ? void 0 : _a.switchCamera()];
|
|
339
|
+
}); }); };
|
|
340
|
+
_this.reinitializeStreams = function (settings) {
|
|
341
|
+
var _a, _b, _c;
|
|
342
|
+
var promises = [];
|
|
343
|
+
if (!_this.session) {
|
|
344
|
+
return Promise.resolve([]);
|
|
345
|
+
}
|
|
346
|
+
var shouldPublishScreen = !!_this.screenPublisher;
|
|
347
|
+
_this.subscriberList.map(function (s) { return s.subscriber; }).forEach((_a = _this.session) === null || _a === void 0 ? void 0 : _a.unsubscribe);
|
|
348
|
+
_this.subscriberList = [];
|
|
349
|
+
(_b = _this.videoPublisher) === null || _b === void 0 ? void 0 : _b.destroy();
|
|
350
|
+
(_c = _this.screenPublisher) === null || _c === void 0 ? void 0 : _c.destroy();
|
|
351
|
+
_this.initVideoPublisher(settings);
|
|
352
|
+
if (shouldPublishScreen) {
|
|
353
|
+
promises.push(_this.publishScreen());
|
|
354
|
+
}
|
|
355
|
+
return Promise.all(promises);
|
|
356
|
+
};
|
|
357
|
+
_this.streamCreatedHandler = function (event) { return __awaiter(_this, void 0, void 0, function () {
|
|
358
|
+
var stream, connection, hasAudio, hasVideo, videoDimensions, videoType, connectionId, data, participantId, clientRole, subscriber;
|
|
359
|
+
return __generator(this, function (_a) {
|
|
360
|
+
trace.info('streamCreatedHandler', event.stream);
|
|
361
|
+
stream = event.stream;
|
|
362
|
+
connection = stream.connection, hasAudio = stream.hasAudio, hasVideo = stream.hasVideo, videoDimensions = stream.videoDimensions, videoType = stream.videoType;
|
|
363
|
+
connectionId = connection.connectionId, data = connection.data;
|
|
364
|
+
participantId = this.getParticipantId(connectionId, videoType);
|
|
365
|
+
clientRole = (0, utils_1.decodeClientRole)(data);
|
|
366
|
+
if (this.ownConnectionId && stream && connectionId !== this.ownConnectionId) {
|
|
367
|
+
if (this.subscriberList.length < MultiPartyService_1.maxParticipantsNumber - 1) {
|
|
368
|
+
subscriber = (0, OpentokSubscriber_1.createSubscriber)(this.session, stream, this.getParticipantId(connectionId, videoType), this.backgroundImageURI);
|
|
369
|
+
this.subscriberList.push({
|
|
370
|
+
subscriber: subscriber,
|
|
371
|
+
connectionId: connectionId,
|
|
372
|
+
clientRole: clientRole,
|
|
373
|
+
videoType: videoType
|
|
374
|
+
});
|
|
375
|
+
}
|
|
376
|
+
else {
|
|
377
|
+
trace.info("a new subscriber cannot be added, as the number of participants reached its limit: ".concat(MultiPartyService_1.maxParticipantsNumber));
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
this.emit(MultipartyServiceEventTypes_1.MultiPartyServiceEventTypes.streamCreated, {
|
|
381
|
+
participantId: participantId,
|
|
382
|
+
clientRole: clientRole,
|
|
383
|
+
connectionId: connectionId,
|
|
384
|
+
hasVideo: hasVideo,
|
|
385
|
+
hasAudio: hasAudio,
|
|
386
|
+
isOwnConnection: false,
|
|
387
|
+
mirror: false,
|
|
388
|
+
videoDimensions: videoDimensions,
|
|
389
|
+
videoType: videoType
|
|
390
|
+
});
|
|
391
|
+
return [2];
|
|
392
|
+
});
|
|
393
|
+
}); };
|
|
394
|
+
_this.streamDestroyedHandler = function (event) {
|
|
395
|
+
trace.info('streamDestroyedHandler', event);
|
|
396
|
+
var _a = event.stream, connection = _a.connection, videoType = _a.videoType;
|
|
397
|
+
var connectionId = connection.connectionId;
|
|
398
|
+
_this.subscriberList = _this.subscriberList.filter(function (subscriber) { return !(0, utils_1.isSameStream)(__assign({}, subscriber), { connectionId: connectionId, videoType: videoType }); });
|
|
399
|
+
_this.emit(MultipartyServiceEventTypes_1.MultiPartyServiceEventTypes.streamDestroyed, {
|
|
400
|
+
participantId: _this.getParticipantId(connectionId, videoType),
|
|
705
401
|
connectionId: connectionId,
|
|
706
|
-
|
|
402
|
+
isOwnConnection: false,
|
|
403
|
+
clientRole: (0, utils_1.decodeClientRole)(connection.data),
|
|
707
404
|
videoType: videoType
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
405
|
+
});
|
|
406
|
+
};
|
|
407
|
+
_this.connectionCreatedHandler = function (event) {
|
|
408
|
+
var _a;
|
|
409
|
+
trace.info('connectionCreatedHandler', event);
|
|
410
|
+
var connection = event.connection;
|
|
411
|
+
var connectionId = connection.connectionId;
|
|
412
|
+
var clientRole = (0, utils_1.decodeClientRole)(connection.data);
|
|
413
|
+
if (!_this.ownConnectionId || !connection) {
|
|
414
|
+
return;
|
|
711
415
|
}
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
_this.emit(MultipartyServiceEventTypes_1.MultiPartyServiceEventTypes.connectionCreated, {
|
|
783
|
-
clientRole: clientRole,
|
|
784
|
-
participantId: _this.getParticipantId(connectionId),
|
|
785
|
-
connectionId: connectionId,
|
|
786
|
-
isOwnConnection: _this.checkOwnConnection(connectionId)
|
|
787
|
-
});
|
|
788
|
-
};
|
|
789
|
-
|
|
790
|
-
_this.connectionDestroyedHandler = function (event) {
|
|
791
|
-
var connection = event.connection;
|
|
792
|
-
var connectionId = connection.connectionId;
|
|
793
|
-
trace.info('connectionDestroyedHandler', event);
|
|
794
|
-
|
|
795
|
-
_this.emit(MultipartyServiceEventTypes_1.MultiPartyServiceEventTypes.connectionDestroyed, {
|
|
796
|
-
clientRole: utils_1.decodeClientRole(connection.data),
|
|
797
|
-
participantId: _this.getParticipantId(connectionId),
|
|
798
|
-
connectionId: connectionId,
|
|
799
|
-
isOwnConnection: _this.checkOwnConnection(connectionId)
|
|
800
|
-
});
|
|
801
|
-
|
|
802
|
-
if (connectionId !== _this.ownConnectionId || !_this.ownConnectionId) {
|
|
803
|
-
return;
|
|
804
|
-
}
|
|
805
|
-
|
|
806
|
-
_this.session = undefined;
|
|
807
|
-
};
|
|
808
|
-
|
|
809
|
-
_this.streamPropertyChangedHandler = function (event) {
|
|
810
|
-
trace.info('streamPropertyChangedHandler', event);
|
|
811
|
-
var _a = event.stream,
|
|
812
|
-
hasVideo = _a.hasVideo,
|
|
813
|
-
hasAudio = _a.hasAudio,
|
|
814
|
-
connection = _a.connection,
|
|
815
|
-
videoDimensions = _a.videoDimensions,
|
|
816
|
-
videoType = _a.videoType;
|
|
817
|
-
var connectionId = connection.connectionId;
|
|
818
|
-
|
|
819
|
-
_this.emit(MultipartyServiceEventTypes_1.MultiPartyServiceEventTypes.streamPropertyChanged, {
|
|
820
|
-
hasVideo: hasVideo,
|
|
821
|
-
hasAudio: hasAudio,
|
|
822
|
-
participantId: _this.getParticipantId(connectionId, videoType),
|
|
823
|
-
connectionId: connectionId,
|
|
824
|
-
isOwnConnection: _this.checkOwnConnection(connectionId),
|
|
825
|
-
clientRole: utils_1.decodeClientRole(connection.data),
|
|
826
|
-
videoDimensions: videoDimensions,
|
|
827
|
-
videoType: videoType
|
|
828
|
-
});
|
|
829
|
-
};
|
|
830
|
-
|
|
831
|
-
_this.sessionDisconnectedHandler = function (event) {
|
|
832
|
-
var _a;
|
|
833
|
-
|
|
834
|
-
(_a = _this.session) === null || _a === void 0 ? void 0 : _a.off();
|
|
835
|
-
trace.info('sessionDisconnectedHandler', event);
|
|
836
|
-
};
|
|
837
|
-
|
|
838
|
-
_this.checkOwnConnection = function (connectionId) {
|
|
839
|
-
return _this.ownConnectionId !== undefined && _this.ownConnectionId === connectionId;
|
|
416
|
+
var sameRole = _this.subscriberList.find(function (subscriber) { return subscriber.clientRole === clientRole; });
|
|
417
|
+
if (sameRole) {
|
|
418
|
+
_this.subscriberList = _this.subscriberList.filter(function (subscriber) { return subscriber.clientRole !== clientRole; });
|
|
419
|
+
(_a = _this.session) === null || _a === void 0 ? void 0 : _a.unsubscribe(sameRole.subscriber);
|
|
420
|
+
}
|
|
421
|
+
_this.emit(MultipartyServiceEventTypes_1.MultiPartyServiceEventTypes.connectionCreated, {
|
|
422
|
+
clientRole: clientRole,
|
|
423
|
+
participantId: _this.getParticipantId(connectionId),
|
|
424
|
+
connectionId: connectionId,
|
|
425
|
+
isOwnConnection: _this.checkOwnConnection(connectionId)
|
|
426
|
+
});
|
|
427
|
+
};
|
|
428
|
+
_this.connectionDestroyedHandler = function (event) {
|
|
429
|
+
var connection = event.connection;
|
|
430
|
+
var connectionId = connection.connectionId;
|
|
431
|
+
trace.info('connectionDestroyedHandler', event);
|
|
432
|
+
_this.emit(MultipartyServiceEventTypes_1.MultiPartyServiceEventTypes.connectionDestroyed, {
|
|
433
|
+
clientRole: (0, utils_1.decodeClientRole)(connection.data),
|
|
434
|
+
participantId: _this.getParticipantId(connectionId),
|
|
435
|
+
connectionId: connectionId,
|
|
436
|
+
isOwnConnection: _this.checkOwnConnection(connectionId)
|
|
437
|
+
});
|
|
438
|
+
if (connectionId !== _this.ownConnectionId || !_this.ownConnectionId) {
|
|
439
|
+
return;
|
|
440
|
+
}
|
|
441
|
+
_this.session = undefined;
|
|
442
|
+
};
|
|
443
|
+
_this.streamPropertyChangedHandler = function (event) {
|
|
444
|
+
trace.info('streamPropertyChangedHandler', event);
|
|
445
|
+
var _a = event.stream, hasVideo = _a.hasVideo, hasAudio = _a.hasAudio, connection = _a.connection, videoDimensions = _a.videoDimensions, videoType = _a.videoType;
|
|
446
|
+
var connectionId = connection.connectionId;
|
|
447
|
+
_this.emit(MultipartyServiceEventTypes_1.MultiPartyServiceEventTypes.streamPropertyChanged, {
|
|
448
|
+
hasVideo: hasVideo,
|
|
449
|
+
hasAudio: hasAudio,
|
|
450
|
+
participantId: _this.getParticipantId(connectionId, videoType),
|
|
451
|
+
connectionId: connectionId,
|
|
452
|
+
isOwnConnection: _this.checkOwnConnection(connectionId),
|
|
453
|
+
clientRole: (0, utils_1.decodeClientRole)(connection.data),
|
|
454
|
+
videoDimensions: videoDimensions,
|
|
455
|
+
videoType: videoType
|
|
456
|
+
});
|
|
457
|
+
};
|
|
458
|
+
_this.sessionDisconnectedHandler = function (event) {
|
|
459
|
+
var _a;
|
|
460
|
+
(_a = _this.session) === null || _a === void 0 ? void 0 : _a.off();
|
|
461
|
+
trace.info('sessionDisconnectedHandler', event);
|
|
462
|
+
};
|
|
463
|
+
_this.checkOwnConnection = function (connectionId) {
|
|
464
|
+
return _this.ownConnectionId !== undefined && _this.ownConnectionId === connectionId;
|
|
465
|
+
};
|
|
466
|
+
return _this;
|
|
467
|
+
}
|
|
468
|
+
Object.defineProperty(OpentokMultiPartyService.prototype, "ownConnectionId", {
|
|
469
|
+
get: function () {
|
|
470
|
+
var _a, _b;
|
|
471
|
+
return ((_b = (_a = this.session) === null || _a === void 0 ? void 0 : _a.connection) === null || _b === void 0 ? void 0 : _b.connectionId) || '';
|
|
472
|
+
},
|
|
473
|
+
enumerable: false,
|
|
474
|
+
configurable: true
|
|
475
|
+
});
|
|
476
|
+
Object.defineProperty(OpentokMultiPartyService.prototype, "subscribers", {
|
|
477
|
+
get: function () {
|
|
478
|
+
return __spreadArray([], this.subscriberList, true);
|
|
479
|
+
},
|
|
480
|
+
enumerable: false,
|
|
481
|
+
configurable: true
|
|
482
|
+
});
|
|
483
|
+
OpentokMultiPartyService.prototype.stopScreenPublisher = function () {
|
|
484
|
+
var _a;
|
|
485
|
+
return (_a = this.screenPublisher) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
840
486
|
};
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
}
|
|
844
|
-
|
|
845
|
-
Object.defineProperty(OpentokMultiPartyService.prototype, "ownConnectionId", {
|
|
846
|
-
get: function get() {
|
|
847
|
-
var _a, _b;
|
|
848
|
-
|
|
849
|
-
return ((_b = (_a = this.session) === null || _a === void 0 ? void 0 : _a.connection) === null || _b === void 0 ? void 0 : _b.connectionId) || '';
|
|
850
|
-
},
|
|
851
|
-
enumerable: false,
|
|
852
|
-
configurable: true
|
|
853
|
-
});
|
|
854
|
-
Object.defineProperty(OpentokMultiPartyService.prototype, "subscribers", {
|
|
855
|
-
get: function get() {
|
|
856
|
-
return __spreadArrays(this.subscriberList);
|
|
857
|
-
},
|
|
858
|
-
enumerable: false,
|
|
859
|
-
configurable: true
|
|
860
|
-
});
|
|
861
|
-
|
|
862
|
-
OpentokMultiPartyService.prototype.stopScreenPublisher = function () {
|
|
863
|
-
var _a;
|
|
864
|
-
|
|
865
|
-
return (_a = this.screenPublisher) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
866
|
-
};
|
|
867
|
-
|
|
868
|
-
return OpentokMultiPartyService;
|
|
869
|
-
}(MultiPartyService_1.MultiPartyService);
|
|
870
|
-
|
|
487
|
+
return OpentokMultiPartyService;
|
|
488
|
+
}(MultiPartyService_1.MultiPartyService));
|
|
871
489
|
exports.OpentokMultiPartyService = OpentokMultiPartyService;
|
|
872
|
-
//# sourceMappingURL=OpentokMultiPartyService.js.map
|
|
490
|
+
//# sourceMappingURL=OpentokMultiPartyService.js.map
|