Software Archive
Read-only legacy content
17061 Обсуждение

playing sound

porya_e_
Начинающий
356Просмотр.

hello

what can i do for play sound.

i use this code.but it just work in testing. not in real after building. (in android)

<audio id="myAudio" autoplay>
<source src="sound.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
<script>
function aud_play_pause() {
  var myAudio = document.getElementById("myAudio");
  if (myAudio.paused) {
    myAudio.play();
  } else {
    myAudio.pause();
  }
}
</script>
<div  onclick="aud_play_pause()"></div>

 

0 баллов
1 Ответить
porya_e_
Начинающий
356Просмотр.

i find out;

close!

Ответить