@signalwire/js 1.3.0-dev.0 → 1.3.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/README.md +4 -2
- package/dist/esm/common/src/BaseSession.d.ts +8 -13
- package/dist/esm/common/src/BaseSession.js +33 -46
- package/dist/esm/common/src/BrowserSession.d.ts +20 -57
- package/dist/esm/common/src/BrowserSession.js +91 -359
- package/dist/esm/common/src/messages/Verto.d.ts +1 -10
- package/dist/esm/common/src/messages/Verto.js +1 -16
- package/dist/esm/common/src/messages/verto/Login.d.ts +1 -13
- package/dist/esm/common/src/messages/verto/Login.js +2 -5
- package/dist/esm/common/src/services/BroadcastHandler.js +3 -2
- package/dist/esm/common/src/services/Handler.d.ts +8 -9
- package/dist/esm/common/src/services/Handler.js +38 -41
- package/dist/esm/common/src/util/constants/index.d.ts +0 -1
- package/dist/esm/common/src/util/constants/index.js +0 -1
- package/dist/esm/common/src/util/helpers.d.ts +9 -2
- package/dist/esm/common/src/util/helpers.js +11 -6
- package/dist/esm/common/src/util/interfaces.d.ts +55 -20
- package/dist/esm/common/src/util/logger.js +1 -4
- package/dist/esm/common/src/util/webrtc/index.d.ts +1 -6
- package/dist/esm/common/src/util/webrtc/index.js +2 -63
- package/dist/esm/common/src/webrtc/BaseCall.d.ts +76 -0
- package/dist/esm/common/src/webrtc/BaseCall.js +701 -0
- package/dist/esm/common/src/webrtc/Call.d.ts +5 -5
- package/dist/esm/common/src/webrtc/Call.js +15 -34
- package/dist/esm/common/src/webrtc/CantinaAuth.d.ts +13 -8
- package/dist/esm/common/src/webrtc/CantinaAuth.js +18 -24
- package/dist/esm/common/src/webrtc/LayoutHandler.d.ts +3 -0
- package/dist/esm/common/src/webrtc/LayoutHandler.js +36 -0
- package/dist/esm/common/src/webrtc/Peer.d.ts +21 -0
- package/dist/esm/common/src/webrtc/Peer.js +145 -0
- package/dist/esm/common/src/webrtc/VertoHandler.d.ts +11 -2
- package/dist/esm/common/src/webrtc/VertoHandler.js +187 -147
- package/dist/esm/common/src/webrtc/constants.d.ts +12 -28
- package/dist/esm/common/src/webrtc/constants.js +11 -34
- package/dist/esm/common/src/webrtc/helpers.d.ts +20 -18
- package/dist/esm/common/src/webrtc/helpers.js +177 -162
- package/dist/esm/common/src/webrtc/interfaces.d.ts +51 -209
- package/dist/esm/js/index.d.ts +1 -3
- package/dist/esm/js/index.js +1 -2
- package/dist/esm/js/src/SignalWire.d.ts +2 -0
- package/dist/esm/js/src/SignalWire.js +13 -0
- package/dist/esm/js/src/Verto.d.ts +2 -8
- package/dist/esm/js/src/Verto.js +14 -50
- package/dist/index.min.js +2 -2
- package/package.json +13 -14
- package/dist/esm/common/src/webrtc/ChatChannelHandler.d.ts +0 -5
- package/dist/esm/common/src/webrtc/ChatChannelHandler.js +0 -22
- package/dist/esm/common/src/webrtc/Conference.d.ts +0 -15
- package/dist/esm/common/src/webrtc/Conference.js +0 -68
- package/dist/esm/common/src/webrtc/ConferenceListChannelHandler.d.ts +0 -5
- package/dist/esm/common/src/webrtc/ConferenceListChannelHandler.js +0 -77
- package/dist/esm/common/src/webrtc/InfoChannelHandler.d.ts +0 -7
- package/dist/esm/common/src/webrtc/InfoChannelHandler.js +0 -85
- package/dist/esm/common/src/webrtc/LaChannelHandler.d.ts +0 -5
- package/dist/esm/common/src/webrtc/LaChannelHandler.js +0 -58
- package/dist/esm/common/src/webrtc/ModChannelHandler.d.ts +0 -71
- package/dist/esm/common/src/webrtc/ModChannelHandler.js +0 -267
- package/dist/esm/common/src/webrtc/RTCPeer.d.ts +0 -51
- package/dist/esm/common/src/webrtc/RTCPeer.js +0 -556
- package/dist/esm/common/src/webrtc/WebRTCCall.d.ts +0 -182
- package/dist/esm/common/src/webrtc/WebRTCCall.js +0 -784
- package/dist/esm/common/src/webrtc/deviceHelpers.d.ts +0 -18
- package/dist/esm/common/src/webrtc/deviceHelpers.js +0 -113
- package/dist/esm/common/src/webrtc/sdpHelpers.d.ts +0 -3
- package/dist/esm/common/src/webrtc/sdpHelpers.js +0 -56
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@signalwire/js",
|
|
3
|
-
"version": "1.3.0
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "Relay SDK for JavaScript to connect to SignalWire.",
|
|
5
5
|
"author": "SignalWire Team <open.source@signalwire.com>",
|
|
6
6
|
"main": "dist/index.min.js",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"build-esm": "tsc",
|
|
19
19
|
"watch-esm": "tsc -w",
|
|
20
20
|
"tslint": "tslint -p tsconfig.json",
|
|
21
|
-
"test": "jest --
|
|
21
|
+
"test": "jest --forceExit --detectOpenHandles",
|
|
22
22
|
"test:watch": "npm run test -- --watchAll",
|
|
23
23
|
"validate": "npm i && npm run tslint && npm run test && npm run clean-build",
|
|
24
24
|
"check_versions": "node ../../.scripts/check_package_version.js"
|
|
@@ -40,24 +40,23 @@
|
|
|
40
40
|
"homepage": "https://github.com/signalwire/signalwire-node",
|
|
41
41
|
"license": "MIT",
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"loglevel": "^1.
|
|
44
|
-
"
|
|
45
|
-
"uuid": "^8.3.2"
|
|
43
|
+
"loglevel": "^1.6.8",
|
|
44
|
+
"uuid": "^7.0.3"
|
|
46
45
|
},
|
|
47
46
|
"devDependencies": {
|
|
48
|
-
"@babel/plugin-transform-runtime": "^7.
|
|
49
|
-
"@types/jest": "^
|
|
50
|
-
"@types/uuid": "^
|
|
47
|
+
"@babel/plugin-transform-runtime": "^7.9.0",
|
|
48
|
+
"@types/jest": "^25.2.1",
|
|
49
|
+
"@types/uuid": "^7.0.2",
|
|
51
50
|
"babel-core": "^6.26.3",
|
|
52
|
-
"babel-loader": "^8.
|
|
51
|
+
"babel-loader": "^8.1.0",
|
|
53
52
|
"babel-preset-env": "^1.7.0",
|
|
54
|
-
"jest": "^
|
|
55
|
-
"ts-jest": "^
|
|
56
|
-
"ts-loader": "^
|
|
57
|
-
"tslint": "^6.1.
|
|
53
|
+
"jest": "^25.3.0",
|
|
54
|
+
"ts-jest": "^25.3.1",
|
|
55
|
+
"ts-loader": "^6.2.2",
|
|
56
|
+
"tslint": "^6.1.1",
|
|
58
57
|
"typescript": "^3.8.3",
|
|
59
58
|
"webpack": "^4.42.1",
|
|
60
59
|
"webpack-cli": "^3.3.11",
|
|
61
|
-
"webpack-dev-server": "^3.
|
|
60
|
+
"webpack-dev-server": "^3.10.3"
|
|
62
61
|
}
|
|
63
62
|
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import BrowserSession from '../BrowserSession';
|
|
2
|
-
export default function chatChannelHandler(session: BrowserSession, { eventChannel, eventSerno, data }: any): void;
|
|
3
|
-
export declare const publicChatMethods: {
|
|
4
|
-
sendChatMessage: (message: string, type: string) => void;
|
|
5
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { ConferenceAction } from './constants';
|
|
2
|
-
export default function chatChannelHandler(session, { eventChannel, eventSerno, data }) {
|
|
3
|
-
const callIds = session.channelToCallIds.get(eventChannel) || [];
|
|
4
|
-
const { direction, from: participantNumber, fromDisplay: participantName, message: messageText, type: messageType } = data;
|
|
5
|
-
const params = {
|
|
6
|
-
action: ConferenceAction.ChatMessage, direction, participantNumber, participantName, messageText, messageType, messageId: eventSerno
|
|
7
|
-
};
|
|
8
|
-
if (callIds.length) {
|
|
9
|
-
callIds.forEach(callId => {
|
|
10
|
-
session.calls[callId] && session.calls[callId]._dispatchConferenceUpdate(params);
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
else {
|
|
14
|
-
console.warn('Dispatch global ConferenceUpdate for', params);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
export const publicChatMethods = {
|
|
18
|
-
sendChatMessage: function (message, type) {
|
|
19
|
-
const { session, nodeId, channel } = this;
|
|
20
|
-
session.vertoBroadcast({ nodeId, channel, data: { action: 'send', message, type } });
|
|
21
|
-
}
|
|
22
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import BrowserSession from '../BrowserSession';
|
|
2
|
-
import { IConferenceInfo } from './interfaces';
|
|
3
|
-
export default class Conference implements Partial<IConferenceInfo> {
|
|
4
|
-
uuid: string;
|
|
5
|
-
md5: string;
|
|
6
|
-
domain: string;
|
|
7
|
-
laName: string;
|
|
8
|
-
laChannel: string;
|
|
9
|
-
infoChannel: string;
|
|
10
|
-
chatChannel: string;
|
|
11
|
-
modChannel: string;
|
|
12
|
-
confName: string;
|
|
13
|
-
isPrivate: boolean;
|
|
14
|
-
constructor(session: BrowserSession, params: Partial<IConferenceInfo>);
|
|
15
|
-
}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { publicModMethods } from './ModChannelHandler';
|
|
2
|
-
import { publicChatMethods } from './ChatChannelHandler';
|
|
3
|
-
import { publicInfoMethods } from './InfoChannelHandler';
|
|
4
|
-
import { publicLiveArrayMethods } from './LaChannelHandler';
|
|
5
|
-
export default class Conference {
|
|
6
|
-
constructor(session, params) {
|
|
7
|
-
const { uuid, md5, domain, laName, laChannel, infoChannel, chatChannel, modChannel = null, confName, isPrivate = false } = params;
|
|
8
|
-
this.uuid = uuid;
|
|
9
|
-
this.md5 = md5;
|
|
10
|
-
this.domain = domain;
|
|
11
|
-
this.laName = laName;
|
|
12
|
-
this.laChannel = laChannel;
|
|
13
|
-
this.infoChannel = infoChannel;
|
|
14
|
-
this.chatChannel = chatChannel;
|
|
15
|
-
this.modChannel = modChannel;
|
|
16
|
-
this.confName = confName;
|
|
17
|
-
this.isPrivate = isPrivate;
|
|
18
|
-
const modObject = {
|
|
19
|
-
session: session,
|
|
20
|
-
nodeId: session.nodeid,
|
|
21
|
-
channel: this.modChannel || null,
|
|
22
|
-
};
|
|
23
|
-
Object.keys(publicModMethods).forEach(method => {
|
|
24
|
-
Object.defineProperty(this, method, {
|
|
25
|
-
configurable: true,
|
|
26
|
-
writable: true,
|
|
27
|
-
value: publicModMethods[method].bind(modObject)
|
|
28
|
-
});
|
|
29
|
-
});
|
|
30
|
-
const chatObject = {
|
|
31
|
-
session: session,
|
|
32
|
-
nodeId: session.nodeid,
|
|
33
|
-
channel: this.chatChannel || null,
|
|
34
|
-
};
|
|
35
|
-
Object.keys(publicChatMethods).forEach(method => {
|
|
36
|
-
Object.defineProperty(this, method, {
|
|
37
|
-
configurable: true,
|
|
38
|
-
writable: true,
|
|
39
|
-
value: publicChatMethods[method].bind(chatObject)
|
|
40
|
-
});
|
|
41
|
-
});
|
|
42
|
-
const infoObject = {
|
|
43
|
-
session: session,
|
|
44
|
-
nodeId: session.nodeid,
|
|
45
|
-
channel: this.infoChannel || null,
|
|
46
|
-
};
|
|
47
|
-
Object.keys(publicInfoMethods).forEach(method => {
|
|
48
|
-
Object.defineProperty(this, method, {
|
|
49
|
-
configurable: true,
|
|
50
|
-
writable: true,
|
|
51
|
-
value: publicInfoMethods[method].bind(infoObject)
|
|
52
|
-
});
|
|
53
|
-
});
|
|
54
|
-
const laObject = {
|
|
55
|
-
session: session,
|
|
56
|
-
nodeId: session.nodeid,
|
|
57
|
-
channel: this.laChannel || null,
|
|
58
|
-
laName: this.laName || null,
|
|
59
|
-
};
|
|
60
|
-
Object.keys(publicLiveArrayMethods).forEach(method => {
|
|
61
|
-
Object.defineProperty(this, method, {
|
|
62
|
-
configurable: true,
|
|
63
|
-
writable: true,
|
|
64
|
-
value: publicLiveArrayMethods[method].bind(laObject)
|
|
65
|
-
});
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { trigger } from '../services/Handler';
|
|
2
|
-
import { SwEvent } from '../util/constants';
|
|
3
|
-
import { Notification } from './constants';
|
|
4
|
-
import Conference from './Conference';
|
|
5
|
-
const _buildConference = (conference) => {
|
|
6
|
-
return {
|
|
7
|
-
uuid: conference.uuid,
|
|
8
|
-
md5: conference.md5,
|
|
9
|
-
running: true,
|
|
10
|
-
laName: conference.name,
|
|
11
|
-
laChannel: conference.liveArrayChannel,
|
|
12
|
-
infoChannel: conference.infoChannel,
|
|
13
|
-
chatChannel: conference.chatChannel,
|
|
14
|
-
modChannel: conference.modChannel,
|
|
15
|
-
confName: conference.displayName,
|
|
16
|
-
numMembers: conference.member_count || 0,
|
|
17
|
-
isPrivate: false,
|
|
18
|
-
recording: Boolean(conference.recording),
|
|
19
|
-
locked: Boolean(conference.locked),
|
|
20
|
-
lastSnapshot: conference.lastSnapshot,
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
export default function (session, { eventChannel, eventSerno, data: packet }) {
|
|
24
|
-
try {
|
|
25
|
-
switch (packet.action) {
|
|
26
|
-
case 'bootObj': {
|
|
27
|
-
session.conferences = {};
|
|
28
|
-
const conferences = [];
|
|
29
|
-
for (const i in packet.data) {
|
|
30
|
-
const conference = packet.data[i][1];
|
|
31
|
-
const confInfo = _buildConference(conference);
|
|
32
|
-
session.conferences[conference.uuid] = new Conference(session, confInfo);
|
|
33
|
-
conferences.push(conference);
|
|
34
|
-
}
|
|
35
|
-
const notification = { type: Notification.ConferenceListBootstrap, conferences };
|
|
36
|
-
trigger(SwEvent.Notification, notification, session.uuid);
|
|
37
|
-
break;
|
|
38
|
-
}
|
|
39
|
-
case 'add': {
|
|
40
|
-
const conference = packet.data;
|
|
41
|
-
const confInfo = _buildConference(conference);
|
|
42
|
-
session.conferences[conference.uuid] = new Conference(session, confInfo);
|
|
43
|
-
const notification = { type: Notification.ConferenceListAdd, conference };
|
|
44
|
-
trigger(SwEvent.Notification, notification, session.uuid);
|
|
45
|
-
break;
|
|
46
|
-
}
|
|
47
|
-
case 'modify': {
|
|
48
|
-
const conference = packet.data;
|
|
49
|
-
const confInfo = _buildConference(conference);
|
|
50
|
-
session.conferences[conference.uuid] = new Conference(session, confInfo);
|
|
51
|
-
const notification = { type: Notification.ConferenceListModify, conference };
|
|
52
|
-
trigger(SwEvent.Notification, notification, session.uuid);
|
|
53
|
-
break;
|
|
54
|
-
}
|
|
55
|
-
case 'del': {
|
|
56
|
-
const conference = packet.data;
|
|
57
|
-
delete session.conferences[conference.uuid];
|
|
58
|
-
const notification = { type: Notification.ConferenceListDelete, conference };
|
|
59
|
-
trigger(SwEvent.Notification, notification, session.uuid);
|
|
60
|
-
break;
|
|
61
|
-
}
|
|
62
|
-
default:
|
|
63
|
-
console.warn('ConferenceList unknown action', packet.action, packet);
|
|
64
|
-
break;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
catch (error) {
|
|
68
|
-
console.warn('ConferenceList error', error, packet);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
export const publicConferenceListMethods = {
|
|
72
|
-
conferenceListBootstrap: function () {
|
|
73
|
-
const { session, nodeId, channel } = this;
|
|
74
|
-
const data = { liveArray: { command: 'bootstrap', context: channel, name: 'conferences' } };
|
|
75
|
-
session.vertoBroadcast({ nodeId, channel, data });
|
|
76
|
-
}
|
|
77
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import BrowserSession from '../BrowserSession';
|
|
2
|
-
export default function infoChannelHandler(session: BrowserSession, params: any): void;
|
|
3
|
-
export declare const publicInfoMethods: {
|
|
4
|
-
infoCommand: (command: string, id: string, value: any) => any;
|
|
5
|
-
getLayoutInfo: () => any;
|
|
6
|
-
getConferenceState: () => any;
|
|
7
|
-
};
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
import logger from '../util/logger';
|
|
13
|
-
import { ConferenceAction } from './constants';
|
|
14
|
-
import { destructConferenceState } from './helpers';
|
|
15
|
-
export default function infoChannelHandler(session, params) {
|
|
16
|
-
const { eventData = null, eventChannel, eventSerno = null, data } = params;
|
|
17
|
-
if (data) {
|
|
18
|
-
return logger.debug('Unhandled conference info event', params);
|
|
19
|
-
}
|
|
20
|
-
if (!eventData) {
|
|
21
|
-
return logger.warn('Unknown conference info event', params);
|
|
22
|
-
}
|
|
23
|
-
const callIds = session.channelToCallIds.get(eventChannel) || [];
|
|
24
|
-
switch (eventData.contentType) {
|
|
25
|
-
case 'layout-info': {
|
|
26
|
-
if (callIds.length) {
|
|
27
|
-
callIds.forEach(callId => {
|
|
28
|
-
session.calls[callId] && session.calls[callId].updateLayouts(eventData);
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
}
|
|
33
|
-
break;
|
|
34
|
-
}
|
|
35
|
-
case 'conference-info':
|
|
36
|
-
const { conferenceState, messages = [] } = eventData;
|
|
37
|
-
return _dispatch(session, { action: ConferenceAction.ConferenceInfo, eventChannel, eventSerno, conferenceState: destructConferenceState(conferenceState), messages }, callIds);
|
|
38
|
-
case 'member-talk-state':
|
|
39
|
-
const { callID, memberID, talking } = eventData;
|
|
40
|
-
return _dispatch(session, { action: ConferenceAction.MemberTalkState, eventChannel, eventSerno, callID, memberID, talking }, callIds);
|
|
41
|
-
case 'caption-info': {
|
|
42
|
-
if (callIds.length) {
|
|
43
|
-
callIds.forEach(callId => {
|
|
44
|
-
session.calls[callId] && session.calls[callId].handleCaptionInfo(eventData);
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
else {
|
|
48
|
-
}
|
|
49
|
-
break;
|
|
50
|
-
}
|
|
51
|
-
default:
|
|
52
|
-
logger.warn('Unknown conference info event', params);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
const _dispatch = (session, params, callIds) => {
|
|
56
|
-
if (callIds.length) {
|
|
57
|
-
callIds.forEach(callId => {
|
|
58
|
-
session.calls[callId] && session.calls[callId]._dispatchConferenceUpdate(params);
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
else {
|
|
62
|
-
session.dispatchConferenceUpdate(params);
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
function _infoCommand(params) {
|
|
66
|
-
const _a = this, { session, nodeId, channel } = _a, rest = __rest(_a, ["session", "nodeId", "channel"]);
|
|
67
|
-
if (!channel) {
|
|
68
|
-
return console.warn('Missing modChannel');
|
|
69
|
-
}
|
|
70
|
-
const data = Object.assign(Object.assign({ application: 'conf-control' }, rest), params);
|
|
71
|
-
session.vertoBroadcast({ nodeId, channel, data });
|
|
72
|
-
}
|
|
73
|
-
export const publicInfoMethods = {
|
|
74
|
-
infoCommand: function (command, id, value) {
|
|
75
|
-
return _infoCommand.call(this, { command, id, value });
|
|
76
|
-
},
|
|
77
|
-
getLayoutInfo: function () {
|
|
78
|
-
const params = { command: 'get-layout-info' };
|
|
79
|
-
return _infoCommand.call(this, params);
|
|
80
|
-
},
|
|
81
|
-
getConferenceState: function () {
|
|
82
|
-
const params = { command: 'get-conference-state' };
|
|
83
|
-
return _infoCommand.call(this, params);
|
|
84
|
-
},
|
|
85
|
-
};
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { mutateLiveArrayData } from '../util/helpers';
|
|
2
|
-
import { ConferenceAction } from './constants';
|
|
3
|
-
export default function (session, { eventChannel, eventSerno, data: packet }) {
|
|
4
|
-
const [, confMd5, domain] = eventChannel.match(/conference-liveArray.(.*)@(.*)/);
|
|
5
|
-
const callIds = session.channelToCallIds.get(eventChannel) || [];
|
|
6
|
-
const { action, data, hashKey: callId, wireSerno } = packet;
|
|
7
|
-
switch (action) {
|
|
8
|
-
case 'bootObj': {
|
|
9
|
-
const participants = [];
|
|
10
|
-
for (const i in data) {
|
|
11
|
-
const participant = Object.assign({ callId: data[i][0], confMd5, domain, eventChannel }, mutateLiveArrayData(data[i][1]));
|
|
12
|
-
const { callId, audio, video } = participant;
|
|
13
|
-
const isMyCall = callIds.includes(callId);
|
|
14
|
-
if (isMyCall && audio && video && session.calls[callId]) {
|
|
15
|
-
session.calls[callId].updateFromLaChannel(audio.muted, video.muted);
|
|
16
|
-
}
|
|
17
|
-
participants.push(participant);
|
|
18
|
-
}
|
|
19
|
-
return _dispatch(session, { action: ConferenceAction.Bootstrap, participants, confMd5, domain, eventChannel, eventSerno, wireSerno }, callIds);
|
|
20
|
-
}
|
|
21
|
-
case 'add':
|
|
22
|
-
return _dispatch(session, Object.assign({ action: ConferenceAction.Add, callId, confMd5, domain, eventChannel, eventSerno, wireSerno }, mutateLiveArrayData(data)), callIds);
|
|
23
|
-
case 'modify': {
|
|
24
|
-
const notification = Object.assign({ action: ConferenceAction.Modify, callId, confMd5, domain, eventChannel, eventSerno, wireSerno }, mutateLiveArrayData(data));
|
|
25
|
-
const isMyCall = callIds.includes(callId);
|
|
26
|
-
if (isMyCall) {
|
|
27
|
-
const { audio, video } = notification;
|
|
28
|
-
if (audio && video && session.calls[callId]) {
|
|
29
|
-
session.calls[callId].updateFromLaChannel(audio.muted, video.muted);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
return _dispatch(session, notification, callIds);
|
|
33
|
-
}
|
|
34
|
-
case 'del':
|
|
35
|
-
return _dispatch(session, Object.assign({ action: ConferenceAction.Delete, callId, confMd5, domain, eventChannel, eventSerno, wireSerno }, mutateLiveArrayData(data)), callIds);
|
|
36
|
-
case 'clear':
|
|
37
|
-
return _dispatch(session, { action: ConferenceAction.Clear, confMd5, domain, eventChannel, eventSerno, wireSerno, confName: packet.name || null }, callIds);
|
|
38
|
-
default:
|
|
39
|
-
return _dispatch(session, { action, data, callId, confMd5, domain, eventChannel, eventSerno, wireSerno }, callIds);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
export const publicLiveArrayMethods = {
|
|
43
|
-
liveArrayBootstrap: function () {
|
|
44
|
-
const { session, nodeId, channel, laName } = this;
|
|
45
|
-
const data = { liveArray: { command: 'bootstrap', context: channel, name: laName } };
|
|
46
|
-
session.vertoBroadcast({ nodeId, channel, data });
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
const _dispatch = (session, params, callIds) => {
|
|
50
|
-
if (callIds.length) {
|
|
51
|
-
callIds.forEach(callId => {
|
|
52
|
-
session.calls[callId] && session.calls[callId]._dispatchConferenceUpdate(params);
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
else {
|
|
56
|
-
session.dispatchConferenceUpdate(params);
|
|
57
|
-
}
|
|
58
|
-
};
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import BrowserSession from '../BrowserSession';
|
|
2
|
-
export default function modChannelHandler(session: BrowserSession, { data, eventChannel, eventSerno }: any): void;
|
|
3
|
-
export declare const publicModMethods: {
|
|
4
|
-
modCommand: (command: string, id: string, value: any) => any;
|
|
5
|
-
listVideoLayouts: () => any;
|
|
6
|
-
getConferenceState: () => any;
|
|
7
|
-
playMedia: (file: string) => any;
|
|
8
|
-
stopMedia: () => any;
|
|
9
|
-
pauseMedia: (isAsync?: boolean) => any;
|
|
10
|
-
fileSeek: (value: string, isAsync?: boolean) => any;
|
|
11
|
-
fileVolume: (value: string, isAsync?: boolean) => any;
|
|
12
|
-
fileReservationId: (value: string, isAsync?: boolean) => any;
|
|
13
|
-
startRecord: (file: string) => any;
|
|
14
|
-
stopRecord: () => any;
|
|
15
|
-
snapshot: (file: string) => any;
|
|
16
|
-
lock: () => any;
|
|
17
|
-
unlock: () => any;
|
|
18
|
-
setVideoLayout: (layout: string, canvasID: number) => any;
|
|
19
|
-
kick: (id: string) => any;
|
|
20
|
-
muteAudioAll: (flags?: string) => any;
|
|
21
|
-
unmuteAudioAll: () => any;
|
|
22
|
-
muteVideoAll: () => any;
|
|
23
|
-
unmuteVideoAll: () => any;
|
|
24
|
-
muteAudio: (participantId: string) => any;
|
|
25
|
-
unmuteAudio: (participantId: string) => any;
|
|
26
|
-
toggleAudioMute: (participantId: string) => any;
|
|
27
|
-
muteVideo: (participantId: string) => any;
|
|
28
|
-
unmuteVideo: (participantId: string) => any;
|
|
29
|
-
toggleVideoMute: (participantId: string) => any;
|
|
30
|
-
deaf: (participantId: string) => any;
|
|
31
|
-
undeaf: (participantId: string) => any;
|
|
32
|
-
setReservationId: (participantId: string, value?: string) => any;
|
|
33
|
-
videoFloor: (participantId: string) => any;
|
|
34
|
-
banner: (participantId: string, text: string) => any;
|
|
35
|
-
volumeDown: (participantId: string) => any;
|
|
36
|
-
volumeUp: (participantId: string) => any;
|
|
37
|
-
gainDown: (participantId: string) => any;
|
|
38
|
-
gainUp: (participantId: string) => any;
|
|
39
|
-
setEnergy: (participantId: string, value: string) => any;
|
|
40
|
-
transferMember: (participantId: string, destination: string) => any;
|
|
41
|
-
setDenoise: (participantId: string, value?: string) => any;
|
|
42
|
-
setLowBitrate: (participantId: string, value?: string) => any;
|
|
43
|
-
addToCall: (extension: string, email?: string, name?: string) => any;
|
|
44
|
-
setHandRaised: (participantId: string, value?: string) => any;
|
|
45
|
-
setVidFloorResId: (value: string) => any;
|
|
46
|
-
confQuality: (value: string) => any;
|
|
47
|
-
confMotionQuality: (value: string) => any;
|
|
48
|
-
confMotionQualityInbound: (value: string) => any;
|
|
49
|
-
confMotionQualityMember: (participantId: string, value: string) => any;
|
|
50
|
-
confFullscreen: (participantId: string, value: string) => any;
|
|
51
|
-
sayAll: (value: string) => any;
|
|
52
|
-
sayMember: (participantId: string, value: string) => any;
|
|
53
|
-
setBanner: (participantId: string, value: string) => any;
|
|
54
|
-
setPerformerDelay: (value: string) => any;
|
|
55
|
-
setVolumeAudience: (value: string) => any;
|
|
56
|
-
toggleVidMuteHide: (value?: string) => any;
|
|
57
|
-
setMeetingMode: (value?: string) => any;
|
|
58
|
-
setSilentMode: (value?: string) => any;
|
|
59
|
-
setBlindMode: (value?: string) => any;
|
|
60
|
-
setConfVariable: (variable: string, value: string) => any;
|
|
61
|
-
grantModerator: (participantId: string, value: string) => any;
|
|
62
|
-
grantScreenShare: (participantId: string, value: string) => any;
|
|
63
|
-
setPin: (pin: string) => any;
|
|
64
|
-
removePin: () => any;
|
|
65
|
-
setModeratorPin: (pin: string) => any;
|
|
66
|
-
removeModeratorPin: () => any;
|
|
67
|
-
setConfLayoutMode: (value: string) => any;
|
|
68
|
-
shuffleVideo: (value: string) => any;
|
|
69
|
-
setVidLogos: (value: "on" | "off") => any;
|
|
70
|
-
setHandraiseOnscreen: (value: "on" | "off") => any;
|
|
71
|
-
};
|