Packagecv.media
Classpublic class RTMPPlayer
InheritanceRTMPPlayer Inheritance NetStreamPlayer Inheritance flash.events.EventDispatcher
ImplementsIMediaPlayer

Version:

1.0.0

Date:

3/10/2009

Updates At:

http://blog.coursevector.com/tempolite

The RTMPPlayer class extends the capabilities of the NetStreamPlayer. Allowing it to stream media from a server.



Public Properties
 PropertyDefined by
 InheritedautoRewind : Boolean = false
Will automatically call stop (rewind) after playing complete.
NetStreamPlayer
 InheritedautoScale : Boolean = false
Gets or sets whether the video object will be scaled to the metadata given for video dimensions.
NetStreamPlayer
 InheritedautoStart : Boolean
Whether media will play automatically once loaded.
NetStreamPlayer
 Inheritedbuffer : int
Gets or sets how long the NetStreamPlayer should buffer the video before playing, in seconds.
NetStreamPlayer
 InheritedcurrentPercent : uint
Gets the current play progress in terms of percent
NetStreamPlayer
 Inheriteddebug : Boolean = false
NetStreamPlayer
 InheritedleftToLeft : Number
A value, from 0 (none) to 1 (all), specifying how much of the left input is played in the left speaker.
NetStreamPlayer
 InheritedleftToRight : Number
A value, from 0 (none) to 1 (all), specifying how much of the left input is played in the right speaker.
NetStreamPlayer
 InheritedloadCurrent : uint
Gets the current load progress in terms of bytes
NetStreamPlayer
 InheritedloadTotal : uint
Gets the total size to be loaded in terms of bytes
NetStreamPlayer
 InheritedmetaData : Object
Gets the metadata if available for the currently playing audio file
NetStreamPlayer
  netConnection : NetConnection
[read-only] Returns a reference to the NetConnection if it exists.
RTMPPlayer
  objectEncoding : uint
Gets or sets the object encodeing for use with streaming servers.
RTMPPlayer
 Inheritedpan : Number
The left-to-right panning of the sound, ranging from -1 (full pan left) to 1 (full pan right).
NetStreamPlayer
 Inheritedpaused : Boolean
Returns the pause status of the player.
NetStreamPlayer
 InheritedrightToLeft : Number
A value, from 0 (none) to 1 (all), specifying how much of the right input is played in the left speaker.
NetStreamPlayer
 InheritedrightToRight : Number
A value, from 0 (none) to 1 (all), specifying how much of the right input is played in the right speaker.
NetStreamPlayer
 Inheritedstatus : String
Returns the load status of the player.
NetStreamPlayer
  streamHost : String
Gets or sets the stream host url for use with streaming media.
RTMPPlayer
 InheritedtimeCurrent : Number
Gets the elapsed play time in milliseconds
NetStreamPlayer
 InheritedtimeLeft : Number
Gets the remaining play time in milliseconds
NetStreamPlayer
 InheritedtimeTotal : Number
Gets the total play time in milliseconds
NetStreamPlayer
 Inheritedvideo : Video
Gets or sets the reference to the display video object.
NetStreamPlayer
 Inheritedvolume : Number
Gets or sets the current volume, from 0 - 1
NetStreamPlayer
Protected Properties
 PropertyDefined by
 InheritedarrFileTypes : Array
NetStreamPlayer
 Inherited_autoStart : Boolean = true
NetStreamPlayer
 Inherited_buffer : Number = 0.1
NetStreamPlayer
 Inheritedclient : Object
NetStreamPlayer
 Inherited_encoding : uint = 0
NetStreamPlayer
 Inherited_leftToLeft : Number = 1
NetStreamPlayer
 Inherited_leftToRight : Number = 0
NetStreamPlayer
 Inherited_loadCurrent : uint
NetStreamPlayer
 InheritedloadTimer : Timer
NetStreamPlayer
 Inherited_loadTotal : uint
NetStreamPlayer
 Inherited_metaData : Object
NetStreamPlayer
 Inheritednc : NetConnection
NetStreamPlayer
 Inheritedns : NetStream
NetStreamPlayer
 Inherited_pan : Number = 0
NetStreamPlayer
 Inherited_paused : Boolean = false
NetStreamPlayer
 InheritedplayTimer : Timer
NetStreamPlayer
 Inherited_rightToLeft : Number = 0
NetStreamPlayer
 Inherited_rightToRight : Number = 1
NetStreamPlayer
 InheritedsendOnce : Boolean = false
NetStreamPlayer
 InheritedskipOnce : Boolean = false
NetStreamPlayer
 Inherited_status : String = "unloaded"
NetStreamPlayer
 Inherited_streamHost : String = "null"
NetStreamPlayer
 InheritedstrURL : String
