jquery - Audio playback in Safari iOS with HTML 5 -



jquery - Audio playback in Safari iOS with HTML 5 -

i'm having problem getting sound tag play on safari ios. i'm trying play file using sound tag. next code works on safari mac chrome android. aware of 'bandwidh conservation' in ios requiring user interaction initiate download have overcome calling next code click interaction callback. $("#myspinner") instance of spin.js (http://fgnass.github.io/spin.js/) library

this.audioelement = $('#myaudio'); this.audioelement.empty(); var currenttrack = // .. track backbone model ....... var source = $('<source></source>', { type: 'audio/mpeg', src: currenttrack.get('url'), }).appendto(this.audioelement); this.audioelement.appendto('#container'); console.log("added new track sound tag"); // $("#myaudio")[0].load(); $("#myaudio").on('canplay', function() { $("#myaudio")[0].play(); $("#myspinner").hide(); });

my own concern lie in canplay callback; spinner dissapears in chrome never goes away on safari ios leads me believe canplay may related. however, according https://developer.apple.com/library/safari/documentation/audiovideo/reference/htmlmediaelementclassreference/htmlmediaelement/htmlmediaelement.html#//apple_ref/doc/uid/tp40009355, callback supported.

in ios, canplay event unsupported. play straight after loading.

jquery ios html5

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -