WebAudio


Module hilo/media/WebAudio Requires hilo/core/Hilo, hilo/core/Class, 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.

Properties

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
WebAudio
static
WebAudio

Methods

Method Defined
WebAudio(properties:Object)
Constructor
WebAudio
load()
WebAudio
WebAudio
play()
WebAudio
WebAudio
setMute(muted)
WebAudio
setVolume(volume)
WebAudio
stop()
WebAudio
static
WebAudio

Property Detail

autoPlay:Boolean
Is the audio autoplay, default value is false.
duration:Number
The duration of the audio, readonly!
[Static] enabled
[Static] isSupported
loaded:Boolean
Is the audio resource loaded, readonly!
loop:Boolean
Is loop playback, default value is false.
muted:Boolean
Is the audio muted, default value is false.
playing:Boolean
Is the audio playing, readonly!
src:String
The source of the playing audio.
volume:Number
The volume of the audio, value between 0 to 1.

Constructor

WebAudio(properties:Object)
parameters
properties:Object — create object properties, include all writable properties of this class.

Method Detail

[Static] enable()
load()
pause()
play()
resume()
setMute(muted)
parameters
muted
setVolume(volume)
parameters
volume
stop()