Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
… into record-button

Conflicts:
	bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/Room.java
	bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/participants/ParticipantsEventSender.java
	bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/recorder/participants/ParticipantsEventRecorder.java
	bigbluebutton-client/branding/default/style/css/BBBDefault.css
	bigbluebutton-client/src/org/bigbluebutton/main/model/users/UserService.as
	bigbluebutton-client/src/org/bigbluebutton/main/model/users/UsersSOService.as
  • Loading branch information
fcecagno committed Jan 15, 2014
2 parents 98f1d51 + 0679568 commit 3070127
Show file tree
Hide file tree
Showing 60 changed files with 1,698 additions and 386 deletions.
4 changes: 2 additions & 2 deletions bbb-api-demo/src/main/webapp/demo_mozilla_persona.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Author: Marcos Calderon <[email protected]>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Join Demo Meeting using Mozilla Persona</title>
<script src="https://browserid.org/include.js" type="text/javascript"></script>
<script src="https://login.persona.org/include.js" type="text/javascript"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
</head>

Expand Down Expand Up @@ -109,7 +109,7 @@ function loggedIn(res){
String data = URLEncoder.encode("assertion", "UTF-8") + "=" + URLEncoder.encode(request.getParameter("assertion"), "UTF-8");
data += "&" + URLEncoder.encode("audience", "UTF-8") + "=" + URLEncoder.encode(BigBlueButtonURL.replace("/bigbluebutton/",""),"UTF-8");
URL urlBrowserID = new URL("https://browserid.org/verify");
URL urlBrowserID = new URL("https://verifier.login.persona.org/verify");
URLConnection conn = urlBrowserID.openConnection();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@
*/
package org.bigbluebutton.conference;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import org.red5.server.api.Red5;import org.bigbluebutton.conference.service.participants.ParticipantsApplication;
import org.red5.server.api.Red5;import org.bigbluebutton.conference.service.lock.LockSettings;
import org.bigbluebutton.conference.service.participants.ParticipantsApplication;
import org.bigbluebutton.conference.service.recorder.RecorderApplication;
import org.red5.logging.Red5LoggerFactory;
import org.red5.server.adapter.IApplication;
Expand Down Expand Up @@ -134,19 +137,40 @@ boolean record = (Boolean)params[4];

String externalUserID = ((String) params[5]).toString();
String internalUserID = ((String) params[6]).toString();

Boolean locked = false;
if(params.length >= 7 && ((Boolean) params[7])) {
locked = true;
}

Boolean muted = false;
if(params.length >= 8 && ((Boolean) params[8])) {
muted = true;
}

Map<String, Boolean> lsMap = null;
if(params.length >= 9) {
try{
lsMap = (Map<String, Boolean> ) params[9];
}catch(Exception e){
lsMap = new HashMap<String, Boolean>();
}
}



if (record == true) {
recorderApplication.createRecordSession(room);
}

BigBlueButtonSession bbbSession = new BigBlueButtonSession(room, internalUserID, username, role,
voiceBridge, record, externalUserID);
voiceBridge, record, externalUserID, muted);
connection.setAttribute(Constants.SESSION, bbbSession);

String debugInfo = "internalUserID=" + internalUserID + ",username=" + username + ",role=" + role + "," +
",voiceConf=" + voiceBridge + ",room=" + room + ",externalUserid=" + externalUserID;
log.debug("User [{}] connected to room [{}]", debugInfo, room);
participantsApplication.createRoom(room);
participantsApplication.createRoom(room, locked, new LockSettings(lsMap));

connInvokerService.addConnection(bbbSession.getInternalUserID(), connection);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,19 @@ public class BigBlueButtonSession {
private final String voiceBridge;
private final Boolean record;
private final String externalUserID;
private final Boolean startAsMuted;

public BigBlueButtonSession(String room, String internalUserID, String username,
String role, String voiceBridge, Boolean record,
String externalUserID){
String externalUserID, Boolean startAsMuted){
this.internalUserID = internalUserID;
this.username = username;
this.role = role;
this.room = room;
this.voiceBridge = voiceBridge;
this.record = record;
this.externalUserID = externalUserID;
this.startAsMuted = startAsMuted;
}

public String getUsername() {
Expand Down Expand Up @@ -67,4 +69,8 @@ public Boolean getRecord() {
public String getExternUserID() {
return externalUserID;
}

public Boolean getStartAsMuted() {
return startAsMuted;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,12 @@
package org.bigbluebutton.conference;

import java.util.ArrayList;
import java.util.Map;

public interface IRoomListener {
public String getName();

public void lockSettingsChange(Map<String, Boolean> lockSettings);
public void participantStatusChange(User p, String status, Object value);
public void participantJoined(User participant);
public void participantLeft(User participant);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

import org.bigbluebutton.conference.service.messaging.MessagingConstants;
import org.bigbluebutton.conference.service.messaging.MessagingService;
Expand Down Expand Up @@ -98,6 +99,11 @@ public void assignPresenter(ArrayList<String> presenter) {
public void endAndKickAll() {
// no-op
}

@Override
public void lockSettingsChange(Map<String, Boolean> lockSettings) {
// Do nothing
}

public void recordingStatusChange(User p, Boolean recording){
if (messagingService != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,18 @@

package org.bigbluebutton.conference;

import org.slf4j.Logger;
import org.red5.logging.Red5LoggerFactory;
import net.jcip.annotations.ThreadSafe;
import java.io.Serializable;
import java.util.concurrent.ConcurrentHashMap;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

import net.jcip.annotations.ThreadSafe;

import org.bigbluebutton.conference.service.lock.LockSettings;
import org.red5.logging.Red5LoggerFactory;
import org.slf4j.Logger;
/**
* Contains information about a Room and it's Participants.
* Encapsulates Participants and RoomListeners.
Expand All @@ -38,14 +41,19 @@ public class Room implements Serializable {
ArrayList<String> currentPresenter = null;
private String name;
private Map <String, User> participants;
private Boolean locked;
private LockSettings lockSettings = null;
private Boolean recording = false;

// these should stay transient so they're not serialized in ActiveMQ messages:
//private transient Map <Long, Participant> unmodifiableMap;
private transient final Map<String, IRoomListener> listeners;

public Room(String name) {
public Room(String name, Boolean locked, LockSettings lockSettings) {
this.name = name;
this.locked = locked;
this.lockSettings = lockSettings;

participants = new ConcurrentHashMap<String, User>();
//unmodifiableMap = Collections.unmodifiableMap(participants);
listeners = new ConcurrentHashMap<String, IRoomListener>();
Expand Down Expand Up @@ -140,7 +148,7 @@ public void endAndKickAll() {
}
}

public Map getParticipants() {
public Map<String, User> getParticipants() {
return participants;//unmodifiableMap;
}

Expand Down Expand Up @@ -179,6 +187,28 @@ public void assignPresenter(ArrayList<String> presenter){
}
}

public void setLocked(Boolean locked) {
this.locked = locked;
}

public boolean isLocked() {
return locked;
}

public LockSettings getLockSettings() {
return lockSettings;
}

public void setLockSettings(LockSettings lockSettings) {
this.lockSettings = lockSettings;

for (Iterator it = listeners.values().iterator(); it.hasNext();) {
IRoomListener listener = (IRoomListener) it.next();
log.debug("calling setLockSettings on listener " + listener.getName());
listener.lockSettingsChange(lockSettings.toMap());
}
}

public void changeRecordingStatus(String userid, Boolean recording) {
boolean present = false;
User p = null;
Expand Down Expand Up @@ -207,5 +237,4 @@ private void changeRecordingStatus(User p, Boolean recording) {
public Boolean getRecordingStatus() {
return recording;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.red5.server.api.so.ISharedObject;

public class RoomListener implements IRoomListener{
Expand Down Expand Up @@ -64,6 +66,13 @@ public void assignPresenter(ArrayList<String> presenter) {

public void endAndKickAll() {
// no-op
}

@Override
public void lockSettingsChange(Map<String, Boolean> lockSettings) {
List list = new ArrayList();
list.add(lockSettings);
so.sendMessage("lockSettingsChange", list);
}

@SuppressWarnings("unchecked")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public Room getRoom(String name) {
return rooms.get(name);
}

public Map getParticipants(String roomName) {
public Map<String, User> getParticipants(String roomName) {
Room r = getRoom(roomName);
if (r != null) {
return r.getParticipants();
Expand Down Expand Up @@ -142,20 +142,7 @@ public void addParticipant(String roomName, User participant) {
log.debug("Add participant " + participant.getName());
Room r = getRoom(roomName);
if (r != null) {
/* if (checkPublisher()) {
if (r.getNumberOfParticipants() == 0) {
log.debug("Notified event listener of conference start");
HashMap<String,String> map = new HashMap<String,String>();
map.put("meetingId", roomName);
map.put("messageId", MessagingConstants.USER_JOINED_EVENT);
Gson gson = new Gson();
publisher.publish(MessagingConstants.SYSTEM_CHANNEL, gson.toJson(map));
}
}
*/ r.addParticipant(participant);
r.addParticipant(participant);

return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,14 @@ public class User implements Serializable {
private final Map status;
private Map<String, Object> unmodifiableStatus;

public User(String internalUserID, String name, String role, String externalUserID, Map<String, Object> status) {
public User(String internalUserID, String name, String role, String externalUserID, Map<String, Object> status, Boolean locked) {
this.internalUserID = internalUserID;
this.name = name;
this.role = role;
this.externalUserID = externalUserID;
this.status = new ConcurrentHashMap<String, Object>(status);
unmodifiableStatus = Collections.unmodifiableMap(status);
setStatus("locked", locked);
}

public boolean isModerator() {
Expand Down Expand Up @@ -116,4 +117,8 @@ public Map toMap() {
m.put("status", new HashMap(unmodifiableStatus));
return m;
}

public Boolean isLocked() {
return ((Boolean) getStatus().get("locked") );
}
}
Loading

0 comments on commit 3070127

Please sign in to comment.