Package | cv.media |
Class | public class ImagePlayer |
Inheritance | ImagePlayer ![]() |
Implements | IMediaPlayer |
Property | Defined by | ||
---|---|---|---|
autoRewind : Boolean = false
Will automatically call stop (rewind) after playing complete.
| ImagePlayer | ||
autoStart : Boolean
Whether media will play automatically once loaded.
| ImagePlayer | ||
currentPercent : uint [read-only]
Gets the current play progress in terms of percent
| ImagePlayer | ||
debug : Boolean = false
Enables/Disables debug traces
| ImagePlayer | ||
loadCurrent : uint [read-only]
Gets the current load progress in terms of bytes
| ImagePlayer | ||
loadTotal : uint [read-only]
Gets the total size to be loaded in terms of bytes
| ImagePlayer | ||
metaData : Object [read-only]
Gets the metadata if available for the currently playing audio file
| ImagePlayer | ||
paused : Boolean [read-only]
Returns the pause status of the player.
| ImagePlayer | ||
status : String [read-only]
Returns the load status of the player.
| ImagePlayer | ||
timeCurrent : Number [read-only]
Gets the elapsed play time in milliseconds
| ImagePlayer | ||
timeLeft : Number [read-only]
Gets the remaining play time in milliseconds
| ImagePlayer | ||
timeTotal : Number [read-only]
Gets the total play time in milliseconds
| ImagePlayer | ||
volume : Number
Gets or sets the current volume, from 0 - 1
| ImagePlayer |
Property | Defined by | ||
---|---|---|---|
arrFileTypes : Array | ImagePlayer | ||
_autoStart : Boolean = true | ImagePlayer | ||
ldr : Loader | ImagePlayer | ||
_loadCurrent : uint | ImagePlayer | ||
_loadTotal : uint | ImagePlayer | ||
_metaData : Object | ImagePlayer | ||
_paused : Boolean = false | ImagePlayer | ||
pausePosition : int = 0 | ImagePlayer | ||
playInterval : uint | ImagePlayer | ||
position : int = 0 | ImagePlayer | ||
sendOnce : Boolean = false | ImagePlayer | ||
skipOnce : Boolean = false | ImagePlayer | ||
_status : String = "unloaded" | ImagePlayer | ||
strURL : String | ImagePlayer | ||
_timeTotal : Number | ImagePlayer | ||
_volume : Number | ImagePlayer |
Method | Defined by | ||
---|---|---|---|
ImagePlayer | |||
isValid(ext:String, url:String):Boolean
Validates if the given filetype is compatible to be played with ImagePlayer.
| ImagePlayer | ||
load(item:*):void
Loads a new file to be played.
| ImagePlayer | ||
pause(b:Boolean = true):void
Pauses the media
| ImagePlayer | ||
play(pos:int = 0):void
Starts playback at the given position.
| ImagePlayer | ||
seek(time:*):void
Seeks to time given.
| ImagePlayer | ||
seekPercent(n:Number):void
Seeks to the given percent
| ImagePlayer | ||
stop():void
Stops the image at the specified position.
| ImagePlayer | ||
unload():void
Unloads the image and resets the metadata.
| ImagePlayer |
Method | Defined by | ||
---|---|---|---|
errorHandler(e:ErrorEvent):void
| ImagePlayer | ||
imageHandler(e:Event):void
| ImagePlayer | ||
progressHandler(e:ProgressEvent):void
| ImagePlayer | ||
setStatus(str:String):void
| ImagePlayer | ||
timeHandler():void
| ImagePlayer | ||
trace2(... arguements):void
| ImagePlayer |
Event | Summary | Defined by | ||
---|---|---|---|---|
Dispatched when the media file has completed loading | ImagePlayer | |||
Dispatched as a media file is loaded | ImagePlayer | |||
Dispatched as a media file begins loading | ImagePlayer | |||
Dispatched after images loads. | ImagePlayer | |||
Dispatched as a media file finishes playing | ImagePlayer | |||
Dispatched as a media file is playing | ImagePlayer | |||
Dispatched once as a media file first begins to play | ImagePlayer | |||
Dispatched when status has been updated. | ImagePlayer |
Constant | Defined by | ||
---|---|---|---|
VERSION : String = "1.0.2" [static]
The current version
| ImagePlayer |
arrFileTypes | property |
protected var arrFileTypes:Array
autoRewind | property |
public var autoRewind:Boolean = false
Will automatically call stop (rewind) after playing complete. If disabled, this will pause the player instead.
_autoStart | property |
protected var _autoStart:Boolean = true
autoStart | property |
autoStart:Boolean
[read-write]Whether media will play automatically once loaded.
The default value is true
.
public function get autoStart():Boolean
public function set autoStart(value:Boolean):void
currentPercent | property |
currentPercent:uint
[read-only]Gets the current play progress in terms of percent
Implementation public function get currentPercent():uint
debug | property |
public var debug:Boolean = false
Enables/Disables debug traces
ldr | property |
protected var ldr:Loader
_loadCurrent | property |
protected var _loadCurrent:uint
loadCurrent | property |
loadCurrent:uint
[read-only]Gets the current load progress in terms of bytes
Implementation public function get loadCurrent():uint
_loadTotal | property |
protected var _loadTotal:uint
loadTotal | property |
loadTotal:uint
[read-only]Gets the total size to be loaded in terms of bytes
Implementation public function get loadTotal():uint
_metaData | property |
protected var _metaData:Object
metaData | property |
metaData:Object
[read-only]Gets the metadata if available for the currently playing audio file
Implementation public function get metaData():Object
_paused | property |
protected var _paused:Boolean = false
paused | property |
paused:Boolean
[read-only]Returns the pause status of the player.
Implementation public function get paused():Boolean
pausePosition | property |
protected var pausePosition:int = 0
playInterval | property |
protected var playInterval:uint
position | property |
protected var position:int = 0
sendOnce | property |
protected var sendOnce:Boolean = false
skipOnce | property |
protected var skipOnce:Boolean = false
_status | property |
protected var _status:String = "unloaded"
status | property |
status:String
[read-only]Returns the load status of the player.
Implementation public function get status():String
strURL | property |
protected var strURL:String
timeCurrent | property |
timeCurrent:Number
[read-only]Gets the elapsed play time in milliseconds
Implementation public function get timeCurrent():Number
timeLeft | property |
timeLeft:Number
[read-only]Gets the remaining play time in milliseconds
Implementation public function get timeLeft():Number
_timeTotal | property |
protected var _timeTotal:Number
timeTotal | property |
timeTotal:Number
[read-only]Gets the total play time in milliseconds
Implementation public function get timeTotal():Number
_volume | property |
protected var _volume:Number
volume | property |
volume:Number
[read-write]Gets or sets the current volume, from 0 - 1
Implementation public function get volume():Number
public function set volume(value:Number):void
ImagePlayer | () | constructor |
public function ImagePlayer()
errorHandler | () | method |
protected function errorHandler(e:ErrorEvent):void
Parameters
e:ErrorEvent |
imageHandler | () | method |
protected function imageHandler(e:Event):void
Parameters
e:Event |
isValid | () | method |
public function isValid(ext:String, url:String):Boolean
Validates if the given filetype is compatible to be played with ImagePlayer. The acceptable file types are :
ext: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:*):void
Loads 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):void
Pauses the media
Parametersb:Boolean (default = true ) — Whether to pause or toggle it off
|
See also
play | () | method |
public function play(pos:int = 0):void
Starts playback at the given position.
Parameterspos:int (default = 0 ) — Position to play from
|
progressHandler | () | method |
protected function progressHandler(e:ProgressEvent):void
Parameters
e:ProgressEvent |
seek | () | method |
public function seek(time:*):void
Seeks to time given.
Parameterstime:* — Seconds into the audio to seek to
|
See also
seekPercent | () | method |
public function seekPercent(n:Number):void
Seeks to the given percent
Parametersn:Number — Percent to seek to
|
See also
setStatus | () | method |
protected function setStatus(str:String):void
Parameters
str:String |
stop | () | method |
public function stop():void
Stops the image at the specified position. Sets the position given as the pause position.
timeHandler | () | method |
protected function timeHandler():void
trace2 | () | method |
protected function trace2(... arguements):void
Parameters
... arguements |
unload | () | method |
public function unload():void
Unloads the image and resets the metadata.
See also
loadComplete | event |
cv.events.LoadEvent
cv.events.LoadEvent.LOAD_COMPLETE
Dispatched when the media file has completed loading
Defines the value of the type
property of an
loadComplete
event object.
loadProgress | event |
flash.events.ProgressEvent
cv.events.LoadEvent.LOAD_PROGRESS
Dispatched as a media file is loaded
Defines the value of the type
property of an
loadProgress
event object.
loadStart | event |
metadata | event |
cv.events.MetaDataEvent
cv.events.MetaDataEvent.METADATA
Dispatched after images loads. Contains height and width of image.
Defines the value of the type
property of an audioMetadata
event object.
This event has the following properties:
Property | Value |
---|---|
bubbles | false |
cancelable | false ; there is
no default behavior to cancel. |
data | The metadata object. |
currentTarget | The object that is actively processing the event object with an event listener. |
target | The object that dispatched the event. The target is
not always the object listening for the event. Use the currentTarget
property to access the object that is listening for the event. |
playComplete | event |
playProgress | event |
cv.events.PlayProgressEvent
cv.events.PlayProgressEvent.PLAY_PROGRESS
Dispatched as a media file is playing
Defines the value of the type
property of an playProgress
event object.
This event has the following properties:
Property | Value |
---|---|
bubbles | false |
cancelable | false ; there is
no default behavior to cancel. |
percent | The percentage of progress for the media playing. |
elapsed | The elapsed time of the media playing. |
remain | The remaining time of the media playing. |
total | The total time of the media playing. |
currentTarget | The object that is actively processing the event object with an event listener. |
target | The object that dispatched the event. The target is
not always the object listening for the event. Use the currentTarget
property to access the object that is listening for the event. |
playStart | event |
status | event |
VERSION | constant |
public static const VERSION:String = "1.0.2"
The current version