Skip to content

Commit

Permalink
Merge pull request #4942 from ritzalam/investigate-rtmps
Browse files Browse the repository at this point in the history
 - try to make rtmps work in client
  • Loading branch information
ritzalam committed Jan 10, 2018
2 parents d4a5b91 + 3523719 commit e2530ed
Show file tree
Hide file tree
Showing 13 changed files with 30 additions and 12 deletions.
Expand Up @@ -157,10 +157,17 @@ public void stopShareRequest(Map<String, Object> msg) {
public void screenShareClientPongMessage(Map<String, Object> msg) {
String meetingId = Red5.getConnectionLocal().getScope().getName();
String streamId = (String) msg.get("streamId");
Double timestamp = (Double) msg.get("timestamp");
Double timestamp;
if (msg.get("timestamp") instanceof Integer) {
Integer tempTimestamp = (Integer) msg.get("timestamp");
timestamp = tempTimestamp.doubleValue();
} else {
timestamp = (Double) msg.get("timestamp");
}

String userId = (String) Red5.getConnectionLocal().getAttribute("USERID");

//log.debug("Received screenShareClientPongMessage for meeting=[{}]", meetingId);
log.debug("Received screenShareClientPongMessage for meeting=[{}]", meetingId);

handler.screenShareClientPongMessage(meetingId, userId, streamId, timestamp.longValue());
}
Expand Down
3 changes: 2 additions & 1 deletion bigbluebutton-client/src/RTMPConnCheck.mxml
Expand Up @@ -46,7 +46,8 @@
rtmp = testRTMP;
netConnection = new NetConnection();
netConnection.proxyType = "best";
netConnection.proxyType = "best";
netConnection.objectEncoding = ObjectEncoding.AMF3;
netConnection.client = this;
netConnection.addEventListener(NetStatusEvent.NET_STATUS, connectionHandler);
Expand Down
3 changes: 2 additions & 1 deletion bigbluebutton-client/src/WebcamViewStandalone.mxml
Expand Up @@ -102,7 +102,8 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
private function connect(url:String):void {
nc = new NetConnection();
nc.proxyType = "best";
nc.proxyType = "best";
nc.objectEncoding = ObjectEncoding.AMF3;
nc.client = this;
nc.addEventListener(AsyncErrorEvent.ASYNC_ERROR, onAsyncError);
nc.addEventListener(IOErrorEvent.IO_ERROR, onIOError);
Expand Down
Expand Up @@ -96,7 +96,7 @@ package org.bigbluebutton.main.model
/**
* Set default encoding to AMF0 so FMS also understands.
*/
NetConnection.defaultObjectEncoding = ObjectEncoding.AMF0;
NetConnection.defaultObjectEncoding = ObjectEncoding.AMF3;

/**
* Create new port test and connect to the RTMP server.
Expand Down Expand Up @@ -138,7 +138,7 @@ package org.bigbluebutton.main.model
nc = new NetConnection();
nc.client = this;
nc.proxyType = "best";

nc.objectEncoding = ObjectEncoding.AMF3;
nc.addEventListener( NetStatusEvent.NET_STATUS, netStatus );
// connect to server
try {
Expand Down
Expand Up @@ -26,6 +26,7 @@ package org.bigbluebutton.main.model.users
import flash.events.SecurityErrorEvent;
import flash.events.TimerEvent;
import flash.net.NetConnection;
import flash.net.ObjectEncoding;
import flash.net.Responder;
import flash.utils.Timer;

Expand Down Expand Up @@ -80,6 +81,7 @@ package org.bigbluebutton.main.model.users
public function NetConnectionDelegate():void {
dispatcher = new Dispatcher();
_netConnection = new NetConnection();
_netConnection.objectEncoding = ObjectEncoding.AMF3;
_netConnection.proxyType = "best";
_netConnection.client = this;
_netConnection.addEventListener( NetStatusEvent.NET_STATUS, netStatus );
Expand Down Expand Up @@ -420,7 +422,7 @@ package org.bigbluebutton.main.model.users
if (BBB.initConnectionManager().isTunnelling) {
bbbAppsUrl = "rtmpt://" + result.server + "/" + result.app + "/" + intMeetingId;
} else {
bbbAppsUrl = "rtmp://" + result.server + ":1935/" + result.app + "/" + intMeetingId;
bbbAppsUrl = result.protocol + "://" + result.server + "/" + result.app + "/" + intMeetingId;
}

var logData:Object = UsersUtil.initLogData();
Expand Down
Expand Up @@ -95,6 +95,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
private function reInitialize():void {
my_nc = new NetConnection();
my_nc.objectEncoding = ObjectEncoding.AMF3;
my_nc.proxyType = "best";
my_nc.connect(null);
nsStream = new NetStream(my_nc);
Expand Down
2 changes: 2 additions & 0 deletions bigbluebutton-client/src/org/bigbluebutton/modules/broadcast/models/Stream.as 100644 → 100755
Expand Up @@ -24,6 +24,7 @@ package org.bigbluebutton.modules.broadcast.models
import flash.media.Video;
import flash.net.NetConnection;
import flash.net.NetStream;
import flash.net.ObjectEncoding;

import mx.core.UIComponent;

Expand Down Expand Up @@ -119,6 +120,7 @@ package org.bigbluebutton.modules.broadcast.models
private function connect():void {
LOGGER.debug("Connecting {0}", [uri]);
nc = new NetConnection();
nc.objectEncoding = ObjectEncoding.AMF3;
nc.proxyType = "best";
nc.connect(uri);
nc.client = this;
Expand Down
Expand Up @@ -25,6 +25,7 @@ package org.bigbluebutton.modules.phone.managers {
import flash.events.SecurityErrorEvent;
import flash.net.NetConnection;
import flash.net.NetStream;
import flash.net.ObjectEncoding;

import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
Expand Down Expand Up @@ -90,9 +91,9 @@ package org.bigbluebutton.modules.phone.managers {
uri = uri.replace(/rtmp:/gi, "rtmpt:");
}
LOGGER.debug("Connecting to uri=[{0}]", [uri]);
NetConnection.defaultObjectEncoding = flash.net.ObjectEncoding.AMF0;
netConnection = new NetConnection();
netConnection.proxyType = "best";
netConnection.objectEncoding = ObjectEncoding.AMF3;
netConnection.client = this;
netConnection.addEventListener( NetStatusEvent.NET_STATUS , netStatus );
netConnection.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
Expand Down
Expand Up @@ -60,7 +60,7 @@ package org.bigbluebutton.modules.screenshare.services.red5 {
uri = uri.replace(/rtmp:/gi, "rtmpt:");
}

NetConnection.defaultObjectEncoding = flash.net.ObjectEncoding.AMF0;
NetConnection.defaultObjectEncoding = flash.net.ObjectEncoding.AMF3;
netConnection = new NetConnection();
netConnection.proxyType = "best";
netConnection.client = this;
Expand Down
Expand Up @@ -245,7 +245,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
connection = new NetConnection();
connection.proxyType = "best";
connection.objectEncoding = ObjectEncoding.AMF0;
connection.objectEncoding = ObjectEncoding.AMF3;
connection.client = this;
connection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
Expand Down
Expand Up @@ -131,7 +131,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
public function connect(rtmpUrl: String):void {
nc = new NetConnection();
nc.proxyType = "best";
nc.objectEncoding = ObjectEncoding.AMF0;
nc.objectEncoding = ObjectEncoding.AMF3;
nc.client = this;
nc.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
Expand Down
Expand Up @@ -29,6 +29,8 @@ package org.bigbluebutton.modules.videoconf.business
import flash.media.H264VideoStreamSettings;
import flash.net.NetConnection;
import flash.net.NetStream;
import flash.net.ObjectEncoding;

import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
import org.bigbluebutton.core.BBB;
Expand Down Expand Up @@ -68,6 +70,7 @@ package org.bigbluebutton.modules.videoconf.business
_url = url;
parseOptions();
nc = new NetConnection();
nc.objectEncoding = ObjectEncoding.AMF3;
nc.proxyType = "best";
nc.client = this;
nc.addEventListener(AsyncErrorEvent.ASYNC_ERROR, onAsyncError);
Expand Down
Expand Up @@ -49,7 +49,7 @@ package org.red5.flash.bwcheck.app
{
nc = new NetConnection();
nc.proxyType = "best";
nc.objectEncoding = flash.net.ObjectEncoding.AMF0;
nc.objectEncoding = flash.net.ObjectEncoding.AMF3;
nc.client = this;
nc.addEventListener(NetStatusEvent.NET_STATUS, onStatus);
nc.connect("rtmp://" + _serverURL + "/" + _serverApplication);
Expand Down

0 comments on commit e2530ed

Please sign in to comment.