onclick button change playing status, replace main block

This commit is contained in:
santic-zombie
2020-03-27 11:18:03 +03:00
parent de8c6598d7
commit dcf3626d6b
2 changed files with 20 additions and 6 deletions

View File

@@ -16,13 +16,12 @@
<body>
<div class="parent">
<div id="song">
<h1>Just Radio</h1>
now playing:
<br>
<div id="myPlay">-</div>
<div id="title">title</div>
@@ -53,15 +52,19 @@
<div id="listeners">title</div>
</div>
</div>
<script language="JavaScript">
var audio = new Audio('http://stream.santic-zombie.ru');
var play = document.getElementById('play');
play.addEventListener('click', function() {
$("#myPlay").text("Now playing:");
audio.play();
}, false);
var pause = document.getElementById('pause');
pause.addEventListener('click', function() {
$("#myPlay").text("Paused");
audio.pause();
}, false);
var volume = document.getElementById('volume');