Commit 208037e6406fd008c903b39b4812e436c0e18868

Authored by ykxie
1 parent e6de892e

fix audio single second

dist/gxb-ide/Dir.js
... ... @@ -660,7 +660,7 @@
660 660 }
661 661 },
662 662 onwaitingCallback: function(){
663   - // alert('onwaitingCallback ----------- ' + playTimes)
  663 + console.log('onwaitingCallback ----------- ' + playTimes)
664 664 },
665 665 playCallback: function() { // 播放
666 666 if (playTimes != 0) {
... ...
dist/js/gbreplayer.js
... ... @@ -430,19 +430,14 @@ $(function(){
430 430 ,debuggers: false
431 431 ,allowSeek: false
432 432 ,canplayCallback: function(res){
433   - if (res.status == true) {
  433 + if (res.status == true && GBCodePlayBack.playTimes === 0) {
434 434 playCode();
435 435 GBCodePlayBack.htmlplayereditor.setOption('readOnly', true);
  436 + GBCodePlayBack.playTimes++
436 437 }
437 438 }
438 439 ,onwaitingCallback: function(){
439   - if (GBCodePlayBack.playTimes !== 0) {
440   - GBCodePlayBack.audioTime = parseInt(player.elements.audioDom.currentTime*1000)
441   - pauseCode();
442   - GBCodePlayBack.firstPlay = 0;
443   - GBCodePlayBack.pauseValue = GBCodePlayBack.htmlplayereditor.getValue();
444   - GBCodePlayBack.htmlplayereditor.setOption('readOnly', false);
445   - }
  440 +
446 441 }
447 442 ,playCallback: function(){ // 播放
448 443 if (GBCodePlayBack.playTimes != 0) {
... ... @@ -482,7 +477,6 @@ $(function(){
482 477 GBCodePlayBack.records = coderecords;
483 478 if(GBCodePlayBack.playTimes === 0){
484 479 player.play();
485   - GBCodePlayBack.playTimes++
486 480 }
487 481 }
488 482  
... ...
src/gxb-ide/Dir.js
... ... @@ -660,7 +660,7 @@
660 660 }
661 661 },
662 662 onwaitingCallback: function(){
663   - // alert('onwaitingCallback ----------- ' + playTimes)
  663 + console.log('onwaitingCallback ----------- ' + playTimes)
664 664 },
665 665 playCallback: function() { // 播放
666 666 if (playTimes != 0) {
... ...
src/js/gbreplayer.js
... ... @@ -430,19 +430,14 @@ $(function(){
430 430 ,debuggers: false
431 431 ,allowSeek: false
432 432 ,canplayCallback: function(res){
433   - if (res.status == true) {
  433 + if (res.status == true && GBCodePlayBack.playTimes === 0) {
434 434 playCode();
435 435 GBCodePlayBack.htmlplayereditor.setOption('readOnly', true);
  436 + GBCodePlayBack.playTimes++
436 437 }
437 438 }
438 439 ,onwaitingCallback: function(){
439   - if (GBCodePlayBack.playTimes !== 0) {
440   - GBCodePlayBack.audioTime = parseInt(player.elements.audioDom.currentTime*1000)
441   - pauseCode();
442   - GBCodePlayBack.firstPlay = 0;
443   - GBCodePlayBack.pauseValue = GBCodePlayBack.htmlplayereditor.getValue();
444   - GBCodePlayBack.htmlplayereditor.setOption('readOnly', false);
445   - }
  440 +
446 441 }
447 442 ,playCallback: function(){ // 播放
448 443 if (GBCodePlayBack.playTimes != 0) {
... ... @@ -482,7 +477,6 @@ $(function(){
482 477 GBCodePlayBack.records = coderecords;
483 478 if(GBCodePlayBack.playTimes === 0){
484 479 player.play();
485   - GBCodePlayBack.playTimes++
486 480 }
487 481 }
488 482  
... ...