Class mx.controls.streamingmedia.RTMPPlayer

mx.controls.streamingmedia.AbstractPlayer
   +--mx.controls.streamingmedia.RTMPPlayer

Implemented Interfaces

IPlayer

Description

RTMPPlayer contains the logic to play FLV streaming media files from Flash Communication Server.

Field Index

_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
Inherited from AbstractPlayer
_playing, playing

Method Index

new RTMPPlayer()

actualConnect(), addListener(), broadcastEvent(), bufferIsFull(), checkComplete(), close(), connectRtmpt(), doneUpdateFrame(), getMediaBytesLoaded(), getMediaBytesTotal(), getMediaUrl(), getPlayheadTime(), getTotalTime(), getVolume(), init(), isSizeChange(), isSizeSet(), load(), logError(), mediaLoaded(), onConnectTimeOut(), pause(), play(), playStopped(), removeAllListeners(), resizeVideo(), setMediaUrl(), setPlayheadTime(), setSeeking(), setTotalTime(), setVolume(), startStream(), stop(), toString()
Inherited from AbstractPlayer
isPlaying(), setPlaying()

Constructor Detail

RTMPPlayer

public function RTMPPlayer(aMediaUrl:
String, aMediaType:String, aVideoHolder:MovieClip, aTotalTime:Number)
Constructor.

Field Detail

_videoHolder

public _videoHolder:MovieClip

_video

public _video:Video

_sound

private _sound:Sound

_nc_rtmp

private _nc_rtmp:RTMPConnection

_nc_rtmpt

private _nc_rtmpt:RTMPConnection

_ns

private _ns:PlayerNetStream

_mediaUrl

private _mediaUrl:String

_mediaType

private _mediaType:String

_protocol

private _protocol:String

_port

private _port:String

_appUrl

private _appUrl:String

_streamName

private _streamName:String

_totalTime

private _totalTime:Number

_isLoaded

private _isLoaded:Boolean

_isLoading

private _isLoading:Boolean

_listeners

private _listeners:Array

_momentaryPlayId

private _momentaryPlayId:Number

_checkCompleteId

private _checkCompleteId:Number

_connectTimeOutId

private _connectTimeOutId:Number

_conn_Id

private _conn_Id:Number

_statusCount

private _statusCount:Number

_playHeadPos

private _playHeadPos:Number

_isSeeking

private _isSeeking:Boolean

_isPausing

private _isPausing:Boolean

_isPlayPending

private _isPlayPending:Boolean

_videoHeight

private _videoHeight:Number

_videoWidth

private _videoWidth:Number

Method Detail

init

private function init()
Initialize the FLVPlayer.

addListener

public function addListener(aListener:
Object):Void

removeAllListeners

public function removeAllListeners():Void

broadcastEvent

public function broadcastEvent(status:
String):Void
The listeners must implement the "handlePlayer" function which takes the current status as a parameter.

bufferIsFull

public function bufferIsFull():Void

resizeVideo

public function resizeVideo():Void

toString

public function toString():
String
Return
A string representation of this player.

close

public function close():Void
Close the player

load

public function load():Void
Make connection to the server and load the media without playing it.

startStream

private function startStream(nc:
NetConnection):Void
This is called when successfully connected to the server, and play the stream if play is pending.

onConnectTimeOut

public function onConnectTimeOut():Void
This is called when connection timeout.

actualConnect

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.

connectRtmpt

public function connectRtmpt():Void
This is called if we are not getting a successful rtmp connection after 3 seconds stream if play is pending

play

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.

pause

public function pause():Void
Stop playback of the media without moving the playhead.

stop

public function stop():Void
Stop playback of the media and reset the playhead to zero.

getPlayheadTime

public function getPlayheadTime():
Number
Return
The playhead position, measued in seconds since the start.

setPlayheadTime

public function setPlayheadTime(position:
Number):Void

doneUpdateFrame

public function doneUpdateFrame():Void
Stop the playback.

playStopped

public function playStopped():Void

checkComplete

public function checkComplete():Void

getMediaUrl

public function getMediaUrl():
String

setMediaUrl

public function setMediaUrl(aUrl:
String):Void

getVolume

public function getVolume():
Number

setVolume

public function setVolume(aVol:
Number):Void

getMediaBytesLoaded

public function getMediaBytesLoaded():
Number
Return
The number of bytes of the media that has loaded.

getMediaBytesTotal

public function getMediaBytesTotal():
Number
Return
The total number of bytes of the media.

getTotalTime

public function getTotalTime():
Number
Return
The total time of the media in seconds. It is a property that is manually set by the author.

setTotalTime

public function setTotalTime(aTime:
Number):Void

mediaLoaded

public function mediaLoaded():Void
Called when the media is completely loaded.

logError

public function logError(error:
String):Void
Log error from FlashCom server

isSizeSet

public function isSizeSet():
Boolean

isSizeChange

public function isSizeChange():
Boolean

setSeeking

public function setSeeking(isSeeking:
Boolean):Void