Packagesekati.media
Classpublic class MP3
InheritanceMP3 Inheritance flash.events.EventDispatcher
ImplementsIProgressiveMedia

MP3 provides a common media control object for playing progressive audio content. Acceptable file types are defined in FileTypeValidator.IS_AUDIO.


Example
    var mp3 : MP3 = new MP3( );
    mp3.load( "path/to/song.mp3" );
    mp3.play( );
  

See also

sekati.ui.MP3Player
sekati.events.MediaEvent


Public Properties
 PropertyDefined by
  bufferLength : Number
[read-only] Amount of play-ahead buffer, in seconds.
MP3
  channel : SoundChannel
[read-only] The SoundChannel.
MP3
  context : SoundLoaderContext
The SoundLoaderContext for the Sound.
MP3
  duration : Number
[read-only] The total playback duration, in seconds.
MP3
  isBuffering : Boolean
[read-only] Buffering status.
MP3
  isPaused : Boolean
[read-only] Paused status.
MP3
  isPlaying : Boolean
[read-only] Playing status.
MP3
  isStopped : Boolean
[read-only] Stopped status.
MP3
  pan : Number
The Sound pan.
MP3
  percentLoaded : Number
[read-only] Return the percent loaded (1 based %).
MP3
  percentPlayed : Number
[read-only] Return the percent played (1 based %).
MP3
  percentPlayedWithBuffer : Number
[read-only] The percent of the movie that should be currently buffered.
MP3
  position : Number
[read-only] The position of the playhead, in seconds.
MP3
  sound : Sound
[read-only] The Sound.
MP3
  transform : SoundTransform
[read-only] The SoundTransform.
MP3
  url : String
[read-only] The Sound url.
MP3
  volume : Number
The Sound volume (0 - 1).
MP3
Public Methods
 MethodDefined by
  
MP3()
MP3 Constructor
MP3
  
destroy():void
Stop playback and cleanup.
MP3
  
fastForward(seconds:Number = 2):void
Fast-Forward playback.
MP3
  
load(url:String, buffer:uint = 4):void
Load the audio and begin playback.
MP3
  
pause():void
Pause playback.
MP3
  
play():void
Start playback.
MP3
  
resume():void
Resume playback.
MP3
  
rewind(seconds:Number = 2):void
Rewind playback.
MP3
  
seek(time:Number):void
Seek to a playback time.
MP3
  
seekToPercent(percent:Number):void
Seek to a playback percent (0 - 1).
MP3
  
stop():void
Stop playback.
MP3
  
togglePause():void
Pause/Resume playback toggle.
MP3
Protected Methods
 MethodDefined by
  
checkBuffer():void
Handle buffer externally to ns.bufferTime so we can achieve proper cuePoint timing.
MP3
  
errorHandler(e:IOErrorEvent):void
Error handler.
MP3
  
id3Handler(e:Event):void
ID3 tag handler.
MP3
  
loadCompleteHandler(e:Event):void
Load complete handler
MP3
  
playCompleteHandler(e:Event):void
playback complete handler.
MP3
  
progressHandler(e:Event):void
Playback progress handler.
MP3
Property detail
bufferLengthproperty
bufferLength:Number  [read-only]

Amount of play-ahead buffer, in seconds.

Implementation
    public function get bufferLength():Number
channelproperty 
channel:SoundChannel  [read-only]

The SoundChannel.

Implementation
    public function get channel():SoundChannel
contextproperty 
context:SoundLoaderContext  [read-write]

The SoundLoaderContext for the Sound.

Implementation
    public function get context():SoundLoaderContext
    public function set context(value:SoundLoaderContext):void
durationproperty 
duration:Number  [read-only]

The total playback duration, in seconds.

Implementation
    public function get duration():Number
isBufferingproperty 
isBuffering:Boolean  [read-only]

Buffering status.

Implementation
    public function get isBuffering():Boolean
isPausedproperty 
isPaused:Boolean  [read-only]

Paused status.

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

Playing status.

Implementation
    public function get isPlaying():Boolean
isStoppedproperty 
isStopped:Boolean  [read-only]

Stopped status.

Implementation
    public function get isStopped():Boolean
panproperty 
pan:Number  [read-write]

The Sound pan. (0 = balanced, -1 = left, 1 = right).

Implementation
    public function get pan():Number
    public function set pan(value:Number):void
percentLoadedproperty 
percentLoaded:Number  [read-only]

Return the percent loaded (1 based %).

Implementation
    public function get percentLoaded():Number
percentPlayedproperty 
percentPlayed:Number  [read-only]

Return the percent played (1 based %).

Implementation
    public function get percentPlayed():Number
percentPlayedWithBufferproperty 
percentPlayedWithBuffer:Number  [read-only]

The percent of the movie that should be currently buffered.

Implementation
    public function get percentPlayedWithBuffer():Number

See also

positionproperty 
position:Number  [read-only]

The position of the playhead, in seconds.

Implementation
    public function get position():Number
soundproperty 
sound:Sound  [read-only]

The Sound.

Implementation
    public function get sound():Sound
transformproperty 
transform:SoundTransform  [read-only]

The SoundTransform.

Implementation
    public function get transform():SoundTransform
urlproperty 
url:String  [read-only]

The Sound url.

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

The Sound volume (0 - 1).

Implementation
    public function get volume():Number
    public function set volume(value:Number):void
Constructor detail
MP3()constructor
public function MP3()

MP3 Constructor

Method detail
checkBuffer()method
protected function checkBuffer():void

Handle buffer externally to ns.bufferTime so we can achieve proper cuePoint timing.

destroy()method 
public function destroy():void

Stop playback and cleanup.

errorHandler()method 
protected function errorHandler(e:IOErrorEvent):void

Error handler.

Parameters
e:IOErrorEvent
fastForward()method 
public function fastForward(seconds:Number = 2):void

Fast-Forward playback.

Parameters
seconds:Number (default = 2) — to step forward.
id3Handler()method 
protected function id3Handler(e:Event):void

ID3 tag handler.

Parameters
e:Event
load()method 
public function load(url:String, buffer:uint = 4):void

Load the audio and begin playback.

Parameters
url:String — of the audio file.
 
buffer:uint (default = 4) — in seconds

Throws
— ArgumentError if url is not audio type.
loadCompleteHandler()method 
protected function loadCompleteHandler(e:Event):void

Load complete handler

Parameters
e:Event
pause()method 
public function pause():void

Pause playback.

play()method 
public function play():void

Start playback.

playCompleteHandler()method 
protected function playCompleteHandler(e:Event):void

playback complete handler.

Parameters
e:Event
progressHandler()method 
protected function progressHandler(e:Event):void

Playback progress handler.

Parameters
e:Event
resume()method 
public function resume():void

Resume playback.

rewind()method 
public function rewind(seconds:Number = 2):void

Rewind playback.

Parameters
seconds:Number (default = 2) — to step back.
seek()method 
public function seek(time:Number):void

Seek to a playback time.

Parameters
time:Number — in playback to seek to.
seekToPercent()method 
public function seekToPercent(percent:Number):void

Seek to a playback percent (0 - 1).

Parameters
percent:Number — of playback to seek to.
stop()method 
public function stop():void

Stop playback.

togglePause()method 
public function togglePause():void

Pause/Resume playback toggle.