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/app/ui-vrecord/client/VRecDialog.js

50 lines
1004 B

import { Blaze } from 'meteor/blaze';
import { Template } from 'meteor/templating';
import { VideoRecorder } from '../../ui';
export const VRecDialog = new class {
opened = false;
dialogView = null;
init() {
this.dialogView = Blaze.render(Template.vrecDialog, document.body);
}
open(source, { rid, tmid }) {
if (!this.dialogView) {
this.init();
}
this.dialogView.templateInstance().update({
rid,
tmid,
input: source.querySelector('.js-input-message'),
});
this.source = source;
const dialog = $('.vrec-dialog');
this.dialogView.templateInstance().setPosition(dialog, source);
dialog.addClass('show');
this.opened = true;
return this.initializeCamera();
}
close() {
$('.vrec-dialog').removeClass('show');
this.opened = false;
if (this.video != null) {
return VideoRecorder.stop();
}
}
initializeCamera() {
this.video = $('.vrec-dialog video').get('0');
if (!this.video) {
return;
}
return VideoRecorder.start(this.video);
}
}();