Commit 4a3d9bc62da18db005df99c921266d5112b04d67

Authored by ykxie
1 parent 2b3ff8c1

fixbug20170224

src/js/gb.js
... ... @@ -528,7 +528,7 @@ $(function() {
528 528 console.info(playUrl)
529 529 console.log(res)
530 530 // 判断数据是否正常
531   - if(res.codeReplayId){
  531 + if(res.codeReplayId || res.studentReplayId){
532 532 playData = res;
533 533 _languageid = playData.languageid;
534 534 console.log(playData.audioUrl);
... ... @@ -961,38 +961,46 @@ $(function() {
961 961 console.info('initPlayerPage')
962 962 console.log(playData);
963 963 var langid = parseInt(playData.languageid);
964   - var coderecords = playData.codeRecordList;
  964 + var coderecords = playData.codeRecordList || playData.studentRecordList;
965 965  
966 966 selectLang(langid);
967 967 compileMode(langid);
968 968  
969 969 console.log("https://gxb-file.oss-cn-beijing.aliyuncs.com" + playData.audioUrl)
970   - player.init({
971   - container: '#audioWrap',
972   - source: "https://gxb-file.oss-cn-beijing.aliyuncs.com" + playData.audioUrl,
973   - imagePath: '../js/audioPlayer/image',
974   - debuggers: false,
975   - allowSeek: false,
976   - playCallback: function() { // 播放
977   - console.log('++++++++');
978   - playCode();
979   - GBCodePlayBack.editable(0);
980   - },
981   - pauseCallback: function() { // 暂停
982   - GBCodePlayBack.editable(1);
983   - GBCodePlayBack.audioTime = parseInt(player.elements.audioDom.currentTime*1000)
984   - GBCodePlayBack.treeSelectNode = treeObj.getSelectedNodes()[0];
985   - pauseCode();
986   - GBCodePlayBack.firstPlay = 0;
987   - GBCodePlayBack.getCodeMirrorValue();
988   - },
989   - seekedCallback: function() { // 拖拽
990 970  
991   - },
992   - endedCallback: function() { // 结束播放
993   - playEnd()
994   - }
995   - });
  971 + if (_role ==0) {
  972 + player.init({
  973 + container: '#audioWrap',
  974 + source: "https://gxb-file.oss-cn-beijing.aliyuncs.com" + playData.audioUrl,
  975 + imagePath: '../js/audioPlayer/image',
  976 + debuggers: false,
  977 + allowSeek: false,
  978 + playCallback: function() { // 播放
  979 + console.log('++++++++');
  980 + playCode();
  981 + GBCodePlayBack.editable(0);
  982 + },
  983 + pauseCallback: function() { // 暂停
  984 + GBCodePlayBack.editable(1);
  985 + GBCodePlayBack.audioTime = parseInt(player.elements.audioDom.currentTime*1000)
  986 + GBCodePlayBack.treeSelectNode = treeObj.getSelectedNodes()[0];
  987 + pauseCode();
  988 + GBCodePlayBack.firstPlay = 0;
  989 + GBCodePlayBack.getCodeMirrorValue();
  990 + },
  991 + seekedCallback: function() { // 拖拽
  992 +
  993 + },
  994 + endedCallback: function() { // 结束播放
  995 + playEnd()
  996 + }
  997 + });
  998 + }else{
  999 + playCode();
  1000 + GBCodePlayBack.editable(0)
  1001 + }
  1002 +
  1003 +
996 1004  
997 1005 var starttime = 0;
998 1006 for (var i = 0; i < coderecords.length; i++) {
... ... @@ -1514,7 +1522,7 @@ $(function() {
1514 1522 postData.codeRecordList = codeRecordLists;
1515 1523 var roleUrl = gxb_api + "/programming/codeReplay/api"
1516 1524 }else if (_role == 1) {
1517   - postData.codeRecordList = codeRecordLists;
  1525 + postData.studentRecordList = codeRecordLists;
1518 1526 var roleUrl = gxb_api + "/programming/student/studentReplay/api"
1519 1527 }
1520 1528 console.log('============');
... ... @@ -1982,7 +1990,9 @@ $(function() {
1982 1990 .removeClass('glyphicon-pause');
1983 1991  
1984 1992 $('#recordertab a:first').tab('show');
1985   - Hourglass.stopTimer();
  1993 + if(document.URL.indexOf('index.htm') >= 0) {
  1994 + Hourglass.stopTimer();
  1995 + }
1986 1996  
1987 1997 /* 移动设备的下一节和代码编写控制 */
1988 1998 $('#donenext').removeClass('disabled');
... ...
src/v1.1/player.html
... ... @@ -166,12 +166,6 @@
166 166 </div>
167 167 <div id="playFooter">
168 168 <div class="" id="audioWrap">
169   - <button id="full-screen">
170   - <i class="icon iconfont icon-fangda"></i>
171   - </button>
172   - <button id="back-screen" style="display: none;">
173   - <i class="icon iconfont icon-fangda"></i>
174   - </button>
175 169 </div>
176 170 </div>
177 171 </div>
... ...