comindware.core.ui
Version:
Comindware Core UI provides the basic components like editors, lists, dropdowns, popups that we so desperately need while creating Marionette-based single-page applications.
27 lines (21 loc) • 784 B
JavaScript
import template from './templates/videoChat.html';
import WebRTCService from '../../services/WebRTCService';
export default Marionette.View.extend({
template: Handlebars.compile(template),
ui: {
localVideo: '.js-local-video',
remoteVideo: '.js-remote-video',
videoCallButton: '.js-video-call-button',
endCallButton: '.js-end-call-button'
},
events: {
'click @ui.videoCallButton': '__handleLocalVideoButtonClick',
'click @ui.endCallButton': '__handleEndCallButtonClick'
},
__handleLocalVideoButtonClick() {
WebRTCService.initiateCall(this.ui.localVideo, this.ui.remoteVideo);
},
__handleEndCallButtonClick() {
WebRTCService.endCall(this.ui.localVideo, this.ui.remoteVideo);
}
});