diff --git a/conference.js b/conference.js index 3d5b27050..2dd8605e0 100644 --- a/conference.js +++ b/conference.js @@ -1114,16 +1114,6 @@ export default { room.addCommandListener( Commands.SHARED_VIDEO, ({value, attributes}, id) => { - // if we are not the moderator or - // the command is coming from a user which is not the moderator - if (!(this.isLocalId(id) && room.isModerator()) - && !this.isParticipantModerator(id)) - { - console.warn('Received shared video command ' + - 'not from moderator'); - return; - } - if (attributes.state === 'stop') { APP.UI.stopSharedVideo(id); } else if (attributes.state === 'start') { diff --git a/lang/main.json b/lang/main.json index f03c1bbc3..24199d190 100644 --- a/lang/main.json +++ b/lang/main.json @@ -166,6 +166,7 @@ "shareVideoLinkError": "Please provide a correct youtube link.", "removeSharedVideoTitle": "Remove shared video", "removeSharedVideoMsg": "Are you sure you would like to remove your shared video?", + "alreadySharedVideoMsg": "Another participant is already sharing video. This conference allows only one shared video at a time.", "WaitingForHost": "Waiting for the host ...", "WaitForHostMsg": "The conference __room__ has not yet started. If you are the host then please authenticate. Otherwise, please wait for the host to arrive.", "IamHost": "I am the host", diff --git a/modules/UI/UI.js b/modules/UI/UI.js index 849f9b30f..4e4a9d99f 100644 --- a/modules/UI/UI.js +++ b/modules/UI/UI.js @@ -233,6 +233,10 @@ UI.initConference = function () { // Add myself to the contact list. ContactList.addContact(id); + //update default button states before showing the toolbar + //if local role changes buttons state will be again updated + UI.updateLocalRole(false); + // Once we've joined the muc show the toolbar ToolbarToggler.showToolbar(); diff --git a/modules/UI/shared_video/SharedVideo.js b/modules/UI/shared_video/SharedVideo.js index 0ced143a4..a6d309423 100644 --- a/modules/UI/shared_video/SharedVideo.js +++ b/modules/UI/shared_video/SharedVideo.js @@ -42,8 +42,15 @@ export default class SharedVideoManager { return; } - showStopVideoPropmpt().then(() => - this.emitter.emit(UIEvents.UPDATE_SHARED_VIDEO, null, 'stop')); + if(APP.conference.isLocalId(this.from)) { + showStopVideoPropmpt().then(() => + this.emitter.emit(UIEvents.UPDATE_SHARED_VIDEO, null, 'stop')); + } else { + messageHandler.openMessageDialog( + "dialog.shareVideoTitle", + "dialog.alreadySharedVideoMsg" + ); + } } /** diff --git a/modules/UI/toolbars/Toolbar.js b/modules/UI/toolbars/Toolbar.js index 890b13bb2..687e91783 100644 --- a/modules/UI/toolbars/Toolbar.js +++ b/modules/UI/toolbars/Toolbar.js @@ -289,8 +289,9 @@ const Toolbar = { }, // Shows or hides the 'shared video' button. - showSharedVideoButton (show) { - if (UIUtil.isButtonEnabled('sharedvideo') && show) { + showSharedVideoButton () { + if (UIUtil.isButtonEnabled('sharedvideo') + && config.disableThirdPartyRequests !== true) { $('#toolbar_button_sharedvideo').css({display: "inline-block"}); } else { $('#toolbar_button_sharedvideo').css({display: "none"});