2017-09-19 21:53:27 +08:00
|
|
|
import { makeCall } from '/imports/ui/services/api';
|
2017-12-09 00:38:51 +08:00
|
|
|
import Users from '/imports/api/users';
|
|
|
|
import { createContainer } from 'meteor/react-meteor-data';
|
2017-09-01 23:26:57 +08:00
|
|
|
|
2017-09-20 11:12:10 +08:00
|
|
|
const joinVideo = () => {
|
|
|
|
var joinVideoEvent = new Event('joinVideo');
|
|
|
|
document.dispatchEvent(joinVideoEvent);
|
|
|
|
}
|
|
|
|
|
|
|
|
const exitVideo = () => {
|
|
|
|
var exitVideoEvent = new Event('exitVideo');
|
|
|
|
document.dispatchEvent(exitVideoEvent);
|
|
|
|
}
|
|
|
|
|
2017-09-19 21:53:27 +08:00
|
|
|
const sendUserShareWebcam = (stream) => {
|
|
|
|
makeCall('userShareWebcam', stream);
|
2017-09-01 23:26:57 +08:00
|
|
|
};
|
|
|
|
|
2017-09-19 21:53:27 +08:00
|
|
|
const sendUserUnshareWebcam = (stream) => {
|
|
|
|
makeCall('userUnshareWebcam', stream);
|
2017-09-01 23:26:57 +08:00
|
|
|
};
|
|
|
|
|
2017-12-09 00:38:51 +08:00
|
|
|
const getAllUsers = () => {
|
|
|
|
return Users.find().fetch();
|
|
|
|
}
|
|
|
|
|
2017-09-01 23:26:57 +08:00
|
|
|
export default {
|
2017-12-09 00:38:51 +08:00
|
|
|
sendUserShareWebcam, sendUserUnshareWebcam, joinVideo, exitVideo, getAllUsers,
|
2017-09-01 23:26:57 +08:00
|
|
|
};
|