diff --git a/bigbluebutton-client/resources/prod/lib/kurento-extension.js b/bigbluebutton-client/resources/prod/lib/kurento-extension.js index 3aa4e9243994311f35964cb79379d1a53cc74f74..1086d53d8af9780648f1c519a45d8d8f7adc331c 100644 --- a/bigbluebutton-client/resources/prod/lib/kurento-extension.js +++ b/bigbluebutton-client/resources/prod/lib/kurento-extension.js @@ -420,6 +420,11 @@ window.getScreenConstraints = function(sendSource, callback) { if(isChrome) { getChromeScreenConstraints ((constraints) => { + if(!constraints){ + document.dispatchEvent(new Event("installChromeExtension")); + return; + } + extensionInstalled = true; let sourceId = constraints.streamId; // this statement sets gets 'sourceId" and sets "chromeMediaSourceId" diff --git a/bigbluebutton-html5/imports/ui/components/video-dock/component.jsx b/bigbluebutton-html5/imports/ui/components/video-dock/component.jsx index 107fc4785b2ed9dff874629097297eaf3d094887..5f47b5ac129522e78ca86aa824f55deb5148f8bb 100644 --- a/bigbluebutton-html5/imports/ui/components/video-dock/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/video-dock/component.jsx @@ -2,7 +2,7 @@ import React, { Component } from 'react'; import ScreenshareContainer from '/imports/ui/components/screenshare/container'; import styles from './styles'; import { log } from '/imports/ui/services/api'; - +import { notify } from '/imports/ui/services/notification'; class VideoElement extends Component { constructor(props) { @@ -89,6 +89,7 @@ export default class VideoDock extends Component { document.addEventListener('joinVideo', this.shareWebcam.bind(this));// TODO find a better way to do this document.addEventListener('exitVideo', this.unshareWebcam.bind(this)); + document.addEventListener('installChromeExtension', this.installChromeExtension.bind(this)); window.addEventListener('resize', this.adjustVideos); @@ -102,7 +103,8 @@ export default class VideoDock extends Component { componentWillUnmount () { document.removeEventListener('joinVideo', this.shareWebcam); - document.removeEventListener('exitVideo', this.shareWebcam); + document.removeEventListener('exitVideo', this.unshareWebcam); + document.removeEventListener('installChromeExtension', this.installChromeExtension); window.removeEventListener('resize', this.adjustVideos); this.ws.removeEventListener('message', this.onWsMessage); @@ -166,6 +168,7 @@ export default class VideoDock extends Component { if (webRtcPeer.didSDPAnswered) { webRtcPeer.addIceCandidate(parsedMessage.candidate, (err) => { if (err) { + this.notifyError('Error adding ice candidate'); return log('error', `Error adding candidate: ${err}`); } }); @@ -241,6 +244,12 @@ export default class VideoDock extends Component { let webRtcPeer = new peerObj(options, function (error) { if (error) { log('error', ' WebRTC peerObj create error'); + log('error', error); + this.notifyError('Error on sharing webcam. Please check permissions.'); + /* This notification error is displayed considering kurento-utils + * returned the error 'The request is not allowed by the user agent + * or the platform in the current context.', but there are other + * errors that could be returned. */ that.destroyWebRTCPeer(id); that.destroyVideoTag(id); @@ -281,6 +290,7 @@ export default class VideoDock extends Component { let candidate = this.iceQueue.shift(); this.addIceCandidate(candidate, (err) => { if (err) { + this.notifyError('Error adding ice candidate'); return console.error(`Error adding candidate: ${err}`); } }); @@ -435,10 +445,22 @@ export default class VideoDock extends Component { } handleError(message) { + this.notifyError("Error on sharing webcam"); + console.error(' Handle error --------------------->'); log('debug', message.message); } + notifyError(message) { + notify(message, 'error', 'video'); + } + + installChromeExtension() { + const CHROME_EXTENSION_LINK = Meteor.settings.public.kurento.chromeExtensionLink; + + this.notifyError(<div>You must install <a href={CHROME_EXTENSION_LINK} target="_blank">this Chrome extension</a></div>, 'error', 'video'); + } + componentDidUpdate() { this.adjustVideos(); } @@ -501,4 +523,5 @@ export default class VideoDock extends Component { return false; } + } diff --git a/labs/bbb-webrtc-sfu/lib/video/VideoManager.js b/labs/bbb-webrtc-sfu/lib/video/VideoManager.js index a42a3454e80b40c8909cc7342359207d54f6fef1..f56af874e47ea4f02657c3ab68de6788a8250ca1 100755 --- a/labs/bbb-webrtc-sfu/lib/video/VideoManager.js +++ b/labs/bbb-webrtc-sfu/lib/video/VideoManager.js @@ -96,6 +96,7 @@ var _onMessage = function (_message) { role: role, id : 'error', response : 'rejected', + cameraId : message.cameraId, message : error }), C.FROM_VIDEO); }