video.html 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1">
  6. <link rel="stylesheet" href="https://apps.bdimg.com/libs/jquerymobile/1.4.5/jquery.mobile-1.4.5.min.css">
  7. <style type="text/css">
  8. body {background-color: #f1f0f5;}
  9. table,tr,td,th {border: 0px; color: #6e6e6e; font-size: 14px; margin: 0px; padding:0px; border-spacing:0px; border-style:none; border-collapse:collapse;}
  10. p {margin: 20px auto 20px auto;text-align: center;}
  11. video {margin: 20px;text-align: center;}
  12. .timenum {color: #1993c7; font-size: 24px;}
  13. .ui-content {margin: 0px; padding: 0px; background-color: #ffffff; }
  14. .gray {
  15. -webkit-filter: grayscale(100%);
  16. -moz-filter: grayscale(100%);
  17. -ms-filter: grayscale(100%);
  18. -o-filter: grayscale(100%);
  19. filter: grayscale(100%);
  20. filter: gray;
  21. opacity:0.7;//通过改变透明度来调节灰色的程度
  22. }
  23. </style>
  24. <script src="https://apps.bdimg.com/libs/jquery/1.10.2/jquery.min.js"></script>
  25. <script src="https://apps.bdimg.com/libs/jquerymobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
  26. <script type="text/javascript">
  27. var GetRequest = function() {
  28. var url = location.search; //获取url中"?"符后的字串
  29. var theRequest = new Object();
  30. if (url.indexOf("?") != -1) {
  31. var str = url.substr(1);
  32. strs = str.split("&");
  33. for (var i = 0; i < strs.length; i++) {
  34. theRequest[strs[i].split("=")[0]] = unescape(strs[i].split("=")[1]);
  35. }
  36. }
  37. return theRequest;
  38. }
  39. var reload = function(){
  40. var video1 = document.getElementById('video1');
  41. video1.innerHTML='';
  42. video1.width = $(window).width();
  43. video1.height = $(window).width()*3/4;
  44. video1.style.margin = '0px';
  45. video1.style.padding = '0px';
  46. var src = document.createElement("source");
  47. src.setAttribute('src','http://47.103.74.123/hls/'+$("#device").val()+'.m3u8');
  48. src.setAttribute('type','application/vnd.apple.mpegurl');
  49. video1.appendChild(src);
  50. video1.load();
  51. video1.play();
  52. }
  53. var closeme = function(){
  54. window.location='/sc/#pagethree';
  55. }
  56. $(document).ready(function(){
  57. var Request = new Object();
  58. Request = GetRequest();
  59. var id = Request["device"];
  60. $("#device").val(id);
  61. $("#deviceid").html(id);
  62. reload();
  63. })
  64. </script>
  65. </head>
  66. <body>
  67. <div data-role="page" id="pageone">
  68. <div data-role="header" data-theme="b">
  69. <a href="#" class="ui-btn ui-btn-left ui-icon-back ui-btn-icon-left" onclick="closeme()">返回</a>
  70. <h1>实时监控</h1>
  71. <a href="#" class="ui-btn ui-icon-refresh ui-btn-icon-notext ui-btn-right" onclick="reload()">刷新</a>
  72. </div>
  73. <div id="webinfo" data-role="content" class="ui-content">
  74. <table width="100%" style="border-top: 5px solid #c8c8c8; border-bottom: 1px solid #c8c8c8;">
  75. <tr>
  76. <th style="width:120px;">设备编号:</th><td id="deviceid"></td>
  77. </tr>
  78. </table>
  79. <video muted controls="controls" id="video1" width="320" height="240" loop="loop" autoplay="autoplay">
  80. </video>
  81. </div>
  82. <input type="hidden" id="device" name="device" value="">
  83. </body>
  84. </html>