Commit 6550db7a4cfe6745f4324b2f222e35cf51c962e7

Authored by ykxie
1 parent d9fdc864

fix signle

dist/js/gbreplayer.js
... ... @@ -23,6 +23,10 @@ $(function(){
23 23 $('#upload').show();
24 24 }
25 25  
  26 + var u = navigator.userAgent;
  27 + var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
  28 + var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
  29 +
26 30 if(document.URL.indexOf('player.htm')>=0){
27 31  
28 32 var title = decodeURIComponent(getQuery('title'));
... ... @@ -430,7 +434,7 @@ $(function(){
430 434 ,debuggers: false
431 435 ,allowSeek: false
432 436 ,canplayCallback: function(res){
433   - if (res.status == true && GBCodePlayBack.playTimes === 0) {
  437 + if (res.status == true && GBCodePlayBack.playTimes === 0 && !isAndroid) {
434 438 playCode();
435 439 GBCodePlayBack.htmlplayereditor.setOption('readOnly', true);
436 440 GBCodePlayBack.playTimes++
... ... @@ -476,7 +480,11 @@ $(function(){
476 480  
477 481 GBCodePlayBack.records = coderecords;
478 482 if(GBCodePlayBack.playTimes === 0){
479   - player.play();
  483 + if(!isAndroid){
  484 + player.play();
  485 + }else{
  486 + GBCodePlayBack.playTimes++
  487 + }
480 488 }
481 489 }
482 490  
... ...
src/js/gbreplayer.js
... ... @@ -23,6 +23,10 @@ $(function(){
23 23 $('#upload').show();
24 24 }
25 25  
  26 + var u = navigator.userAgent;
  27 + var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
  28 + var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
  29 +
26 30 if(document.URL.indexOf('player.htm')>=0){
27 31  
28 32 var title = decodeURIComponent(getQuery('title'));
... ... @@ -430,7 +434,7 @@ $(function(){
430 434 ,debuggers: false
431 435 ,allowSeek: false
432 436 ,canplayCallback: function(res){
433   - if (res.status == true && GBCodePlayBack.playTimes === 0) {
  437 + if (res.status == true && GBCodePlayBack.playTimes === 0 && !isAndroid) {
434 438 playCode();
435 439 GBCodePlayBack.htmlplayereditor.setOption('readOnly', true);
436 440 GBCodePlayBack.playTimes++
... ... @@ -476,7 +480,11 @@ $(function(){
476 480  
477 481 GBCodePlayBack.records = coderecords;
478 482 if(GBCodePlayBack.playTimes === 0){
479   - player.play();
  483 + if(!isAndroid){
  484 + player.play();
  485 + }else{
  486 + GBCodePlayBack.playTimes++
  487 + }
480 488 }
481 489 }
482 490  
... ...