Commit c6b9deafeea419af9682513f9bbc0ccdb4cb0a2a

Authored by ykxie
1 parent 13489a3f

test

src/js/audioPlayer/jQuery.AudioPlayer.js
... ... @@ -239,6 +239,7 @@
239 239  
240 240 // When the browser can play audio / 当浏览器可以播放音频时
241 241 _this.elements.audioDom.oncanplay = function() {
  242 + alert('oncanplay')
242 243 _this.log('oncanplay');
243 244 // Determine the audio to load / 判断音频加载完毕
244 245 var duration = Math.round(_this.elements.audioDom.duration);
... ... @@ -273,6 +274,7 @@
273 274  
274 275 // When the browser is downloading audio / 当浏览器正在下载音频时
275 276 _this.elements.audioDom.onprogress = function() {
  277 + alert('onprogress')
276 278 if (_this.elements.audioDom.readyState == 4) {
277 279 _this.elements.loadProgress.width((_this.elements.audioDom.buffered.end(0) / _this.elements.audioDom.seekable.end(0)) * _this.elements.totalPlayProgress.width());
278 280 }
... ... @@ -280,6 +282,7 @@
280 282  
281 283 // When the browser begins searching for the audio / 当浏览器开始查找音频时
282 284 _this.elements.audioDom.onloadstart = function() {
  285 + alert('onloadstart')
283 286 _this.log('onloadstart');
284 287 if(typeof _this.options.onloadstartCallback == 'function'){
285 288 _this.options.onloadstartCallback({'status': true});
... ... @@ -288,18 +291,21 @@
288 291  
289 292 // When the audio has begun or is no longer suspended / 当音频已开始或不再暂停时
290 293 _this.elements.audioDom.onplay = function() {
  294 + alert('onplay')
291 295 _this.log('onplay');
292 296 _this.elements.playButton.find('img').attr('src', _this.options.imagePath + '/pause.png');
293 297 }
294 298  
295 299 // When the audio has been suspended / 当音频已暂停时
296 300 _this.elements.audioDom.onpause = function() {
  301 + alert('onpause')
297 302 _this.log('onpause');
298 303 _this.elements.playButton.find('img').attr('src', _this.options.imagePath + '/play.png');
299 304 }
300 305  
301 306 // When the current playlist has ended / 当目前的播放列表已结束时
302 307 _this.elements.audioDom.onended = function() {
  308 + alert('onended')
303 309 _this.log('onended');
304 310  
305 311 if(typeof _this.options.endedCallback == 'function'){
... ... @@ -327,6 +333,7 @@
327 333 }
328 334  
329 335 _this.elements.audioDom.onwaiting = function() {
  336 + alert('onwaiting')
330 337 _this.log('onwaiting');
331 338 if(typeof _this.options.onwaitingCallback == 'function'){
332 339 _this.options.onwaitingCallback({'status': true});
... ...