Commit 208037e6406fd008c903b39b4812e436c0e18868

Authored by ykxie
1 parent e6de892e

fix audio single second

dist/gxb-ide/Dir.js
@@ -660,7 +660,7 @@ @@ -660,7 +660,7 @@
660 } 660 }
661 }, 661 },
662 onwaitingCallback: function(){ 662 onwaitingCallback: function(){
663 - // alert('onwaitingCallback ----------- ' + playTimes) 663 + console.log('onwaitingCallback ----------- ' + playTimes)
664 }, 664 },
665 playCallback: function() { // 播放 665 playCallback: function() { // 播放
666 if (playTimes != 0) { 666 if (playTimes != 0) {
dist/js/gbreplayer.js
@@ -430,19 +430,14 @@ $(function(){ @@ -430,19 +430,14 @@ $(function(){
430 ,debuggers: false 430 ,debuggers: false
431 ,allowSeek: false 431 ,allowSeek: false
432 ,canplayCallback: function(res){ 432 ,canplayCallback: function(res){
433 - if (res.status == true) { 433 + if (res.status == true && GBCodePlayBack.playTimes === 0) {
434 playCode(); 434 playCode();
435 GBCodePlayBack.htmlplayereditor.setOption('readOnly', true); 435 GBCodePlayBack.htmlplayereditor.setOption('readOnly', true);
  436 + GBCodePlayBack.playTimes++
436 } 437 }
437 } 438 }
438 ,onwaitingCallback: function(){ 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 ,playCallback: function(){ // 播放 442 ,playCallback: function(){ // 播放
448 if (GBCodePlayBack.playTimes != 0) { 443 if (GBCodePlayBack.playTimes != 0) {
@@ -482,7 +477,6 @@ $(function(){ @@ -482,7 +477,6 @@ $(function(){
482 GBCodePlayBack.records = coderecords; 477 GBCodePlayBack.records = coderecords;
483 if(GBCodePlayBack.playTimes === 0){ 478 if(GBCodePlayBack.playTimes === 0){
484 player.play(); 479 player.play();
485 - GBCodePlayBack.playTimes++  
486 } 480 }
487 } 481 }
488 482
src/gxb-ide/Dir.js
@@ -660,7 +660,7 @@ @@ -660,7 +660,7 @@
660 } 660 }
661 }, 661 },
662 onwaitingCallback: function(){ 662 onwaitingCallback: function(){
663 - // alert('onwaitingCallback ----------- ' + playTimes) 663 + console.log('onwaitingCallback ----------- ' + playTimes)
664 }, 664 },
665 playCallback: function() { // 播放 665 playCallback: function() { // 播放
666 if (playTimes != 0) { 666 if (playTimes != 0) {
src/js/gbreplayer.js
@@ -430,19 +430,14 @@ $(function(){ @@ -430,19 +430,14 @@ $(function(){
430 ,debuggers: false 430 ,debuggers: false
431 ,allowSeek: false 431 ,allowSeek: false
432 ,canplayCallback: function(res){ 432 ,canplayCallback: function(res){
433 - if (res.status == true) { 433 + if (res.status == true && GBCodePlayBack.playTimes === 0) {
434 playCode(); 434 playCode();
435 GBCodePlayBack.htmlplayereditor.setOption('readOnly', true); 435 GBCodePlayBack.htmlplayereditor.setOption('readOnly', true);
  436 + GBCodePlayBack.playTimes++
436 } 437 }
437 } 438 }
438 ,onwaitingCallback: function(){ 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 ,playCallback: function(){ // 播放 442 ,playCallback: function(){ // 播放
448 if (GBCodePlayBack.playTimes != 0) { 443 if (GBCodePlayBack.playTimes != 0) {
@@ -482,7 +477,6 @@ $(function(){ @@ -482,7 +477,6 @@ $(function(){
482 GBCodePlayBack.records = coderecords; 477 GBCodePlayBack.records = coderecords;
483 if(GBCodePlayBack.playTimes === 0){ 478 if(GBCodePlayBack.playTimes === 0){
484 player.play(); 479 player.play();
485 - GBCodePlayBack.playTimes++  
486 } 480 }
487 } 481 }
488 482