Module hilo/media/WebAudio
Requires
hilo/core/Class, hilo/util/util, hilo/event/EventMixin
Source
WebAudio.js
WebAudio audio playing module. It provides a better way to play and control audio, use on iOS6+ platform.
Compatibility:iOS6+、Chrome33+、Firefox28+ supported,but all Android browsers do not support.
| Property | Defined | |
|---|---|---|
|
autoPlay:Boolean
Is the audio autoplay, default value is false.
|
WebAudio | |
|
duration:Number
The duration of the audio, readonly!
|
WebAudio | |
|
loaded:Boolean
Is the audio resource loaded, readonly!
|
WebAudio | |
|
loop:Boolean
Is loop playback, default value is false.
|
WebAudio | |
|
muted:Boolean
Is the audio muted, default value is false.
|
WebAudio | |
|
playing:Boolean
Is the audio playing, readonly!
|
WebAudio | |
|
src:String
The source of the playing audio.
|
WebAudio | |
|
volume:Number
The volume of the audio, value between 0 to 1.
|
WebAudio | |
|
static
Does the browser support WebAudio.
|
WebAudio | |
|
static
Does browser activate WebAudio already.
|
WebAudio |
| Method | Defined | |
|---|---|---|
|
WebAudio(properties:Object)
Constructor
|
WebAudio | |
|
load()
Load audio file.
|
WebAudio | |
|
pause()
Pause (halt) playing the audio.
|
WebAudio | |
|
play()
Play the audio.
|
WebAudio | |
|
resume()
Continue to play the audio.
|
WebAudio | |
|
setMute(muted)
Set mute mode.
|
WebAudio | |
|
setVolume(volume)
Set the volume.
|
WebAudio | |
|
stop()
Stop playing the audio.
|
WebAudio | |
|
enable()
static
Activate WebAudio.
|
WebAudio | |
|
clearBufferCache(url:String)
static
Clear the audio buffer cache.
|
WebAudio |