Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title> PKP mp3 online</title>
- <meta name="viewport" content="width=device-width, initial-scale=1">
- </head>
- <body>
- <audio controls id="MyMp3">
- <source id="urlstream" src="" type="audio/mpeg">
- Your browser does not support the audio element.
- </audio>
- <br />
- Nhap ma:
- <br />
- <input id="inputURL" type="text" value="">
- <button onclick="myFunction()">Xac nhan</button>
- <br />
- <button onclick="playVid()" type="button">Play</button>
- <button onclick="pauseVid()" type="button">Pause</button><br>
- <br />Số lần đã check: <span id="checkPAUSE1"></span>
- <br />Số lần load lại: <span id="checkPAUSE2"></span>
- <script language="JavaScript">
- var vid = document.getElementById("MyMp3");
- function myFunction()
- {
- document.getElementById("urlstream").src = atob(document.getElementById("inputURL").value);
- vid.load(); vid.play();
- }
- function playVid() { vid.play(); }
- function pauseVid() { vid.pause(); }
- var numPAUSE = 0;
- var i = 0;
- setInterval(function()
- {
- if (vid.currentTime == 0 && !vid.duration || vid.currentTime == vid.duration)
- {
- vid.load();
- vid.play();
- numPAUSE++;
- document.getElementById("checkPAUSE2").innerHTML = numPAUSE;
- }
- document.getElementById("checkPAUSE1").innerHTML = i + "_" + vid.currentTime + "_" + vid.duration;
- i++;
- }, 4000);
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement