Enables shared video for all participants, the first to share is the video all will see, later attempts will result just a dialog informing that video is already shared.

This commit is contained in:
damencho 2016-03-25 19:38:56 -05:00
parent 9b09e61877
commit 7d0cd00a50
4 changed files with 13 additions and 14 deletions

View File

@ -1114,16 +1114,6 @@ export default {
room.addCommandListener( room.addCommandListener(
Commands.SHARED_VIDEO, ({value, attributes}, id) => { 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') { if (attributes.state === 'stop') {
APP.UI.stopSharedVideo(id, attributes); APP.UI.stopSharedVideo(id, attributes);
} else if (attributes.state === 'start') { } else if (attributes.state === 'start') {

View File

@ -166,6 +166,7 @@
"shareVideoLinkError": "Please provide a correct youtube link.", "shareVideoLinkError": "Please provide a correct youtube link.",
"removeSharedVideoTitle": "Remove shared video", "removeSharedVideoTitle": "Remove shared video",
"removeSharedVideoMsg": "Are you sure you would like to remove your 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 ...", "WaitingForHost": "Waiting for the host ...",
"WaitForHostMsg": "The conference <b>__room__ </b> has not yet started. If you are the host then please authenticate. Otherwise, please wait for the host to arrive.", "WaitForHostMsg": "The conference <b>__room__ </b> 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", "IamHost": "I am the host",

View File

@ -43,8 +43,15 @@ export default class SharedVideoManager {
return; return;
} }
if(APP.conference.isLocalId(this.from)) {
showStopVideoPropmpt().then(() => showStopVideoPropmpt().then(() =>
this.emitter.emit(UIEvents.UPDATE_SHARED_VIDEO, null, 'stop')); this.emitter.emit(UIEvents.UPDATE_SHARED_VIDEO, null, 'stop'));
} else {
messageHandler.openMessageDialog(
"dialog.shareVideoTitle",
"dialog.alreadySharedVideoMsg"
);
}
} }
/** /**

View File

@ -289,8 +289,9 @@ const Toolbar = {
}, },
// Shows or hides the 'shared video' button. // Shows or hides the 'shared video' button.
showSharedVideoButton (show) { showSharedVideoButton () {
if (UIUtil.isButtonEnabled('sharedvideo') && show) { if (UIUtil.isButtonEnabled('sharedvideo')
&& config.disableThirdPartyRequests !== true) {
$('#toolbar_button_sharedvideo').css({display: "inline-block"}); $('#toolbar_button_sharedvideo').css({display: "inline-block"});
} else { } else {
$('#toolbar_button_sharedvideo').css({display: "none"}); $('#toolbar_button_sharedvideo').css({display: "none"});