bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/audio/service.js
Anton Georgiev 5087e5b24b Handle audio on refactored modal (#2)
* handle audio on refactored modal

* wrap component with withModalMounter
2017-05-02 13:18:01 -04:00

41 lines
988 B
JavaScript
Executable File

import React from 'react';
import AudioModal from './audio-modal/component';
import Meetings from '/imports/api/meetings';
import Users from '/imports/api/users';
import Auth from '/imports/ui/services/auth';
import AudioManager from '/imports/api/audio/client/manager';
let audioManager = undefined;
const init = () => {
const userId = Auth.userID;
const User = Users.findOne({ userId });
const username = User.user.name;
const Meeting = Meetings.findOne(); //TODO test this with Breakouts
const turns = Meeting.turns;
const stuns = Meeting.stuns;
const voiceBridge = Meeting.voiceConf;
const userData = {
userId,
username,
turns,
stuns,
voiceBridge,
};
audioManager = new AudioManager(userData);
};
let exitAudio = () => audioManager.exitAudio();
let joinListenOnly = () => audioManager.joinAudio(true);
let joinMicrophone = () => audioManager.joinAudio(false);
export default {
init,
exitAudio,
joinListenOnly,
joinMicrophone,
};