Skip to content
This repository was archived by the owner on Jan 11, 2024. It is now read-only.

Commit 4dfb788

Browse files
committed
Add onloadstartCallback function
1 parent b935cf4 commit 4dfb788

3 files changed

Lines changed: 12 additions & 2 deletions

File tree

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ Example:
4949
| **debuggers** | *Boolean* |open console log, default close 'false' / 打开控制台日志,默认关闭:`false` |
5050
| **allowSeek** | *Boolean* | Whether to support drag and drop, the default open: `true` / 是否支持拖拽,默认开启:`true` |
5151
| **canplayCallback** | *function* | After can play TODO / 可以播放之后,做某些事情 |
52+
| **onloadstartCallback** | *function* | After searching for the audio TODO / 开始查找音频之后,做某些事情 |
5253
| **playCallback** | *function* | After playback TODO / 播放之后,做某些事情 |
5354
| **pauseCallback** | *function* | After the suspension TODO / 暂停之后,做某些事情 |
5455
| **seekedCallback** | *function* | After the drag, the callback function (`allowSeek: false`) / 拖动之后,回调函数(`allowSeek: false`|
@@ -169,6 +170,10 @@ AudioPlayer.play(function(data){
169170
- Add comments in English
170171
- Fix the window change audio download progress bar UI has not changed
171172

173+
##### 2017.06.26
174+
175+
- Add onloadstartCallback function
176+
172177

173178
#### [issues](https://github.com/Keystion/jQuery.AudioPlayer.js/issues)
174179

dist/jQuery.AudioPlayer.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/jQuery.AudioPlayer.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
,allowSeek: true
2525
// After can play TODO / 可以播放之后,做某些事情
2626
,canplayCallback: null
27+
// After searching for the audio TODO / 开始查找音频之后,做某些事情
28+
,onloadstartCallback: null
2729
// After playback TODO / 播放之后,做某些事情
2830
,playCallback: null
2931
// After the suspension TODO / 暂停之后,做某些事情
@@ -261,6 +263,9 @@
261263
// When the browser begins searching for the audio / 当浏览器开始查找音频时
262264
_this.elements.audioDom.onloadstart = function() {
263265
_this.log('onloadstart');
266+
if(typeof _this.options.onloadstartCallback == 'function'){
267+
_this.options.onloadstartCallback({'status': true});
268+
}
264269
}
265270

266271
// When the audio has begun or is no longer suspended / 当音频已开始或不再暂停时

0 commit comments

Comments
 (0)