@signalwire/js 1.3.0-dev.1 → 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.
Files changed (65) hide show
  1. package/README.md +4 -2
  2. package/dist/esm/common/src/BaseSession.d.ts +8 -13
  3. package/dist/esm/common/src/BaseSession.js +33 -46
  4. package/dist/esm/common/src/BrowserSession.d.ts +20 -57
  5. package/dist/esm/common/src/BrowserSession.js +91 -359
  6. package/dist/esm/common/src/messages/Verto.d.ts +1 -10
  7. package/dist/esm/common/src/messages/Verto.js +1 -16
  8. package/dist/esm/common/src/messages/verto/Login.d.ts +1 -13
  9. package/dist/esm/common/src/messages/verto/Login.js +2 -5
  10. package/dist/esm/common/src/services/BroadcastHandler.js +3 -2
  11. package/dist/esm/common/src/services/Handler.d.ts +8 -9
  12. package/dist/esm/common/src/services/Handler.js +38 -41
  13. package/dist/esm/common/src/util/constants/index.d.ts +0 -1
  14. package/dist/esm/common/src/util/constants/index.js +0 -1
  15. package/dist/esm/common/src/util/helpers.d.ts +9 -2
  16. package/dist/esm/common/src/util/helpers.js +11 -6
  17. package/dist/esm/common/src/util/interfaces.d.ts +55 -20
  18. package/dist/esm/common/src/util/logger.js +1 -4
  19. package/dist/esm/common/src/util/webrtc/index.d.ts +1 -6
  20. package/dist/esm/common/src/util/webrtc/index.js +2 -63
  21. package/dist/esm/common/src/webrtc/BaseCall.d.ts +76 -0
  22. package/dist/esm/common/src/webrtc/BaseCall.js +701 -0
  23. package/dist/esm/common/src/webrtc/Call.d.ts +5 -5
  24. package/dist/esm/common/src/webrtc/Call.js +15 -34
  25. package/dist/esm/common/src/webrtc/CantinaAuth.d.ts +13 -8
  26. package/dist/esm/common/src/webrtc/CantinaAuth.js +18 -24
  27. package/dist/esm/common/src/webrtc/LayoutHandler.d.ts +3 -0
  28. package/dist/esm/common/src/webrtc/LayoutHandler.js +36 -0
  29. package/dist/esm/common/src/webrtc/Peer.d.ts +21 -0
  30. package/dist/esm/common/src/webrtc/Peer.js +145 -0
  31. package/dist/esm/common/src/webrtc/VertoHandler.d.ts +11 -2
  32. package/dist/esm/common/src/webrtc/VertoHandler.js +187 -147
  33. package/dist/esm/common/src/webrtc/constants.d.ts +12 -28
  34. package/dist/esm/common/src/webrtc/constants.js +11 -34
  35. package/dist/esm/common/src/webrtc/helpers.d.ts +20 -18
  36. package/dist/esm/common/src/webrtc/helpers.js +177 -162
  37. package/dist/esm/common/src/webrtc/interfaces.d.ts +51 -209
  38. package/dist/esm/js/index.d.ts +1 -3
  39. package/dist/esm/js/index.js +1 -2
  40. package/dist/esm/js/src/SignalWire.d.ts +2 -0
  41. package/dist/esm/js/src/SignalWire.js +13 -0
  42. package/dist/esm/js/src/Verto.d.ts +2 -8
  43. package/dist/esm/js/src/Verto.js +14 -50
  44. package/dist/index.min.js +2 -2
  45. package/package.json +13 -14
  46. package/dist/esm/common/src/webrtc/ChatChannelHandler.d.ts +0 -5
  47. package/dist/esm/common/src/webrtc/ChatChannelHandler.js +0 -22
  48. package/dist/esm/common/src/webrtc/Conference.d.ts +0 -15
  49. package/dist/esm/common/src/webrtc/Conference.js +0 -68
  50. package/dist/esm/common/src/webrtc/ConferenceListChannelHandler.d.ts +0 -5
  51. package/dist/esm/common/src/webrtc/ConferenceListChannelHandler.js +0 -77
  52. package/dist/esm/common/src/webrtc/InfoChannelHandler.d.ts +0 -7
  53. package/dist/esm/common/src/webrtc/InfoChannelHandler.js +0 -85
  54. package/dist/esm/common/src/webrtc/LaChannelHandler.d.ts +0 -5
  55. package/dist/esm/common/src/webrtc/LaChannelHandler.js +0 -58
  56. package/dist/esm/common/src/webrtc/ModChannelHandler.d.ts +0 -71
  57. package/dist/esm/common/src/webrtc/ModChannelHandler.js +0 -267
  58. package/dist/esm/common/src/webrtc/RTCPeer.d.ts +0 -51
  59. package/dist/esm/common/src/webrtc/RTCPeer.js +0 -556
  60. package/dist/esm/common/src/webrtc/WebRTCCall.d.ts +0 -182
  61. package/dist/esm/common/src/webrtc/WebRTCCall.js +0 -784
  62. package/dist/esm/common/src/webrtc/deviceHelpers.d.ts +0 -18
  63. package/dist/esm/common/src/webrtc/deviceHelpers.js +0 -113
  64. package/dist/esm/common/src/webrtc/sdpHelpers.d.ts +0 -3
  65. package/dist/esm/common/src/webrtc/sdpHelpers.js +0 -56
