Software Archive
Read-only legacy content
17061 Discussions

playing sound

porya_e_
Beginner
355 Views

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 Kudos
1 Reply
porya_e_
Beginner
355 Views

i find out;

close!

0 Kudos
Reply