| Package | cv.interfaces |
| Interface | public interface IMediaPlayer extends flash.events.IEventDispatcher |
| Implementors | ImagePlayer, NetStreamPlayer, RTMPPlayer, SoundPlayer, TempoLite |
| Property | Defined by | ||
|---|---|---|---|
| autoStart : Boolean
Whether media will play automatically once loaded.
| IMediaPlayer | ||
| currentPercent : uint [read-only]
Gets the play progress percentage of the currently
playing media file.
| IMediaPlayer | ||
| loadCurrent : uint [read-only]
Gets the number of bytes currently loaded.
| IMediaPlayer | ||
| loadTotal : uint [read-only]
Gets the total number of bytes for a given file
being loaded.
| IMediaPlayer | ||
| metaData : Object [read-only]
Gets the meta data object of the current file if available.
| IMediaPlayer | ||
| paused : Boolean [read-only]
Gets the pause status of the media player.
| IMediaPlayer | ||
| status : String [read-only]
Gets the loading status of the media player.
| IMediaPlayer | ||
| timeCurrent : Number [read-only]
Gets the elapsed play time of the current file.
| IMediaPlayer | ||
| timeLeft : Number [read-only]
Gets the remaining play time of the current file.
| IMediaPlayer | ||
| timeTotal : Number [read-only]
Gets the total play time of the current file.
| IMediaPlayer | ||
| volume : Number
Gets or sets the volume of the media player.
| IMediaPlayer | ||
| Method | Defined by | ||
|---|---|---|---|
|
isValid(ext:String, url:String):Boolean
Validates if the given filetype is compatible to be played with media player.
| IMediaPlayer | ||
|
load(item:*):void
Loads a new file to be played.
| IMediaPlayer | ||
|
pause(b:Boolean = true):void
Controls the pause of the audio
| IMediaPlayer | ||
|
play(pos:int = 0):void
Plays the media file, starting at the given position.
| IMediaPlayer | ||
|
seek(time:*):void
Seeks to time given in the media file.
| IMediaPlayer | ||
|
seekPercent(n:Number):void
Seeks to the given percent in the media file.
| IMediaPlayer | ||
|
stop():void
Stops the media file at the specified position.
| IMediaPlayer | ||
|
unload():void
Stops the media, closes out any connections, and resets the metadata.
| IMediaPlayer | ||
| autoStart | property |
autoStart:Boolean [read-write]Whether media will play automatically once loaded.
Implementation public function get autoStart():Boolean
public function set autoStart(value:Boolean):void
| currentPercent | property |
currentPercent:uint [read-only]Gets the play progress percentage of the currently playing media file.
Implementation public function get currentPercent():uint
| loadCurrent | property |
loadCurrent:uint [read-only]Gets the number of bytes currently loaded.
Implementation public function get loadCurrent():uint
| loadTotal | property |
loadTotal:uint [read-only]Gets the total number of bytes for a given file being loaded.
Implementation public function get loadTotal():uint
| metaData | property |
metaData:Object [read-only]Gets the meta data object of the current file if available.
Implementation public function get metaData():Object
| paused | property |
paused:Boolean [read-only]Gets the pause status of the media player.
Implementation public function get paused():Boolean
| status | property |
status:String [read-only]Gets the loading status of the media player.
Implementation public function get status():String
| timeCurrent | property |
timeCurrent:Number [read-only]Gets the elapsed play time of the current file.
Implementation public function get timeCurrent():Number
| timeLeft | property |
timeLeft:Number [read-only]Gets the remaining play time of the current file.
Implementation public function get timeLeft():Number
| timeTotal | property |
timeTotal:Number [read-only]Gets the total play time of the current file.
Implementation public function get timeTotal():Number
| volume | property |
volume:Number [read-write]Gets or sets the volume of the media player.
Implementation public function get volume():Number
public function set volume(value:Number):void
| isValid | () | method |
public function isValid(ext:String, url:String):BooleanValidates if the given filetype is compatible to be played with media player.
Parametersext:String — The file extension to be validated
|
|
url:String — The full file url if the extension is not enough
|
Boolean — Boolean of whether the extension was valid or not.
|
| load | () | method |
public function load(item:*):voidLoads a new file to be played.
Parametersitem:* — The url of the file to be loaded
|
See also
| pause | () | method |
public function pause(b:Boolean = true):voidControls the pause of the audio
Parametersb:Boolean (default = true) — Whether to pause or not
|
| play | () | method |
public function play(pos:int = 0):voidPlays the media file, starting at the given position.
Parameterspos:int (default = 0) — Position to play from
|
| seek | () | method |
public function seek(time:*):voidSeeks to time given in the media file.
Parameterstime:* — Seconds into the file to seek to
|
| seekPercent | () | method |
public function seekPercent(n:Number):voidSeeks to the given percent in the media file.
Parametersn:Number — Percent to seek to
|
| stop | () | method |
public function stop():voidStops the media file at the specified position. Sets the position given as the pause position.
| unload | () | method |
public function unload():voidStops the media, closes out any connections, and resets the metadata.