Class mx.controls.streamingmedia.FLVPlayer

mx.controls.streamingmedia.AbstractPlayer
   +--mx.controls.streamingmedia.FLVPlayer

Implemented Interfaces

IPlayer

Description

FLVPlayer contains the logic to play FLV streaming media files.

Field Index

_isLoaded, _listeners, _mediaUrl, _momentaryPlayId, _nc, _ns, _sound, _totalTime, _video, _videoHeight, _videoHolder, _videoWidth
Inherited from AbstractPlayer
_playing, playing

Method Index

new FLVPlayer()

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

Constructor Detail

FLVPlayer

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

Field Detail

_videoHolder

public _videoHolder:MovieClip

_video

public _video:Video

_sound

private _sound:Sound

_nc

private _nc:NetConnection

_ns

private _ns:PlayerNetStream

_mediaUrl

private _mediaUrl:String

_totalTime

private _totalTime:Number

_isLoaded

private _isLoaded:Boolean

_listeners

private _listeners:Array

_momentaryPlayId

private _momentaryPlayId:Number

_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
Load the media without playing it.

assignBufferTime

private function assignBufferTime():Void
Assign the buffer time of the netstream as a function of the total time.

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
The media finished playing.

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. For mp3 files, this is a property of the Sound object. For video, 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

isSizeSet

public function isSizeSet():
Boolean

isSizeChange

public function isSizeChange():
Boolean

setSeeking

public function setSeeking(isSeeking:
Boolean):Void
For FLVPlayer, this is a no-op