Commit 9923e821b9ed6d6ff962491805ba929e5e63bfec
1 parent
13fa3e39
fix audio
Showing
2 changed files
with
26 additions
and
15 deletions
src/gxb-ide/Dir.js
src/js/audioPlayer/jQuery.AudioPlayer.js
| ... | ... | @@ -241,23 +241,34 @@ |
| 241 | 241 | _this.elements.audioDom.oncanplay = function() { |
| 242 | 242 | _this.log('oncanplay'); |
| 243 | 243 | // Determine the audio to load / 判断音频加载完毕 |
| 244 | - if (_this.elements.audioDom.readyState == 4) { | |
| 245 | - var duration = Math.round(_this.elements.audioDom.duration); | |
| 246 | - var minutes = Math.floor(duration / 60); | |
| 247 | - minutes = 10 <= minutes ? minutes : "0" + minutes; | |
| 248 | - duration = Math.floor(duration % 60); | |
| 244 | + var duration = Math.round(_this.elements.audioDom.duration); | |
| 245 | + var minutes = Math.floor(duration / 60); | |
| 246 | + minutes = 10 <= minutes ? minutes : "0" + minutes; | |
| 247 | + duration = Math.floor(duration % 60); | |
| 249 | 248 | |
| 250 | - _this.elements.totalTime.html(minutes + ":" + (10 <= duration ? duration : "0" + duration)); | |
| 249 | + _this.elements.totalTime.html(minutes + ":" + (10 <= duration ? duration : "0" + duration)); | |
| 251 | 250 | |
| 252 | - if(typeof _this.options.canplayCallback == 'function'){ | |
| 253 | - _this.options.canplayCallback({'status': true}); | |
| 254 | - }else{ | |
| 255 | - alert('canplayCallback') | |
| 256 | - _this.options.canplayCallback({'status': true}); | |
| 257 | - } | |
| 258 | - }else{ | |
| 259 | - alert(_this.elements.audioDom.readyState) | |
| 251 | + if(typeof _this.options.canplayCallback == 'function'){ | |
| 252 | + _this.options.canplayCallback({'status': true}); | |
| 260 | 253 | } |
| 254 | + | |
| 255 | + // if (_this.elements.audioDom.readyState == 4) { | |
| 256 | + // var duration = Math.round(_this.elements.audioDom.duration); | |
| 257 | + // var minutes = Math.floor(duration / 60); | |
| 258 | + // minutes = 10 <= minutes ? minutes : "0" + minutes; | |
| 259 | + // duration = Math.floor(duration % 60); | |
| 260 | + | |
| 261 | + // _this.elements.totalTime.html(minutes + ":" + (10 <= duration ? duration : "0" + duration)); | |
| 262 | + | |
| 263 | + // if(typeof _this.options.canplayCallback == 'function'){ | |
| 264 | + // _this.options.canplayCallback({'status': true}); | |
| 265 | + // }else{ | |
| 266 | + // alert('canplayCallback') | |
| 267 | + // _this.options.canplayCallback({'status': true}); | |
| 268 | + // } | |
| 269 | + // }else{ | |
| 270 | + // alert(_this.elements.audioDom.readyState) | |
| 271 | + // } | |
| 261 | 272 | } |
| 262 | 273 | |
| 263 | 274 | // When the browser is downloading audio / 当浏览器正在下载音频时 | ... | ... |