Packagecv.interfaces
Interfacepublic interface IMediaManager extends flash.events.IEventDispatcher
ImplementorsAudioManager, VideoManager

Implement the IMediaManager interface to create a custom media manager. A media manager handles audio or video playback.

See also

cv.media.AudioManager
cv.media.VideoManager


Public Properties
 PropertyDefined by
  buffer : int
Gets or sets the buffer value of a media manager.
IMediaManager
  currentPercent : uint
[read-only] Gets the play progress percentage of the currently playing media file.
IMediaManager
  isPause : Boolean
[read-only] Gets the pause status of the media manager.
IMediaManager
  isPlaying : Boolean
[read-only] Gets the playing status of the media manager.
IMediaManager
  loadCurrent : Number
[read-only] Gets the number of bytes currently loaded.
IMediaManager
  loadTotal : Number
[read-only] Gets the total number of bytes for a given file being loaded.
IMediaManager
  metaData : Object
[read-only] Gets the meta data object of the current file if available.
IMediaManager
  timeCurrent : Number
[read-only] Gets the elapsed play time of the current file.
IMediaManager
  timeLeft : Number
[read-only] Gets the remaining play time of the current file.
IMediaManager
  timeTotal : Number
[read-only] Gets the total play time of the current file.
IMediaManager
  volume : Number
Gets or sets the volume of the media manager.
IMediaManager
Public Methods
 MethodDefined by
  
isValid(str:String):Boolean
Validates if the given filetype is compatible to be played with media manager.
IMediaManager
  
load(s:String):void
Loads a new file to be played.
IMediaManager
  
mute(b:Boolean = true):void
Controls the mute of the audio
IMediaManager
  
pause(b:Boolean = true):void
Controls the pause of the audio
IMediaManager
  
play(pos:int = 0):void
Plays the media file, starting at the given position.
IMediaManager
  
seek(n:Number):void
Seeks to time given in the media file.
IMediaManager
  
seekPercent(n:Number):void
Seeks to the given percent in the media file.
IMediaManager
  
stop(pos:int = 0):void
Stops the media file at the specified position.
IMediaManager
  
unLoad():void
Stops the media, closes out any connections, and resets the metadata.
IMediaManager
Property detail
bufferproperty
buffer:int  [read-write]

Gets or sets the buffer value of a media manager. This controls how long a file is buffered before it begins to play.

Implementation
    public function get buffer():int
    public function set buffer(value:int):void
currentPercentproperty 
currentPercent:uint  [read-only]

Gets the play progress percentage of the currently playing media file.

Implementation
    public function get currentPercent():uint
isPauseproperty 
isPause:Boolean  [read-only]

Gets the pause status of the media manager.

Implementation
    public function get isPause():Boolean
isPlayingproperty 
isPlaying:Boolean  [read-only]

Gets the playing status of the media manager.

Implementation
    public function get isPlaying():Boolean
loadCurrentproperty 
loadCurrent:Number  [read-only]

Gets the number of bytes currently loaded.

Implementation
    public function get loadCurrent():Number
loadTotalproperty 
loadTotal:Number  [read-only]

Gets the total number of bytes for a given file being loaded.

Implementation
    public function get loadTotal():Number
metaDataproperty 
metaData:Object  [read-only]

Gets the meta data object of the current file if available.

Implementation
    public function get metaData():Object
timeCurrentproperty 
timeCurrent:Number  [read-only]

Gets the elapsed play time of the current file.

Implementation
    public function get timeCurrent():Number
timeLeftproperty 
timeLeft:Number  [read-only]

Gets the remaining play time of the current file.

Implementation
    public function get timeLeft():Number
timeTotalproperty 
timeTotal:Number  [read-only]

Gets the total play time of the current file.

Implementation
    public function get timeTotal():Number
volumeproperty 
volume:Number  [read-write]

Gets or sets the volume of the media manager.

Implementation
    public function get volume():Number
    public function set volume(value:Number):void
Method detail
isValid()method
public function isValid(str:String):Boolean

Validates if the given filetype is compatible to be played with media manager.

Parameters
str:String — The file extension to be validated

Returns
Boolean — Boolean of whether the extension was valid or not.
load()method 
public function load(s:String):void

Loads a new file to be played.

Parameters
s:String — The url of the file to be loaded

See also

cv.events.LoadEvent.LOAD_START
mute()method 
public function mute(b:Boolean = true):void

Controls the mute of the audio

Parameters
b:Boolean (default = true) — Whether to mute or not
pause()method 
public function pause(b:Boolean = true):void

Controls the pause of the audio

Parameters
b:Boolean (default = true) — Whether to pause or not
play()method 
public function play(pos:int = 0):void

Plays the media file, starting at the given position.

Parameters
pos:int (default = 0) — Position to play from
seek()method 
public function seek(n:Number):void

Seeks to time given in the media file.

Parameters
n:Number — Seconds into the file to seek to
seekPercent()method 
public function seekPercent(n:Number):void

Seeks to the given percent in the media file.

Parameters
n:Number — Percent to seek to
stop()method 
public function stop(pos:int = 0):void

Stops the media file at the specified position. Sets the position given as the pause position.

Parameters
pos:int (default = 0) — Position to stop at
unLoad()method 
public function unLoad():void

Stops the media, closes out any connections, and resets the metadata.