@signalwire/js 3.23.3 → 3.23.4
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/core/src/BaseClient.d.ts.map +1 -1
- package/dist/core/src/BaseComponent.d.ts +8 -114
- package/dist/core/src/BaseComponent.d.ts.map +1 -1
- package/dist/core/src/BaseConsumer.d.ts +2 -2
- package/dist/core/src/BaseConsumer.d.ts.map +1 -1
- package/dist/core/src/BaseSession.d.ts.map +1 -1
- package/dist/core/src/RPCMessages/RPCConnect.d.ts +1 -0
- package/dist/core/src/RPCMessages/RPCConnect.d.ts.map +1 -1
- package/dist/core/src/chat/BaseChat.d.ts +5 -6
- package/dist/core/src/chat/BaseChat.d.ts.map +1 -1
- package/dist/core/src/chat/workers/chatWorker.d.ts.map +1 -1
- package/dist/core/src/index.d.ts +4 -5
- package/dist/core/src/index.d.ts.map +1 -1
- package/dist/core/src/memberPosition/workers.d.ts +1 -1
- package/dist/core/src/memberPosition/workers.d.ts.map +1 -1
- package/dist/core/src/pubSub/BasePubSub.d.ts +8 -9
- package/dist/core/src/pubSub/BasePubSub.d.ts.map +1 -1
- package/dist/core/src/pubSub/workers/pubSubWorker.d.ts.map +1 -1
- package/dist/core/src/redux/actions.d.ts +0 -9
- package/dist/core/src/redux/actions.d.ts.map +1 -1
- package/dist/core/src/redux/features/session/sessionSaga.d.ts +2 -3
- package/dist/core/src/redux/features/session/sessionSaga.d.ts.map +1 -1
- package/dist/core/src/redux/index.d.ts +1 -0
- package/dist/core/src/redux/index.d.ts.map +1 -1
- package/dist/core/src/redux/interfaces.d.ts +0 -1
- package/dist/core/src/redux/interfaces.d.ts.map +1 -1
- package/dist/core/src/redux/rootSaga.d.ts +10 -10
- package/dist/core/src/redux/rootSaga.d.ts.map +1 -1
- package/dist/core/src/redux/utils/useInstanceMap.d.ts +6 -0
- package/dist/core/src/redux/utils/useInstanceMap.d.ts.map +1 -0
- package/dist/core/src/redux/utils/useSession.d.ts +16 -0
- package/dist/core/src/redux/utils/useSession.d.ts.map +1 -0
- package/dist/core/src/rooms/RoomSessionPlayback.d.ts +20 -3
- package/dist/core/src/rooms/RoomSessionPlayback.d.ts.map +1 -1
- package/dist/core/src/rooms/RoomSessionRecording.d.ts +18 -5
- package/dist/core/src/rooms/RoomSessionRecording.d.ts.map +1 -1
- package/dist/core/src/rooms/RoomSessionStream.d.ts +19 -5
- package/dist/core/src/rooms/RoomSessionStream.d.ts.map +1 -1
- package/dist/core/src/rooms/index.d.ts +0 -4
- package/dist/core/src/rooms/index.d.ts.map +1 -1
- package/dist/core/src/rooms/methods.d.ts +6 -2
- package/dist/core/src/rooms/methods.d.ts.map +1 -1
- package/dist/core/src/testUtils.d.ts +3 -2
- package/dist/core/src/testUtils.d.ts.map +1 -1
- package/dist/core/src/types/chat.d.ts +0 -1
- package/dist/core/src/types/chat.d.ts.map +1 -1
- package/dist/core/src/types/index.d.ts +2 -0
- package/dist/core/src/types/index.d.ts.map +1 -1
- package/dist/core/src/types/messaging.d.ts +0 -1
- package/dist/core/src/types/messaging.d.ts.map +1 -1
- package/dist/core/src/types/pubSub.d.ts +0 -1
- package/dist/core/src/types/pubSub.d.ts.map +1 -1
- package/dist/core/src/types/video.d.ts +8 -7
- package/dist/core/src/types/video.d.ts.map +1 -1
- package/dist/core/src/types/videoRoomDevice.d.ts +6 -4
- package/dist/core/src/types/videoRoomDevice.d.ts.map +1 -1
- package/dist/core/src/types/videoRoomSession.d.ts +9 -0
- package/dist/core/src/types/videoRoomSession.d.ts.map +1 -1
- package/dist/core/src/types/voiceCall.d.ts +16 -5
- package/dist/core/src/types/voiceCall.d.ts.map +1 -1
- package/dist/core/src/utils/eventUtils.d.ts +2 -0
- package/dist/core/src/utils/eventUtils.d.ts.map +1 -0
- package/dist/core/src/utils/eventUtils.test.d.ts +2 -0
- package/dist/core/src/utils/eventUtils.test.d.ts.map +1 -0
- package/dist/core/src/utils/index.d.ts +3 -2
- package/dist/core/src/utils/index.d.ts.map +1 -1
- package/dist/core/src/utils/interfaces.d.ts +9 -117
- package/dist/core/src/utils/interfaces.d.ts.map +1 -1
- package/dist/index.esm.js +365 -320
- package/dist/index.esm.js.map +3 -3
- package/dist/index.js +366 -342
- package/dist/index.js.map +3 -3
- package/dist/index.umd.js +3 -3
- package/dist/index.umd.js.map +1 -1
- package/dist/js/src/BaseRoomSession.d.ts +5 -15
- package/dist/js/src/BaseRoomSession.d.ts.map +1 -1
- package/dist/js/src/Client.d.ts.map +1 -1
- package/dist/js/src/RoomSession.d.ts.map +1 -1
- package/dist/js/src/cantina/VideoManager.d.ts +4 -5
- package/dist/js/src/cantina/VideoManager.d.ts.map +1 -1
- package/dist/js/src/cantina/workers/index.d.ts +2 -0
- package/dist/js/src/cantina/workers/index.d.ts.map +1 -0
- package/dist/js/src/cantina/workers/videoManagerRoomWorker.d.ts +4 -0
- package/dist/js/src/cantina/workers/videoManagerRoomWorker.d.ts.map +1 -0
- package/dist/js/src/cantina/workers/videoManagerRoomsWorker.d.ts +4 -0
- package/dist/js/src/cantina/workers/videoManagerRoomsWorker.d.ts.map +1 -0
- package/dist/js/src/cantina/workers/videoManagerWorker.d.ts +7 -0
- package/dist/js/src/cantina/workers/videoManagerWorker.d.ts.map +1 -0
- package/dist/js/src/createRoomObject.d.ts.map +1 -1
- package/dist/js/src/fabric/WSClient.d.ts.map +1 -1
- package/dist/js/src/features/mediaElements/mediaElementsSagas.d.ts.map +1 -1
- package/dist/js/src/testUtils.d.ts +2 -0
- package/dist/js/src/testUtils.d.ts.map +1 -1
- package/dist/js/src/utils/interfaces.d.ts +2 -2
- package/dist/js/src/utils/interfaces.d.ts.map +1 -1
- package/dist/js/src/utils/videoElement.d.ts.map +1 -1
- package/dist/js/src/video/childMemberJoinedWorker.d.ts.map +1 -1
- package/dist/js/src/video/memberListUpdatedWorker.d.ts.map +1 -1
- package/dist/js/src/video/videoPlaybackWorker.d.ts +4 -0
- package/dist/js/src/video/videoPlaybackWorker.d.ts.map +1 -0
- package/dist/js/src/video/videoRecordWorker.d.ts +4 -0
- package/dist/js/src/video/videoRecordWorker.d.ts.map +1 -0
- package/dist/js/src/video/videoStreamWorker.d.ts +4 -0
- package/dist/js/src/video/videoStreamWorker.d.ts.map +1 -0
- package/dist/js/src/video/videoWorker.d.ts +7 -0
- package/dist/js/src/video/videoWorker.d.ts.map +1 -0
- package/dist/js/src/video/workers.d.ts +1 -1
- package/dist/js/src/video/workers.d.ts.map +1 -1
- package/dist/js/tsconfig.build.tsbuildinfo +1 -1
- package/dist/webrtc/src/BaseConnection.d.ts +4 -5
- package/dist/webrtc/src/BaseConnection.d.ts.map +1 -1
- package/dist/webrtc/src/RTCPeer.d.ts +1 -1
- package/dist/webrtc/src/RTCPeer.d.ts.map +1 -1
- package/dist/webrtc/src/workers/roomSubscribedWorker.d.ts.map +1 -1
- package/dist/webrtc/src/workers/vertoEventWorker.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/BaseRoomSession.test.ts +4 -6
- package/src/BaseRoomSession.ts +47 -211
- package/src/Client.ts +1 -11
- package/src/RoomSession.ts +5 -5
- package/src/RoomSessionDevice.test.ts +0 -1
- package/src/RoomSessionScreenShare.test.ts +0 -1
- package/src/cantina/VideoManager.test.ts +0 -2
- package/src/cantina/VideoManager.ts +10 -51
- package/src/cantina/workers/index.ts +1 -0
- package/src/cantina/workers/videoManagerRoomWorker.ts +28 -0
- package/src/cantina/workers/videoManagerRoomsWorker.ts +33 -0
- package/src/cantina/workers/videoManagerWorker.ts +64 -0
- package/src/createRoomObject.ts +0 -1
- package/src/fabric/WSClient.ts +1 -2
- package/src/features/mediaElements/mediaElementsSagas.ts +7 -3
- package/src/utils/interfaces.ts +4 -2
- package/src/utils/videoElement.ts +1 -0
- package/src/video/childMemberJoinedWorker.test.ts +11 -12
- package/src/video/childMemberJoinedWorker.ts +0 -9
- package/src/video/memberListUpdatedWorker.ts +15 -15
- package/src/video/videoPlaybackWorker.ts +54 -0
- package/src/video/videoRecordWorker.ts +54 -0
- package/src/video/videoStreamWorker.ts +48 -0
- package/src/video/videoWorker.ts +96 -0
- package/src/video/workers.ts +1 -1
- package/dist/core/src/ApplyEventListeners.d.ts +0 -11
- package/dist/core/src/ApplyEventListeners.d.ts.map +0 -1
- package/dist/core/src/redux/features/pubSub/pubSubSaga.d.ts +0 -10
- package/dist/core/src/redux/features/pubSub/pubSubSaga.d.ts.map +0 -1
- package/dist/core/src/redux/features/pubSub/pubSubSaga.test.d.ts +0 -2
- package/dist/core/src/redux/features/pubSub/pubSubSaga.test.d.ts.map +0 -1
- package/dist/core/src/redux/features/session/sessionSaga.test.d.ts +0 -2
- package/dist/core/src/redux/features/session/sessionSaga.test.d.ts.map +0 -1
- package/dist/core/src/rooms/RoomSessionRTPlayback.d.ts +0 -47
- package/dist/core/src/rooms/RoomSessionRTPlayback.d.ts.map +0 -1
- package/dist/core/src/rooms/RoomSessionRTPlayback.test.d.ts +0 -2
- package/dist/core/src/rooms/RoomSessionRTPlayback.test.d.ts.map +0 -1
- package/dist/core/src/rooms/RoomSessionRTRecording.d.ts +0 -37
- package/dist/core/src/rooms/RoomSessionRTRecording.d.ts.map +0 -1
- package/dist/core/src/rooms/RoomSessionRTRecording.test.d.ts +0 -2
- package/dist/core/src/rooms/RoomSessionRTRecording.test.d.ts.map +0 -1
- package/dist/core/src/rooms/RoomSessionRTStream.d.ts +0 -36
- package/dist/core/src/rooms/RoomSessionRTStream.d.ts.map +0 -1
- package/dist/core/src/rooms/RoomSessionRTStream.test.d.ts +0 -2
- package/dist/core/src/rooms/RoomSessionRTStream.test.d.ts.map +0 -1
- package/dist/core/src/rooms/methodsRT.d.ts +0 -65
- package/dist/core/src/rooms/methodsRT.d.ts.map +0 -1
- package/dist/core/src/utils/eventTransformUtils.d.ts +0 -16
- package/dist/core/src/utils/eventTransformUtils.d.ts.map +0 -1
- package/dist/core/src/utils/eventTransformUtils.test.d.ts +0 -2
- package/dist/core/src/utils/eventTransformUtils.test.d.ts.map +0 -1
- package/dist/core/src/utils/proxyUtils.d.ts +0 -17
- package/dist/core/src/utils/proxyUtils.d.ts.map +0 -1
- package/dist/js/src/cantina/workers.d.ts +0 -4
- package/dist/js/src/cantina/workers.d.ts.map +0 -1
- package/dist/js/src/video/memberPositionWorker.d.ts +0 -3
- package/dist/js/src/video/memberPositionWorker.d.ts.map +0 -1
- package/src/cantina/workers.ts +0 -28
- package/src/video/memberPositionWorker.ts +0 -15
|
@@ -13,10 +13,10 @@ declare type EventsHandlerMapping = Record<BaseConnectionState, (params: any) =>
|
|
|
13
13
|
export declare type BaseConnectionStateEventTypes = {
|
|
14
14
|
[k in keyof EventsHandlerMapping]: EventsHandlerMapping[k];
|
|
15
15
|
};
|
|
16
|
-
export declare type BaseConnectionOptions
|
|
16
|
+
export declare type BaseConnectionOptions = ConnectionOptions & BaseComponentOptions;
|
|
17
17
|
export declare class BaseConnection<EventTypes extends EventEmitter.ValidEventTypes> extends BaseComponent<EventTypes & BaseConnectionStateEventTypes> implements Rooms.BaseRoomInterface<EventTypes & BaseConnectionStateEventTypes>, BaseConnectionContract<EventTypes & BaseConnectionStateEventTypes> {
|
|
18
18
|
direction: 'inbound' | 'outbound';
|
|
19
|
-
options: BaseConnectionOptions
|
|
19
|
+
options: BaseConnectionOptions;
|
|
20
20
|
/** @internal */
|
|
21
21
|
leaveReason: BaseConnectionContract<EventTypes>['leaveReason'];
|
|
22
22
|
/** @internal */
|
|
@@ -27,15 +27,13 @@ export declare class BaseConnection<EventTypes extends EventEmitter.ValidEventTy
|
|
|
27
27
|
gotEarly: boolean;
|
|
28
28
|
/** @internal */
|
|
29
29
|
doReinvite: boolean;
|
|
30
|
-
/** @internal */
|
|
31
|
-
protected _eventsPrefix: "video";
|
|
32
30
|
private state;
|
|
33
31
|
private prevState;
|
|
34
32
|
private activeRTCPeerId;
|
|
35
33
|
private rtcPeerMap;
|
|
36
34
|
private sessionAuthTask;
|
|
37
35
|
private resuming;
|
|
38
|
-
constructor(options: BaseConnectionOptions
|
|
36
|
+
constructor(options: BaseConnectionOptions);
|
|
39
37
|
get id(): string;
|
|
40
38
|
get active(): boolean;
|
|
41
39
|
get trying(): boolean;
|
|
@@ -172,6 +170,7 @@ export declare class BaseConnection<EventTypes extends EventEmitter.ValidEventTy
|
|
|
172
170
|
*/
|
|
173
171
|
private _checkDefaultMediaConstraints;
|
|
174
172
|
private _initPeer;
|
|
173
|
+
private _buildPeer;
|
|
175
174
|
/** @internal */
|
|
176
175
|
protected _finalize(): void;
|
|
177
176
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseConnection.d.ts","sourceRoot":"","sources":["../../../../webrtc/src/BaseConnection.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,aAAa,EAEb,oBAAoB,EACpB,mBAAmB,EACnB,KAAK,EAEL,YAAY,EACZ,sBAAsB,EAMtB,YAAY,EAGb,MAAM,kBAAkB,CAAA;AACzB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACtD,OAAO,OAAO,MAAM,WAAW,CAAA;AAC/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAKtD,UAAU,gBAAgB;IACxB,QAAQ,EAAE,MAAM,CAAA;IAChB,YAAY,EAAE,MAAM,CAAA;IACpB,SAAS,EAAE,MAAM,CAAA;IACjB,mBAAmB,CAAC,EAAE,MAAM,CAAA;CAC7B;AA4CD,oBAAY,UAAU,GAClB,iBAAiB,GACjB,oBAAoB,GACpB,oBAAoB,CAAA;AAExB,aAAK,oBAAoB,GAAG,MAAM,CAAC,mBAAmB,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,CAAC,GAC5E,MAAM,CAAC,UAAU,EAAE,MAAM,IAAI,CAAC,CAAA;AAEhC,oBAAY,6BAA6B,GAAG;KACzC,CAAC,IAAI,MAAM,oBAAoB,GAAG,oBAAoB,CAAC,CAAC,CAAC;CAC3D,CAAA;AAED,oBAAY,qBAAqB,
|
|
1
|
+
{"version":3,"file":"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MvB,gBAAgB;IAChB,iBAAiB;IAMjB,gBAAgB;IAChB,oBAAoB;IAMpB,gBAAgB;IAChB,iBAAiB;IAMjB,gBAAgB;IAChB,oBAAoB;IAMpB,gBAAgB;IAChB,QAAQ,CAAC,KAAK,EAAE,mBAAmB;IAyBnC,gBAAgB;IAChB,kBAAkB,CAAC,OAAO,EAAE;QAC1B,KAAK,CAAC,EAAE,OAAO,CAAA;QACf,KAAK,CAAC,EAAE,OAAO,CAAA;QACf,cAAc,CAAC,EAAE,OAAO,CAAA;QACxB,cAAc,CAAC,EAAE,OAAO,CAAA;KACzB;IASD,gBAAgB;IACT,UAAU,WAAY,gBAAgB,UAkC5C;IAED;;;;SAIK;IACL,OAAO,CAAC,SAAS;IAIjB;;;;;OAKG;IACH,OAAO,CAAC,6BAA6B;IAWrC,OAAO,CAAC,SAAS;IAOjB,OAAO,CAAC,UAAU;IAQlB,gBAAgB;IAChB,SAAS,CAAC,SAAS;CAMpB"}
|
|
@@ -25,7 +25,7 @@ export default class RTCPeer<EventTypes extends EventEmitter.ValidEventTypes> {
|
|
|
25
25
|
private rtcConfigPolyfill;
|
|
26
26
|
private get logger();
|
|
27
27
|
constructor(call: BaseConnection<EventTypes>, type: RTCSdpType);
|
|
28
|
-
get options(): import("./BaseConnection").BaseConnectionOptions
|
|
28
|
+
get options(): import("./BaseConnection").BaseConnectionOptions;
|
|
29
29
|
get watchMediaPacketsTimeout(): number;
|
|
30
30
|
get localStream(): MediaStream | undefined;
|
|
31
31
|
set localStream(stream: MediaStream | undefined);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RTCPeer.d.ts","sourceRoot":"","sources":["../../../../webrtc/src/RTCPeer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAmB,MAAM,kBAAkB,CAAA;AAQhE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAWjD,MAAM,CAAC,OAAO,OAAO,OAAO,CAAC,UAAU,SAAS,YAAY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ts","sourceRoot":"","sources":["../../../../../webrtc/src/workers/roomSubscribedWorker.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,SAAS,EAGT,cAAc,EAQf,MAAM,kBAAkB,CAAA;AAEzB,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAElD,aAAK,0BAA0B,GAAG,CAAC,IAAI,EAAE,cAAc,CAAC,GAAG,CAAC,KAAK,IAAI,CAAA;AACrE,aAAK,0BAA0B,GAAG,CAAC,IAAI,EAAE;IAAE,KAAK,EAAE,KAAK,CAAA;CAAE,KAAK,IAAI,CAAA;AAElE,oBAAY,yBAAyB,GAAG,cAAc,CACpD,0BAA0B,EAC1B,0BAA0B,CAC3B,CAAA;AAED,eAAO,MAAM,oBAAoB,EAAE,SAAS,CAC1C,cAAc,CAAC,GAAG,CAAC,EACnB,yBAAyB,CA0C1B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vertoEventWorker.d.ts","sourceRoot":"","sources":["../../../../../webrtc/src/workers/vertoEventWorker.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,SAAS,EAGT,cAAc,EAKf,MAAM,kBAAkB,CAAA;AAEzB,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAElD,aAAK,sBAAsB,GAAG,CAAC,IAAI,EAAE,cAAc,CAAC,GAAG,CAAC,KAAK,IAAI,CAAA;AACjE,aAAK,sBAAsB,GAAG,CAAC,IAAI,EAAE;IAAE,KAAK,EAAE,KAAK,CAAA;CAAE,KAAK,IAAI,CAAA;AAE9D,oBAAY,qBAAqB,GAAG,cAAc,CAChD,sBAAsB,EACtB,sBAAsB,CACvB,CAAA;AAQD,eAAO,MAAM,gBAAgB,EAAE,SAAS,CACtC,cAAc,CAAC,GAAG,CAAC,EACnB,qBAAqB,
|
|
1
|
+
{"version":3,"file":"vertoEventWorker.d.ts","sourceRoot":"","sources":["../../../../../webrtc/src/workers/vertoEventWorker.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,SAAS,EAGT,cAAc,EAKf,MAAM,kBAAkB,CAAA;AAEzB,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAElD,aAAK,sBAAsB,GAAG,CAAC,IAAI,EAAE,cAAc,CAAC,GAAG,CAAC,KAAK,IAAI,CAAA;AACjE,aAAK,sBAAsB,GAAG,CAAC,IAAI,EAAE;IAAE,KAAK,EAAE,KAAK,CAAA;CAAE,KAAK,IAAI,CAAA;AAE9D,oBAAY,qBAAqB,GAAG,cAAc,CAChD,sBAAsB,EACtB,sBAAsB,CACvB,CAAA;AAQD,eAAO,MAAM,gBAAgB,EAAE,SAAS,CACtC,cAAc,CAAC,GAAG,CAAC,EACnB,qBAAqB,CAsItB,CAAA"}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "SignalWire JS SDK",
|
|
4
4
|
"author": "SignalWire Team <open.source@signalwire.com>",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"version": "3.23.
|
|
6
|
+
"version": "3.23.4",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
8
|
"module": "dist/index.esm.js",
|
|
9
9
|
"unpkg": "dist/index.umd.js",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"src"
|
|
13
13
|
],
|
|
14
14
|
"engines": {
|
|
15
|
-
"node": ">=
|
|
15
|
+
"node": ">=14"
|
|
16
16
|
},
|
|
17
17
|
"keywords": [
|
|
18
18
|
"signalwire",
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"prepublishOnly": "npm run build"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@signalwire/core": "3.
|
|
43
|
-
"@signalwire/webrtc": "3.10.
|
|
42
|
+
"@signalwire/core": "3.19.0",
|
|
43
|
+
"@signalwire/webrtc": "3.10.3",
|
|
44
44
|
"jwt-decode": "^3.1.2"
|
|
45
45
|
},
|
|
46
46
|
"types": "dist/js/src/index.d.ts"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { actions, componentActions } from '@signalwire/core'
|
|
2
2
|
import { BaseRoomSession, createBaseRoomSessionObject } from './BaseRoomSession'
|
|
3
3
|
import type { RoomSession } from './RoomSession'
|
|
4
4
|
import { configureFullStack, dispatchMockedRoomSubscribed } from './testUtils'
|
|
@@ -26,7 +26,6 @@ describe('Room Object', () => {
|
|
|
26
26
|
store = stack.store
|
|
27
27
|
room = createBaseRoomSessionObject<RoomSession>({
|
|
28
28
|
store,
|
|
29
|
-
emitter: new EventEmitter(),
|
|
30
29
|
})
|
|
31
30
|
store.dispatch(
|
|
32
31
|
componentActions.upsert({
|
|
@@ -74,6 +73,8 @@ describe('Room Object', () => {
|
|
|
74
73
|
expect(room.setLayout).toBeDefined()
|
|
75
74
|
expect(room.hideVideoMuted).toBeDefined()
|
|
76
75
|
expect(room.showVideoMuted).toBeDefined()
|
|
76
|
+
// expect(room.lock).toBeDefined()
|
|
77
|
+
// expect(room.unlock).toBeDefined()
|
|
77
78
|
expect(room.getRecordings).toBeDefined()
|
|
78
79
|
expect(room.startRecording).toBeDefined()
|
|
79
80
|
expect(room.getPlaybacks).toBeDefined()
|
|
@@ -474,7 +475,6 @@ describe('Room Object', () => {
|
|
|
474
475
|
|
|
475
476
|
setupRoomForTests()
|
|
476
477
|
|
|
477
|
-
// const startedHandler = jest.fn()
|
|
478
478
|
room.on('room.joined', (params) => {
|
|
479
479
|
/** Test same keys between room_session and room for backwards compat. */
|
|
480
480
|
const keys = ['room_session', 'room'] as const
|
|
@@ -483,9 +483,7 @@ describe('Room Object', () => {
|
|
|
483
483
|
expect(params[key].room_id).toEqual(roomId)
|
|
484
484
|
expect(params[key].recording).toBe(true)
|
|
485
485
|
expect(params[key].hide_video_muted).toBe(false)
|
|
486
|
-
// @ts-expect-error
|
|
487
486
|
expect(params[key].meta).toStrictEqual({})
|
|
488
|
-
// @ts-expect-error
|
|
489
487
|
const { members, recordings } = params[key]
|
|
490
488
|
|
|
491
489
|
// Test members and member object
|
|
@@ -508,7 +506,7 @@ describe('Room Object', () => {
|
|
|
508
506
|
expect(recordingObj.state).toEqual('recording')
|
|
509
507
|
expect(recordingObj.duration).toBeNull()
|
|
510
508
|
expect(recordingObj.startedAt).toBeInstanceOf(Date)
|
|
511
|
-
expect(recordingObj.endedAt).
|
|
509
|
+
expect(recordingObj.endedAt).toBeUndefined() // When state is recording
|
|
512
510
|
|
|
513
511
|
const execMock = jest.fn()
|
|
514
512
|
const _clearMock = () => {
|
package/src/BaseRoomSession.ts
CHANGED
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
connect,
|
|
3
3
|
Rooms,
|
|
4
|
-
EventTransform,
|
|
5
4
|
extendComponent,
|
|
6
5
|
BaseComponentContract,
|
|
7
6
|
BaseComponentOptions,
|
|
8
7
|
BaseConnectionContract,
|
|
9
|
-
toLocalEvent,
|
|
10
|
-
toExternalJSON,
|
|
11
|
-
VideoRoomEventParams,
|
|
12
|
-
MemberPosition,
|
|
13
|
-
VideoRoomSubscribedEventParams,
|
|
14
8
|
VideoAuthorization,
|
|
9
|
+
LOCAL_EVENT_PREFIX,
|
|
10
|
+
validateEventsToSubscribe,
|
|
11
|
+
EventEmitter,
|
|
15
12
|
} from '@signalwire/core'
|
|
16
13
|
import {
|
|
17
14
|
getDisplayMedia,
|
|
@@ -88,6 +85,10 @@ export class RoomSessionConnection
|
|
|
88
85
|
) {
|
|
89
86
|
super(options)
|
|
90
87
|
this._mirrored = options.mirrorLocalVideoOverlay
|
|
88
|
+
|
|
89
|
+
this.runWorker('videoWorker', {
|
|
90
|
+
worker: workers.videoWorker,
|
|
91
|
+
})
|
|
91
92
|
}
|
|
92
93
|
|
|
93
94
|
get screenShareList() {
|
|
@@ -112,172 +113,6 @@ export class RoomSessionConnection
|
|
|
112
113
|
})
|
|
113
114
|
}
|
|
114
115
|
|
|
115
|
-
/** @internal */
|
|
116
|
-
protected getEmitterTransforms() {
|
|
117
|
-
return new Map<string | string[], EventTransform>([
|
|
118
|
-
[
|
|
119
|
-
['video.room.joined'],
|
|
120
|
-
{
|
|
121
|
-
type: 'roomSession',
|
|
122
|
-
instanceFactory: () => {
|
|
123
|
-
return {}
|
|
124
|
-
},
|
|
125
|
-
payloadTransform: (payload: VideoRoomSubscribedEventParams) => {
|
|
126
|
-
return payload
|
|
127
|
-
},
|
|
128
|
-
nestedFieldsToProcess: {
|
|
129
|
-
recordings: {
|
|
130
|
-
eventTransformType: 'roomSessionRecording',
|
|
131
|
-
processInstancePayload: (payload) => ({ recording: payload }),
|
|
132
|
-
},
|
|
133
|
-
playbacks: {
|
|
134
|
-
eventTransformType: 'roomSessionPlayback',
|
|
135
|
-
processInstancePayload: (payload) => ({ playback: payload }),
|
|
136
|
-
},
|
|
137
|
-
streams: {
|
|
138
|
-
eventTransformType: 'roomSessionStream',
|
|
139
|
-
processInstancePayload: (payload) => ({ stream: payload }),
|
|
140
|
-
},
|
|
141
|
-
},
|
|
142
|
-
},
|
|
143
|
-
],
|
|
144
|
-
[
|
|
145
|
-
[toLocalEvent('video.recording.list')],
|
|
146
|
-
{
|
|
147
|
-
type: 'roomSessionRecordingList',
|
|
148
|
-
instanceFactory: (_payload: any) => {
|
|
149
|
-
return {}
|
|
150
|
-
},
|
|
151
|
-
payloadTransform: (payload: any) => {
|
|
152
|
-
return payload
|
|
153
|
-
},
|
|
154
|
-
nestedFieldsToProcess: {
|
|
155
|
-
recordings: {
|
|
156
|
-
eventTransformType: 'roomSessionRecording',
|
|
157
|
-
processInstancePayload: (payload) => ({ recording: payload }),
|
|
158
|
-
},
|
|
159
|
-
},
|
|
160
|
-
},
|
|
161
|
-
],
|
|
162
|
-
[
|
|
163
|
-
[toLocalEvent('video.playback.list')],
|
|
164
|
-
{
|
|
165
|
-
type: 'roomSessionPlaybackList',
|
|
166
|
-
instanceFactory: (_payload: any) => {
|
|
167
|
-
return {}
|
|
168
|
-
},
|
|
169
|
-
payloadTransform: (payload: any) => {
|
|
170
|
-
return payload
|
|
171
|
-
},
|
|
172
|
-
nestedFieldsToProcess: {
|
|
173
|
-
playbacks: {
|
|
174
|
-
eventTransformType: 'roomSessionPlayback',
|
|
175
|
-
processInstancePayload: (payload) => ({ playback: payload }),
|
|
176
|
-
},
|
|
177
|
-
},
|
|
178
|
-
},
|
|
179
|
-
],
|
|
180
|
-
[
|
|
181
|
-
[
|
|
182
|
-
toLocalEvent('video.recording.start'),
|
|
183
|
-
'video.recording.started',
|
|
184
|
-
'video.recording.updated',
|
|
185
|
-
'video.recording.ended',
|
|
186
|
-
],
|
|
187
|
-
{
|
|
188
|
-
type: 'roomSessionRecording',
|
|
189
|
-
instanceFactory: (_payload: any) => {
|
|
190
|
-
return Rooms.createRoomSessionRecordingObject({
|
|
191
|
-
store: this.store,
|
|
192
|
-
// @ts-expect-error
|
|
193
|
-
emitter: this.emitter,
|
|
194
|
-
})
|
|
195
|
-
},
|
|
196
|
-
payloadTransform: (payload: any) => {
|
|
197
|
-
return toExternalJSON({
|
|
198
|
-
...payload.recording,
|
|
199
|
-
room_session_id: this.roomSessionId,
|
|
200
|
-
})
|
|
201
|
-
},
|
|
202
|
-
},
|
|
203
|
-
],
|
|
204
|
-
[
|
|
205
|
-
[
|
|
206
|
-
toLocalEvent('video.playback.start'),
|
|
207
|
-
'video.playback.started',
|
|
208
|
-
'video.playback.updated',
|
|
209
|
-
'video.playback.ended',
|
|
210
|
-
],
|
|
211
|
-
{
|
|
212
|
-
type: 'roomSessionPlayback',
|
|
213
|
-
instanceFactory: (_payload: any) => {
|
|
214
|
-
return Rooms.createRoomSessionPlaybackObject({
|
|
215
|
-
store: this.store,
|
|
216
|
-
// @ts-expect-error
|
|
217
|
-
emitter: this.emitter,
|
|
218
|
-
})
|
|
219
|
-
},
|
|
220
|
-
payloadTransform: (payload: any) => {
|
|
221
|
-
return toExternalJSON({
|
|
222
|
-
...payload.playback,
|
|
223
|
-
room_session_id: this.roomSessionId,
|
|
224
|
-
})
|
|
225
|
-
},
|
|
226
|
-
},
|
|
227
|
-
],
|
|
228
|
-
[
|
|
229
|
-
[toLocalEvent('video.stream.list')],
|
|
230
|
-
{
|
|
231
|
-
type: 'roomSessionStreamList',
|
|
232
|
-
instanceFactory: (_payload: any) => {
|
|
233
|
-
return {}
|
|
234
|
-
},
|
|
235
|
-
payloadTransform: (payload: any) => {
|
|
236
|
-
return payload
|
|
237
|
-
},
|
|
238
|
-
nestedFieldsToProcess: {
|
|
239
|
-
streams: {
|
|
240
|
-
eventTransformType: 'roomSessionStream',
|
|
241
|
-
processInstancePayload: (payload) => {
|
|
242
|
-
return { stream: payload }
|
|
243
|
-
},
|
|
244
|
-
},
|
|
245
|
-
},
|
|
246
|
-
},
|
|
247
|
-
],
|
|
248
|
-
[
|
|
249
|
-
[
|
|
250
|
-
toLocalEvent('video.stream.start'),
|
|
251
|
-
'video.stream.started',
|
|
252
|
-
'video.stream.ended',
|
|
253
|
-
],
|
|
254
|
-
{
|
|
255
|
-
type: 'roomSessionStream',
|
|
256
|
-
instanceFactory: (_payload: any) => {
|
|
257
|
-
return Rooms.createRoomSessionStreamObject({
|
|
258
|
-
store: this.store,
|
|
259
|
-
// @ts-expect-error
|
|
260
|
-
emitter: this.emitter,
|
|
261
|
-
})
|
|
262
|
-
},
|
|
263
|
-
payloadTransform: (payload: any) => {
|
|
264
|
-
return toExternalJSON({
|
|
265
|
-
...payload.stream,
|
|
266
|
-
room_session_id: this.roomSessionId,
|
|
267
|
-
})
|
|
268
|
-
},
|
|
269
|
-
},
|
|
270
|
-
],
|
|
271
|
-
])
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
/** @internal */
|
|
275
|
-
protected override getCompoundEvents() {
|
|
276
|
-
return new Map<any, any>([
|
|
277
|
-
...MemberPosition.MEMBER_POSITION_COMPOUND_EVENTS,
|
|
278
|
-
])
|
|
279
|
-
}
|
|
280
|
-
|
|
281
116
|
/**
|
|
282
117
|
* This method will be called by `join()` right before the
|
|
283
118
|
* `connect()` happens and it's a way for us to control
|
|
@@ -290,18 +125,6 @@ export class RoomSessionConnection
|
|
|
290
125
|
})
|
|
291
126
|
}
|
|
292
127
|
|
|
293
|
-
/**
|
|
294
|
-
* This method will be called right after
|
|
295
|
-
* `room.subscribed` happened
|
|
296
|
-
* @internal
|
|
297
|
-
*/
|
|
298
|
-
protected attachOnSubscribedWorkers(payload: VideoRoomEventParams) {
|
|
299
|
-
this.runWorker('memberPositionWorker', {
|
|
300
|
-
worker: workers.memberPositionWorker,
|
|
301
|
-
initialState: payload,
|
|
302
|
-
})
|
|
303
|
-
}
|
|
304
|
-
|
|
305
128
|
/** @deprecated Use {@link startScreenShare} instead. */
|
|
306
129
|
async createScreenShareObject(opts: CreateScreenShareObjectOptions = {}) {
|
|
307
130
|
return this.startScreenShare(opts)
|
|
@@ -323,7 +146,7 @@ export class RoomSessionConnection
|
|
|
323
146
|
audio: audio === true ? SCREENSHARE_AUDIO_CONSTRAINTS : audio,
|
|
324
147
|
video,
|
|
325
148
|
})
|
|
326
|
-
const options: BaseConnectionOptions
|
|
149
|
+
const options: BaseConnectionOptions = {
|
|
327
150
|
...this.options,
|
|
328
151
|
screenShare: true,
|
|
329
152
|
recoverCall: false,
|
|
@@ -360,7 +183,6 @@ export class RoomSessionConnection
|
|
|
360
183
|
})
|
|
361
184
|
|
|
362
185
|
screenShare.once('destroy', () => {
|
|
363
|
-
// @ts-expect-error
|
|
364
186
|
screenShare.emit('room.left')
|
|
365
187
|
this._screenShareList.delete(screenShare)
|
|
366
188
|
})
|
|
@@ -421,7 +243,7 @@ export class RoomSessionConnection
|
|
|
421
243
|
)
|
|
422
244
|
}
|
|
423
245
|
|
|
424
|
-
const options: BaseConnectionOptions
|
|
246
|
+
const options: BaseConnectionOptions = {
|
|
425
247
|
...this.options,
|
|
426
248
|
localStream: undefined,
|
|
427
249
|
remoteStream: undefined,
|
|
@@ -446,7 +268,6 @@ export class RoomSessionConnection
|
|
|
446
268
|
})(options)
|
|
447
269
|
|
|
448
270
|
roomDevice.once('destroy', () => {
|
|
449
|
-
// @ts-expect-error
|
|
450
271
|
roomDevice.emit('room.left')
|
|
451
272
|
this._deviceList.delete(roomDevice)
|
|
452
273
|
})
|
|
@@ -483,25 +304,28 @@ export class RoomSessionConnection
|
|
|
483
304
|
|
|
484
305
|
updateSpeaker({ deviceId }: { deviceId: string }) {
|
|
485
306
|
const prevId = this._audioEl.sinkId as string
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
307
|
+
this.once(
|
|
308
|
+
// @ts-expect-error
|
|
309
|
+
`${LOCAL_EVENT_PREFIX}.speaker.updated`,
|
|
310
|
+
async (newId: string) => {
|
|
311
|
+
const prevSpeaker = await getSpeakerById(prevId)
|
|
312
|
+
const newSpeaker = await getSpeakerById(newId)
|
|
313
|
+
|
|
314
|
+
const isSame = newSpeaker?.deviceId === prevSpeaker?.deviceId
|
|
315
|
+
if (!newSpeaker?.deviceId || isSame) return
|
|
316
|
+
|
|
317
|
+
this.emit('speaker.updated', {
|
|
318
|
+
previous: {
|
|
319
|
+
deviceId: prevSpeaker?.deviceId,
|
|
320
|
+
label: prevSpeaker?.label,
|
|
321
|
+
},
|
|
322
|
+
current: {
|
|
323
|
+
deviceId: newSpeaker.deviceId,
|
|
324
|
+
label: newSpeaker.label,
|
|
325
|
+
},
|
|
326
|
+
})
|
|
327
|
+
}
|
|
328
|
+
)
|
|
505
329
|
|
|
506
330
|
return this.triggerCustomSaga<undefined>(audioSetSpeakerAction(deviceId))
|
|
507
331
|
}
|
|
@@ -557,7 +381,6 @@ export class RoomSessionConnection
|
|
|
557
381
|
getAudioEl() {
|
|
558
382
|
if (this._audioEl) return this._audioEl
|
|
559
383
|
this._audioEl = new Audio()
|
|
560
|
-
console.log('listener attached!')
|
|
561
384
|
this._attachSpeakerTrackListener()
|
|
562
385
|
return this._audioEl
|
|
563
386
|
}
|
|
@@ -608,11 +431,22 @@ export class RoomSessionConnection
|
|
|
608
431
|
mirrored: this._mirrored,
|
|
609
432
|
setMirrored: (value: boolean) => {
|
|
610
433
|
this._mirrored = value
|
|
611
|
-
|
|
612
|
-
|
|
434
|
+
this.emit(
|
|
435
|
+
// @ts-expect-error
|
|
436
|
+
`${LOCAL_EVENT_PREFIX}.mirror.video`,
|
|
437
|
+
this._mirrored
|
|
438
|
+
)
|
|
613
439
|
},
|
|
614
440
|
}
|
|
615
441
|
}
|
|
442
|
+
|
|
443
|
+
/** @internal */
|
|
444
|
+
protected override getSubscriptions() {
|
|
445
|
+
const eventNamesWithPrefix = this.eventNames().map(
|
|
446
|
+
(event) => `video.${event}`
|
|
447
|
+
) as EventEmitter.EventNames<RoomSessionObjectEvents>[]
|
|
448
|
+
return validateEventsToSubscribe(eventNamesWithPrefix)
|
|
449
|
+
}
|
|
616
450
|
}
|
|
617
451
|
|
|
618
452
|
export const RoomSessionAPI = extendComponent<
|
|
@@ -656,6 +490,8 @@ export const RoomSessionAPI = extendComponent<
|
|
|
656
490
|
demote: Rooms.demote,
|
|
657
491
|
getStreams: Rooms.getStreams,
|
|
658
492
|
startStream: Rooms.startStream,
|
|
493
|
+
// lock: Rooms.lock,
|
|
494
|
+
// unlock: Rooms.unlock,
|
|
659
495
|
})
|
|
660
496
|
|
|
661
497
|
type RoomSessionObjectEventsHandlerMapping = RoomSessionObjectEvents &
|
|
@@ -663,7 +499,7 @@ type RoomSessionObjectEventsHandlerMapping = RoomSessionObjectEvents &
|
|
|
663
499
|
|
|
664
500
|
/** @internal */
|
|
665
501
|
export const createBaseRoomSessionObject = <RoomSessionType>(
|
|
666
|
-
params: BaseComponentOptions
|
|
502
|
+
params: BaseComponentOptions
|
|
667
503
|
): BaseRoomSession<RoomSessionType> => {
|
|
668
504
|
const room = connect<
|
|
669
505
|
RoomSessionObjectEventsHandlerMapping,
|
package/src/Client.ts
CHANGED
|
@@ -61,6 +61,7 @@ export class ClientAPI<
|
|
|
61
61
|
...options
|
|
62
62
|
} = makeRoomOptions
|
|
63
63
|
|
|
64
|
+
// TODO: This might not be needed here. We can initiate these sagas in the BaseRoomSession constructor.
|
|
64
65
|
const customSagas: Array<CustomSaga<RoomSessionConnection>> = []
|
|
65
66
|
|
|
66
67
|
/**
|
|
@@ -89,8 +90,6 @@ export class ClientAPI<
|
|
|
89
90
|
const room = createBaseRoomSessionObject<RoomSessionType>({
|
|
90
91
|
...options,
|
|
91
92
|
store: this.store,
|
|
92
|
-
// @ts-expect-error
|
|
93
|
-
emitter: this.emitter,
|
|
94
93
|
customSagas,
|
|
95
94
|
})
|
|
96
95
|
|
|
@@ -137,10 +136,6 @@ export class ClientAPI<
|
|
|
137
136
|
if (!this._chat) {
|
|
138
137
|
this._chat = ChatNamespace.createBaseChatObject<ChatClient>({
|
|
139
138
|
store: this.store,
|
|
140
|
-
// Emitter is now typed but we share it across objects
|
|
141
|
-
// so types won't match
|
|
142
|
-
// @ts-expect-error
|
|
143
|
-
emitter: this.options.emitter,
|
|
144
139
|
})
|
|
145
140
|
}
|
|
146
141
|
return this._chat
|
|
@@ -150,10 +145,6 @@ export class ClientAPI<
|
|
|
150
145
|
if (!this._pubSub) {
|
|
151
146
|
this._pubSub = PubSubNamespace.createBasePubSubObject<PubSubClient>({
|
|
152
147
|
store: this.store,
|
|
153
|
-
// Emitter is now typed but we share it across objects
|
|
154
|
-
// so types won't match
|
|
155
|
-
// @ts-expect-error
|
|
156
|
-
emitter: this.options.emitter,
|
|
157
148
|
})
|
|
158
149
|
}
|
|
159
150
|
return this._pubSub
|
|
@@ -162,7 +153,6 @@ export class ClientAPI<
|
|
|
162
153
|
/** @internal */
|
|
163
154
|
get videoManager() {
|
|
164
155
|
if (!this._videoManager) {
|
|
165
|
-
// @ts-expect-error
|
|
166
156
|
this._videoManager = createVideoManagerObject(this.options)
|
|
167
157
|
}
|
|
168
158
|
return this._videoManager
|
package/src/RoomSession.ts
CHANGED
|
@@ -55,6 +55,8 @@ export const UNSAFE_PROP_ACCESS = [
|
|
|
55
55
|
'deleteMemberMeta',
|
|
56
56
|
'promote',
|
|
57
57
|
'demote',
|
|
58
|
+
'lock',
|
|
59
|
+
'unlock',
|
|
58
60
|
]
|
|
59
61
|
|
|
60
62
|
/**
|
|
@@ -178,7 +180,6 @@ export const RoomSession = function (roomOptions: RoomSessionOptions) {
|
|
|
178
180
|
|
|
179
181
|
// WebRTC connection left the room.
|
|
180
182
|
room.once('destroy', () => {
|
|
181
|
-
// @ts-expect-error
|
|
182
183
|
room.emit('room.left', { reason: room.leaveReason })
|
|
183
184
|
|
|
184
185
|
// Remove callId to reattach
|
|
@@ -186,7 +187,8 @@ export const RoomSession = function (roomOptions: RoomSessionOptions) {
|
|
|
186
187
|
client.disconnect()
|
|
187
188
|
})
|
|
188
189
|
|
|
189
|
-
|
|
190
|
+
// @ts-expect-error
|
|
191
|
+
client.session.once('session.disconnected', () => {
|
|
190
192
|
room.destroy()
|
|
191
193
|
})
|
|
192
194
|
|
|
@@ -242,9 +244,7 @@ export const RoomSession = function (roomOptions: RoomSessionOptions) {
|
|
|
242
244
|
})
|
|
243
245
|
}
|
|
244
246
|
|
|
245
|
-
room.once('room.subscribed', (
|
|
246
|
-
// @ts-expect-error
|
|
247
|
-
room.attachOnSubscribedWorkers(payload)
|
|
247
|
+
room.once('room.subscribed', () => {
|
|
248
248
|
resolve(room)
|
|
249
249
|
})
|
|
250
250
|
|
|
@@ -8,7 +8,6 @@ describe('RoomScreenShare Object', () => {
|
|
|
8
8
|
beforeEach(() => {
|
|
9
9
|
roomScreenShare = new RoomSessionScreenShareAPI({
|
|
10
10
|
store: configureJestStore(),
|
|
11
|
-
emitter: jest.fn() as any,
|
|
12
11
|
}) as any as RoomSessionScreenShare
|
|
13
12
|
// @ts-expect-error
|
|
14
13
|
roomScreenShare.execute = jest.fn()
|
|
@@ -11,8 +11,6 @@ describe('VideoManager namespace', () => {
|
|
|
11
11
|
fullStack.emitter.removeAllListeners()
|
|
12
12
|
manager = createVideoManagerObject({
|
|
13
13
|
store: fullStack.store,
|
|
14
|
-
// @ts-expect-error
|
|
15
|
-
emitter: fullStack.emitter,
|
|
16
14
|
})
|
|
17
15
|
// @ts-expect-error
|
|
18
16
|
manager.execute = jest.fn()
|