vidplay.php 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <html>
  2. <link rel="stylesheet" href="script/tocas.min.css">
  3. <head>
  4. <script src="script/jquery.min.js"></script>
  5. <meta charset="utf-8">
  6. <title>Video</title>
  7. <script>
  8. $(document).ready(function(){
  9. var vidvol = 0.5
  10. var player = document.getElementById("videoplayer");
  11. var viddiv = document.getElementById("vidcontainer");
  12. var maxvidwidth = document.getElementById("vidcontainer").offsetWidth;
  13. var screenwidth = $(window).width();
  14. if (localStorage.getItem("systemvol") != null){
  15. vidvol = localStorage.getItem("systemvol");
  16. player.volume = localStorage.getItem("systemvol");
  17. if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {
  18. //Mobile
  19. viddiv.style.left = 0;
  20. viddiv.style.width= screenwidth* 0.93 + 'px';
  21. player.width = screenwidth * 0.89;
  22. }else{
  23. //Viewing on PC
  24. player.width = maxvidwidth * 0.65;
  25. }
  26. }
  27. udvol();
  28. });
  29. </script>
  30. </head>
  31. <body>
  32. <div class="ts container">
  33. <br>
  34. <h1>IMUS Laboratory </h1><br>
  35. <h2>ArOZ Video Bank</h2><br>
  36. <div class="ts divider"></div>
  37. <div class="ts container">
  38. <?php
  39. $path = $_GET['directory'];
  40. $file = $_GET['filename'];
  41. echo '<div id="vidcontainer" class="ts basic jumbotron" style="background-color: #353535;">';
  42. $filetitle = "|| " . hex2bin(str_replace(".mp4","",str_replace("inith","",$file)));
  43. echo '<h2><font color="white">' . $filetitle . "</font></h2>";
  44. echo '<video id="videoplayer" width="480" autoplay controls>';
  45. echo '<source src="' . $path .$file.'" type="video/mp4">';
  46. echo '<script>';
  47. echo 'var video = document.currentScript.parentElement;';
  48. echo 'video.volume = vidvol;';
  49. echo '</script>';
  50. echo '</video><br>';
  51. echo '</div>';
  52. ?>
  53. <div class="ts basic jumbotron" style="outline: solid #353535">
  54. <a align="right" class="ts mini basic button" href="video.php">Back</a>
  55. <button class="ts mini basic button" onclick="Voldown()" type="button">Vol -</button>
  56. <span id="vol">[Global Volume:100]</span>
  57. <button class="ts mini basic button" onclick="Volup()" type="button">Vol +</button>
  58. <button class="ts mini basic button" onclick="cinema()" type="button">Large Screen</button>
  59. <a class="ts mini basic button" href="<?php echo $path .$file; ?>" download>Download</a>
  60. </div><br>
  61. <script>
  62. var player = document.getElementById("videoplayer");
  63. var oncinema = false;
  64. function udvol(){
  65. $('#vol').text("[Global Volume: " + parseInt(player.volume * 100) + "]");
  66. }
  67. function cinema(){
  68. var maxvidwidth = document.getElementById("vidcontainer").offsetWidth;
  69. if (oncinema == false){
  70. player.width = maxvidwidth * 0.95;
  71. oncinema = true;
  72. }else{
  73. player.width = maxvidwidth * 0.65;
  74. oncinema = false;
  75. }
  76. }
  77. function saveVol(){
  78. var systemvol = player.volume;
  79. localStorage.setItem("systemvol", systemvol);
  80. }
  81. function Voldown() {
  82. player.volume -= 0.1;
  83. saveVol();
  84. udvol();
  85. }
  86. function Volup() {
  87. player.volume += 0.1;
  88. saveVol();
  89. udvol();
  90. }
  91. </script>
  92. </body>
  93. </html>