Adds verto manager window functions

This commit is contained in:
perroned 2016-06-17 17:47:24 +00:00
parent 7ae2da4e9d
commit 86035fce39
6 changed files with 83 additions and 31 deletions

View File

@ -226,7 +226,6 @@
}
function doCallback(self, func, arg) {
debugger;
if (func in self.options.callbacks) {
self.options.callbacks[func](self, arg);
}

View File

@ -458,7 +458,7 @@ VertoManager.prototype.shareScreen = function (
conferenceIdNumber,
userCallback,
credentials,
chromeExtension) {
chromeExtension) {
// this.exitVideo();
this.vertoScreenShare = new Verto(
voiceBridge,
@ -470,3 +470,66 @@ chromeExtension) {
);
this.vertoScreenShare.setScreenShare(tag);
};
window.flashVertoInitialize = function () {
if (window.vertoManager = null || window.vertoManager == undefined) {
window.vertoManager = new VertoManager();
}
};
window.vertoJoinListenOnly = function (
tag,
voiceBridge,
conferenceUsername,
conferenceIdNumber,
userCallback,
credentials
) {
window.flashVertoInitialize();
window.vertoManager.joinListenOnly(
tag,
voiceBridge,
conferenceUsername,
conferenceIdNumber,
userCallback,
credentials
);
};
window.vertoJoinMicrophone = function (
tag,
voiceBridge,
conferenceUsername,
conferenceIdNumber,
userCallback,
credentials
) {
window.flashVertoInitialize();
window.vertoManager.joinMicrophone(
tag,
voiceBridge,
conferenceUsername,
conferenceIdNumber,
userCallback,
credentials
);
};
window.vertoWatchVideo = function (
tag,
voiceBridge,
conferenceUsername,
conferenceIdNumber,
userCallback,
credentials
) {
window.flashVertoInitialize();
window.vertoManager.joinWatchVideo(
tag,
voiceBridge,
conferenceUsername,
conferenceIdNumber,
userCallback,
credentials
);
};

View File

@ -3,7 +3,6 @@ import { Meteor } from 'meteor/meteor';
import { render } from 'react-dom';
import { renderRoutes } from '../imports/startup/client/routes.js';
import { IntlProvider, addLocaleData } from 'react-intl';
import {vertoInitialize} from '/imports/api/verto';
import Locales from '../imports/locales';
@ -52,7 +51,7 @@ Meteor.startup(() => {
loadLib('jquery.json-2.4.min.js');
loadLib('jquery.FSRTC.js');
loadLib('jquery.verto.js');
loadLib('verto_extension.js', vertoInitialize);
loadLib('verto_extension.js');
loadLib('jquery.jsonrpcclient.js');
loadLib('verto_extension_share.js');

View File

@ -3,7 +3,7 @@ import Meetings from '/imports/api/meetings';
import Auth from '/imports/ui/services/auth';
import {callServer} from '/imports/ui/services/api';
import {clientConfig} from '/config';
import {exitVertoAudio, joinVertoListenOnly, joinVertoMicrophone} from '/imports/api/verto';
import {vertoExitAudio, vertoJoinListenOnly, vertoJoinMicrophone} from '/imports/api/verto';
let triedHangup = false;
@ -20,7 +20,7 @@ function amIListenOnly() {
// hangup, retry if a call is in progress, send the leave voice conference message to BBB
function exitAudio(afterExitCall) {
if (!clientConfig.media.useSIPAudio) {
exitVertoAudio();
vertoExitAudio();
return;
} else {
// To be called when the hangup is initiated
@ -107,7 +107,7 @@ function joinListenOnly() {
if (clientConfig.media.useSIPAudio) {
joinVoiceCallSIP({ isListenOnly: true });
} else {
joinVertoListenOnly();
vertoJoinListenOnly();
}
}
@ -115,7 +115,7 @@ function joinMicrophone() {
if (clientConfig.media.useSIPAudio) {
joinVoiceCallSIP({ isListenOnly: false });
} else {
joinVertoMicrophone();
vertoJoinMicrophone();
}
}

View File

@ -4,13 +4,6 @@ import Auth from '/imports/ui/services/auth';
import { clientConfig } from '/config';
import { getVoiceBridge } from '/imports/api/phone';
let vertoManager = null;
function vertoInitialize() {
console.log('verto initialized');
vertoManager = new VertoManager();
}
function createVertoUserName() {
const uid = Auth.getUser();
const uName = Users.findOne({ userId: uid }).user.name;
@ -27,12 +20,12 @@ function getVertoCredentials() {
};
}
function exitVertoAudio() {
vertoManager.exitAudio();
function vertoExitAudio() {
window.vertoExitAudio();
}
function joinVertoListenOnly() {
vertoManager.joinListenOnly(
function vertoJoinListenOnly() {
window.vertoJoinListenOnly(
'remote-media',
getVoiceBridge(),
createVertoUserName(),
@ -42,8 +35,8 @@ function joinVertoListenOnly() {
);
}
function joinVertoMicrophone() {
vertoManager.joinMicrophone(
function vertoJoinMicrophone() {
window.vertoJoinMicrophone(
'remote-media',
getVoiceBridge(),
createVertoUserName(),
@ -53,8 +46,8 @@ function joinVertoMicrophone() {
);
}
function watchVertoVideo() {
vertoManager.joinWatchVideo(
function vertoWatchVideo() {
window.vertoWatchVideo(
'deskshareVideo',
getVoiceBridge(),
createVertoUserName(),
@ -76,10 +69,9 @@ function shareVertoScreen() {
}
export {
joinVertoListenOnly,
joinVertoMicrophone,
watchVertoVideo,
exitVertoAudio,
vertoInitialize,
vertoJoinListenOnly,
vertoJoinMicrophone,
vertoWatchVideo,
vertoExitAudio,
shareVertoScreen,
};

View File

@ -1,8 +1,7 @@
import Deskshare from '/imports/api/deskshare';
import {conferenceUsername, joinVertoAudio, watchVertoVideo} from '/imports/api/verto';
import {createVertoUserName, vertoWatchVideo} from '/imports/api/verto';
import Auth from '/imports/ui/services/auth';
import {getVoiceBridge} from '/imports/api/phone';
import {createVertoUserName} from '/imports/api/verto';
// when the meeting information has been updated check to see if it was
// desksharing. If it has changed either trigger a call to receive video
@ -32,7 +31,7 @@ function watchDeskshare(options) {
const extension = options.extension || getVoiceBridge();
const conferenceUsername = createVertoUserName();
conferenceIdNumber = '1009';
watchVertoVideo({ extension, conferenceUsername, conferenceIdNumber,
vertoWatchVideo({ extension, conferenceUsername, conferenceIdNumber,
watchOnly: true, });
}