audio style, 音频播放器样式
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
dist
example
src
.gitignore
README.md
gulpfile.js

README.md

audio

audio style, 音频播放器样式

demo示例:http://www.lovewebgames.com/jsmodule/audio.html

<audio src="horse.ogg" class="audio" controls="controls">
Your browser does not support the audio element.
</audio>
<audio src="horse.ogg" class="audio" controls="controls">
Your browser does not support the audio element.
</audio>
<script src="../dist/jquery-1.9.1.min.js" type="text/javascript"></script>
<script src="../dist/audio.js" type="text/javascript"></script>
<script>
$('.audio').Audio();//or new Audio.init({target:$('.audio')})
</script>

注意:当duration取不到时,会尝试去audio的duration属性 #属性和回调(options)

##target: 要变化样式的audio ##play: 开始 ##stop: 停止 ##playCallback: function(this.audio,this.audio.paused,this.durationContent)

播放或暂停时的回调

##stopCallback function(this,this.audio,this.audio.paused,this.durationContent)

停止后的回调

##updateCallback function(this,this.audio,this.audio.duration,this.durationContent))

更新进度时的回调