mx.controls.streamingmedia.AbstractPlayer +--mx.controls.streamingmedia.RTMPPlayer
IPlayer
RTMPPlayer contains the logic to play FLV streaming media files from Flash Communication Server.
_appUrl
, _checkCompleteId
, _conn_Id
, _connectTimeOutId
, _isLoaded
, _isLoading
, _isPausing
, _isPlayPending
, _isSeeking
, _listeners
, _mediaType
, _mediaUrl
, _momentaryPlayId
, _nc_rtmp
, _nc_rtmpt
, _ns
, _playHeadPos
, _port
, _protocol
, _sound
, _statusCount
, _streamName
, _totalTime
, _video
, _videoHeight
, _videoHolder
, _videoWidth
_playing
, playing
new RTMPPlayer()
public _videoHolder:MovieClip
public _video:Video
private _sound:Sound
private _nc_rtmp:RTMPConnection
private _nc_rtmpt:RTMPConnection
private _ns:PlayerNetStream
private _mediaUrl:String
private _mediaType:String
private _protocol:String
private _port:String
private _appUrl:String
private _streamName:String
private _totalTime:Number
private _isLoaded:Boolean
private _isLoading:Boolean
private _listeners:Array
private _momentaryPlayId:Number
private _checkCompleteId:Number
private _connectTimeOutId:Number
private _conn_Id:Number
private _statusCount:Number
private _playHeadPos:Number
private _isSeeking:Boolean
private _isPausing:Boolean
private _isPlayPending:Boolean
private _videoHeight:Number
private _videoWidth:Number
public function broadcastEvent(status:String):Void
The listeners must implement the "handlePlayer" function which takes the current status as a parameter.
public function load():Void
Make connection to the server and load the media without playing it.
private function startStream(nc:NetConnection):Void
This is called when successfully connected to the server, and play the stream if play is pending.
private function actualConnect():Void
Make the actual connection to the server, if the protocol is rtmp and no port is specified. We make an extra rtmpt connection to the server after 1.5 seconds. And use the connection whenever which one makes the connection first.
public function connectRtmpt():Void
This is called if we are not getting a successful rtmp connection after 3 seconds stream if play is pending
public function play(startingPoint:Number):Void
Play the media starting at the specified starting point. If the media hasn't yet been loaded, load it.
- Parameters
startingPoint
The number of seconds into the media to start at. This is an optional parameter. If omitted, playing will occur at the current playhead position.
public function getPlayheadTime():Number
- Return
- The playhead position, measued in seconds since the start.
public function getMediaBytesLoaded():Number
- Return
- The number of bytes of the media that has loaded.
public function getMediaBytesTotal():Number
- Return
- The total number of bytes of the media.
public function getTotalTime():Number
- Return
- The total time of the media in seconds. It is a property that is manually set by the author.