Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <audio autoplay id="myAudio" src="./takbiran.mp3" preload="auto">
- </audio>
- <script>
- var myAudio = document.getElementById("myAudio");
- var isPlaying = false;
- function togglePlay() {
- if (isPlaying) {
- myAudio.pause()
- } else {
- myAudio.play();
- }
- };
- myAudio.onplaying = function() {
- isPlaying = true;
- };
- myAudio.onpause = function() {
- isPlaying = false;
- };
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement