mardi 10 février 2015

Audio.play() isn't working in latest Chrome. It's bug or am I fool?


<audio id="message_notification" preload="auto">
<source src="http://domain/sounds/message_notification.mp3" type="audio/mpeg">
<source src="http://domain/sounds/message_notification.ogg" type="audio/ogg">
<source src="http://domain/sounds/message_notification.aac" type="audio/aac">
</audio>


...



function verifyMessages(){

$.ajax({
type:"POST",
ifModified: false,
cache: false,
url: (domain + pathSeparator + pathToPHP),
async: true,
success: function (data, textStatus, jqXHR) {
if( parseInt(data) > messagesCounterFromPage ){
$("#new_messages_counter").text("Сообщения: " + data); // it's work
document.getElementById("message_notification").play(); // it isn't work
messagesCounterFromPage = data;
}
}
});

}


This works in Firefox and does not work in the latest Chrome. Audio files are small, issue tracker write that bug with playing small files fixed. I still make the file more from 228 kilobytes, but nothing has changed. It's really a bug or am I a fool? In the bug tracker is something similar with autoplay, but not confirmed.


Aucun commentaire:

Enregistrer un commentaire