0

i was trying to run this script in iOS Safari and Android browsers but doesnt work, works very well in any desktop browser.

case 4:
    if(estado == '1'){    
        alert('case 4!!');      
         $('#respuesta').empty();
         $('#respuesta').append('Well done!<br>That was correct.');
         $('#estado').val(2);
          document.getElementById('well_done').play();

       //when the audio finish, must wait 5 seconds to play another one.

          setTimeout(function(){ 
            document.getElementById('question_2').play();        
          },5000);          
    }

i repeat, works very well in desktop but not in mobile.

Thanks for your help.

FranciscoV
  • 61
  • 8
  • possible duplicate of [Autoplay audio files on an iPad with HTML5](http://stackoverflow.com/questions/3009888/autoplay-audio-files-on-an-ipad-with-html5) – ceejayoz Dec 02 '14 at 01:37
  • Short version: iOS/Android devices only allow you to control audio in very specific cases, in which a setTimeout is not included. – ceejayoz Dec 02 '14 at 01:38
  • @ceejayoz really!In what cases allows to control? Or do you know any alternative for setTimeout? – FranciscoV Dec 02 '14 at 01:41
  • My understanding is you can only trigger audio if it's directly related to a click. A timeout is no longer attached to a click event. – ceejayoz Dec 02 '14 at 01:46

0 Answers0