Skip to content

Commit

Permalink
allowing for context query param.
Browse files Browse the repository at this point in the history
  • Loading branch information
bustardcelly committed Sep 22, 2016
1 parent 997a5f1 commit e258996
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions flash-clients/Broadcaster/src/Broadcaster.mxml
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@
private var microphone:Microphone;
private var streamName:String;
private var context:String = "live";
private var streamHost:String = "localhost";
private var streamType:String = "live";
Expand Down Expand Up @@ -267,6 +268,10 @@
streamHost = loaderInfo.parameters.host;
}
if (loaderInfo.parameters.context) {
context = loaderInfo.parameters.context;
}
if (loaderInfo.parameters.streamType) {
var st:String = loaderInfo.parameters.streamType;
if (STREAM_TYPE.indexOf(st) > -1) {
Expand Down Expand Up @@ -434,7 +439,7 @@
netConnection.client = this;
netConnection.addEventListener(NetStatusEvent.NET_STATUS, onStatus, false, 0, true);
// 'live' is our endpoint from the Red5 Pro Server webapps.
rtmpEndpoint = "rtmp://" + streamHost + "/live";
rtmpEndpoint = "rtmp://" + this.streamHost + "/" + this.context;
netConnection.connect(rtmpEndpoint);
startStreamButton.label = STOP_BROADCAST;
Expand Down Expand Up @@ -462,8 +467,8 @@
log("" + event.info.code);
if(ExternalInterface.available) {
try{
var rtmpEndpoint:String = "rtmp://" + streamHost + "/live";
ExternalInterface.call("broadcast.onStatus",{host:rtmpEndpoint,streamName:streamName, status:"" + event.info.code });
var rtmpEndpoint:String = "rtmp://" + this.streamHost + "/" + this.context;
ExternalInterface.call("broadcast.onStatus",{host: rtmpEndpoint, streamName: this.streamName, status: "" + event.info.code});
}catch(e:Error){
}
Expand Down Expand Up @@ -506,7 +511,7 @@
netStream.videoStreamSettings = h264settings;
netStream.attachAudio(microphone);
netStream.publish(streamName, streamType);
log("Publishing as stream name '" + streamName + "'...");
log("Publishing as stream name '" + this.streamName + "'...");
break;
Expand Down

0 comments on commit e258996

Please sign in to comment.