I have implemented in a page to play a sound if some criteria are fired inside a polling cycle of 3 seconds as you can see here:
$(document).ready(function () {
soundManager.setup({
url: '/js/soundmanager2.swf',
debugMode: true
});
});
function playMe() {
soundManager.createSound({
url: '/images/woop_woop.mp3',
onload: function() {
console.log('start playing...');
soundManager._writeDebug(this.id + ' loaded');
this.play();
}
}).load();
}
function NewReadyData()
(
.
.
.
.
.
jQuery.ajax({
type: "GET",
dataType: "json",
url: "./getData.php?xxxxxxxxxxxx",
success: function(data) {
if (data.length > 0) {
if (sound_notify) {
executeAsync(function() {
playMe();
});
}
if ( window.navigator && window.navigator.vibrate && buzz_notify )
window.navigator.vibrate(2000);
}
}
});
.
.
.
.
setTimeout('NewReadyData', 3000);
}
setTimeout('NewReadyData', 3000);
The matter is on Window Desktop it works and it plays that little mp3 but on Android it doesn't play sound. Is there a way to force playing? like calling an ajax so it would play like in independent event of playing when occurs?...
Thanks Cheers, Luigi
Nevermind, I figured out myself the solution...
I thought I couldn't use tag but after discovering to enable that flag about requisite for multimedia reproduction so now I could play by code.
Thanks everyone anyway! :) Cheers Luigi