@techsee/techsee-media-service 18.6.0 → 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,3 +1,4 @@
|
|
|
1
1
|
import { MultiPartyService } from './MultiPartyService';
|
|
2
2
|
import { MediaServiceType } from '../MediaConstants';
|
|
3
|
-
export declare const createMultiPartyService: (mediaServiceType: MediaServiceType, getParticipantDomId: (connectionId?: string
|
|
3
|
+
export declare const createMultiPartyService: (mediaServiceType: MediaServiceType, getParticipantDomId: (connectionId?: string) => string) => MultiPartyService;
|
|
4
|
+
//# sourceMappingURL=MultiPartyServiceFactory.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"file":"MultiPartyServiceFactory.d.ts","sourceRoot":"","sources":["../../src/MultiParty/MultiPartyServiceFactory.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AAEtD,OAAO,EAAC,gBAAgB,EAAC,MAAM,mBAAmB,CAAC;AAEnD,eAAO,MAAM,uBAAuB,qBACd,gBAAgB,uCACG,MAAM,KAAK,MAAM,KACvD,iBAMF,CAAC"}
|
|
@@ -1,21 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.createMultiPartyService = void 0;
|
|
7
|
-
|
|
8
4
|
var OpentokMultiPartyService_1 = require("./opentok/OpentokMultiPartyService");
|
|
9
|
-
|
|
10
5
|
var MediaConstants_1 = require("../MediaConstants");
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
throw new Error('NOT_SUPPORTED');
|
|
6
|
+
var createMultiPartyService = function (mediaServiceType, getParticipantDomId) {
|
|
7
|
+
if (mediaServiceType === MediaConstants_1.MediaServiceType.OPENTOK) {
|
|
8
|
+
return new OpentokMultiPartyService_1.OpentokMultiPartyService(getParticipantDomId);
|
|
9
|
+
}
|
|
10
|
+
throw new Error('NOT_SUPPORTED');
|
|
18
11
|
};
|
|
19
|
-
|
|
20
12
|
exports.createMultiPartyService = createMultiPartyService;
|
|
21
|
-
//# sourceMappingURL=MultiPartyServiceFactory.js.map
|
|
13
|
+
//# sourceMappingURL=MultiPartyServiceFactory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"MultiPartyServiceFactory.js","sourceRoot":"","sources":["../../src/MultiParty/MultiPartyServiceFactory.ts"],"names":[],"mappings":";;;AAEA,+EAA4E;AAC5E,oDAAmD;AAE5C,IAAM,uBAAuB,GAAG,UACnC,gBAAkC,EAClC,mBAAsD;IAEtD,IAAI,gBAAgB,KAAK,iCAAgB,CAAC,OAAO,EAAE;QAC/C,OAAO,IAAI,mDAAwB,CAAC,mBAAmB,CAAC,CAAC;KAC5D;IAED,MAAM,IAAI,KAAK,CAAC,eAAe,CAAC,CAAC;AACrC,CAAC,CAAC;AATW,QAAA,uBAAuB,2BASlC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"file":"MultipartyServiceEventTypes.d.ts","sourceRoot":"","sources":["../../src/MultiParty/MultipartyServiceEventTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,qBAAqB,EAAE,iBAAiB,EAAE,cAAc,EAAC,MAAM,mBAAmB,CAAC;AAE3F,oBAAY,2BAA2B;IACnC,aAAa,kBAAkB;IAC/B,eAAe,oBAAoB;IACnC,iBAAiB,sBAAsB;IACvC,mBAAmB,wBAAwB;IAC3C,aAAa,kBAAkB;IAC/B,mBAAmB,wBAAwB;IAC3C,qBAAqB,0BAA0B;IAC/C,uBAAuB,4BAA4B;IACnD,mBAAmB,wBAAwB;CAC9C;AAED,oBAAY,mCAAmC,GAAG;IAC9C,IAAI,EAAE;QACF,GAAG,EAAE,MAAM,CAAC;KACf,CAAC;CACL,CAAC;AAEF,oBAAY,uCAAuC,GAAG;IAClD,eAAe,EAAE,OAAO,CAAC;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,iBAAiB,CAAC;CACjC,CAAC;AAEF,oBAAY,yCAAyC,GAAG;IACpD,eAAe,EAAE,OAAO,CAAC;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,iBAAiB,CAAC;CACjC,CAAC;AAEF,oBAAY,mCAAmC,GAAG;IAC9C,eAAe,EAAE,OAAO,CAAC;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,iBAAiB,CAAC;IAC9B,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;IAChB,eAAe,EAAE;QACb,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,SAAS,EAAE,cAAc,CAAC;CAC7B,CAAC;AAEF,oBAAY,yCAAyC,GAAG;IACpD,OAAO,EAAE,gBAAgB,GAAG,iBAAiB,CAAC;CACjD,CAAC;AAEF,oBAAY,qCAAqC,GAAG;IAChD,eAAe,EAAE,OAAO,CAAC;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,iBAAiB,CAAC;IAC9B,SAAS,EAAE,cAAc,CAAC;CAC7B,CAAC;AAEF,oBAAY,2CAA2C,GAAG;IACtD,eAAe,EAAE,OAAO,CAAC;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,iBAAiB,CAAC;IAC9B,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,eAAe,EAAE;QACb,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,SAAS,EAAE,cAAc,CAAC;CAC7B,CAAC;AAEF,oBAAY,yCAAyC,GAAG;IACpD,YAAY,EAAE,qBAAqB,CAAC;IACpC,MAAM,EAAE,OAAO,CAAC;IAChB,eAAe,EAAE;QACb,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;KAClB,CAAC;CACL,CAAC;AAEF,oBAAY,uCAAuC,GAAG;IAClD,eAAe,EAAE,OAAO,CAAC;CAC5B,CAAC;AAEF,MAAM,WAAW,8BAA8B;IAC3C,iBAAiB,EAAE,uCAAuC,CAAC;IAC3D,mBAAmB,EAAE,yCAAyC,CAAC;IAC/D,aAAa,EAAE,mCAAmC,CAAC;IACnD,eAAe,EAAE,qCAAqC,CAAC;IACvD,aAAa,EAAE,mCAAmC,CAAC;IACnD,mBAAmB,EAAE,yCAAyC,CAAC;IAC/D,qBAAqB,EAAE,2CAA2C,CAAC;IACnE,uBAAuB,EAAE,uCAAuC,CAAC;IACjE,mBAAmB,EAAE,yCAAyC,CAAC;CAClE"}
|
|
@@ -1,20 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.MultiPartyServiceEventTypes = void 0;
|
|
7
4
|
var MultiPartyServiceEventTypes;
|
|
8
|
-
|
|
9
5
|
(function (MultiPartyServiceEventTypes) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
6
|
+
MultiPartyServiceEventTypes["connectFailed"] = "connectFailed";
|
|
7
|
+
MultiPartyServiceEventTypes["streamDestroyed"] = "streamDestroyed";
|
|
8
|
+
MultiPartyServiceEventTypes["connectionCreated"] = "connectionCreated";
|
|
9
|
+
MultiPartyServiceEventTypes["connectionDestroyed"] = "connectionDestroyed";
|
|
10
|
+
MultiPartyServiceEventTypes["streamCreated"] = "streamCreated";
|
|
11
|
+
MultiPartyServiceEventTypes["videoElementCreated"] = "videoElementCreated";
|
|
12
|
+
MultiPartyServiceEventTypes["streamPropertyChanged"] = "streamPropertyChanged";
|
|
13
|
+
MultiPartyServiceEventTypes["mediaDeviceAccessDenied"] = "mediaDeviceAccessDenied";
|
|
14
|
+
MultiPartyServiceEventTypes["cameraSourceChanged"] = "cameraSourceChanged";
|
|
19
15
|
})(MultiPartyServiceEventTypes = exports.MultiPartyServiceEventTypes || (exports.MultiPartyServiceEventTypes = {}));
|
|
20
|
-
//# sourceMappingURL=MultipartyServiceEventTypes.js.map
|
|
16
|
+
//# sourceMappingURL=MultipartyServiceEventTypes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"MultipartyServiceEventTypes.js","sourceRoot":"","sources":["../../src/MultiParty/MultipartyServiceEventTypes.ts"],"names":[],"mappings":";;;AAEA,IAAY,2BAUX;AAVD,WAAY,2BAA2B;IACnC,8DAA+B,CAAA;IAC/B,kEAAmC,CAAA;IACnC,sEAAuC,CAAA;IACvC,0EAA2C,CAAA;IAC3C,8DAA+B,CAAA;IAC/B,0EAA2C,CAAA;IAC3C,8EAA+C,CAAA;IAC/C,kFAAmD,CAAA;IACnD,0EAA2C,CAAA;AAC/C,CAAC,EAVW,2BAA2B,GAA3B,mCAA2B,KAA3B,mCAA2B,QAUtC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/MultiParty/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAC,uBAAuB,EAAC,MAAM,4BAA4B,CAAC"}
|
package/lib/MultiParty/index.js
CHANGED
|
@@ -1,45 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
get: function get() {
|
|
8
|
-
return m[k];
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
9
7
|
}
|
|
10
|
-
|
|
11
|
-
} : function
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
var
|
|
17
|
-
for (var p in m) {
|
|
18
|
-
if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
19
|
-
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
20
15
|
};
|
|
21
|
-
|
|
22
|
-
Object.defineProperty(exports, "__esModule", {
|
|
23
|
-
value: true
|
|
24
|
-
});
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
17
|
exports.createMultiPartyService = void 0;
|
|
26
|
-
|
|
27
18
|
__exportStar(require("./types"), exports);
|
|
28
|
-
|
|
29
19
|
__exportStar(require("./MediaCapabilitiesUtils"), exports);
|
|
30
|
-
|
|
31
20
|
__exportStar(require("./MultiPartyService"), exports);
|
|
32
|
-
|
|
33
21
|
__exportStar(require("./MultipartyServiceEventTypes"), exports);
|
|
34
|
-
|
|
35
22
|
__exportStar(require("./MediaTracer"), exports);
|
|
36
|
-
|
|
37
23
|
var MultiPartyServiceFactory_1 = require("./MultiPartyServiceFactory");
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
enumerable: true,
|
|
41
|
-
get: function get() {
|
|
42
|
-
return MultiPartyServiceFactory_1.createMultiPartyService;
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
//# sourceMappingURL=index.js.map
|
|
24
|
+
Object.defineProperty(exports, "createMultiPartyService", { enumerable: true, get: function () { return MultiPartyServiceFactory_1.createMultiPartyService; } });
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/MultiParty/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,2DAAyC;AACzC,sDAAoC;AACpC,gEAA8C;AAC9C,gDAA8B;AAC9B,uEAAmE;AAA3D,mIAAA,uBAAuB,OAAA"}
|
|
@@ -19,7 +19,7 @@ export declare class OpentokMultiPartyService extends MultiPartyService {
|
|
|
19
19
|
takeSnapshot: (connectionId: string, videoType?: VideoTypesEnum) => string | null;
|
|
20
20
|
private prepareVideoPublisherSettings;
|
|
21
21
|
private initVideoPublisher;
|
|
22
|
-
isScreenSharingSupported: (isScreenSharingCapabilitiesEnabled?: boolean
|
|
22
|
+
isScreenSharingSupported: (isScreenSharingCapabilitiesEnabled?: boolean) => Promise<boolean>;
|
|
23
23
|
private forwardPublisherEvents;
|
|
24
24
|
publishAudio: (shouldMute: boolean) => Promise<void>;
|
|
25
25
|
publishVideo: (shouldPublishVideo: boolean) => Promise<void>;
|
|
@@ -35,3 +35,4 @@ export declare class OpentokMultiPartyService extends MultiPartyService {
|
|
|
35
35
|
private checkOwnConnection;
|
|
36
36
|
stopScreenPublisher(): void | undefined;
|
|
37
37
|
}
|
|
38
|
+
//# sourceMappingURL=OpentokMultiPartyService.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/MultiParty/opentok/OpentokMultiPartyService.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,WAAW,EAAE,eAAe,EAAC,MAAM,UAAU,CAAC;AAGtD,OAAO,EAA4C,iBAAiB,EAAE,cAAc,EAAC,MAAM,sBAAsB,CAAC;AAOlH,OAAO,EAAC,cAAc,EAAC,MAAM,sBAAsB,CAAC;AAQpD,qBAAa,wBAAyB,SAAQ,iBAAiB;IAW/C,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IAV7C,OAAO,CAAC,cAAc,CAAC,CAAwB;IAC/C,OAAO,CAAC,eAAe,CAAC,CAAyB;IACjD,OAAO,CAAC,oBAAoB,CAAkB;IAE9C,OAAO,CAAC,kBAAkB,CAA8B;IAExD,OAAO,CAAC,OAAO,CAAC,CAAa;IAC7B,OAAO,CAAC,cAAc,CAA+B;IACrD,OAAO,CAAC,qBAAqB,CAAM;gBAEN,gBAAgB,EAAE,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,KAAK,MAAM;IAIpG,IAAW,eAAe,IAAI,MAAM,CAEnC;IAED,IAAW,WAAW,IAAI,cAAc,EAAE,CAEzC;IAEM,qBAAqB,QAAS,MAAM,UAEzC;IAEK,OAAO,oBAAqB,eAAe,eAAe,WAAW,KAAG,IAAI,CA8CjF;IAEK,UAAU,QAAa,QAAQ,IAAI,CAAC,CAezC;IAEK,YAAY,iBAAkB,MAAM,iCAAsC,MAAM,GAAG,IAAI,CAkB5F;IAEF,OAAO,CAAC,6BAA6B,CAwBnC;IAEF,OAAO,CAAC,kBAAkB,CAqBxB;IAEK,wBAAwB,gEAAyD,QAAQ,OAAO,CAAC,CAgBtG;IAEF,OAAO,CAAC,sBAAsB,CAQ5B;IAEK,YAAY,eAAsB,OAAO,KAAG,QAAQ,IAAI,CAAC,CAU9D;IAEK,YAAY,uBAA8B,OAAO,KAAG,QAAQ,IAAI,CAAC,CAUtE;IAEK,aAAa,QAAa,QAAQ,IAAI,CAAC,CAqC5C;IAEK,YAAY,QAAa,QAAQ,IAAI,CAAC,CAAwC;IAE9E,mBAAmB,aAAc,eAAe,KAAG,QAAQ,IAAI,EAAE,CAAC,CAqBvE;IAEF,OAAO,CAAC,oBAAoB,CAyC1B;IAEF,OAAO,CAAC,sBAAsB,CAgB5B;IAEF,OAAO,CAAC,wBAAwB,CA6B9B;IAEF,OAAO,CAAC,0BAA0B,CAkBhC;IAEF,OAAO,CAAC,4BAA4B,CAgBlC;IAEF,OAAO,CAAC,0BAA0B,CAGhC;IAEF,OAAO,CAAC,kBAAkB,CACsD;IAEzE,mBAAmB,IAAI,IAAI,GAAG,SAAS;CAGjD","file":"OpentokMultiPartyService.d.ts","sourcesContent":["import {getMediaTracer} from '../MediaTracer';\nimport {Credentials, SessionSettings} from '../types';\nimport {MediaCapabilitiesService} from '../MediaCapabilitiesService';\nimport {checkAudioCapabilities, checkIsMobile, checkVideoCapabilities} from '../MediaCapabilitiesUtils';\nimport {DEFAULT_AVATAR_URI, maxParticipantsNumber, MultiPartyService, SubscriberInfo} from '../MultiPartyService';\nimport {MultiPartyServiceEventTypes} from '../MultipartyServiceEventTypes';\nimport {OpentokVideoPublisher} from './OpentokVideoPublisher';\nimport {OpentokScreenPublisher} from './OpentokScreenPublisher';\nimport {createSubscriber} from './OpentokSubscriber';\nimport {decodeClientRole, isSameStream} from '../utils';\nimport {traceError} from './trace';\nimport {VideoTypesEnum} from '../../MediaConstants';\n\nconst trace = getMediaTracer('Multiparty');\n\ntype OpentokSubscriberInfo = SubscriberInfo & {\n subscriber: OT.Subscriber;\n};\n\nexport class OpentokMultiPartyService extends MultiPartyService {\n private videoPublisher?: OpentokVideoPublisher;\n private screenPublisher?: OpentokScreenPublisher;\n private enableDesktopSharing: boolean = false;\n\n private backgroundImageURI: string = DEFAULT_AVATAR_URI;\n\n private session?: OT.Session;\n private subscriberList: OpentokSubscriberInfo[] = [];\n private videoPublisherOptions: any;\n\n constructor(private readonly getParticipantId: (connectionId?: string, videoType?: string) => string) {\n super();\n }\n\n public get ownConnectionId(): string {\n return this.session?.connection?.connectionId || '';\n }\n\n public get subscribers(): SubscriberInfo[] {\n return [...this.subscriberList];\n }\n\n public setBackgroundImageURI = (uri: string) => {\n this.backgroundImageURI = uri || DEFAULT_AVATAR_URI;\n };\n\n public connect = (sessionSettings: SessionSettings, credentials: Credentials): void => {\n try {\n this.session = OT.initSession(credentials.apiKey, credentials.sessionId);\n\n this.session.on('connectionCreated', this.connectionCreatedHandler);\n this.session.on('connectionDestroyed', this.connectionDestroyedHandler);\n this.session.on('streamCreated', this.streamCreatedHandler);\n this.session.on('streamDestroyed', this.streamDestroyedHandler);\n this.session.on('streamPropertyChanged', this.streamPropertyChangedHandler);\n this.session.on('sessionDisconnected', this.sessionDisconnectedHandler);\n\n //best practice\n this.prepareVideoPublisherSettings().then(() => {\n this.initVideoPublisher(sessionSettings);\n\n this?.session?.connect(credentials.token, (error?: any) => {\n if (error) {\n this?.videoPublisher?.destroy();\n this.session?.off();\n this.session = undefined;\n traceError(error);\n\n this.emit(MultiPartyServiceEventTypes.connectFailed, {\n meta: {err: JSON.stringify(error)}\n });\n\n return;\n }\n if (this.videoPublisher) {\n this.session?.publish(this.videoPublisher.get(), traceError);\n }\n\n this.isScreenSharingSupported(sessionSettings.isScreenSharingCapabilitiesEnabled).then(() => {\n if (this.screenPublisher) {\n this.session?.publish(this.screenPublisher.get(), traceError);\n }\n });\n });\n });\n } catch (err) {\n trace.error(JSON.stringify(err));\n\n this.emit(MultiPartyServiceEventTypes.connectFailed, {\n meta: {err: JSON.stringify(err)}\n });\n }\n };\n\n public disconnect = async (): Promise<void> => {\n try {\n if (this.videoPublisher?.getVideoFilter) {\n await this.videoPublisher?.clearVideoFilter();\n }\n\n trace.info('Disconnecting from session');\n\n if (this.session) {\n this.session.disconnect();\n trace.info('Disconnection from session completed');\n }\n } catch (err) {\n trace.error(JSON.stringify(err));\n }\n };\n\n public takeSnapshot = (connectionId: string, videoType = VideoTypesEnum.CAMERA): string | null => {\n if (!connectionId) {\n return null;\n }\n\n if (connectionId === this.ownConnectionId) {\n if (videoType === VideoTypesEnum.CAMERA) {\n return this.videoPublisher?.getImgData() || null;\n }\n\n return this.screenPublisher?.getImgData() || null;\n }\n\n return (\n this.subscribers\n .find((s) => s.connectionId === connectionId && s.videoType === videoType)\n ?.subscriber.getImgData() || null\n );\n };\n\n private prepareVideoPublisherSettings = async (): Promise<void> => {\n if (!this.session) {\n return;\n }\n\n const canStartWithAudio = await checkAudioCapabilities();\n const canStartWithVideo = await checkVideoCapabilities();\n const capabilitiesService = await MediaCapabilitiesService.getInstance();\n\n if (!canStartWithAudio && !canStartWithVideo) {\n throw new Error('Creating session requires initialized publisher');\n }\n\n const publisherOptions = {\n backgroundImageURI: this.backgroundImageURI,\n participantId: this.getParticipantId(this.ownConnectionId, VideoTypesEnum.CAMERA)\n };\n\n this.videoPublisherOptions = {\n publisherOptions: publisherOptions,\n canStartWithAudio: canStartWithAudio,\n canStartWithVideo: canStartWithVideo,\n capabilitiesService: capabilitiesService\n };\n };\n\n private initVideoPublisher = (settings: Readonly<SessionSettings>): void => {\n if (!(this.videoPublisherOptions?.canStartWithAudio && this.videoPublisherOptions?.canStartWithVideo)) {\n throw new Error('could not init publisher');\n }\n\n try {\n this.videoPublisher = new OpentokVideoPublisher(\n {\n ...settings.videoSettings,\n cameraEnabled: settings.videoSettings.cameraEnabled && this.videoPublisherOptions.canStartWithVideo,\n startWithAudioMuted:\n settings.videoSettings.startWithAudioMuted && this.videoPublisherOptions.canStartWithAudio\n },\n this.videoPublisherOptions.publisherOptions,\n this.videoPublisherOptions.capabilitiesService\n );\n\n this.forwardPublisherEvents(this.videoPublisher);\n } catch (error) {\n trace.error('could not init publisher');\n }\n };\n\n public isScreenSharingSupported = async (isScreenSharingCapabilitiesEnabled?: boolean): Promise<boolean> => {\n if (isScreenSharingCapabilitiesEnabled && !checkIsMobile()) {\n await OT.checkScreenSharingCapability((res) => {\n if (!res.supported || res.extensionRegistered === false) {\n // This browser does not support screen sharing.\n trace.error('no screen sharing support found');\n this.enableDesktopSharing = false;\n } else {\n this.enableDesktopSharing = true;\n }\n });\n } else {\n this.enableDesktopSharing = false;\n }\n\n return Promise.resolve(this.enableDesktopSharing);\n };\n\n private forwardPublisherEvents = (publisher: OpentokVideoPublisher | OpentokScreenPublisher) => {\n publisher.on('cameraSourceChanged', (e) => this.emit(MultiPartyServiceEventTypes.cameraSourceChanged, e));\n publisher.on('streamCreated', (e) => this.emit(MultiPartyServiceEventTypes.streamCreated, e));\n publisher.on('streamDestroyed', (e) => this.emit(MultiPartyServiceEventTypes.streamDestroyed, e));\n publisher.on('mediaDeviceAccessDenied', (e) =>\n this.emit(MultiPartyServiceEventTypes.mediaDeviceAccessDenied, e)\n );\n publisher.on('videoElementCreated', (e) => this.emit(MultiPartyServiceEventTypes.videoElementCreated, e));\n };\n\n public publishAudio = async (shouldMute: boolean): Promise<void> => {\n const canPublishAudio = await checkAudioCapabilities();\n\n if (shouldMute && !canPublishAudio) {\n trace.error('could not publish audio');\n\n return;\n }\n\n this.videoPublisher?.publishAudio(shouldMute);\n };\n\n public publishVideo = async (shouldPublishVideo: boolean): Promise<void> => {\n const canPublishVideo = await checkVideoCapabilities();\n\n if (shouldPublishVideo && !canPublishVideo) {\n trace.error('could not publish video');\n\n return;\n }\n\n this.videoPublisher?.publishVideo(shouldPublishVideo);\n };\n\n public publishScreen = async (): Promise<void> => {\n if (this.enableDesktopSharing) {\n const publisherOptions = {\n backgroundImageURI: this.backgroundImageURI\n };\n const capabilitiesService = await MediaCapabilitiesService.getInstance();\n\n try {\n this.screenPublisher = new OpentokScreenPublisher(\n {\n ...publisherOptions,\n participantId: this.getParticipantId(this.ownConnectionId, VideoTypesEnum.SCREEN)\n },\n capabilitiesService\n );\n\n this.forwardPublisherEvents(this.screenPublisher);\n\n return await new Promise((resolve, reject) => {\n this.screenPublisher &&\n this.session?.connection &&\n this.session?.publish(this.screenPublisher.get(), (err) => {\n if (err) {\n trace.error('Failed to publish screen', err);\n\n return reject(err);\n }\n\n return resolve();\n });\n });\n } catch (e) {\n trace.error('Failed to publish screen', e);\n\n return Promise.reject(e);\n }\n }\n };\n\n public switchCamera = async (): Promise<void> => this.videoPublisher?.switchCamera();\n\n public reinitializeStreams = (settings: SessionSettings): Promise<void[]> => {\n const promises: Promise<void>[] = [];\n\n if (!this.session) {\n return Promise.resolve([]);\n }\n\n const shouldPublishScreen = !!this.screenPublisher;\n\n this.subscriberList.map((s) => s.subscriber).forEach(this.session?.unsubscribe);\n this.subscriberList = [];\n\n this.videoPublisher?.destroy();\n this.screenPublisher?.destroy();\n\n this.initVideoPublisher(settings);\n if (shouldPublishScreen) {\n promises.push(this.publishScreen());\n }\n\n return Promise.all(promises);\n };\n\n private streamCreatedHandler = async (event: {stream: OT.Stream}): Promise<void> => {\n trace.info('streamCreatedHandler', event.stream);\n const {stream} = event;\n const {connection, hasAudio, hasVideo, videoDimensions, videoType} = stream;\n const {connectionId, data} = connection;\n const participantId = this.getParticipantId(connectionId, videoType);\n const clientRole = decodeClientRole(data);\n\n if (this.ownConnectionId && stream && connectionId !== this.ownConnectionId) {\n if (this.subscriberList.length < maxParticipantsNumber - 1) {\n const subscriber = createSubscriber(\n this.session!,\n stream,\n this.getParticipantId(connectionId, videoType),\n this.backgroundImageURI\n );\n\n this.subscriberList.push({\n subscriber,\n connectionId,\n clientRole,\n videoType: videoType as VideoTypesEnum\n });\n } else {\n trace.info(\n `a new subscriber cannot be added, as the number of participants reached its limit: ${maxParticipantsNumber}`\n );\n }\n }\n\n this.emit(MultiPartyServiceEventTypes.streamCreated, {\n participantId,\n clientRole,\n connectionId,\n hasVideo,\n hasAudio,\n isOwnConnection: false,\n mirror: false,\n videoDimensions,\n videoType: videoType as VideoTypesEnum\n });\n };\n\n private streamDestroyedHandler = (event: {stream: OT.Stream; reason: string}): void => {\n trace.info('streamDestroyedHandler', event);\n\n const {connection, videoType} = event.stream;\n const {connectionId} = connection;\n\n this.subscriberList = this.subscriberList.filter(\n (subscriber) => !isSameStream({...subscriber}, {connectionId, videoType: videoType as VideoTypesEnum})\n );\n this.emit(MultiPartyServiceEventTypes.streamDestroyed, {\n participantId: this.getParticipantId(connectionId, videoType),\n connectionId,\n isOwnConnection: false,\n clientRole: decodeClientRole(connection.data),\n videoType: videoType as VideoTypesEnum\n });\n };\n\n private connectionCreatedHandler = (event: {connection: OT.Connection}): void => {\n trace.info('connectionCreatedHandler', event);\n\n const {connection} = event;\n const {connectionId} = connection;\n const clientRole = decodeClientRole(connection.data);\n\n if (!this.ownConnectionId || !connection) {\n return;\n }\n\n /*\n TODO: when we will support few connections with the same clientRole (example- multiple observers)\n we should pass as metadata in backend userId that we can distinguish between the connections in techsee-media-service-client\n */\n const sameRole = this.subscriberList.find((subscriber) => subscriber.clientRole === clientRole);\n\n if (sameRole) {\n this.subscriberList = this.subscriberList.filter((subscriber) => subscriber.clientRole !== clientRole);\n\n this.session?.unsubscribe(sameRole.subscriber);\n }\n\n this.emit(MultiPartyServiceEventTypes.connectionCreated, {\n clientRole,\n participantId: this.getParticipantId(connectionId),\n connectionId,\n isOwnConnection: this.checkOwnConnection(connectionId)\n });\n };\n\n private connectionDestroyedHandler = (event: {connection: OT.Connection; reason: string}): void => {\n const {connection} = event;\n const {connectionId} = connection;\n\n trace.info('connectionDestroyedHandler', event);\n\n this.emit(MultiPartyServiceEventTypes.connectionDestroyed, {\n clientRole: decodeClientRole(connection.data),\n participantId: this.getParticipantId(connectionId),\n connectionId,\n isOwnConnection: this.checkOwnConnection(connectionId)\n });\n\n if (connectionId !== this.ownConnectionId || !this.ownConnectionId) {\n return;\n }\n\n this.session = undefined;\n };\n\n private streamPropertyChangedHandler = (event: {stream: OT.Stream}): void => {\n trace.info('streamPropertyChangedHandler', event);\n\n const {hasVideo, hasAudio, connection, videoDimensions, videoType} = event.stream;\n const {connectionId} = connection;\n\n this.emit(MultiPartyServiceEventTypes.streamPropertyChanged, {\n hasVideo,\n hasAudio,\n participantId: this.getParticipantId(connectionId, videoType),\n connectionId: connectionId,\n isOwnConnection: this.checkOwnConnection(connectionId),\n clientRole: decodeClientRole(connection.data),\n videoDimensions,\n videoType: videoType as VideoTypesEnum\n });\n };\n\n private sessionDisconnectedHandler = (event: unknown) => {\n this.session?.off();\n trace.info('sessionDisconnectedHandler', event);\n };\n\n private checkOwnConnection = (connectionId: string) =>\n this.ownConnectionId !== undefined && this.ownConnectionId === connectionId;\n\n public stopScreenPublisher(): void | undefined {\n return this.screenPublisher?.destroy();\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"OpentokMultiPartyService.d.ts","sourceRoot":"","sources":["../../../src/MultiParty/opentok/OpentokMultiPartyService.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,WAAW,EAAE,eAAe,EAAC,MAAM,UAAU,CAAC;AAGtD,OAAO,EAA4C,iBAAiB,EAAE,cAAc,EAAC,MAAM,sBAAsB,CAAC;AAOlH,OAAO,EAAC,cAAc,EAAC,MAAM,sBAAsB,CAAC;AAQpD,qBAAa,wBAAyB,SAAQ,iBAAiB;IAW/C,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IAV7C,OAAO,CAAC,cAAc,CAAC,CAAwB;IAC/C,OAAO,CAAC,eAAe,CAAC,CAAyB;IACjD,OAAO,CAAC,oBAAoB,CAAkB;IAE9C,OAAO,CAAC,kBAAkB,CAA8B;IAExD,OAAO,CAAC,OAAO,CAAC,CAAa;IAC7B,OAAO,CAAC,cAAc,CAA+B;IACrD,OAAO,CAAC,qBAAqB,CAAM;gBAEN,gBAAgB,EAAE,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,KAAK,MAAM;IAIpG,IAAW,eAAe,IAAI,MAAM,CAEnC;IAED,IAAW,WAAW,IAAI,cAAc,EAAE,CAEzC;IAEM,qBAAqB,QAAS,MAAM,UAEzC;IAEK,OAAO,oBAAqB,eAAe,eAAe,WAAW,KAAG,IAAI,CA8CjF;IAEK,UAAU,QAAa,QAAQ,IAAI,CAAC,CAezC;IAEK,YAAY,iBAAkB,MAAM,iCAAsC,MAAM,GAAG,IAAI,CAkB5F;IAEF,OAAO,CAAC,6BAA6B,CAwBnC;IAEF,OAAO,CAAC,kBAAkB,CAqBxB;IAEK,wBAAwB,wCAA+C,OAAO,KAAG,QAAQ,OAAO,CAAC,CAgBtG;IAEF,OAAO,CAAC,sBAAsB,CAQ5B;IAEK,YAAY,eAAsB,OAAO,KAAG,QAAQ,IAAI,CAAC,CAU9D;IAEK,YAAY,uBAA8B,OAAO,KAAG,QAAQ,IAAI,CAAC,CAUtE;IAEK,aAAa,QAAa,QAAQ,IAAI,CAAC,CAqC5C;IAEK,YAAY,QAAa,QAAQ,IAAI,CAAC,CAAwC;IAE9E,mBAAmB,aAAc,eAAe,KAAG,QAAQ,IAAI,EAAE,CAAC,CAqBvE;IAEF,OAAO,CAAC,oBAAoB,CAyC1B;IAEF,OAAO,CAAC,sBAAsB,CAgB5B;IAEF,OAAO,CAAC,wBAAwB,CA6B9B;IAEF,OAAO,CAAC,0BAA0B,CAkBhC;IAEF,OAAO,CAAC,4BAA4B,CAgBlC;IAEF,OAAO,CAAC,0BAA0B,CAGhC;IAEF,OAAO,CAAC,kBAAkB,CACsD;IAEzE,mBAAmB,IAAI,IAAI,GAAG,SAAS;CAGjD"}
|