javascript - Sound won't play if invoked on ajax success function -



javascript - Sound won't play if invoked on ajax success function -

i have sound clip embedded in mobile web page so:

<audio id="sound"> <source src="/assets/sound/mysound.mp3" type="audio/mpeg"> </audio>

i phone call so:

$('#sound').get(0).play();

this works fine on chrome in both laptop , iphone. however, if phone call within success function of ajax so

$.ajax({ .... success: function() { $('#sound').get(0).play(); }

on chrome browser of laptop, works fine. on chrome or safari in ios, no sound played.

anyone else run this?

ios places restrictions on when/how can play sound in web apps. example, can't auto-play sounds, have initiated user-event (tapping button, etc).

check out more info: http://www.ibm.com/developerworks/library/wa-ioshtml5/#n100e8

javascript ios audio

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -