play.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <style>a:link {color: #FE9A2E}</style>
  6. <link rel="stylesheet" href="script/tocas.min.css">
  7. <script src="script/jquery.min.js"></script>
  8. <script>
  9. $(document).ready(function(){
  10. var player = document.getElementById("musicplayer");
  11. if (localStorage.getItem("systemvol") != null){
  12. player.volume = localStorage.getItem("systemvol");
  13. udvol();
  14. }
  15. });
  16. </script>
  17. </head>
  18. <body>
  19. <div align="center" class="ts text container">
  20. <?php
  21. if (isset($_GET['song']) !== False){
  22. if (strpos($_GET['song'],".mp4") !== False){
  23. echo "Now Playing || " . hex2bin(str_replace("inith","",basename($_GET['song'], ".mp4"))) . " [MP4 AAC]<br>";
  24. }elseif (strpos($_GET['song'],".mp3") !== False){
  25. echo "Now Playing || " . hex2bin(str_replace("inith","",basename($_GET['song'], ".mp3"))). " [MP3]<br>";
  26. }else{
  27. echo "Playing unsupported format >> " . str_replace("inith","",$_GET['song']). "<br>";
  28. }
  29. echo '<audio id="musicplayer" style="width: 100%;" controls preload="auto" loop autoplay>';
  30. echo '<source type="audio/mpeg" src="' . $_GET['song'] . '">';
  31. echo '</audio>';
  32. echo "<br>";
  33. }
  34. ?>
  35. <div align="center" class="ts container">
  36. <button class="ts mini basic button" onclick="Voldown()" type="button">Vol -</button>
  37. <span id="vol">[Global Volume:100]</span>
  38. <button class="ts mini basic button" onclick="Volup()" type="button">Vol +</button>
  39. </div>
  40. </div>
  41. <script>
  42. var player = document.getElementById("musicplayer");
  43. function udvol(){
  44. $('#vol').text("[Global Volume: " + parseInt(player.volume * 100) + "]");
  45. }
  46. function saveVol(){
  47. var systemvol = player.volume;
  48. localStorage.setItem("systemvol", systemvol);
  49. }
  50. function Voldown() {
  51. player.volume -= 0.1;
  52. saveVol();
  53. udvol();
  54. }
  55. function Volup() {
  56. player.volume += 0.1;
  57. saveVol();
  58. udvol();
  59. }
  60. </script>
  61. </body>
  62. </html>