NetStreamPlayer
 Inheritedvid : Video
NetStreamPlayer
 Inherited_volume : Number = .5
NetStreamPlayer
Public Methods
 MethodDefined by
  
RTMPPlayer
  
addHeader(operation:String, mustUnderstand:Boolean = false, param:Object = null):void
Adds a context header to the Action Message Format (AMF) packet structure.
RTMPPlayer
  
call(command:String, responder:Responder, ... rest):void
Invokes a command or method on Flash Media Server or on an application server running Flash Remoting.
RTMPPlayer
  
isValid(ext:String, url:String):Boolean
RTMPPlayer
 Inherited
load(item:*):void
Loads a new file to be played.
NetStreamPlayer
 Inherited
pause(b:Boolean = true):void
Loads a netstream from the BulkLoader to be played.
NetStreamPlayer
 Inherited
play(pos:int = 0):void
Plays the media, starting at the given position.
NetStreamPlayer
 Inherited
seek(time:*):void
Seeks to time given in the media.
NetStreamPlayer
 Inherited
seekPercent(n:Number):void
Seeks to the given percent in the media
NetStreamPlayer
 Inherited
stop():void
Stops the media at the specified position.
NetStreamPlayer
 Inherited
unload():void
Stops the media, closes the NetConnetion or NetStream, and resets the metadata.
NetStreamPlayer
Protected Methods
 MethodDefined by
 Inherited
createConnection(command:String = null):void
NetStreamPlayer
 Inherited
createStream(netstream:NetStream = null):void
NetStreamPlayer
 Inherited
errorHandler(e:ErrorEvent):void
NetStreamPlayer
 Inherited
NetStreamPlayer
 Inherited
loadTimerHandler(event:TimerEvent):void
NetStreamPlayer
  
netStatusHandler(e:NetStatusEvent):void
RTMPPlayer
  
onBWCheck(... rest):Number
This is required by native bandwidth detection.
RTMPPlayer
  
onBWDone(... rest):void
The server calls the onBWDone() function when it finishes measuring the bandwidth.
RTMPPlayer
  
onCaption(cps:String, spk:Number):void
RTMPPlayer
  
onCaptionInfo(o:Object):void
RTMPPlayer
 Inherited
onCuePoint(o:Object):void
NetStreamPlayer
  
onFCSubscribe(o:Object):void
RTMPPlayer
  
onImageData(o:Object):void
RTMPPlayer
  
onLastSecond(o:Object):void
RTMPPlayer
 Inherited
onMetaData(o:Object):void
Handles the metadata returned.
NetStreamPlayer
  
onPlayStatus(o:Object):void
RTMPPlayer
  
onTextData(o:Object):void
RTMPPlayer
 Inherited
playTimerHandler(event:TimerEvent):void
NetStreamPlayer
  
RtmpSampleAccess(o:Object):void
RTMPPlayer
 Inherited
setStatus(str:String):void
NetStreamPlayer
 Inherited
trace2(... arguements):void
NetStreamPlayer
 Inherited
NetStreamPlayer
 Inherited
NetStreamPlayer
Events
 EventSummaryDefined by
   Dispatched when onBWDone is called.RTMPPlayer
   Dispatched when onCaption is called.RTMPPlayer
   Dispatched when onCaptionInfo is called.RTMPPlayer
 Inherited Dispatched when a cue point is reached.NetStreamPlayer
   Dispatched when onFCSubscribe is called.RTMPPlayer
   Dispatched when onImageData is called.RTMPPlayer
   Dispatched when onLastSecond is called.RTMPPlayer
 Inherited Dispatched when the media file has completed loading NetStreamPlayer
 Inherited Dispatched as a media file is loaded NetStreamPlayer
 Inherited Dispatched as a media file begins loading NetStreamPlayer
 Inherited Dispatched as metadata is receieved from the media playing NetStreamPlayer
 Inherited Dispatched as a media file finishes playing NetStreamPlayer
 Inherited Dispatched as a media file is playing NetStreamPlayer
 Inherited Dispatched once as a media file first begins to play NetStreamPlayer
   Dispatched when onPlayStatus is called.RTMPPlayer
   Dispatched when RTMPSampleAccess is called.RTMPPlayer
 Inherited Dispatched when isPause or isPlaying has updated.NetStreamPlayer
   Dispatched when onTextData is called.RTMPPlayer
Public Constants
 ConstantDefined by
  VERSION : String = "1.0.0"
[static] The current version
RTMPPlayer
Property detail
netConnectionproperty
netConnection:NetConnection  [read-only]

Returns a reference to the NetConnection if it exists. This is used instead of having all the same properties in NetStreamPlayer. Note: addHeader() and call() are added to NetStreamPlayer for your convenience.

Implementation
    public function get netConnection():NetConnection

