bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/settings/submenus/closed-captions/service.js

26 lines
662 B
JavaScript
Raw Normal View History

2016-12-23 16:26:22 +08:00
import Storage from '/imports/ui/services/storage/session';
import Captions from '/imports/api/captions';
getClosedCaptionSettings = () => {
let ccSettings = {};
let ccEnabled = Storage.getItem('closedCaptions');
2016-12-24 02:49:17 +08:00
ccSettings.ccEnabled = !!ccEnabled;
2016-12-23 16:26:22 +08:00
//list of unique locales in the Captions Collection
let locales = _.uniq(Captions.find({}, {
sort: { locale: 1 },
fields: { locale: true },
}).fetch().map(function (obj) {
return obj.locale;
}), true);
//adding the list of active locales to the closed-captions settings object
2016-12-24 02:49:17 +08:00
ccSettings.locales = locales;
2016-12-23 16:26:22 +08:00
return ccSettings;
}
export default {
getClosedCaptionSettings,
};