@signalwire/js
Advanced tools
Comparing version 1.3.0-alpha.14 to 1.3.0-alpha.15
@@ -90,2 +90,12 @@ import BaseSession from './BaseSession'; | ||
unwatchVertoConferenceList: () => Promise<void>; | ||
vertoSubscribeToConference({ infoChannel, modChannel, laChannel }: { | ||
infoChannel?: string; | ||
modChannel?: string; | ||
laChannel?: string; | ||
}): Promise<void>; | ||
vertoUnsubscribeFromConference({ infoChannel, modChannel, laChannel }: { | ||
infoChannel?: string; | ||
modChannel?: string; | ||
laChannel?: string; | ||
}): Promise<void>; | ||
} |
@@ -492,2 +492,51 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
} | ||
vertoSubscribeToConference({ infoChannel, modChannel, laChannel }) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
try { | ||
const channels = [ | ||
infoChannel, | ||
modChannel, | ||
laChannel, | ||
].filter(Boolean); | ||
if (!(channels === null || channels === void 0 ? void 0 : channels.length)) { | ||
return; | ||
} | ||
this._detachChannels(channels); | ||
const result = yield this.vertoSubscribe({ channels }); | ||
const { subscribed = [], alreadySubscribed = [] } = destructSubscribeResponse(result); | ||
const all = subscribed.concat(alreadySubscribed); | ||
if (all.includes(infoChannel)) { | ||
this._addSubscription(this.relayProtocol, infoChannelHandler.bind(this, this), infoChannel); | ||
} | ||
if (all.includes(modChannel)) { | ||
this._addSubscription(this.relayProtocol, modChannelHandler.bind(this, this), modChannel); | ||
} | ||
} | ||
catch (error) { | ||
console.error('vertoSubscribeToConference error', error); | ||
} | ||
}); | ||
} | ||
vertoUnsubscribeFromConference({ infoChannel, modChannel, laChannel }) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
try { | ||
const channels = [ | ||
infoChannel, | ||
modChannel, | ||
laChannel, | ||
].filter(Boolean); | ||
if (!(channels === null || channels === void 0 ? void 0 : channels.length)) { | ||
return; | ||
} | ||
this._detachChannels(channels); | ||
yield this.vertoUnsubscribe({ | ||
nodeId: this.nodeid, | ||
channels | ||
}); | ||
} | ||
catch (error) { | ||
console.error('vertoUnsubscribeFromConference error', error); | ||
} | ||
}); | ||
} | ||
} |
@@ -6,2 +6,3 @@ import BrowserSession from '../BrowserSession'; | ||
listVideoLayouts: () => any; | ||
getConferenceState: () => any; | ||
playMedia: (file: string) => any; | ||
@@ -8,0 +9,0 @@ stopMedia: () => any; |
@@ -13,3 +13,3 @@ var __rest = (this && this.__rest) || function (s, e) { | ||
import { ConferenceAction } from './constants'; | ||
import { mungeLayoutList } from './helpers'; | ||
import { mungeLayoutList, destructConferenceState } from './helpers'; | ||
export default function modChannelHandler(session, { data, eventChannel, eventSerno = null }) { | ||
@@ -19,3 +19,3 @@ const callIds = session.channelToCallIds.get(eventChannel) || []; | ||
switch (data['conf-command']) { | ||
case 'list-videoLayouts': | ||
case 'list-videoLayouts': { | ||
if (data.responseData) { | ||
@@ -28,2 +28,9 @@ const normal = data.responseData.filter(({ type }) => type === 'layout'); | ||
break; | ||
} | ||
case 'getConferenceState': { | ||
if (data.responseData) { | ||
_dispatch(session, { action: ConferenceAction.ConferenceInfo, eventChannel, eventSerno, conferenceState: destructConferenceState(data.responseData), messages: [] }, callIds); | ||
} | ||
break; | ||
} | ||
default: | ||
@@ -62,2 +69,6 @@ params = { action: ConferenceAction.ModCmdResponse, eventChannel, eventSerno, command: data['conf-command'], response: data.response }; | ||
}, | ||
getConferenceState: function () { | ||
const params = { command: 'getConferenceState' }; | ||
return _modCommand.call(this, params); | ||
}, | ||
playMedia: function (file) { | ||
@@ -64,0 +75,0 @@ return _modCommand.call(this, { command: 'play', value: file }); |
import Relay from './src/SignalWire'; | ||
import Verto from './src/Verto'; | ||
import CantinaAuth from '../common/src/webrtc/CantinaAuth'; | ||
export declare const VERSION = "1.3.0-alpha.14"; | ||
export declare const VERSION = "1.3.0-alpha.15"; | ||
export { Relay, Verto, CantinaAuth }; | ||
@@ -6,0 +6,0 @@ export * from '../common/src/webrtc/deviceHelpers'; |
@@ -5,5 +5,5 @@ import Relay from './src/SignalWire'; | ||
import CantinaAuth from '../common/src/webrtc/CantinaAuth'; | ||
export const VERSION = '1.3.0-alpha.14'; | ||
export const VERSION = '1.3.0-alpha.15'; | ||
setAgentName(`JavaScript SDK/${VERSION}`); | ||
export { Relay, Verto, CantinaAuth }; | ||
export * from '../common/src/webrtc/deviceHelpers'; |
{ | ||
"name": "@signalwire/js", | ||
"version": "1.3.0-alpha.14", | ||
"version": "1.3.0-alpha.15", | ||
"description": "Relay SDK for JavaScript to connect to SignalWire.", | ||
@@ -5,0 +5,0 @@ "author": "SignalWire Team <open.source@signalwire.com>", |
Sorry, the diff of this file is too big to display
407114
5992