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, playingnew RTMPPlayer()
public _videoHolder:MovieClippublic _video:Videoprivate _sound:Soundprivate _nc_rtmp:RTMPConnectionprivate _nc_rtmpt:RTMPConnectionprivate _ns:PlayerNetStreamprivate _mediaUrl:Stringprivate _mediaType:Stringprivate _protocol:Stringprivate _port:Stringprivate _appUrl:Stringprivate _streamName:Stringprivate _totalTime:Numberprivate _isLoaded:Booleanprivate _isLoading:Booleanprivate _listeners:Arrayprivate _momentaryPlayId:Numberprivate _checkCompleteId:Numberprivate _connectTimeOutId:Numberprivate _conn_Id:Numberprivate _statusCount:Numberprivate _playHeadPos:Numberprivate _isSeeking:Booleanprivate _isPausing:Booleanprivate _isPlayPending:Booleanprivate _videoHeight:Numberprivate _videoWidth:Numberpublic function broadcastEvent(status:String):VoidThe listeners must implement the "handlePlayer" function which takes the current status as a parameter.
public function load():VoidMake connection to the server and load the media without playing it.
private function startStream(nc:NetConnection):VoidThis is called when successfully connected to the server, and play the stream if play is pending.
private function actualConnect():VoidMake 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():VoidThis is called if we are not getting a successful rtmp connection after 3 seconds stream if play is pending
public function play(startingPoint:Number):VoidPlay the media starting at the specified starting point. If the media hasn't yet been loaded, load it.
- Parameters
startingPointThe 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.