This commit is contained in:
Ryan Cavanaugh
2016-07-30 07:59:46 -07:00
parent 0cf6a5c259
commit 0cccb7f2b8
2 changed files with 12 additions and 12 deletions
+4 -4
View File
@@ -80,7 +80,7 @@ declare namespace VoxImplant {
TransferFailed
}
namespace Events {
namespace EventTypes {
/**
* Event dispatched after login , loginWithOneTimeKey, requestOneTimeLoginKey or loginWithCode function call
@@ -989,9 +989,9 @@ declare namespace VoxImplant {
}
type VoxImplantEvent = Events.AuthResult | Events.ConnectionClosed | Events.ConnectionEstablished |
Events.ConnectionFailed | Events.IncomingCall | Events.MicAccessResult |
Events.NetStatsReceived | Events.PlaybackFinished | Events.SDKReady | Events.SourcesInfoUpdated;
type VoxImplantEvent = EventTypes.AuthResult | EventTypes.ConnectionClosed | EventTypes.ConnectionEstablished |
EventTypes.ConnectionFailed | EventTypes.IncomingCall | EventTypes.MicAccessResult |
EventTypes.NetStatsReceived | EventTypes.PlaybackFinished | EventTypes.SDKReady | EventTypes.SourcesInfoUpdated;
type VoxImplantCallEvent = CallEvents.Connected | CallEvents.Disconnected | CallEvents.Failed |
+8 -8
View File
@@ -7,25 +7,25 @@ vox.init({
micRequired: true
});
vox.addEventListener(VoxImplant.Events.SDKReady, function(event: VoxImplant.Events.SDKReady) {
vox.addEventListener(VoxImplant.Events.SDKReady, function(event: VoxImplant.EventTypes.SDKReady) {
console.log("VoxImplant SDK ver. " + event.version + " initialized");
vox.connect();
});
vox.addEventListener(VoxImplant.Events.ConnectionEstablished, function(event: VoxImplant.Events.ConnectionEstablished) {
vox.addEventListener(VoxImplant.Events.ConnectionEstablished, function(event: VoxImplant.EventTypes.ConnectionEstablished) {
console.log("Connection established");
vox.login("username", "password");
});
vox.addEventListener(VoxImplant.Events.ConnectionClosed, function(event: VoxImplant.Events.ConnectionClosed) {
vox.addEventListener(VoxImplant.Events.ConnectionClosed, function(event: VoxImplant.EventTypes.ConnectionClosed) {
console.log("Connection closed");
});
vox.addEventListener(VoxImplant.Events.ConnectionFailed, function(event: VoxImplant.Events.ConnectionFailed) {
vox.addEventListener(VoxImplant.Events.ConnectionFailed, function(event: VoxImplant.EventTypes.ConnectionFailed) {
console.log("Connection failed. Reason: " + event.message);
});
vox.addEventListener(VoxImplant.Events.AuthResult, function(event: VoxImplant.Events.AuthResult) {
vox.addEventListener(VoxImplant.Events.AuthResult, function(event: VoxImplant.EventTypes.AuthResult) {
if (event.result === true) {
// Authorized successfully
console.log("Logged in as " + event.displayName);
@@ -48,11 +48,11 @@ vox.addEventListener(VoxImplant.Events.AuthResult, function(event: VoxImplant.Ev
}
});
vox.addEventListener(VoxImplant.Events.MicAccessResult, function(event: VoxImplant.Events.MicAccessResult) {
vox.addEventListener(VoxImplant.Events.MicAccessResult, function(event: VoxImplant.EventTypes.MicAccessResult) {
console.log("Microphone access allowed: " + event.result);
});
vox.addEventListener(VoxImplant.Events.IncomingCall, function(event: VoxImplant.Events.IncomingCall) {
vox.addEventListener(VoxImplant.Events.IncomingCall, function(event: VoxImplant.EventTypes.IncomingCall) {
call = event.call;
call.addEventListener(VoxImplant.CallEvents.Connected, function(callevent: VoxImplant.CallEvents.Connected) {
console.log("Inbound Call Connected");
@@ -67,7 +67,7 @@ vox.addEventListener(VoxImplant.IMEvents.MessageReceived, function(event: VoxImp
console.log("Message received: " + event.content + " from " + event.id + " id " + event.message_id);
});
vox.addEventListener(VoxImplant.Events.SourcesInfoUpdated, function(event: VoxImplant.Events.SourcesInfoUpdated) {
vox.addEventListener(VoxImplant.Events.SourcesInfoUpdated, function(event: VoxImplant.EventTypes.SourcesInfoUpdated) {
var audioSources: VoxImplant.AudioSourceInfo[] = vox.audioSources(),
videoSources: VoxImplant.VideoSourceInfo[] = vox.videoSources();
console.log("Received recording sources data:");