Commit e6de892e1b23406d2b8337da6b59dbc8625dc50c
1 parent
a33ca933
fix audio
Showing
3 changed files
with
16 additions
and
29 deletions
dist/gxb-ide/CodingEditer.js
| ... | ... | @@ -292,8 +292,6 @@ |
| 292 | 292 | // 生成 CodeMirror |
| 293 | 293 | for (var i = 0; i < treeLinkEditor.length; i++) { |
| 294 | 294 | var modeNameItem = modeName[i] || modeName[0]; |
| 295 | - console.log('00000----------------------00000000') | |
| 296 | - console.log(modeNameItem) | |
| 297 | 295 | // 判断是否是播放页面,如果是则不显示录制区相关dom |
| 298 | 296 | if(!Dir.isReplayPage){ |
| 299 | 297 | treeLinkEditor[i].CodeMirrorRecord = CodeMirror.fromTextArea($('#' + treeLinkEditor[i].record)[0], { |
| ... | ... | @@ -310,7 +308,6 @@ |
| 310 | 308 | buildRecords(Dir.getCurrentEditor(em.getWrapperElement().getAttribute('id')), changeobj); |
| 311 | 309 | } |
| 312 | 310 | if (CodingEditer.isWeb) { |
| 313 | - console.log("++++++++++") | |
| 314 | 311 | CodingEditer.webResult(_pauseValue[0], _pauseValue[1], _pauseValue[2]) |
| 315 | 312 | } |
| 316 | 313 | }, |
| ... | ... | @@ -432,9 +429,6 @@ |
| 432 | 429 | record.trigger = 1; //标记已运行 |
| 433 | 430 | record.playTime = new Date().getTime(); // 播放开始时间 |
| 434 | 431 | |
| 435 | - console.log("==================++======================"); | |
| 436 | - console.log(record.runtimeArgus); | |
| 437 | - | |
| 438 | 432 | if (record.code == 0 || record.code == 1) { |
| 439 | 433 | var iterm = new Iterm(); |
| 440 | 434 | var resultData = { |
| ... | ... | @@ -464,6 +458,7 @@ |
| 464 | 458 | } |
| 465 | 459 | |
| 466 | 460 | CodingEditer.triggertotal = 0; |
| 461 | + CodingEditer.firstPlay = 1; | |
| 467 | 462 | |
| 468 | 463 | if (_role == 1) { |
| 469 | 464 | $('.play-code').show(); | ... | ... |
dist/gxb-ide/Dir.js
| ... | ... | @@ -653,32 +653,25 @@ |
| 653 | 653 | debuggers: false, |
| 654 | 654 | allowSeek: false, |
| 655 | 655 | canplayCallback: function(res){ |
| 656 | - // alert('res.status ----------- ' + res.status) | |
| 657 | - if (res.status == true) { | |
| 658 | - // alert('canplayCallback ----------- ' + playTimes) | |
| 656 | + if (res.status == true && playTimes === 0) { | |
| 659 | 657 | CodingEditer.playCoding(); |
| 658 | + playTimes++ | |
| 659 | + // alert('canplayCallback可以播放 ----------- ' + playTimes) | |
| 660 | 660 | } |
| 661 | 661 | }, |
| 662 | 662 | onwaitingCallback: function(){ |
| 663 | - if (playTimes != 0) { | |
| 664 | - // alert('onwaitingCallback ----------- ' + playTimes) | |
| 665 | - CodingEditer.audioTime = parseInt(player.elements.audioDom.currentTime*1000); | |
| 666 | - CodingEditer.pauseCode(); | |
| 667 | - }else{ | |
| 668 | - playTimes++ | |
| 669 | - } | |
| 663 | + // alert('onwaitingCallback ----------- ' + playTimes) | |
| 670 | 664 | }, |
| 671 | 665 | playCallback: function() { // 播放 |
| 672 | - // alert('播放 ----------- ' + playTimes) | |
| 673 | 666 | if (playTimes != 0) { |
| 674 | - // alert('playCallback ----------- ' + playTimes) | |
| 675 | 667 | CodingEditer.playCoding(); |
| 676 | 668 | } |
| 669 | + // CodingEditer.playCoding(); | |
| 677 | 670 | }, |
| 678 | 671 | pauseCallback: function() { // 暂停 |
| 679 | - // alert('playCallback ----------- ' + playTimes) | |
| 680 | 672 | CodingEditer.audioTime = parseInt(player.elements.audioDom.currentTime*1000); |
| 681 | 673 | CodingEditer.pauseCode(); |
| 674 | + // alert('pauseCallback暂停 ----------- ' + playTimes) | |
| 682 | 675 | }, |
| 683 | 676 | seekedCallback: function() { // 拖拽 |
| 684 | 677 | }, | ... | ... |
src/gxb-ide/Dir.js
| ... | ... | @@ -653,21 +653,20 @@ |
| 653 | 653 | debuggers: false, |
| 654 | 654 | allowSeek: false, |
| 655 | 655 | canplayCallback: function(res){ |
| 656 | - // if (res.status == true) { | |
| 657 | - // CodingEditer.playCoding(); | |
| 658 | - // alert('canplayCallback可以播放 ----------- ' + playTimes) | |
| 659 | - // } | |
| 656 | + if (res.status == true && playTimes === 0) { | |
| 657 | + CodingEditer.playCoding(); | |
| 658 | + playTimes++ | |
| 659 | + // alert('canplayCallback可以播放 ----------- ' + playTimes) | |
| 660 | + } | |
| 660 | 661 | }, |
| 661 | 662 | onwaitingCallback: function(){ |
| 662 | 663 | // alert('onwaitingCallback ----------- ' + playTimes) |
| 663 | - playTimes++ | |
| 664 | 664 | }, |
| 665 | 665 | playCallback: function() { // 播放 |
| 666 | - // if (playTimes != 0) { | |
| 667 | - // alert('playCallback播放 ----------- ' + playTimes) | |
| 668 | - // CodingEditer.playCoding(); | |
| 669 | - // } | |
| 670 | - CodingEditer.playCoding(); | |
| 666 | + if (playTimes != 0) { | |
| 667 | + CodingEditer.playCoding(); | |
| 668 | + } | |
| 669 | + // CodingEditer.playCoding(); | |
| 671 | 670 | }, |
| 672 | 671 | pauseCallback: function() { // 暂停 |
| 673 | 672 | CodingEditer.audioTime = parseInt(player.elements.audioDom.currentTime*1000); | ... | ... |