diff --git a/bigbluebutton-client/resources/prod/BigBlueButton.html b/bigbluebutton-client/resources/prod/BigBlueButton.html index a799be30e65458465ffedbe1e3d610741d310b9b..bc3f9c4901b1fe2a1a61edcde14d3a6b920baf30 100755 --- a/bigbluebutton-client/resources/prod/BigBlueButton.html +++ b/bigbluebutton-client/resources/prod/BigBlueButton.html @@ -143,7 +143,7 @@ <script src="lib/verto_extension.js" language="javascript"></script> <script src="lib/kurento-extension.js" language="javascript"></script> - <script src="lib/kurento-utils.js" language="javascript"></script> + <script src="lib/kurento-utils.min.js" language="javascript"></script> <script src="lib/bbb_api_bridge.js?v=VERSION" language="javascript"></script> <script src="lib/sip.js?v=VERSION" language="javascript"></script> diff --git a/bigbluebutton-client/resources/prod/lib/kurento-extension.js b/bigbluebutton-client/resources/prod/lib/kurento-extension.js index 386e85339e92b6916bc595731d7d8387261633ad..b697044636eacd1f28c8c69caf18a628b46c4045 100644 --- a/bigbluebutton-client/resources/prod/lib/kurento-extension.js +++ b/bigbluebutton-client/resources/prod/lib/kurento-extension.js @@ -189,8 +189,8 @@ Kurento.prototype.setRenderTag = function (tag) { Kurento.prototype.presenterResponse = function (message) { if (message.response != 'accepted') { - var errorMsg = message.message ? message.message : 'Unknow error'; - console.warn('Call not accepted for the following reason: ' + errorMsg); + var errorMsg = message.message ? message.message : 'Unknown error'; + console.warn('Call not accepted for the following reason: ' + JSON.stringify(errorMsg, null, 2)); kurentoManager.exitScreenShare(); this.onFail(errorMessage); } else { diff --git a/bigbluebutton-html5/imports/api/screenshare/client/bridge/kurento.js b/bigbluebutton-html5/imports/api/screenshare/client/bridge/kurento.js index 00f12f5b180849329ea65ebf3b888d3fb61b70d2..77e10ef49f17aa622bb35ba843f86e073fd885d6 100755 --- a/bigbluebutton-html5/imports/api/screenshare/client/bridge/kurento.js +++ b/bigbluebutton-html5/imports/api/screenshare/client/bridge/kurento.js @@ -2,6 +2,8 @@ import Users from '/imports/api/users'; import Auth from '/imports/ui/services/auth'; import BridgeService from './service'; +const CHROME_EXTENSION_KEY = Meteor.settings.public.kurento.chromeExtensionKey; + const getUserId = () => { const userID = Auth.userID; return userID; @@ -39,7 +41,7 @@ export default class KurentoScreenshareBridge { getUsername(), getMeetingId(), null, - null, + CHROME_EXTENSION_KEY, ); } diff --git a/bigbluebutton-html5/imports/api/video/server/eventHandlers.js b/bigbluebutton-html5/imports/api/video/server/eventHandlers.js index e20b6cd39a60214325a75d8f3428ece95eda1940..0e773b08eafe12ba8138ab8523b8a4c2e5196a82 100644 --- a/bigbluebutton-html5/imports/api/video/server/eventHandlers.js +++ b/bigbluebutton-html5/imports/api/video/server/eventHandlers.js @@ -1,4 +1,4 @@ -import RedisPubSub from '/imports/startup/server/redis2x'; +import RedisPubSub from '/imports/startup/server/redis'; import handleUserSharedHtml5Webcam from './handlers/userSharedHtml5Webcam'; import handleUserUnsharedHtml5Webcam from './handlers/userUnsharedHtml5Webcam'; diff --git a/bigbluebutton-html5/imports/api/video/server/handlers/userSharedHtml5Webcam.js b/bigbluebutton-html5/imports/api/video/server/handlers/userSharedHtml5Webcam.js index b0c21ee31cf51227d5e3aef827fb58c0f4aa56ec..e0101f99917c3dd917c380cf83309c1c35d0c397 100644 --- a/bigbluebutton-html5/imports/api/video/server/handlers/userSharedHtml5Webcam.js +++ b/bigbluebutton-html5/imports/api/video/server/handlers/userSharedHtml5Webcam.js @@ -1,4 +1,5 @@ import sharedWebcam from '../modifiers/sharedWebcam'; +import {check} from 'meteor/check'; export default function handleUserSharedHtml5Webcam({ header, payload }) { const meetingId = header.meetingId; diff --git a/bigbluebutton-html5/imports/api/video/server/handlers/userUnsharedHtml5Webcam.js b/bigbluebutton-html5/imports/api/video/server/handlers/userUnsharedHtml5Webcam.js index bf0f0994f9e453285d70fc095869715c1d4cd7c6..d982c8daabc718f5f5f59c3efae563a7ef9885c6 100644 --- a/bigbluebutton-html5/imports/api/video/server/handlers/userUnsharedHtml5Webcam.js +++ b/bigbluebutton-html5/imports/api/video/server/handlers/userUnsharedHtml5Webcam.js @@ -1,4 +1,5 @@ import unsharedWebcam from '../modifiers/unsharedWebcam'; +import { check } from 'meteor/check'; export default function handleUserUnsharedHtml5Webcam({ header, payload }) { const meetingId = header.meetingId; diff --git a/bigbluebutton-html5/imports/api/video/server/methods/userShareWebcam.js b/bigbluebutton-html5/imports/api/video/server/methods/userShareWebcam.js index 6121725948bb5c968bf00df07ca2c4cb0c0a6dc0..9dbcabf1dde5f3dfb3833ae8d9244cca34b9c012 100644 --- a/bigbluebutton-html5/imports/api/video/server/methods/userShareWebcam.js +++ b/bigbluebutton-html5/imports/api/video/server/methods/userShareWebcam.js @@ -1,7 +1,7 @@ import { Meteor } from 'meteor/meteor'; import { check } from 'meteor/check'; import Logger from '/imports/startup/server/logger'; -import RedisPubSub from '/imports/startup/server/redis2x'; +import RedisPubSub from '/imports/startup/server/redis'; export default function userShareWebcam(credentials, message) { const REDIS_CONFIG = Meteor.settings.redis; @@ -28,11 +28,5 @@ export default function userShareWebcam(credentials, message) { isHtml5Client: true, }; - const header = { - meetingId, - name: EVENT_NAME, - userId: requesterUserId, - }; - - return RedisPubSub.publish(CHANNEL, EVENT_NAME, meetingId, payload, header); + return RedisPubSub.publishUserMessage(CHANNEL, EVENT_NAME, meetingId, requesterUserId, payload); } diff --git a/bigbluebutton-html5/imports/api/video/server/methods/userUnshareWebcam.js b/bigbluebutton-html5/imports/api/video/server/methods/userUnshareWebcam.js index 62b83be491441184ea151c73d9c215974ebb4e8f..ebec447808fa5c3e44ea168649cfdb74a0e4d8d4 100644 --- a/bigbluebutton-html5/imports/api/video/server/methods/userUnshareWebcam.js +++ b/bigbluebutton-html5/imports/api/video/server/methods/userUnshareWebcam.js @@ -1,7 +1,7 @@ import { Meteor } from 'meteor/meteor'; import { check } from 'meteor/check'; import Logger from '/imports/startup/server/logger'; -import RedisPubSub from '/imports/startup/server/redis2x'; +import RedisPubSub from '/imports/startup/server/redis'; export default function userUnshareWebcam(credentials, message) { const REDIS_CONFIG = Meteor.settings.redis; @@ -28,11 +28,5 @@ export default function userUnshareWebcam(credentials, message) { isHtml5Client: true, }; - const header = { - meetingId, - name: EVENT_NAME, - userId: requesterUserId, - }; - - return RedisPubSub.publish(CHANNEL, EVENT_NAME, meetingId, payload, header); + return RedisPubSub.publishUserMessage(CHANNEL, EVENT_NAME, meetingId, requesterUserId, payload); } diff --git a/bigbluebutton-html5/imports/api/video/server/modifiers/sharedWebcam.js b/bigbluebutton-html5/imports/api/video/server/modifiers/sharedWebcam.js index 0a8f96321ba19e5296fa8baf16214a136a4e124b..749407ffc44860feb53b2389a2f68ce6d2e60bf5 100644 --- a/bigbluebutton-html5/imports/api/video/server/modifiers/sharedWebcam.js +++ b/bigbluebutton-html5/imports/api/video/server/modifiers/sharedWebcam.js @@ -1,5 +1,6 @@ import Logger from '/imports/startup/server/logger'; import Users from '/imports/api/users'; +import { check } from 'meteor/check'; export default function sharedWebcam(meetingId, userId) { check(meetingId, String); diff --git a/bigbluebutton-html5/imports/api/video/server/modifiers/unsharedWebcam.js b/bigbluebutton-html5/imports/api/video/server/modifiers/unsharedWebcam.js index 817031199b1053c7366fe96b6308eecd1c958b62..0ef8f0be36d552cd1610f739b30515f75308fac2 100644 --- a/bigbluebutton-html5/imports/api/video/server/modifiers/unsharedWebcam.js +++ b/bigbluebutton-html5/imports/api/video/server/modifiers/unsharedWebcam.js @@ -1,5 +1,6 @@ import Logger from '/imports/startup/server/logger'; import Users from '/imports/api/users'; +import { check } from 'meteor/check'; export default function unsharedWebcam(meetingId, userId) { check(meetingId, String); diff --git a/bigbluebutton-html5/imports/ui/components/video-dock/component.jsx b/bigbluebutton-html5/imports/ui/components/video-dock/component.jsx index 90a1bd17d8a975b4dac305f8d902cee595b88ab8..47232fb93890f1cf1d4657ee4ea4011d128d5735 100644 --- a/bigbluebutton-html5/imports/ui/components/video-dock/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/video-dock/component.jsx @@ -1,6 +1,8 @@ import React, { Component } from 'react'; import ScreenshareContainer from '/imports/ui/components/screenshare/container'; import styles from './styles'; +import { log } from '/imports/ui/services/api'; + window.addEventListener('resize', () => { window.adjustVideos('webcamArea', true); @@ -48,7 +50,6 @@ export default class VideoDock extends Component { const { users } = this.props; for (let i = 0; i < users.length; i++) { if (users[i].has_stream) { - console.log("COMPONENT DID MOUNT => " + users[i].userId); this.start(users[i].userId, false, this.refs.videoInput); } } @@ -59,8 +60,8 @@ export default class VideoDock extends Component { ws.addEventListener('message', (msg) => { const parsedMessage = JSON.parse(msg.data); - console.debug('Received message new ws message: '); - console.debug(parsedMessage); + log('debug', 'Received message new ws message: '); + log('debug', parsedMessage); switch (parsedMessage.id) { @@ -88,11 +89,11 @@ export default class VideoDock extends Component { if (webRtcPeer !== null) { webRtcPeer.addIceCandidate(parsedMessage.candidate, (err) => { if (err) { - return console.error(`Error adding candidate: ${err}`); + return log('error', `Error adding candidate: ${err}`); } }); } else { - console.error(' [ICE] Message arrived before webRtcPeer?'); + log('error', ' [ICE] Message arrived before webRtcPeer?'); } break; @@ -106,8 +107,8 @@ export default class VideoDock extends Component { const ws = this.state.ws; - console.log(`Starting video call for video: ${id}`); - console.log('Creating WebRtcPeer and generating local sdp offer ...'); + log('info', `Starting video call for video: ${id}`); + log('info', 'Creating WebRtcPeer and generating local sdp offer ...'); const onIceCandidate = function (candidate) { const message = { @@ -148,8 +149,8 @@ export default class VideoDock extends Component { this.state.webRtcPeers[id] = new peerObj(options, function (error) { if (error) { - console.error(' [ERROR] Webrtc error'); - console.error(error); + log('error', ' [ERROR] Webrtc error'); + log('error', error); return; } @@ -160,10 +161,10 @@ export default class VideoDock extends Component { this.generateOffer((error, offerSdp) => { if (error) { - return console.error(error); + return log('error', error); } - console.info(`Invoking SDP offer callback function ${location.host}`); + log('info', `Invoking SDP offer callback function ${location.host}`); const message = { id: 'start', sdpOffer: offerSdp, @@ -183,7 +184,7 @@ export default class VideoDock extends Component { const webRtcPeer = this.state.webRtcPeers[id]; if (webRtcPeer) { - console.log('Stopping WebRTC peer'); + log('info', 'Stopping WebRTC peer'); if (id == this.state.myId) { this.state.sharedWebcam.dispose(); @@ -193,7 +194,7 @@ export default class VideoDock extends Component { webRtcPeer.dispose(); delete this.state.webRtcPeers[id]; } else { - console.log('NO WEBRTC PEER TO STOP?'); + log('info', 'NO WEBRTC PEER TO STOP?'); } const videoTag = document.getElementById(`video-elem-${id}`); @@ -214,7 +215,7 @@ export default class VideoDock extends Component { } unshareWebcam() { - console.log("Unsharing webcam"); + log('info', "Unsharing webcam"); const { users } = this.props; const id = users[0].userId; this.sendUserUnshareWebcam(id); @@ -225,18 +226,18 @@ export default class VideoDock extends Component { const webRtcPeer = this.state.webRtcPeers[id]; if (message.sdpAnswer == null) { - return console.debug('Null sdp answer. Camera unplugged?'); + return log('debug', 'Null sdp answer. Camera unplugged?'); } if (webRtcPeer == null) { - return console.debug('Null webrtc peer ????'); + return log('debug', 'Null webrtc peer ????'); } - console.log('SDP answer received from server. Processing ...'); + log('info', 'SDP answer received from server. Processing ...'); webRtcPeer.processAnswer(message.sdpAnswer, (error) => { if (error) { - return console.error(error); + return log(error); } }); @@ -248,10 +249,10 @@ export default class VideoDock extends Component { if (ws.readyState == WebSocket.OPEN) { const jsonMessage = JSON.stringify(message); - console.log(`Sending message: ${jsonMessage}`); + log('info', `Sending message: ${jsonMessage}`); ws.send(jsonMessage, (error) => { if (error) { - console.error(`client: Websocket error "${error}" on message "${jsonMessage.id}"`); + log('debug', `client: Websocket error "${error}" on message "${jsonMessage.id}"`); } }); } else { @@ -260,19 +261,19 @@ export default class VideoDock extends Component { } handlePlayStop(message) { - console.log('Handle play stop <--------------------'); + log('info', 'Handle play stop <--------------------'); this.stop(message.cameraId); } handlePlayStart(message) { - console.log('Handle play start <==================='); + log('info', 'Handle play start <==================='); window.adjustVideos('webcamArea', true); } handleError(message) { - console.log(` Handle error ---------------------> ${message.message}`); + log('error', ` Handle error ---------------------> ${message.message}`); } render() { @@ -296,7 +297,7 @@ export default class VideoDock extends Component { if (users && users[i] && nextUsers && nextUsers[i]) { if (users[i].has_stream !== nextUsers[i].has_stream) { - console.log(`User ${nextUsers[i].has_stream ? '' : 'un'}shared webcam ${users[i].userId}`); + log('info', `User ${nextUsers[i].has_stream ? '' : 'un'}shared webcam ${users[i].userId}`); if (nextUsers[i].has_stream) { this.start(users[i].userId, false, this.refs.videoInput); diff --git a/bigbluebutton-html5/public/js/adjust-videos.js b/bigbluebutton-html5/public/js/adjust-videos.js index 5d8e44e9420eb6c7941f188bb3ded85642d8d7aa..bdacb7f984e4311ff039eefd18e3eb72d0bb2836 100644 --- a/bigbluebutton-html5/public/js/adjust-videos.js +++ b/bigbluebutton-html5/public/js/adjust-videos.js @@ -85,7 +85,5 @@ videos.attr('height', best.height); } - console.log(" ---------------------------------- bro!!!"); - window.adjustVideos = adjustVideos; })(); diff --git a/bigbluebutton-html5/server/main.js b/bigbluebutton-html5/server/main.js index 1dab09e2879dc5ec2278e623e6703d710a03efe3..ac582ccc4631a68deb3ddab454687fd7155d3a1e 100644 --- a/bigbluebutton-html5/server/main.js +++ b/bigbluebutton-html5/server/main.js @@ -14,6 +14,7 @@ import '/imports/api/chat/server'; import '/imports/api/screenshare/server'; import '/imports/api/voice-users/server'; import '/imports/api/whiteboard-multi-user/server'; +import '/imports/api/video/server'; // Commons import '/imports/api/log-client/server';