Skip to content

Commit

Permalink
support for record selection in UI.
Browse files Browse the repository at this point in the history
  • Loading branch information
bustardcelly committed Sep 22, 2016
1 parent e258996 commit f265a33
Showing 1 changed file with 37 additions and 3 deletions.
40 changes: 37 additions & 3 deletions flash-clients/Broadcaster/src/Broadcaster.mxml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,30 @@
</s:VGroup>
</s:Group>

<s:Group width="100%">
<s:Rect width="100%" height="100%">
<s:fill>
<s:SolidColor color="#e3e3e3" />
</s:fill>
</s:Rect>
<s:VGroup width="100%"
paddingTop="10" paddingLeft="10"
paddingBottom="10" paddingRight="10">

<s:Label width="100%"
styleName="header"
text="Enable Recording of the Stream (for VOD)?"
/>
<!-- Upstream Buffer -->
<s:CheckBox id="recordCheck"
width="100%"
label="Enable Recording"
enabled="false"
selected="false"
/>
</s:VGroup>
</s:Group>

<s:Group width="100%">
<s:Rect width="100%" height="100%">
<s:fill>
Expand Down Expand Up @@ -221,7 +245,6 @@

<fx:Script>
<![CDATA[
import flash.utils.setTimeout;
import mx.binding.utils.BindingUtils;
import mx.controls.Alert;
Expand All @@ -237,9 +260,11 @@
private var streamName:String;
private var context:String = "live";
private var streamHost:String = "localhost";
private var streamType:String = "live";
private var streamType:String = STREAM_TYPE_LIVE;
private static const STREAM_TYPE:Array = ["live", "record"];
private static const STREAM_TYPE_LIVE:String = "live";
private static const STREAM_TYPE_RECORD:String = "record";
private static const STREAM_TYPE:Array = [STREAM_TYPE_LIVE, STREAM_TYPE_RECORD];
private var quality:String = RESOLUTION_MID;
private var useHigherQuality:Boolean = false;
Expand Down Expand Up @@ -282,7 +307,11 @@
// Enable input fields as we have basic criteria
streamNameField.enabled = true;
resolutionGroup.enabled = true;
recordCheck.enabled = true;
bufferCheck.enabled = true;
recordCheck.selected = (streamType == STREAM_TYPE_RECORD);
// Default AMF encoding.
NetConnection.defaultObjectEncoding = ObjectEncoding.AMF0;
Expand Down Expand Up @@ -491,6 +520,10 @@
netStream.attachCamera(camera);
netStream.addEventListener(NetStatusEvent.NET_STATUS, onStatus, false);
if(recordCheck.selected) {
this.streamType = STREAM_TYPE_RECORD;
}
if(quality == RESOLUTION_LOW) {
h264settings = setUpLowQualityBroadcast();
}
Expand Down Expand Up @@ -541,6 +574,7 @@
if(bufferCheck.selected) {
netStream.bufferTime = 1;
}
microphone.encodeQuality = 4;
return h264settings;
Expand Down

0 comments on commit f265a33

Please sign in to comment.