See also

objectEncodingproperty 
objectEncoding:uint  [read-write]

Gets or sets the object encodeing for use with streaming servers.

Implementation
    public function get objectEncoding():uint
    public function set objectEncoding(value:uint):void
streamHostproperty 
streamHost:String  [read-write]

Gets or sets the stream host url for use with streaming media.

Implementation
    public function get streamHost():String
    public function set streamHost(value:String):void
Constructor detail
RTMPPlayer()constructor
public function RTMPPlayer()
Method detail
addHeader()method
public function addHeader(operation:String, mustUnderstand:Boolean = false, param:Object = null):void

Adds a context header to the Action Message Format (AMF) packet structure. This header is sent with every future AMF packet. If you call NetConnection.addHeader() using the same name, the new header replaces the existing header, and the new header persists for the duration of the NetConnection object. You can remove a header by calling NetConnection.addHeader() with the name of the header to remove an undefined object.

Parameters
operation:String — Identifies the header and the ActionScript object data associated with it.
 
mustUnderstand:Boolean (default = false) — A value of true indicates that the server must understand and process this header before it handles any of the following headers or messages.
 
param:Object (default = null) — Any ActionScript object.
call()method 
public function call(command:String, responder:Responder, ... rest):void

Invokes a command or method on Flash Media Server or on an application server running Flash Remoting.

Parameters
command:String — A method specified in the form [objectPath/]method. For example, the someObject/doSomething command tells the remote server to invoke the clientObject.someObject.doSomething() method, with all the optional ... arguments parameters. If the object path is missing, clientObject.doSomething() is invoked on the remote server.
 
responder:Responder — An optional object that is used to handle return values from the server. The Responder object can have two defined methods to handle the returned result: result and status. If an error is returned as the result, status is invoked; otherwise, result is invoked. The Responder object can process errors related to specific operations, while the NetConnection object responds to errors related to the connection status.
 
... rest — rest Optional arguments that can be of any ActionScript type, including a reference to another ActionScript object. These arguments are passed to the method specified in the command parameter when the method is executed on the remote application server.
isValid()method 
public override function isValid(ext:String, url:String):BooleanParameters
ext:String
 
url:String

Returns
Boolean
netStatusHandler()method 
protected override function netStatusHandler(e:NetStatusEvent):voidParameters
e:NetStatusEvent
onBWCheck()method 
protected function onBWCheck(... rest):Number

This is required by native bandwidth detection. It takes an argument, ...rest. The function must return a value, even if the value is 0, to indicate to the server that the client has received the data.

Parameters
... rest — rest

Returns
Number
onBWDone()method 
protected function onBWDone(... rest):void

The server calls the onBWDone() function when it finishes measuring the bandwidth. It takes four arguments. The first argument it returns is the bandwidth measured in Kbps. The second and third arguments are not used. The fourth argument is the latency in milliseconds.

Parameters
... rest — rest
onCaption()method 
protected function onCaption(cps:String, spk:Number):voidParameters
cps:String
 
spk:Number
onCaptionInfo()method 
protected function onCaptionInfo(o:Object):voidParameters
o:Object
onFCSubscribe()method 
protected function onFCSubscribe(o:Object):voidParameters
o:Object
onImageData()method 
protected function onImageData(o:Object):voidParameters
o:Object
onLastSecond()method 
protected function onLastSecond(o:Object):voidParameters
o:Object
onPlayStatus()method 
protected function onPlayStatus(o:Object):voidParameters
o:Object
onTextData()method 
protected function onTextData(o:Object):voidParameters
o:Object
RtmpSampleAccess()method 
protected function RtmpSampleAccess(o:Object):voidParameters
o:Object
Event detail
bandwidthevent 
Event object type: cv.events.MetaDataEvent

Dispatched when onBWDone is called.

captionevent  
Event object type: cv.events.MetaDataEvent

Dispatched when onCaption is called.

captionInfoevent  
Event object type: cv.events.MetaDataEvent

Dispatched when onCaptionInfo is called.

fcSubscribeevent  
Event object type: cv.events.MetaDataEvent

Dispatched when onFCSubscribe is called.

imageDataevent  
Event object type: cv.events.MetaDataEvent

Dispatched when onImageData is called.

lastSecondevent  
Event object type: cv.events.MetaDataEvent

Dispatched when onLastSecond is called.

playStatusevent  
Event object type: cv.events.MetaDataEvent

Dispatched when onPlayStatus is called.

RTMPSampleAccessevent  
Event object type: cv.events.MetaDataEvent

Dispatched when RTMPSampleAccess is called.

textDataevent  
Event object type: cv.events.MetaDataEvent

Dispatched when onTextData is called.

Constant detail
VERSIONconstant
public static const VERSION:String = "1.0.0"

The current version