feat(streaming): bot's default avatar

Set a default avatar to bot. Add the defaults methods to handle
the new feature.
This commit is contained in:
Max Franke 2021-06-08 14:31:58 -03:00 committed by Arthurk12
parent 22c2a371b0
commit 740ff53fb5
6 changed files with 24 additions and 1 deletions

View File

@ -77,6 +77,7 @@ public class ParamsProcessorUtil {
private Integer defaultHttpSessionTimeout = 14400; private Integer defaultHttpSessionTimeout = 14400;
private Boolean useDefaultAvatar = false; private Boolean useDefaultAvatar = false;
private String defaultAvatarURL; private String defaultAvatarURL;
private String defaultBotAvatarURL;
private Boolean useDefaultWebcamBackground = false; private Boolean useDefaultWebcamBackground = false;
private String defaultWebcamBackgroundURL; private String defaultWebcamBackgroundURL;
private String defaultGuestPolicy; private String defaultGuestPolicy;
@ -783,6 +784,7 @@ public class ParamsProcessorUtil {
} }
String avatarURL = useDefaultAvatar ? defaultAvatarURL : ""; String avatarURL = useDefaultAvatar ? defaultAvatarURL : "";
String botAvatarURL = defaultBotAvatarURL;
String webcamBackgroundURL = useDefaultWebcamBackground ? defaultWebcamBackgroundURL : ""; String webcamBackgroundURL = useDefaultWebcamBackground ? defaultWebcamBackgroundURL : "";
if(defaultAllowDuplicateExtUserid == false) { if(defaultAllowDuplicateExtUserid == false) {
@ -803,6 +805,7 @@ public class ParamsProcessorUtil {
.withTelVoice(telVoice).withWebVoice(webVoice) .withTelVoice(telVoice).withWebVoice(webVoice)
.withDialNumber(dialNumber) .withDialNumber(dialNumber)
.withDefaultAvatarURL(avatarURL) .withDefaultAvatarURL(avatarURL)
.withDefaultBotAvatarURL(botAvatarURL)
.withDefaultWebcamBackgroundURL(webcamBackgroundURL) .withDefaultWebcamBackgroundURL(webcamBackgroundURL)
.withAutoStartRecording(autoStartRec) .withAutoStartRecording(autoStartRec)
.withAllowStartStopRecording(allowStartStoptRec) .withAllowStartStopRecording(allowStartStoptRec)
@ -1393,6 +1396,10 @@ public class ParamsProcessorUtil {
this.defaultAvatarURL = url; this.defaultAvatarURL = url;
} }
public void setDefaultBotAvatarURL(String url) {
this.defaultBotAvatarURL = url;
}
public void setUseDefaultWebcamBackground(Boolean value) { public void setUseDefaultWebcamBackground(Boolean value) {
this.useDefaultWebcamBackground = value; this.useDefaultWebcamBackground = value;
} }

View File

@ -77,6 +77,7 @@ public class Meeting {
private Integer maxPinnedCameras = 0; private Integer maxPinnedCameras = 0;
private String dialNumber; private String dialNumber;
private String defaultAvatarURL; private String defaultAvatarURL;
private String defaultBotAvatarURL;
private String defaultWebcamBackgroundURL; private String defaultWebcamBackgroundURL;
private Map<String, Object> plugins; private Map<String, Object> plugins;
private ArrayList<PluginsManifest> pluginsManifests; private ArrayList<PluginsManifest> pluginsManifests;
@ -153,6 +154,7 @@ public class Meeting {
logoutUrl = builder.logoutUrl; logoutUrl = builder.logoutUrl;
logoutTimer = builder.logoutTimer; logoutTimer = builder.logoutTimer;
defaultAvatarURL = builder.defaultAvatarURL; defaultAvatarURL = builder.defaultAvatarURL;
defaultBotAvatarURL = builder.defaultBotAvatarURL;
defaultWebcamBackgroundURL = builder.defaultWebcamBackgroundURL; defaultWebcamBackgroundURL = builder.defaultWebcamBackgroundURL;
record = builder.record; record = builder.record;
autoStartRecording = builder.autoStartRecording; autoStartRecording = builder.autoStartRecording;
@ -479,6 +481,10 @@ public class Meeting {
return defaultAvatarURL; return defaultAvatarURL;
} }
public String getDefaultBotAvatarURL() {
return defaultBotAvatarURL;
}
public String getDefaultWebcamBackgroundURL() { public String getDefaultWebcamBackgroundURL() {
return defaultWebcamBackgroundURL; return defaultWebcamBackgroundURL;
} }
@ -960,6 +966,7 @@ public class Meeting {
private Map<String, String> metadata; private Map<String, String> metadata;
private String dialNumber; private String dialNumber;
private String defaultAvatarURL; private String defaultAvatarURL;
private String defaultBotAvatarURL;
private String defaultWebcamBackgroundURL; private String defaultWebcamBackgroundURL;
private long createdTime; private long createdTime;
private boolean isBreakout; private boolean isBreakout;
@ -1113,6 +1120,11 @@ public class Meeting {
return this; return this;
} }
public Builder withDefaultBotAvatarURL(String w) {
defaultBotAvatarURL = w;
return this;
}
public Builder withDefaultWebcamBackgroundURL(String w) { public Builder withDefaultWebcamBackgroundURL(String w) {
defaultWebcamBackgroundURL = w; defaultWebcamBackgroundURL = w;
return this; return this;

Binary file not shown.

After

Width:  |  Height:  |  Size: 977 B

View File

@ -332,6 +332,7 @@ defaultHttpSessionTimeout=14400
# The default avatar image to display. # The default avatar image to display.
useDefaultAvatar=false useDefaultAvatar=false
defaultAvatarURL=${bigbluebutton.web.serverURL}/html5client/resources/images/avatar.png defaultAvatarURL=${bigbluebutton.web.serverURL}/html5client/resources/images/avatar.png
defaultBotAvatarURL=${bigbluebutton.web.serverURL}/html5client/resources/images/bot-avatar.png
# The default webcam background image to display. # The default webcam background image to display.
useDefaultWebcamBackground=false useDefaultWebcamBackground=false

View File

@ -162,6 +162,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<property name="defaultMaxPinnedCameras" value="${maxPinnedCameras}"/> <property name="defaultMaxPinnedCameras" value="${maxPinnedCameras}"/>
<property name="useDefaultAvatar" value="${useDefaultAvatar}"/> <property name="useDefaultAvatar" value="${useDefaultAvatar}"/>
<property name="defaultAvatarURL" value="${defaultAvatarURL}"/> <property name="defaultAvatarURL" value="${defaultAvatarURL}"/>
<property name="defaultBotAvatarURL" value="${defaultBotAvatarURL}"/>
<property name="useDefaultWebcamBackground" value="${useDefaultWebcamBackground}"/> <property name="useDefaultWebcamBackground" value="${useDefaultWebcamBackground}"/>
<property name="defaultWebcamBackgroundURL" value="${defaultWebcamBackgroundURL}"/> <property name="defaultWebcamBackgroundURL" value="${defaultWebcamBackgroundURL}"/>
<property name="defaultGuestPolicy" value="${defaultGuestPolicy}"/> <property name="defaultGuestPolicy" value="${defaultGuestPolicy}"/>

View File

@ -458,6 +458,8 @@ class ApiController {
if (!StringUtils.isEmpty(params.avatarURL)) { if (!StringUtils.isEmpty(params.avatarURL)) {
us.avatarURL = params.avatarURL; us.avatarURL = params.avatarURL;
} else if (us.bot) {
us.avatarURL = meeting.defaultBotAvatarURL
} else { } else {
us.avatarURL = meeting.defaultAvatarURL us.avatarURL = meeting.defaultAvatarURL
} }