FLVPlayer

Kind of class:class
Inherits from:AbstractPlayer
Implements:
Author:Andrew Guldman
Classpath:mx.controls.streamingmedia.FLVPlayer
File last modified:Tuesday, 18 December 2007, 15:44:38
FLVPlayer contains the logic to play FLV streaming media files.

Summary


Constructor
  • FLVPlayer (aMediaUrl:String, aVideoHolder:MovieClip, aTotalTime:Number)
    • Constructor.
Instance properties
Instance properties inherited from AbstractPlayer
Instance methods
Instance methods inherited from AbstractPlayer

Constructor

FLVPlayer

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

Constructor.

Instance properties

_isLoaded

private _isLoaded:Boolean
(read)

Has the flv been loaded yet?

_listeners

private _listeners:Array
(read)

Lightweight event broadcaster

_mediaUrl

private _mediaUrl:String
(read)

_momentaryPlayId

private _momentaryPlayId:Number
(read)

The interval id used to briefly play the media when the playhead is
moved when playback is paused.

_nc

private _nc:NetConnection
(read)

_ns

private _ns:PlayerNetStream
(read)

_sound

private _sound:Sound
(read)

Controls the volume of the video

_totalTime

private _totalTime:Number
(read)

The total time of the video

_video

_video:Video
(read)

Embedded video object used to display video

_videoHeight

private _videoHeight:Number
(read)

_videoHolder

_videoHolder:MovieClip
(read)

Holds the video. Also used to control volume

_videoWidth

private _videoWidth:Number
(read)

Instance methods

addListener

function addListener (
aListener:Object) : Void

Specified by:

assignBufferTime

private function assignBufferTime (
) : Void

Assign the buffer time of the netstream as a function of the total time.

broadcastEvent

function broadcastEvent (
status:String) : Void

The listeners must implement the "handlePlayer"
function which takes the current status as a parameter.

bufferIsFull

function bufferIsFull (
) : Void

Specified by:

close

function close (
) : Void

Close the player
Specified by:

doneUpdateFrame

function doneUpdateFrame (
) : Void

Stop the playback.

getMediaBytesLoaded

function getMediaBytesLoaded (
) : Number

Returns:
  • The number of bytes of the media that has loaded.

getMediaBytesTotal

function getMediaBytesTotal (
) : Number

Returns:
  • The total number of bytes of the media.

getMediaUrl

function getMediaUrl (
) : String

Specified by:

getPlayheadTime

function getPlayheadTime (
) : Number

Returns:
  • The playhead position, measued in seconds since the start.

getTotalTime

function getTotalTime (
) : Number

Returns:
  • 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.
Specified by:

getVolume

function getVolume (
) : Number

Specified by:

init

private function init (
)

Initialize the FLVPlayer.

isSizeChange

function isSizeChange (
) : Boolean

Specified by:

isSizeSet

function isSizeSet (
) : Boolean

Specified by:

load

function load (
) : Void

Load the media without playing it.
Specified by:

logError

function logError (
error:String) : Void

Specified by:

mediaLoaded

function mediaLoaded (
) : Void

Called when the media is completely loaded.
Specified by:

pause

function pause (
) : Void

Stop playback of the media without moving the playhead.
Specified by:

play

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.
Specified by:

playStopped

function playStopped (
) : Void

The media finished playing.
Specified by:

removeAllListeners

function removeAllListeners (
) : Void

resizeVideo

function resizeVideo (
) : Void

Specified by:

setMediaUrl

function setMediaUrl (
aUrl:String) : Void

Specified by:

setPlayheadTime

function setPlayheadTime (
position:Number) : Void

setSeeking

function setSeeking (
isSeeking:Boolean) : Void

For FLVPlayer, this is a no-op
Specified by:

setTotalTime

function setTotalTime (
aTime:Number) : Void

setVolume

function setVolume (
aVol:Number) : Void

Specified by:

stop

function stop (
) : Void

Stop playback of the media and reset the playhead to zero.

toString

function toString (
) : String

Returns:
  • A string representation of this player.