bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/app/service.js

47 lines
1.2 KiB
JavaScript
Raw Normal View History

import Breakouts from '/imports/api/breakouts';
2019-04-06 02:10:05 +08:00
import Meetings from '/imports/api/meetings';
2017-03-29 02:41:48 +08:00
import Settings from '/imports/ui/services/settings';
2017-08-12 01:14:50 +08:00
import Auth from '/imports/ui/services/auth/index';
const getCaptionsStatus = () => {
2017-04-06 19:46:15 +08:00
const ccSettings = Settings.cc;
return ccSettings ? ccSettings.enabled : false;
};
const getFontSize = () => {
2017-04-06 19:46:15 +08:00
const applicationSettings = Settings.application;
return applicationSettings ? applicationSettings.fontSize : '16px';
};
2018-10-24 01:18:09 +08:00
const getBreakoutRooms = () => Breakouts.find().fetch();
2019-04-06 02:10:05 +08:00
const getMeeting = () => {
const { meetingID } = Auth;
return Meetings.findOne({ meetingId: meetingID });
};
function meetingIsBreakout() {
2019-04-06 02:10:05 +08:00
const meeting = getMeeting();
return (meeting && meeting.meetingProp.isBreakout);
}
const validIOSVersion = () => {
const SUPPORTED_OS_VERSION = 12.2;
const iosMatch = navigator.userAgent.match(/OS (\d+)_(\d+)/);
if (iosMatch) {
const versionNumber = iosMatch[0].split(' ')[1].replace('_', '.');
const isInvalid = parseFloat(versionNumber) < SUPPORTED_OS_VERSION;
if (isInvalid) return false;
}
return true;
};
2016-05-13 03:50:02 +08:00
export {
getCaptionsStatus,
getFontSize,
meetingIsBreakout,
2018-10-24 01:18:09 +08:00
getBreakoutRooms,
2019-04-06 02:10:05 +08:00
getMeeting,
validIOSVersion,
2016-05-12 23:41:51 +08:00
};