The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/packages/rocketchat-videobridge/client/views/videoFlexTabBbb.js

61 lines
1.7 KiB

import { Meteor } from 'meteor/meteor';
import { Template } from 'meteor/templating';
import { RocketChat } from 'meteor/rocketchat:lib';
import { popout } from 'meteor/rocketchat:ui';
Template.videoFlexTabBbb.helpers({
openInNewWindow() {
return RocketChat.settings.get('Jitsi_Open_New_Window');
},
live() {
const isLive = RocketChat.models.Rooms.findOne({ _id: this.rid, 'streamingOptions.type': 'call' }, { fields: { streamingOptions: 1 } }) != null;
if (isLive === false && popout.context) {
popout.close();
}
return isLive;
},
callManagement() {
const type = RocketChat.models.Rooms.findOne({ _id: this.rid }).t;
return type === 'd' || RocketChat.authz.hasAllPermission('call-management') || RocketChat.authz.hasAllPermission('call-management', this.rid);
},
});
Template.videoFlexTabBbb.onCreated(function() {
this.tabBar = Template.currentData().tabBar;
});
Template.videoFlexTabBbb.events({
'click .js-join-meeting'(e) {
$(e.currentTarget).prop('disabled', true);
Meteor.call('bbbJoin', { rid: this.rid }, (err, result) => {
$(e.currentTarget).prop('disabled', false);
console.log(err, result);
if (result) {
popout.open({
content: 'bbbLiveView',
data: {
source: result.url,
streamingOptions: result,
canOpenExternal: true,
showVideoControls: false,
},
onCloseCallback: () => console.log('bye popout'),
});
}
});
// Get the link and open the iframe
},
'click .js-end-meeting'(e) {
$(e.currentTarget).prop('disabled', true);
Meteor.call('bbbEnd', { rid: this.rid }, (err, result) => {
// $(e.currentTarget).prop('disabled', false);
console.log(err, result);
});
// Get the link and open the iframe
},
});