@@ -9,164 +9,204 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  };
10
10
  import logger from '../util/logger';
11
11
  import Call from './Call';
12
+ import { checkSubscribeResponse } from './helpers';
12
13
  import { Result } from '../messages/Verto';
13
14
  import { SwEvent } from '../util/constants';
14
- import { VertoMethod, Notification, Direction } from './constants';
15
- import { trigger } from '../services/Handler';
16
- import { State } from './constants';
17
- import { checkIsDirectCall } from './helpers';
18
- const _handlePvtEvent = (session, pvtData) => __awaiter(void 0, void 0, void 0, function* () {
19
- const { action, callID } = pvtData;
20
- if (!callID || !session.calls[callID]) {
21
- return logger.debug('Verto pvtData with invalid or unknown callID.', pvtData);
15
+ import { VertoMethod, NOTIFICATION_TYPE } from './constants';
16
+ import { trigger, deRegister } from '../services/Handler';
17
+ import { State, ConferenceAction } from './constants';
18
+ import { MCULayoutEventHandler } from './LayoutHandler';
19
+ class VertoHandler {
20
+ constructor(session) {
21
+ this.session = session;
22
22
  }
23
- const call = session.calls[callID];
24
- if (call.options.skipLiveArray) {
25
- return logger.debug('Skip liveArray pvtData for', callID, pvtData);
26
- }
27
- switch (action) {
28
- case 'conference-liveArray-join':
29
- yield call.conferenceJoinHandler(pvtData);
30
- break;
31
- case 'conference-liveArray-part':
32
- yield call.conferencePartHandler(pvtData);
33
- break;
34
- }
35
- });
36
- const _handleSessionEvent = (session, eventData) => {
37
- const { contentType, callID } = eventData;
38
- if (!callID || !session.calls.hasOwnProperty(callID)) {
39
- return logger.debug('Unhandled session event:', eventData);
40
- }
41
- const call = session.calls[callID];
42
- switch (contentType) {
43
- case 'layout-info':
44
- case 'layer-info':
45
- call.updateLayouts(eventData);
46
- break;
47
- case 'logo-info':
48
- call.updateLogo(eventData);
49
- break;
50
- case 'caption-info':
51
- call.handleCaptionInfo(eventData);
52
- break;
53
- case 'conference-info':
54
- call.handleConferenceInfo(eventData);
55
- break;
56
- }
57
- };
58
- const _buildCall = (session, params, attach, nodeId) => {
59
- let remoteCallerName = params.caller_id_name;
60
- let remoteCallerNumber = params.caller_id_number;
61
- let callerName = params.callee_id_name;
62
- let callerNumber = params.callee_id_number;
63
- if (params.display_direction === Direction.Inbound) {
64
- remoteCallerName = params.callee_id_name;
65
- remoteCallerNumber = params.callee_id_number;
66
- callerName = params.caller_id_name;
67
- callerNumber = params.caller_id_number;
68
- }
69
- const call = new Call(session, {
70
- id: params.callID,
71
- remoteSdp: params.sdp,
72
- destinationNumber: params.callee_id_number,
73
- remoteCallerName,
74
- remoteCallerNumber,
75
- callerName,
76
- callerNumber,
77
- attach,
78
- secondSource: /;second-source$/.test(params.callee_id_number),
79
- screenShare: /;screen$/.test(params.callee_id_number),
80
- shakenCheck: params.shaken_check || '',
81
- shakenResult: params.shaken_result || '',
82
- });
83
- const hasAudioLine = params.sdp.indexOf('m=audio') !== -1;
84
- if (!hasAudioLine) {
85
- call.options.audio = false;
86
- call.options.micId = null;
87
- call.options.micLabel = null;
88
- }
89
- const hasVideoLine = params.sdp.indexOf('m=video') !== -1;
90
- if (!hasVideoLine) {
91
- call.options.video = false;
92
- call.options.camId = null;
93
- call.options.camLabel = null;
94
- }
95
- call.nodeId = nodeId;
96
- call.isDirect = checkIsDirectCall(params);
97
- return call;
98
- };
99
- export default (session, msg) => {
100
- const { id, method, nodeId, params } = msg;
101
- const { callID, eventChannel, eventType } = params;
102
- if (eventType === 'channelPvtData') {
103
- params.pvtData.nodeId = nodeId;
104
- return _handlePvtEvent(session, params.pvtData);
105
- }
106
- if (eventChannel === session.sessionid || eventChannel === session.relayProtocol) {
107
- return _handleSessionEvent(session, params.eventData);
108
- }
109
- if (callID && session.calls.hasOwnProperty(callID)) {
110
- trigger(callID, params, method);
111
- if (method !== VertoMethod.Attach) {
112
- const msg = new Result(id, method);
113
- msg.targetNodeId = nodeId;
114
- session.execute(msg);
23
+ _ack(id, method) {
24
+ const msg = new Result(id, method);
25
+ if (this.nodeId) {
26
+ msg.targetNodeId = this.nodeId;
115
27
  }
116
- return;
28
+ this.session.execute(msg);
117
29
  }
118
- const attach = method === VertoMethod.Attach;
119
- switch (method) {
120
- case VertoMethod.Ping:
121
- const msg = new Result(id, method);
122
- msg.targetNodeId = nodeId;
123
- return session.execute(msg);
124
- case VertoMethod.Punt:
125
- session.purge();
126
- return session.disconnect();
127
- case VertoMethod.Invite: {
128
- const call = _buildCall(session, params, attach, nodeId);
129
- call.setState(State.Ringing);
130
- const msg = new Result(id, method);
131
- msg.targetNodeId = nodeId;
132
- return session.execute(msg);
133
- }
134
- case VertoMethod.Attach: {
135
- const call = _buildCall(session, params, attach, nodeId);
136
- return trigger(call.id, params, method);
30
+ handleMessage(msg) {
31
+ const { session } = this;
32
+ const { id, method, params } = msg;
33
+ const { callID, eventChannel, eventType } = params;
34
+ const attach = method === VertoMethod.Attach;
35
+ if (eventType === 'channelPvtData') {
36
+ return this._handlePvtEvent(params.pvtData);
137
37
  }
138
- case VertoMethod.Event:
139
- case 'webrtc.event': {
140
- const { subscribedChannel } = params;
141
- if (subscribedChannel && trigger(session.relayProtocol, params, subscribedChannel)) {
38
+ if (callID && session.calls.hasOwnProperty(callID)) {
39
+ if (attach) {
40
+ session.calls[callID].hangup({}, false);
41
+ }
42
+ else {
43
+ session.calls[callID].handleMessage(msg);
44
+ this._ack(id, method);
142
45
  return;
143
46
  }
144
- if (eventChannel) {
145
- const channelType = eventChannel.split('.')[0];
146
- const global = trigger(session.relayProtocol, params, channelType);
147
- let specific = false;
148
- if (channelType !== eventChannel) {
149
- specific = trigger(session.relayProtocol, params, eventChannel);
47
+ }
48
+ const _buildCall = () => {
49
+ const call = new Call(session, {
50
+ id: callID,
51
+ remoteSdp: params.sdp,
52
+ destinationNumber: params.callee_id_number,
53
+ remoteCallerName: params.caller_id_name,
54
+ remoteCallerNumber: params.caller_id_number,
55
+ callerName: params.callee_id_name,
56
+ callerNumber: params.callee_id_number,
57
+ attach
58
+ });
59
+ call.nodeId = this.nodeId;
60
+ return call;
61
+ };
62
+ switch (method) {
63
+ case VertoMethod.Punt:
64
+ session.disconnect();
65
+ break;
66
+ case VertoMethod.Invite: {
67
+ const call = _buildCall();
68
+ call.setState(State.Ringing);
69
+ this._ack(id, method);
70
+ break;
71
+ }
72
+ case VertoMethod.Attach: {
73
+ const call = _buildCall();
74
+ if (this.session.autoRecoverCalls) {
75
+ call.answer();
76
+ }
77
+ else {
78
+ call.setState(State.Recovering);
150
79
  }
151
- if (global || specific) {
80
+ call.handleMessage(msg);
81
+ break;
82
+ }
83
+ case VertoMethod.Event:
84
+ case 'webrtc.event':
85
+ if (!eventChannel) {
86
+ logger.error('Verto received an unknown event:', params);
152
87
  return;
153
88
  }
89
+ const protocol = session.relayProtocol;
90
+ const firstValue = eventChannel.split('.')[0];
91
+ if (session._existsSubscription(protocol, eventChannel)) {
92
+ trigger(protocol, params, eventChannel);
93
+ }
94
+ else if (eventChannel === session.sessionid) {
95
+ this._handleSessionEvent(params.eventData);
96
+ }
97
+ else if (session._existsSubscription(protocol, firstValue)) {
98
+ trigger(protocol, params, firstValue);
99
+ }
100
+ else if (session.calls.hasOwnProperty(eventChannel)) {
101
+ session.calls[eventChannel].handleMessage(msg);
102
+ }
103
+ else {
104
+ trigger(SwEvent.Notification, params, session.uuid);
105
+ }
106
+ break;
107
+ case VertoMethod.Info:
108
+ params.type = NOTIFICATION_TYPE.generic;
109
+ trigger(SwEvent.Notification, params, session.uuid);
110
+ break;
111
+ case VertoMethod.ClientReady:
112
+ params.type = NOTIFICATION_TYPE.vertoClientReady;
113
+ trigger(SwEvent.Notification, params, session.uuid);
114
+ break;
115
+ default:
116
+ logger.warn('Verto message unknown method:', msg);
117
+ }
118
+ }
119
+ _retrieveCallId(packet, laChannel) {
120
+ const callIds = Object.keys(this.session.calls);
121
+ if (packet.action === 'bootObj') {
122
+ const me = packet.data.find((pr) => callIds.includes(pr[0]));
123
+ if (me instanceof Array) {
124
+ return me[0];
154
125
  }
155
- params.type = Notification.Generic;
156
- return trigger(SwEvent.Notification, params, session.uuid);
157
126
  }
158
- case VertoMethod.Info:
159
- params.type = Notification.Generic;
160
- return trigger(SwEvent.Notification, params, session.uuid);
161
- case VertoMethod.ClientReady:
162
- params.type = Notification.VertoClientReady;
163
- return trigger(SwEvent.Notification, params, session.uuid);
164
- case VertoMethod.Announce:
165
- params.type = Notification.Announce;
166
- return trigger(SwEvent.Notification, params, session.uuid);
167
- default:
168
- logger.debug('Unknown Verto method:', method, params);
169
- params.type = method;
170
- return trigger(SwEvent.Notification, params, session.uuid);
127
+ else {
128
+ return callIds.find((id) => this.session.calls[id].channels.includes(laChannel));
129
+ }
171
130
  }
172
- };
131
+ _handlePvtEvent(pvtData) {
132
+ return __awaiter(this, void 0, void 0, function* () {
133
+ const { session } = this;
134
+ const protocol = session.relayProtocol;
135
+ const { action, laChannel, laName, chatChannel, infoChannel, modChannel, conferenceMemberID, role, callID } = pvtData;
136
+ switch (action) {
137
+ case 'conference-liveArray-join': {
138
+ const _liveArrayBootstrap = () => {
139
+ session.vertoBroadcast({ nodeId: this.nodeId, channel: laChannel, data: { liveArray: { command: 'bootstrap', context: laChannel, name: laName } } });
140
+ };
141
+ const tmp = {
142
+ nodeId: this.nodeId,
143
+ channels: [laChannel],
144
+ handler: ({ data: packet }) => {
145
+ const id = callID || this._retrieveCallId(packet, laChannel);
146
+ if (id && session.calls.hasOwnProperty(id)) {
147
+ const call = session.calls[id];
148
+ call._addChannel(laChannel);
149
+ call.extension = laName;
150
+ call.handleConferenceUpdate(packet, pvtData)
151
+ .then(error => {
152
+ if (error === 'INVALID_PACKET') {
153
+ _liveArrayBootstrap();
154
+ }
155
+ });
156
+ }
157
+ }
158
+ };
159
+ const result = yield session.vertoSubscribe(tmp)
160
+ .catch(error => {
161
+ logger.error('liveArray subscription error:', error);
162
+ });
163
+ if (checkSubscribeResponse(result, laChannel)) {
164
+ _liveArrayBootstrap();
165
+ }
166
+ break;
167
+ }
168
+ case 'conference-liveArray-part': {
169
+ let call = null;
170
+ if (laChannel && session._existsSubscription(protocol, laChannel)) {
171
+ const { callId = null } = session.subscriptions[protocol][laChannel];
172
+ call = session.calls[callId] || null;
173
+ if (callId !== null) {
174
+ const notification = { type: NOTIFICATION_TYPE.conferenceUpdate, action: ConferenceAction.Leave, conferenceName: laName, participantId: Number(conferenceMemberID), role };
175
+ if (!trigger(SwEvent.Notification, notification, callId, false)) {
176
+ trigger(SwEvent.Notification, notification, session.uuid);
177
+ }
178
+ if (call === null) {
179
+ deRegister(SwEvent.Notification, null, callId);
180
+ }
181
+ }
182
+ }
183
+ const channels = [laChannel, chatChannel, infoChannel, modChannel];
184
+ session.vertoUnsubscribe({ nodeId: this.nodeId, channels })
185
+ .then(({ unsubscribedChannels = [] }) => {
186
+ if (call) {
187
+ call.channels = call.channels.filter(c => !unsubscribedChannels.includes(c));
188
+ }
189
+ })
190
+ .catch(error => {
191
+ logger.error('liveArray unsubscribe error:', error);
192
+ });
193
+ break;
194
+ }
195
+ }
196
+ });
197
+ }
198
+ _handleSessionEvent(eventData) {
199
+ switch (eventData.contentType) {
200
+ case 'layout-info':
201
+ case 'layer-info':
202
+ MCULayoutEventHandler(this.session, eventData);
203
+ break;
204
+ case 'logo-info': {
205
+ const notification = { type: NOTIFICATION_TYPE.conferenceUpdate, action: ConferenceAction.LogoInfo, logo: eventData.logoURL };
206
+ trigger(SwEvent.Notification, notification, this.session.uuid);
207
+ break;
208
+ }
209
+ }
210
+ }
211
+ }
212
+ export default VertoHandler;
@@ -21,31 +21,18 @@ export declare enum VertoMethod {
21
21
  Subscribe = "verto.subscribe",
22
22
  Unsubscribe = "verto.unsubscribe",
23
23
  ClientReady = "verto.clientReady",
24
- Modify = "verto.modify",
25
- MediaParams = "verto.mediaParams",
26
- Prompt = "verto.prompt",
27
- JsApi = "jsapi",
28
- Stats = "verto.stats",
29
- Ping = "verto.ping",
30
- Announce = "verto.announce"
31
- }
32
- export declare enum Notification {
33
- Generic = "event",
34
- ParticipantData = "participantData",
35
- ConferenceUpdate = "conferenceUpdate",
36
- CallUpdate = "callUpdate",
37
- VertoClientReady = "vertoClientReady",
38
- UserMediaError = "userMediaError",
39
- RefreshToken = "refreshToken",
40
- Prompt = "prompt",
41
- Announce = "announce",
42
- DeviceUpdated = "deviceUpdated",
43
- MediaParams = "mediaParams",
44
- ConferenceListBootstrap = "conferenceListBootstrap",
45
- ConferenceListAdd = "conferenceListAdd",
46
- ConferenceListModify = "conferenceListModify",
47
- ConferenceListDelete = "conferenceListDelete"
24
+ Modify = "verto.modify"
48
25
  }
26
+ export declare const NOTIFICATION_TYPE: {
27
+ generic: string;
28
+ "verto.display": string;
29
+ "verto.attach": string;
30
+ conferenceUpdate: string;
31
+ callUpdate: string;
32
+ vertoClientReady: string;
33
+ userMediaError: string;
34
+ refreshToken: string;
35
+ };
49
36
  export declare const DEFAULT_CALL_OPTIONS: CallOptions;
50
37
  export declare enum State {
51
38
  New = 0,
@@ -78,10 +65,7 @@ export declare enum ConferenceAction {
78
65
  LogoInfo = "logoInfo",
79
66
  LayoutInfo = "layoutInfo",
80
67
  LayoutList = "layoutList",
81
- ModCmdResponse = "modCommandResponse",
82
- ConferenceInfo = "conferenceInfo",
83
- CaptionInfo = "captionInfo",
84
- MemberTalkState = "memberTalkState"
68
+ ModCmdResponse = "modCommandResponse"
85
69
  }
86
70
  export declare enum DeviceType {
87
71
  Video = "videoinput",
@@ -24,31 +24,17 @@ export var VertoMethod;
24
24
  VertoMethod["Unsubscribe"] = "verto.unsubscribe";
25
25
  VertoMethod["ClientReady"] = "verto.clientReady";
26
26
  VertoMethod["Modify"] = "verto.modify";
27
- VertoMethod["MediaParams"] = "verto.mediaParams";
28
- VertoMethod["Prompt"] = "verto.prompt";
29
- VertoMethod["JsApi"] = "jsapi";
30
- VertoMethod["Stats"] = "verto.stats";
31
- VertoMethod["Ping"] = "verto.ping";
32
- VertoMethod["Announce"] = "verto.announce";
33
27
  })(VertoMethod || (VertoMethod = {}));
34
- export var Notification;
35
- (function (Notification) {
36
- Notification["Generic"] = "event";
37
- Notification["ParticipantData"] = "participantData";
38
- Notification["ConferenceUpdate"] = "conferenceUpdate";
39
- Notification["CallUpdate"] = "callUpdate";
40
- Notification["VertoClientReady"] = "vertoClientReady";
41
- Notification["UserMediaError"] = "userMediaError";
42
- Notification["RefreshToken"] = "refreshToken";
43
- Notification["Prompt"] = "prompt";
44
- Notification["Announce"] = "announce";
45
- Notification["DeviceUpdated"] = "deviceUpdated";
46
- Notification["MediaParams"] = "mediaParams";
47
- Notification["ConferenceListBootstrap"] = "conferenceListBootstrap";
48
- Notification["ConferenceListAdd"] = "conferenceListAdd";
49
- Notification["ConferenceListModify"] = "conferenceListModify";
50
- Notification["ConferenceListDelete"] = "conferenceListDelete";
51
- })(Notification || (Notification = {}));
28
+ export const NOTIFICATION_TYPE = {
29
+ generic: 'event',
30
+ [VertoMethod.Display]: 'participantData',
31
+ [VertoMethod.Attach]: 'participantData',
32
+ conferenceUpdate: 'conferenceUpdate',
33
+ callUpdate: 'callUpdate',
34
+ vertoClientReady: 'vertoClientReady',
35
+ userMediaError: 'userMediaError',
36
+ refreshToken: 'refreshToken',
37
+ };
52
38
  export const DEFAULT_CALL_OPTIONS = {
53
39
  destinationNumber: '',
54
40
  remoteCallerName: 'Outbound Call',
@@ -56,17 +42,11 @@ export const DEFAULT_CALL_OPTIONS = {
56
42
  callerName: '',
57
43
  callerNumber: '',
58
44
  audio: true,
59
- video: true,
45
+ video: false,
60
46
  useStereo: false,
61
47
  attach: false,
62
48
  screenShare: false,
63
- secondSource: false,
64
49
  userVariables: {},
65
- requestTimeout: 10 * 1000,
66
- experimental: false,
67
- autoApplyMediaParams: true,
68
- iceGatheringTimeout: 2 * 1000,
69
- maxIceGatheringTimeout: 5 * 1000,
70
50
  };
71
51
  export var State;
72
52
  (function (State) {
@@ -103,9 +83,6 @@ export var ConferenceAction;
103
83
  ConferenceAction["LayoutInfo"] = "layoutInfo";
104
84
  ConferenceAction["LayoutList"] = "layoutList";
105
85
  ConferenceAction["ModCmdResponse"] = "modCommandResponse";
106
- ConferenceAction["ConferenceInfo"] = "conferenceInfo";
107
- ConferenceAction["CaptionInfo"] = "captionInfo";
108
- ConferenceAction["MemberTalkState"] = "memberTalkState";
109
86
  })(ConferenceAction || (ConferenceAction = {}));
110
87
  export var DeviceType;
111
88
  (function (DeviceType) {
@@ -1,7 +1,14 @@
1
- import { CallOptions, IVertoCanvasInfo, ICanvasInfo, IConferenceInfo, ILayout, IVertoLayout } from './interfaces';
2
- export declare const getUserMedia: (constraints: MediaStreamConstraints) => Promise<MediaStream>;
3
- export declare const removeUnsupportedConstraints: (constraints: MediaTrackConstraints) => void;
4
- export declare const getMediaConstraints: (options: CallOptions) => Promise<MediaStreamConstraints>;
1
+ import { CallOptions } from './interfaces';
2
+ declare const getUserMedia: (constraints: MediaStreamConstraints) => Promise<MediaStream>;
3
+ declare const getDevices: (kind?: string, fullList?: boolean) => Promise<MediaDeviceInfo[]>;
4
+ declare const scanResolutions: (deviceId: string) => Promise<any[]>;
5
+ declare const getMediaConstraints: (options: CallOptions) => Promise<MediaStreamConstraints>;
6
+ declare const assureDeviceId: (id: string, label: string, kind: MediaDeviceKind) => Promise<string>;
7
+ declare const removeUnsupportedConstraints: (constraints: MediaTrackConstraints) => void;
8
+ declare const checkDeviceIdConstraints: (id: string, label: string, kind: MediaDeviceKind, constraints: MediaTrackConstraints) => Promise<MediaTrackConstraints>;
9
+ declare const sdpStereoHack: (sdp: string) => string;
10
+ declare const sdpMediaOrderHack: (answer: string, localOffer: string) => string;
11
+ declare const checkSubscribeResponse: (response: any, channel: string) => boolean;
5
12
  declare type DestructuredResult = {
6
13
  subscribed: string[];
7
14
  alreadySubscribed: string[];
@@ -9,17 +16,12 @@ declare type DestructuredResult = {
9
16
  unsubscribed: string[];
10
17
  notSubscribed: string[];
11
18
  };
12
- export declare const destructSubscribeResponse: (response: any) => DestructuredResult;
13
- export declare const enableAudioTracks: (stream: MediaStream) => void;
14
- export declare const disableAudioTracks: (stream: MediaStream) => void;
15
- export declare const toggleAudioTracks: (stream: MediaStream) => void;
16
- export declare const enableVideoTracks: (stream: MediaStream) => void;
17
- export declare const disableVideoTracks: (stream: MediaStream) => void;
18
- export declare const toggleVideoTracks: (stream: MediaStream) => void;
19
- export declare const mutateCanvasInfoData: (canvasInfo: IVertoCanvasInfo) => ICanvasInfo;
20
- export declare const checkIsDirectCall: ({ variables }: {
21
- variables: any;
22
- }) => boolean;
23
- export declare const destructConferenceState: (confState: any) => IConferenceInfo;
24
- export declare const mungeLayoutList: (layouts: IVertoLayout[], layoutGroups: IVertoLayout[]) => ILayout[];
25
- export {};
19
+ declare const destructSubscribeResponse: (response: any) => DestructuredResult;
20
+ declare const enableAudioTracks: (stream: MediaStream) => void;
21
+ declare const disableAudioTracks: (stream: MediaStream) => void;
22
+ declare const toggleAudioTracks: (stream: MediaStream) => void;
23
+ declare const enableVideoTracks: (stream: MediaStream) => void;
24
+ declare const disableVideoTracks: (stream: MediaStream) => void;
25
+ declare const toggleVideoTracks: (stream: MediaStream) => void;
26
+ declare const sdpBitrateHack: (sdp: string, max: number, min: number, start: number) => string;
27
+ export { getUserMedia, getDevices, scanResolutions, getMediaConstraints, assureDeviceId, removeUnsupportedConstraints, checkDeviceIdConstraints, sdpStereoHack, sdpMediaOrderHack, sdpBitrateHack, checkSubscribeResponse, destructSubscribeResponse, enableAudioTracks, disableAudioTracks, toggleAudioTracks, enableVideoTracks, disableVideoTracks, toggleVideoTracks, };