0
J'ai lecteur audio html5 comme jouer, pause, boutons d'arrêt.html5 balise audio lecture de l'audio quand il est chargé
function onUpdate()
{
var isPlaying = (!getAudioElement().paused);
document.getElementById("playerplay").style.display = (isPlaying)?"none":"block";
document.getElementById("playerpause").style.display = (isPlaying)?"block":"none";
};
function getAudioElement()
{
return document.getElementById("id_audio_element");
}
function play() {
getAudioElement().play();
onUpdate();
}
function pause() {
getAudioElement().pause();
onUpdate();
}
function stop() {
getAudioElement().pause();
getAudioElement().currentTime=0;
onUpdate();
getAudioElement().load();
}
Et audio tag:
<audio id="id_audio_element" onended="onUpdate();load();"><source src="105.ogg" type="audio/ogg"></audio>
cela fonctionne tous les navigateurs parfaitement, exepté Safari et Chrome pour iPhone et iPad. Quand j'appelle load(), l'audio commence à jouer, bien que je n'appelle pas play().
Quelqu'un a une solution? Merci!