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
- _videoHolder : MovieClip
- Holds the video.
- _video : Video
- Embedded video object used to display video
- _sound : Sound
- Controls the volume of the video
- _nc : NetConnection
- _ns : PlayerNetStream
- _mediaUrl : String
- _totalTime : Number
- The total time of the video
- _isLoaded : Boolean
- Has the flv been loaded yet?
- _listeners : Array
- Lightweight event broadcaster
- _momentaryPlayId : Number
- The interval id used to briefly play the media when the playhead is
- _videoHeight : Number
- _videoWidth : Number
Instance properties inherited from AbstractPlayer
Instance methods
- init
- addListener (aListener:Object) : Void
- removeAllListeners : Void
- broadcastEvent (status:String) : Void
- The listeners must implement the "handlePlayer"
- bufferIsFull : Void
- resizeVideo : Void
- toString : String
- close : Void
- Close the player
- load : Void
- Load the media without playing it.
- assignBufferTime : Void
- Assign the buffer time of the netstream as a function of the total time.
- play (startingPoint:Number) : Void
- Play the media starting at the specified starting point.
- pause : Void
- Stop playback of the media without moving the playhead.
- stop : Void
- Stop playback of the media and reset the playhead to zero.
- getPlayheadTime : Number
- setPlayheadTime (position:Number) : Void
- doneUpdateFrame : Void
- Stop the playback.
- playStopped : Void
- The media finished playing.
- getMediaUrl : String
- setMediaUrl (aUrl:String) : Void
- getVolume : Number
- setVolume (aVol:Number) : Void
- getMediaBytesLoaded : Number
- getMediaBytesTotal : Number
- getTotalTime : Number
- setTotalTime (aTime:Number) : Void
- mediaLoaded : Void
- Called when the media is completely loaded.
- logError (error:String) : Void
- isSizeSet : Boolean
- isSizeChange : Boolean
- setSeeking (isSeeking:Boolean) : Void
- For FLVPlayer, this is a no-op
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.
moved when playback is paused.
_nc
private _nc:NetConnection
(read)
_ns
_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
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.
function which takes the current status as a parameter.
doneUpdateFrame
function doneUpdateFrame (
) : Void
Stop the playback.
getMediaBytesLoaded
function getMediaBytesLoaded (
) : Number
Returns:
- The number of bytes of the media that has loaded.
Specified by:
getMediaBytesTotal
function getMediaBytesTotal (
) : Number
Returns:
- The total number of bytes of the media.
Specified by:
getPlayheadTime
function getPlayheadTime (
) : Number
Returns:
- The playhead position, measued in seconds since the start.
Specified by:
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:
init
private function init (
)
Initialize the FLVPlayer.
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.
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.
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:
setPlayheadTime
function setPlayheadTime (
position:Number) : Void
Specified by:
setSeeking
function setSeeking (
isSeeking:Boolean) : Void
For FLVPlayer, this is a no-op
Specified by:
setTotalTime
function setTotalTime (
aTime:Number) : Void
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.