| Package | fl.video |
| Class | public class NCManager |
| Inheritance | NCManager Object |
| Implements | INCManager |
| Subclasses | NCManagerNative |
| Language Version: | ActionScript 3.0 |
| Runtime Versions: | AIR 1.0 Flash Player 9.0.28.0 |
NetConnection
object for the VideoPlayer class, a
helper class for that user facing class.
The NCManager class searches a URL and assumes the following:
| Property | Defined By | ||
|---|---|---|---|
| bitrate : Number When streaming from Flash Media Server (FMS), the bitrate property
returns the value calculated from autodetection,
not the value set through the bitrate() property. | NCManager | ||
![]() | constructor : Object A reference to the class object or constructor function for a given object instance. | Object | |
| fallbackServerName : String Exposes the fallbackServerName property indirectly or directly. | NCManager | ||
| isRTMP : Boolean [read-only] Whether the URL is for RTMP streaming from a Flash Media Server (FMS)
or a progressive download. | NCManager | ||
| netConnection : NetConnection [read-only] Reference to the NetConnection object. | NCManager | ||
![]() | prototype : Object [static] A reference to the prototype object of a class or function object. | Object | |
| streamHeight : int [read-only] Height of the stream, in pixels. | NCManager | ||
| streamLength : Number [read-only] Length of the stream, in seconds. | NCManager | ||
| streamName : String [read-only] The stream name passed into the
NetStream.play() method. | NCManager | ||
| streamWidth : int [read-only] Width of the stream, in pixels. | NCManager | ||
| timeout : uint The time in milliseconds after which attempts to make a connection stop. | NCManager | ||
| videoPlayer : VideoPlayer The VideoPlayer object that owns this object. | NCManager | ||
| Method | Defined By | ||
|---|---|---|---|
Creates a new NCManager instance. | NCManager | ||
Closes the NetConnection. | NCManager | ||
Called by the VideoPlayer object if the connection is
successfully made but the stream is not found. | NCManager | ||
Called by the VideoPlayer object to ask for a connection to the
URL. | NCManager | ||
Allows getting of the fallbackServerName, fpadZone, objectEncoding,
and proxyType properties. | NCManager | ||
![]() | Indicates whether an object has a specified property defined. | Object | |
Called by any helper object doing a task for the
NCManager object to signal it has completed
and whether it was successful. | NCManager | ||
![]() | Indicates whether an instance of the Object class is in the prototype chain of the object specified
as the parameter. | Object | |
![]() | Indicates whether the specified property exists and is enumerable. | Object | |
Called by the VideoPlayer object to ask for reconnection
after the connection is lost. | NCManager | ||
Allows setting of the fallbackServerName, fpadZone, objectEncoding,
and proxyType properties. | NCManager | ||
![]() | Sets the availability of a dynamic property for loop operations. | Object | |
![]() | Returns the string representation of the specified object. | Object | |
![]() | Returns the primitive value of the specified object. | Object | |
| Constant | Defined By | ||
|---|---|---|---|
| DEFAULT_TIMEOUT : uint = 60000 The default timeout in milliseconds. | NCManager | ||
| SHORT_VERSION : String = "2.1" [static] State variable indicating the short version number of the component. | NCManager | ||
| VERSION : String = "2.1.0.20" [static] State variable indicating the long version number of the component. | NCManager | ||
| bitrate | property |
bitrate:Number [read-write] | Language Version: | ActionScript 3.0 |
| Runtime Versions: | AIR 1.0 Flash Player 9.0.28.0 |
When streaming from Flash Media Server (FMS), the
bitrate
property
returns the value calculated from autodetection,
not the value set through the
bitrate()
property.
public function get bitrate():Number public function set bitrate(value:Number):voidSee also
| fallbackServerName | property |
public var fallbackServerName:String| Language Version: | ActionScript 3.0 |
| Runtime Versions: | AIR 1.0 Flash Player 9.0.28.0 |
Exposes the
fallbackServerName
property indirectly or directly.
fallbackServerName
property uses that base attribute.
(The
fallbackServerName
property uses the server name only,
nothing else.)
ncMgr
property in
FLVPlayback or VideoPlayer and set the
fallbackServerName
property or use
the
setProperty()
method.
See also
| isRTMP | property |
isRTMP:Boolean [read-only] | Language Version: | ActionScript 3.0 |
| Runtime Versions: | AIR 1.0 Flash Player 9.0.28.0 |
Whether the URL is for RTMP streaming from a Flash Media Server (FMS)
or a progressive download. If the
stream is an RTMP stream from an FMS, then
true
. If the stream is a
progressive download of an HTTP, local or other file, then
false
.
public function get isRTMP():BooleanSee also
| netConnection | property |
netConnection:NetConnection [read-only] | Language Version: | ActionScript 3.0 |
| Runtime Versions: | AIR 1.0 Flash Player 9.0.28.0 |
Reference to the NetConnection object.
public function get netConnection():NetConnectionSee also
| streamHeight | property |
streamHeight:int [read-only] | Language Version: | ActionScript 3.0 |
| Runtime Versions: | AIR 1.0 Flash Player 9.0.28.0 |
Height of the stream, in pixels. After the
VideoPlayer.ncConnected()
method is called, if the
streamHeight
property is less than 0, that indicates to the VideoPlayer object that there is no stream
height information. If the
VideoPlayer object has the
scaleMode
property set
to
VideoScaleMode.MAINTAIN_ASPECT_RATIO
or
VideoScaleMode.NO_SCALE
,
then this value will be used and the resizing will
happen instantly, rather than waiting.
public function get streamHeight():intSee also
| streamLength | property |
streamLength:Number [read-only] | Language Version: | ActionScript 3.0 |
| Runtime Versions: | AIR 1.0 Flash Player 9.0.28.0 |
Length of the stream, in seconds. After the
VideoPlayer.ncConnected()
method
is called, if it returns undefined,
null
or less than 0,
then the VideoPlayer object knows that there is no stream length information.
If stream length information is returned, it overrides any existing steam length information
including information set by the
totalTime
parameter of the
VideoPlayer.play()
method or the
VideoPlayer.load()
method or information received from the FLV file's metadata.
public function get streamLength():NumberSee also
| streamName | property |
streamName:String [read-only] | Language Version: | ActionScript 3.0 |
| Runtime Versions: | AIR 1.0 Flash Player 9.0.28.0 |
The stream name passed into the
NetStream.play()
method.
public function get streamName():StringSee also
| streamWidth | property |
streamWidth:int [read-only] | Language Version: | ActionScript 3.0 |
| Runtime Versions: | AIR 1.0 Flash Player 9.0.28.0 |
Width of the stream, in pixels. After the
VideoPlayer.ncConnected()
method is called, if the
streamWidth
property
is less than 0, that indicates to the VideoPlayer object that there is no stream width
information. If the VideoPlayer object has the
scaleMode
property set
to
VideoScaleMode.MAINTAIN_ASPECT_RATIO
or
VideoScaleMode.NO_SCALE
,
then this value is used and the resizing happens instantly, rather than waiting.
public function get streamWidth():intSee also
| timeout | property |
timeout:uint [read-write] | Language Version: | ActionScript 3.0 |
| Runtime Versions: | AIR 1.0 Flash Player 9.0.28.0 |
The time in milliseconds after which attempts to make a connection stop.
public function get timeout():uint public function set timeout(value:uint):voidSee also
| videoPlayer | property |
videoPlayer:VideoPlayer [read-write] | Language Version: | ActionScript 3.0 |
| Runtime Versions: | AIR 1.0 Flash Player 9.0.28.0 |
The VideoPlayer object that owns this object.
public function get videoPlayer():VideoPlayer public function set videoPlayer(value:VideoPlayer):voidSee also
| NCManager | () | Constructor |
public function NCManager()| Language Version: | ActionScript 3.0 |
| Runtime Versions: | AIR 1.0 Flash Player 9.0.28.0 |
Creates a new NCManager instance.
| close | () | method |
public function close():void| Language Version: | ActionScript 3.0 |
| Runtime Versions: | AIR 1.0 Flash Player 9.0.28.0 |
Closes the NetConnection.
See also
| connectAgain | () | method |
public function connectAgain():Boolean| Language Version: | ActionScript 3.0 |
| Runtime Versions: | AIR 1.0 Flash Player 9.0.28.0 |
Called by the VideoPlayer object if the connection is successfully made but the stream is not found. If multiple alternate interpretations of the RTMP URL are possible, it tries to connect to the server with a different URL and hand back a different stream name.
This can be necessary in cases where the URL is something like rtmp://servername/path1/path2/path3. When passing in an application name and an instance name, open the NetConnection object with rtmp://servername/path1/path2, or use the default instance so the stream is opened with path2/path3. In general, this is possible whenever there are more than two parts to the path but not possible if there are only two (there should never be only one).
ReturnsBoolean —
If an attempt is made to make another connection, then
true
.
If an attempt has already been made or no additional attempts
are merited, then
false
.
|
See also
| connectToURL | () | method |
public function connectToURL(url:String):Boolean| Language Version: | ActionScript 3.0 |
| Runtime Versions: | AIR 1.0 Flash Player 9.0.28.0 |
Called by the VideoPlayer object to ask for a connection to the
URL. Once a connection is successful or failed, then call the
VideoPlayer.ncConnected()
method. If the connection has failed, then
set
nc = null
before calling.
Parameters
url:String — The URL to which the VideoPlayer object requests connection. |
Boolean —
If a connection is made synchronously,
true
. If an attempt is
made asynchronously so caller should expect a "connected"
event coming,
false
.
|
See also
| getProperty | () | method |
public function getProperty(propertyName:String):*| Language Version: | ActionScript 3.0 |
| Runtime Versions: | AIR 1.0 Flash Player 9.0.28.0 |
Allows getting of the
fallbackServerName
,
fpadZone
,
objectEncoding
,
and
proxyType
properties. See
setProperty()
for
an explanation of these properties.
Parameters
propertyName:String —
The name of the property that the
getProperty
method is calling.
|
* — String representation of the fallbackServerName, fpadZone, objectEncoding, and proxyType properties. |
See also
| helperDone | () | method |
public function helperDone(helper:Object, success:Boolean):void| Language Version: | ActionScript 3.0 |
| Runtime Versions: | AIR 1.0 Flash Player 9.0.28.0 |
Called by any helper object doing a task for the NCManager object to signal it has completed and whether it was successful. The NCManager object uses this with SMILManager.
Parameters
helper:Object — The helper object. | |
success:Boolean —
A setting to signal when a task is completed. If
success
is
true
, then the task was completed successfully; otherwise
false
.
|
See also
| reconnect | () | method |
public function reconnect():void| Language Version: | ActionScript 3.0 |
| Runtime Versions: | AIR 1.0 Flash Player 9.0.28.0 |
Called by the VideoPlayer object to ask for reconnection
after the connection is lost. Once the connection is either successful
or failed, call the
VideoPlayer.ncReconnected()
method. If the
connection failed, set
nc = null
before calling.
See also
| setProperty | () | method |
public function setProperty(propertyName:String, value:*):void| Language Version: | ActionScript 3.0 |
| Runtime Versions: | AIR 1.0 Flash Player 9.0.28.0 |
Allows setting of the
fallbackServerName
,
fpadZone
,
objectEncoding
,
and
proxyType
properties.
The
fallbackServerName
property specifies a Flash Media Server (FMS) URL
to be used if the primary server address derived from the URL passed
into
connectToURL()
cannot be reached. This property can also be set
directly through the
fallbackServerName
property.
The
fpadZone
property specifies the
fpadZone
property for Flash Media Server (FMS).
If the returned value is not a number (NaN),
then no zone is set.
The
fpadZone
property must be set before
the connection process begins to have effect.
If you do not want to set a zone, set the
fpadZone
property to
NaN
.
NaN
.
The
objectEncoding
property specifies the value to be used for the
objectEncoding
property on
NetConnection
instances. Default is
flash.net.ObjectEncoding.AMF0
.
The
proxyType
property specifies the value to be used for the
proxyType
property on
NetConnection
instances. Default is "best".
Parameters
propertyName:String —
The name of the property that the
setProperty
method is calling.
| |
value:* — The property value. |
See also
| DEFAULT_TIMEOUT | Constant |
public const DEFAULT_TIMEOUT:uint = 60000| Language Version: | ActionScript 3.0 |
| Runtime Versions: | AIR 1.0 Flash Player 9.0.28.0 |
The default timeout in milliseconds.
See also
| SHORT_VERSION | Constant |
public static const SHORT_VERSION:String = "2.1"| Language Version: | ActionScript 3.0 |
| Runtime Versions: | AIR 1.0 Flash Player 9.0.28.0 |
State variable indicating the short version number of the component. The version number is useful when you have a FLA file and need to know the component version. To determine the component version, type the following code trace into the FLA file:
FLVPlayback.SHORT_VERSION
The
SHORT_VERSION
variable includes only the major
and minor version numbers, for example, 2.0. The
VERSION
variable includes
the major and minor version numbers as well as the revision and build numbers,
for example, 2.0.0.11.
See also
| VERSION | Constant |
public static const VERSION:String = "2.1.0.20"| Language Version: | ActionScript 3.0 |
| Runtime Versions: | AIR 1.0 Flash Player 9.0.28.0 |
State variable indicating the long version number of the component. The version number is useful when you have a FLA file and need to know the component version. To determine the component version, type the following code trace into the FLA file:
FLVPlayback.VERSION
The
VERSION
variable includes
the major and minor version numbers as well as the revision and build numbers,
for example, 2.0.0.11. The
SHORT_VERSION
variable includes only the major
and minor version numbers, for example, 2.0.
See also
To run the example, follow these steps:
testVideoPath
with an absolute or relative path to an FLV file.
package
{
import fl.video.VideoEvent;
import fl.video.VideoPlayer;
import flash.display.Sprite;
public class NCManagerExample extends Sprite
{
private var videoPath:String = "http://www.helpexamples.com/flash/video/sheep.flv"
private var player:VideoPlayer;
public function NCManagerExample() {
player = new VideoPlayer();
player.play(videoPath);
player.addEventListener(VideoEvent.READY,announceRTMS);
addChild(player);
}
private function announceRTMS(e:VideoEvent):void {
var player:VideoPlayer = e.target as VideoPlayer;
if(player.ncMgr.isRTMP) {
trace("Video is streaming");
}
else {
trace("Video is progressively downloading");
}
}
}
}