Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Main-app.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

<!-- A universally unique application identifier. Must be unique across all AIR applications.
Using a reverse DNS-style name as the id is recommended. (Eg. com.example.ExampleApplication.) Required. -->
<id>org.bigbluebutton.bbb-air-client</id>
<id>BigBlueButtonMobile</id>

<!-- Used as the filename for the application. Required. -->
<filename>BigBlueButton</filename>
Expand Down
11 changes: 6 additions & 5 deletions src/org/bigbluebutton/AppConfig.as
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ package org.bigbluebutton
import org.bigbluebutton.command.DisconnectUserSignal;
import org.bigbluebutton.command.LoadSlideCommand;
import org.bigbluebutton.command.LoadSlideSignal;
import org.bigbluebutton.command.ReconnectIOSVideoCommand;
import org.bigbluebutton.command.ReconnectIOSVideoSignal;
import org.bigbluebutton.command.ShareCameraCommand;
import org.bigbluebutton.command.ShareCameraSignal;
import org.bigbluebutton.command.ShareMicrophoneCommand;
Expand All @@ -21,13 +23,13 @@ package org.bigbluebutton
import org.bigbluebutton.core.IChatMessageService;
import org.bigbluebutton.core.IDeskshareConnection;
import org.bigbluebutton.core.ILoginService;
import org.bigbluebutton.core.IUsersService;
import org.bigbluebutton.core.UsersService;
import org.bigbluebutton.core.IPresentationService;
import org.bigbluebutton.core.IVoiceConnection;
import org.bigbluebutton.core.IUsersService;
import org.bigbluebutton.core.IVideoConnection;
import org.bigbluebutton.core.IVoiceConnection;
import org.bigbluebutton.core.LoginService;
import org.bigbluebutton.core.PresentationService;
import org.bigbluebutton.core.UsersService;
import org.bigbluebutton.core.VideoConnection;
import org.bigbluebutton.core.VoiceConnection;
import org.bigbluebutton.model.ConferenceParameters;
Expand All @@ -38,8 +40,6 @@ package org.bigbluebutton
import org.bigbluebutton.model.UserUISession;
import org.bigbluebutton.model.chat.ChatMessagesSession;
import org.bigbluebutton.model.chat.IChatMessagesSession;



import robotlegs.bender.extensions.signalCommandMap.api.ISignalCommandMap;
import robotlegs.bender.framework.api.IConfig;
Expand Down Expand Up @@ -79,6 +79,7 @@ package org.bigbluebutton
signalCommandMap.map(LoadSlideSignal).toCommand(LoadSlideCommand);
signalCommandMap.map(CameraQualitySignal).toCommand(CameraQualityCommand);
signalCommandMap.map(DisconnectUserSignal).toCommand(DisconnectUserCommand);
signalCommandMap.map(ReconnectIOSVideoSignal).toCommand(ReconnectIOSVideoCommand);
}
}
}
28 changes: 25 additions & 3 deletions src/org/bigbluebutton/command/ConnectCommand.as
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,22 @@ package org.bigbluebutton.command
presentationService.setupMessageSenderReceiver();

// set up and connect the remaining connections
videoConnection.uri = userSession.config.getConfigFor("VideoConfModule").@uri + "/" + conferenceParameters.room;
videoConnection.uri = userSession.config.getConfigFor("VideoConfModule").@uri;
videoConnection.iosUri = userSession.config.getConfigFor("VideoConfModule").@iosUri;

//TODO see if videoConnection.successConnected is dispatched when it's connected properly
videoConnection.successConnected.add(successVideoConnected);
videoConnection.unsuccessConnected.add(unsuccessVideoConnected);
videoConnection.successIOSConnected.add(successIOSVideoConnected);
videoConnection.unsuccessIOSConnected.add(unsuccessIOSVideoConnected);

videoConnection.connect();

if (userSession.clientIsIOS)
{
videoConnection.connectIOS();
}

userSession.videoConnection = videoConnection;

voiceConnection.uri = userSession.config.getConfigFor("PhoneModule").@uri;
Expand All @@ -108,13 +116,13 @@ package org.bigbluebutton.command
deskshareConnection.connect();

userSession.deskshareConnection = deskshareConnection;

// Query the server for chat, users, and presentation info
chatService.sendWelcomeMessage();
chatService.getPublicChatMessages();

presentationService.getPresentationInfo();

userSession.userList.allUsersAddedSignal.add(successUsersAdded);
usersService.queryForParticipants();
usersService.queryForRecordingStatus();
Expand Down Expand Up @@ -162,5 +170,19 @@ package org.bigbluebutton.command
videoConnection.unsuccessConnected.remove(unsuccessVideoConnected);
videoConnection.successConnected.remove(successVideoConnected);
}

private function successIOSVideoConnected():void {
Log.getLogger("org.bigbluebutton").info(String(this) + ":successIOSVideoConnected()");

videoConnection.successConnected.remove(successIOSVideoConnected);
videoConnection.unsuccessConnected.remove(unsuccessIOSVideoConnected);
}

private function unsuccessIOSVideoConnected(reason:String):void {
Log.getLogger("org.bigbluebutton").info(String(this) + ":unsuccessIOSVideoConnected()");

videoConnection.unsuccessConnected.remove(unsuccessIOSVideoConnected);
videoConnection.successConnected.remove(successIOSVideoConnected);
}
}
}
5 changes: 5 additions & 0 deletions src/org/bigbluebutton/command/DisconnectUserCommand.as
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ package org.bigbluebutton.command
userSession.mainConnection.connection.close();
userSession.videoConnection.connection.close();
userSession.voiceConnection.connection.close();

if(userSession.videoConnection.iosConnection)
{
userSession.videoConnection.iosConnection.close();
}
}
}
}
17 changes: 17 additions & 0 deletions src/org/bigbluebutton/command/ReconnectIOSVideoCommand.as
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package org.bigbluebutton.command
{
import org.bigbluebutton.model.IUserSession;

import robotlegs.bender.bundles.mvcs.Command;

public class ReconnectIOSVideoCommand extends Command
{
[Inject]
public var userSession:IUserSession;

public override function execute():void
{
userSession.videoConnection.connectIOS();
}
}
}
12 changes: 12 additions & 0 deletions src/org/bigbluebutton/command/ReconnectIOSVideoSignal.as
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package org.bigbluebutton.command
{
import org.osflash.signals.Signal;

public class ReconnectIOSVideoSignal extends Signal
{
public function ReconnectIOSVideoSignal()
{
super();
}
}
}
9 changes: 6 additions & 3 deletions src/org/bigbluebutton/command/ShareCameraCommand.as
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ package org.bigbluebutton.command
[Inject]
public var usersService: IUsersService;

[Inject]
public var conferenceParameters:IConferenceParameters;

override public function execute():void {
if (enabled) {
userSession.videoConnection.cameraPosition = position;
Expand All @@ -40,12 +43,12 @@ package org.bigbluebutton.command
}
}

private function buildStreamName(camWidth:int, camHeight:int, userId:String):String {
private function buildStreamName(camWidth:int, camHeight:int, userId:String, roomId:String):String {
var d:Date = new Date();
var curTime:Number = d.getTime();
var uid:String = userSession.userId;
var res:String = camWidth + "x" + camHeight;
return res.concat("-" + uid) + "-" + curTime;
return res.concat("-" + uid) + "-" + roomId + "-" + curTime;
}

private function setupCamera(position:String):Camera
Expand Down Expand Up @@ -107,7 +110,7 @@ package org.bigbluebutton.command

if(userSession.videoConnection.camera)
{
var streamName:String = buildStreamName(userSession.videoConnection.camera.width, userSession.videoConnection.camera.height, userId);
var streamName:String = buildStreamName(userSession.videoConnection.camera.width, userSession.videoConnection.camera.height, userId, conferenceParameters.room);

usersService.addStream(userId, streamName);
userSession.videoConnection.startPublishing(userSession.videoConnection.camera, streamName);
Expand Down
17 changes: 10 additions & 7 deletions src/org/bigbluebutton/core/BaseConnection.as
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ package org.bigbluebutton.core
{
[Inject]
public var disconnectUserSignal:DisconnectUserSignal;

public static const NAME:String = "BaseConnection";

protected var _successConnected:ISignal = new Signal();
Expand All @@ -29,7 +29,7 @@ package org.bigbluebutton.core
protected var _netConnection:NetConnection;
protected var _uri:String;
protected var _onUserCommand:Boolean;

public function BaseConnection() {
Log.getLogger("org.bigbluebutton").info(String(this));
}
Expand All @@ -48,19 +48,19 @@ package org.bigbluebutton.core
{
return _unsuccessConnected;
}

public function get successConnected():ISignal
{
return _successConnected;
}

public function get connection():NetConnection {
return _netConnection;
}

public function connect(uri:String, ...parameters):void {
_uri = uri;

// The connect call needs to be done properly. At the moment lock settings
// are not implemented in the mobile client, so parameters[7] and parameters[8]
// are "faked" in order to connect (without them, I couldn't get the connect
Expand Down Expand Up @@ -110,7 +110,10 @@ package org.bigbluebutton.core

case "NetConnection.Connect.Closed":
trace(NAME + ": Connection closed. Uri: " + _uri);
sendConnectionFailedEvent(ConnectionFailedEvent.CONNECTION_CLOSED);
if (!_uri.indexOf("iosvideo") == -1)
{
sendConnectionFailedEvent(ConnectionFailedEvent.CONNECTION_CLOSED);
}
break;

case "NetConnection.Connect.InvalidApp":
Expand Down Expand Up @@ -138,7 +141,7 @@ package org.bigbluebutton.core
break;
}
}

protected function sendConnectionSuccessEvent():void
{
successConnected.dispatch();
Expand Down
11 changes: 11 additions & 0 deletions src/org/bigbluebutton/core/IVideoConnection.as
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,27 @@ package org.bigbluebutton.core
{
function get unsuccessConnected():ISignal
function get successConnected():ISignal
function get unsuccessIOSConnected():ISignal
function get successIOSConnected():ISignal
function get successIOSVideoReconnected():ISignal
function set uri(uri:String):void
function get uri():String
function set iosUri(uri:String):void
function get iosUri():String
function get connection():NetConnection
function get iosConnection():NetConnection
function get iosBaseConnection():IBaseConnection
function get cameraPosition():String;
function set cameraPosition(position:String):void
function get camera():Camera;
function set camera(value:Camera):void
function get selectedCameraQuality():int;
function set selectedCameraQuality(value:int):void
function get streamViewCounter():int
function increaseStreamViewCounter():void
function resetStreamViewCounter():void
function connect():void
function connectIOS():void
function startPublishing(camera:Camera, streamName:String):void
function stopPublishing():void
function selectCameraQuality(value:int):void
Expand Down
Loading