The default is _100
Here is the code:
import flash.geom.*;
var nc:NetConnection;
var nsPlay:NetStream = null;
var serverName:String = “rtmp://server/video”;
var movieName:String = “Extremists”;
var duration:Number = 0;
var progressTimer:Number = 0;
var isPlaying:Boolean = true;
var isProgressUpdate:Boolean = false;
var fastSettings:Array = new Array();
var currFastDir:Number = 0;
var currFastIndex:Number = 0;
var scrubTimer:Number = 0;
var isScrubbing:Boolean = false;
var scrubTime:Number = 0;
var scrubIsPlaying:Boolean;
var stageListener:Object = new Object();
var saveVideoObjX:Number;
var saveVideoObjY:Number;
var saveVideoObjW:Number;
var saveVideoObjH:Number;
var adjVideoObjW:Number;
var adjVideoObjH:Number;
var videoSizeTimer:Number = 0;
var videoLastW:Number = 0;
var videoLastH:Number = 0;
var fullscreenCapable:Boolean = false;
var hardwareScaleCapable:Boolean = false;
function mainInit()
{
// get movie name from parameter is defined
if (_root.zmovieName != undefined)
movieName = _root.zmovieName;
// initialize player control events
_root.controls.doPlay.onPress = _root.doPlayToggle;
_root.controls.doRewind.onPress = _root.doRewind;
_root.slider.onPress = _root.startScrub;
_root.slider.onRelease = _root.stopScrub;
_root.slider.onReleaseOutside = _root.stopScrub;
// uncomment this to monitor frame rate and buffer length
//setInterval(_root, “updateStreamValues”, 500);
_root.connect.connectStr.text = serverName;
_root.connect.streamStr.text = movieName;
_root.connect.connectButton.onPress = _root.doConnect;
_root.doFullscreen.onPress = _root.enterFullscreen;
enablePlayControls(false);
stageListener.onFullScreen = enterLeaveFullscreen;
Stage.addListener( stageListener );
saveVideoObjX = videoObj._x;
saveVideoObjY = videoObj._y;
adjVideoObjW = (saveVideoObjW = videoObj._width);
adjVideoObjH = (saveVideoObjH = videoObj._height);
videoObj._visible = false;
fullscreenCapable = testVersion(9, 0, 28, 0);
hardwareScaleCapable = testVersion(9, 0, 60, 0);
}
function doConnect()
{
// connect to the Wowza Media Server
if (nc == null)
{
enablePlayControls(true);
nc = new NetConnection();
nc.onStatus = function(infoObject)
{
trace(“nc.onStatus: “+infoObject.code+” (”+infoObject.description+")");
for (var prop in infoObject)
{
trace("\t"+prop+":\t"+infoObject[prop]);
}
// once we are connected to the server create the nsPlay NetStream object
if (infoObject.code == “NetConnection.Connect.Success”)
{
enablePlayControls(true);
createPlayStream();
videoLastW = 0;
videoLastH = 0;
videoSizeTimer = setInterval(_root, “updateVideoSize”, 500);
}
else if (infoObject.code == “NetConnection.Connect.Failed”)
_root.prompt.text = “Connection failed: Try rtmp://[server-ip-address]/simplevideostreaming”;
else if (infoObject.code == “NetConnection.Connect.Rejected”)
_root.prompt.text = infoObject.description;
}
nc.connect(_root.connect.connectStr.text);
// uncomment this to monitor frame rate and buffer length
//debugInterval = setInterval(_root, “updateStreamValues”, 500);
_root.connect.connectButton.label = “Stop”;
}
else
{
videoObj.attachVideo(null);
videoObj.attachAudio(null);
videoObj.clear();
videoObj._visible = false;
if (videoSizeTimer)
clearInterval(videoSizeTimer);
videoSizeTimer = 0;
videoLastW = 0;
videoLastH = 0;
nc.close();
nc = null;
if (debugInterval > 0)
clearInterval(debugInterval);
debugInterval = 0;
enablePlayControls(false);
setProgress(0);
_root.connect.connectButton.label = “Play”;
_root.prompt.text = “”;
}
}
function enablePlayControls(isEnable:Boolean)
{
_root.controls.doPlay.enabled = isEnable;
_root.controls.doRewind.enabled = isEnable;
_root.doFullscreen._visible = isEnable & fullscreenCapable;
}
// function to monitor the frame rate and buffer length
function updateStreamValues()
{
var newVal:String = “”;
if (nsPlay != null)
newVal = (Math.round(nsPlay.currentFps1000)/1000)+" fps/"+(Math.round(nsPlay.bufferLength1000)/1000)+" secs";
fpsText.text = newVal;
}
// create the nsPlay NetStream object
function createPlayStream()
{
nsPlay = new NetStream(nc);
nsPlay.onStatus = function(infoObject)
{
trace("onStatus: ");
for (var propName:String in infoObject)
{
trace(" "+propName + " = " + infoObject[propName]);
}
if (infoObject.code == “NetStream.Play.Start”)
_root.isProgressUpdate = true;
else if (infoObject.code == “NetStream.Play.StreamNotFound” || infoObject.code == “NetStream.Play.Failed”)
_root.prompt.text = infoObject.description;
};
nsPlay.onMetaData = function(infoObject:Object)
{
trace(“onMetaData”);
// print debug information about the metaData
for (var propName:String in infoObject)
{
trace(" "+propName + " = " + infoObject[propName]);
}
// grab the movies duration from the metadata
if (_root.duration == 0)
{
_root.duration = infoObject.duration;
progressTimer = setInterval(_root, “updateProgress”, 250);
}
};
// print debug information when we encounter a cuePoint
nsPlay.onCuePoint = function(infoObject)
{
trace(“onCuePoint: “+infoObject.name+” (”+infoObject.type+")");
for(param in infoObject.parameters)
{
trace(" param: “+param+”="+infoObject.parameters[param]);
}
};
// print debug information when we play status changes
nsPlay.onPlayStatus = function(infoObject:Object)
{
trace(“onPlayStatus”);
for (var prop in infoObject)
{
trace("\t"+prop+":\t"+infoObject[prop]);
}
};
// set the buffer time and attach the video and audio
nsPlay.setBufferTime(3);
_root.videoObj.attachVideo(nsPlay);
_root.videoObj.attachAudio(nsPlay);
// start playback
_root.isProgressUpdate = false;
_root.isPlaying = true;
var bandwidthVer = “_100”;
if (detected_bw >= 800)
bandwidthVer = “_750”;
else if (detected_bw >= 550)
bandwidthVer = “_500”;
else if (detected_bw >= 300)
bandwidthVer = “_250”;
_root.connect.streamStr.text = _root.connect.streamStr.text+bandwidthVer;
nsPlay.play(_root.connect.streamStr.text);
}