Add new API options to display a banner in the client.

This commit is contained in:
Ghazi Triki 2017-10-03 21:49:06 +01:00
parent 0276a0fc41
commit e96d6ae726
12 changed files with 81 additions and 17 deletions

View File

@ -74,7 +74,7 @@ libraryDependencies += "org.libreoffice" % "juh" % "5.3.2"
libraryDependencies += "org.libreoffice" % "jurt" % "5.3.2"
libraryDependencies += "org.apache.poi" % "poi-ooxml" % "3.15"
libraryDependencies += "org.apache.poi" % "poi-ooxml" % "3.17"
libraryDependencies += "org.slf4j" % "slf4j-api" % "1.7.5"

View File

@ -348,7 +348,11 @@ public class ParamsProcessorUtil {
int maxUsers = processMaxUser(params.get("maxParticipants"));
int meetingDuration = processMeetingDuration(params.get("duration"));
int logoutTimer = processMeetingDuration(params.get("logoutTimer"));
// Banner parameters
String bannerText = params.get("bannerText");
String bannerColor = params.get("bannerColor");
// set is breakout room property
boolean isBreakout = false;
if (!StringUtils.isEmpty(params.get("isBreakout"))) {
@ -444,6 +448,7 @@ public class ParamsProcessorUtil {
.withViewerPass(viewerPass).withRecording(record)
.withDuration(meetingDuration).withLogoutUrl(logoutUrl)
.withLogoutTimer(logoutTimer)
.withBannerText(bannerText).withBannerColor(bannerColor)
.withTelVoice(telVoice).withWebVoice(webVoice)
.withDialNumber(dialNumber)
.withDefaultAvatarURL(defaultAvatarURL)

View File

@ -47,6 +47,8 @@ public class Meeting {
private String logoutUrl;
private int logoutTimer = 0;
private int maxUsers;
private String bannerColor = "#FFFFFF";
private String bannerText = "";
private boolean record;
private boolean autoStartRecording = false;
private boolean allowStartStopRecording = false;
@ -76,6 +78,8 @@ public class Meeting {
viewerPass = builder.viewerPass;
moderatorPass = builder.moderatorPass;
maxUsers = builder.maxUsers;
bannerColor = builder.bannerColor;
bannerText = builder.bannerText;
logoutUrl = builder.logoutUrl;
logoutTimer = builder.logoutTimer;
defaultAvatarURL = builder.defaultAvatarURL;
@ -272,6 +276,14 @@ public class Meeting {
public int getLogoutTimer() {
return logoutTimer;
}
public String getBannerColor() {
return bannerColor;
}
public String getBannerText() {
return bannerText;
}
public boolean isRecord() {
return record;
@ -393,8 +405,6 @@ public class Meeting {
return (Map<String, Object>) userCustomData.get(userID);
}
/***
* Meeting Builder
*
@ -416,6 +426,8 @@ public class Meeting {
private String welcomeMsgTemplate;
private String welcomeMsg;
private String logoutUrl;
private String bannerColor;
private String bannerText;
private int logoutTimer;
private Map<String, String> metadata;
private String dialNumber;
@ -520,6 +532,15 @@ public class Meeting {
return this;
}
public Builder withBannerColor(String c) {
bannerColor = c;
return this;
}
public Builder withBannerText(String t) {
bannerText = t;
return this;
}
public Builder withMetadata(Map<String, String> m) {
metadata = m;

View File

@ -143,8 +143,9 @@ phonecomponents|MuteMeButton {
.toolbarMainBox {
backgroundColor : #FFFFFF;
paddingTop : 6;
paddingBottom : 6;
paddingTop : 0;
paddingBottom : 0;
verticalGap : 0;
}
.breakoutRoomRibbon {
@ -155,6 +156,13 @@ phonecomponents|MuteMeButton {
horizontalAlign : center;
}
.bannerStyle {
color : #FFFFFF;
fontSize : 16;
verticalAlign : middle;
horizontalAlign : center;
}
.topBoxStyle {
paddingTop : 0;
paddingBottom : 0;

View File

@ -20,7 +20,6 @@ package org.bigbluebutton.core.model
public var authToken:String = "";
public var layout:String = "";
public var logoutURL:String = "";
public var logoutTimer:int=0;
public var welcome:String = "";
public var avatarURL:String = "";

View File

@ -17,6 +17,8 @@ package org.bigbluebutton.core.model
public var webcamsOnlyForModerator:Boolean = false;
public var metadata:Object = null;
public var muteOnStart:Boolean = false;
public var logoutTimer:int=0;
public var bannerColor:String = "";
public var bannerText:String = "";
}
}

View File

@ -14,6 +14,8 @@ package org.bigbluebutton.main.model.users
public var logoutTimer : int;
public var defaultLayout: String;
public var avatarURL: String;
public var bannerText: String;
public var bannerColor: String;
public var dialnumber: String;
public var voiceConf: String;
public var welcome: String;

View File

@ -151,8 +151,10 @@ package org.bigbluebutton.main.model.users
apiResponse.record = (result.response.record.toUpperCase() == "TRUE");
apiResponse.allowStartStopRecording = result.response.allowStartStopRecording;
apiResponse.webcamsOnlyForModerator = result.response.webcamsOnlyForModerator;
apiResponse.bannerColor = result.response.bannerColor;
apiResponse.bannerText = result.response.bannerText;
apiResponse.dialnumber = result.response.dialnumber;
apiResponse.voiceConf = result.response.voicebridge;

View File

@ -104,7 +104,6 @@ package org.bigbluebutton.main.model.users
LiveMeeting.inst().me.authToken = result.authToken;
LiveMeeting.inst().me.layout = result.defaultLayout;
LiveMeeting.inst().me.logoutURL = result.logoutUrl;
LiveMeeting.inst().me.logoutTimer = result.logoutTimer;
LiveMeeting.inst().me.role = result.role;
LiveMeeting.inst().me.welcome = result.welcome;
LiveMeeting.inst().me.avatarURL = result.avatarURL;
@ -130,7 +129,11 @@ package org.bigbluebutton.main.model.users
LiveMeeting.inst().meeting.metadata = result.metadata;
LiveMeeting.inst().meeting.muteOnStart = meetingOptions.muteOnStart;
LiveMeeting.inst().meeting.logoutTimer = result.logoutTimer;
LiveMeeting.inst().meeting.bannerColor = result.bannerColor;
LiveMeeting.inst().meeting.bannerText = result.bannerText;
// assign the meeting name to the document title
ExternalInterface.call("setTitle", result.meetingName);

View File

@ -808,10 +808,13 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
private function updateToolbarHeight():void {
if (toolbarHeight != 0) {
toolbarHeight = Math.max(DEFAULT_TOOLBAR_HEIGHT, toolbar.logo.height + toolbar.quickLinks.includeInLayout ? toolbar.quickLinks.height : 0 + 10);
toolbarHeight = Math.max(DEFAULT_TOOLBAR_HEIGHT, toolbar.logo.height + toolbar.quickLinks.includeInLayout ? toolbar.quickLinks.height : 0);
if (UsersUtil.isBreakout()) {
toolbarHeight += toolbar.breakoutRibbon.height;
}
if (toolbar.banner.includeInLayout) {
toolbarHeight += toolbar.banner.height;
}
}
calculateCanvasHeight();
}

View File

@ -195,6 +195,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
initBandwidthToolTip();
}
}
private function handleRemainingTimeUpdate(e:MeetingTimeRemainingEvent):void {
// Display timer only if there is less than 30 minutes remaining
if (!timeRemaining.visible && e.timeLeftInSec <= 1800) {
@ -218,14 +219,24 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
breakoutLabel.text = ResourceUtil.getInstance().getString("bbb.users.breakout.youareinroom", [sequence]);
}
if (LiveMeeting.inst().me.logoutTimer > 0 ) {
idleLogoutButton.startTimer(LiveMeeting.inst().me.logoutTimer);
if (LiveMeeting.inst().meeting.logoutTimer > 0 ) {
idleLogoutButton.startTimer(LiveMeeting.inst().meeting.logoutTimer);
} else {
rightBox.removeChild(idleLogoutButton);
}
initBanner();
logFlashPlayerCapabilities();
}
private function initBanner() : void {
if (!StringUtils.isEmpty(LiveMeeting.inst().meeting.bannerText)) {
banner.visible = banner.includeInLayout = true;
banner.setStyle("backgroundColor", uint("0x" + LiveMeeting.inst().meeting.bannerColor.substr(1)));
bannerLabel.text = LiveMeeting.inst().meeting.bannerText;
}
}
private function refreshModeratorButtonsVisibility(e:*):void {
showGuestSettingsButton = UsersUtil.amIModerator() && usersOptions.enableGuestUI;
@ -400,7 +411,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
}
if (!StringUtils.isEmpty(brandingOptions.toolbarColor)) {
mainBox.setStyle("backgroundColor", uint("0x" + brandingOptions.toolbarColor.substr(1)));
topBox.setStyle("backgroundColor", uint("0x" + brandingOptions.toolbarColor.substr(1)));
}
}
@ -535,6 +546,9 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<mx:VBox id="mainBox" styleName="toolbarMainBox" width="100%" horizontalScrollPolicy="off" verticalAlign="top">
<!-- Breakout room Ribbon-->
<mx:HBox id="banner" visible="false" includeInLayout="false" styleName="bannerStyle" width="100%" height="30">
<mx:Label id="bannerLabel" width="100%" textAlign="center"/>
</mx:HBox>
<mx:HBox id="breakoutRibbon" width="100%" height="30"
styleName="breakoutRoomRibbon"
visible="false" includeInLayout="false" >
@ -545,7 +559,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
toolTip="{ResourceUtil.getInstance().getString('bbb.users.breakout.timer.toolTip')}"/>
</mx:HBox>
<!-- Top bar -->
<mx:HBox id="topBox" width="100%" verticalAlign="middle" horizontalScrollPolicy="off" styleName="topBoxStyle">
<mx:HBox id="topBox" width="100%" verticalAlign="middle" height="50" horizontalScrollPolicy="off" styleName="topBoxStyle">
<mx:HBox id="titleBox" width="40%" horizontalAlign="left" verticalAlign="middle" horizontalScrollPolicy="off">
<mx:Image id="logo" right="20" maxHeight="35" ioError="hideLogo()" />
<mx:VRule id="logoSperatator" styleName="toolbarSeparator" height="10" />

View File

@ -1356,8 +1356,13 @@ class ApiController {
allowStartStopRecording = meeting.getAllowStartStopRecording()
webcamsOnlyForModerator = meeting.getWebcamsOnlyForModerator()
welcome = us.welcome
if (! StringUtils.isEmpty(meeting.moderatorOnlyMessage))
if (! StringUtils.isEmpty(meeting.moderatorOnlyMessage)) {
modOnlyMessage = meeting.moderatorOnlyMessage
}
if (! StringUtils.isEmpty(meeting.bannerText)) {
bannerText = meeting.getBannerText()
bannerColor = meeting.getBannerColor()
}
logoutUrl = us.logoutUrl
defaultLayout = us.defaultLayout
avatarURL = us.avatarURL