h5.html 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. <!DOCTYPE html>
  2. <html lang=zh-CN>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="divport" content="width=device-width,user-scalable=no,initial-scale=1,maximum-scale=1,minimum-scale=1">
  7. <title>监控详情页</title>
  8. <meta name="Copyright" content="helang">
  9. <link rel="shortcut icon" type="image/png" href="/uniapp-extend/static/logo.png">
  10. <meta name="keywords" content="黄河爱浪,WEB前端河浪,jQuery插件开发者河浪">
  11. <meta name="description" content="公众号:web-7258,QQ:1846492969,邮箱:helang.love@qq.com">
  12. <style type="text/css">
  13. body {
  14. margin: 0;
  15. background-color: #f3f3f3;
  16. }
  17. /* iframe {
  18. width: 375px;
  19. height: 667px;
  20. background-color: #fff;
  21. box-sizing: content-box;
  22. border: none;
  23. } */
  24. .btn-box {
  25. margin-top: 20px;
  26. display: flex;
  27. flex-direction: row;
  28. justify-content: space-around;
  29. align-items: center;
  30. }
  31. .more,
  32. .less {
  33. flex: 1
  34. }
  35. img {
  36. width: 100%;
  37. }
  38. .direc {
  39. width: 50%;
  40. background: url('./image/monitor/1.png');
  41. background-size: 100% auto;
  42. background-repeat: no-repeat;
  43. position: relative;
  44. }
  45. .direc div {
  46. width: 50px;
  47. height: 50px;
  48. position: absolute;
  49. }
  50. .top {
  51. top: 0;
  52. left: 50px
  53. }
  54. .bottom {
  55. bottom: 0;
  56. left: 50px
  57. }
  58. .left {
  59. left: 0;
  60. top: 50px
  61. }
  62. .right {
  63. right: 0;
  64. top: 50px
  65. }
  66. </style>
  67. <script type="text/javascript" src="./js/ezuikit.js"></script>
  68. </head>
  69. <body>
  70. <div id="myPlayer"></div>
  71. <div class="btn-box">
  72. <div class="more" ontouchstart="configCamera('move', 8)" ontouchend="stopConfigCamera()">
  73. <image src="./image/monitor/3.png" mode="widthFix"></image>
  74. </div>
  75. <div class="direc">
  76. <div class="top" ontouchstart="configCamera('move', 0)" ontouchend="stopConfigCamera()">
  77. </div>
  78. <div class="bottom" ontouchstart="configCamera('move', 1)" ontouchend="stopConfigCamera()">
  79. </div>
  80. <!-- <div class="photo" ontouchstart="configCamera('takephoto', '')">
  81. </div> -->
  82. <div class="left" ontouchstart="configCamera('move', 2)" ontouchend="stopConfigCamera()">
  83. </div>
  84. <div class="right" ontouchstart="configCamera('move', 6)" ontouchend="stopConfigCamera()">
  85. </div>
  86. </div>
  87. <div class="less" ontouchstart="configCamera('move', 9)" ontouchend="stopConfigCamera()">
  88. <image src="./image/monitor/2.png" mode="widthFix"></image>
  89. </div>
  90. </div>
  91. </body>
  92. <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
  93. <script type="text/javascript">
  94. //上下左右和拍照
  95. function configCamera(ctrl, movenum) {
  96. if (ctrl == "takephoto") {
  97. $.ajax({
  98. type: "POST",
  99. url: "http://182.92.193.64:8002/api/api_gateway?method=camera.camera_manage.camera_takephoto",
  100. data: {
  101. device_id: device_id,
  102. }
  103. }).then((res) => {
  104. if (res.data.data) {
  105. var data = JSON.parse(res.data.data);
  106. var picUrl = data.data.picUrl;
  107. } else {
  108. console.log(res.data.message)
  109. }
  110. });
  111. } else {
  112. //上下左右、放大、缩小
  113. $.ajax({
  114. type: "POST",
  115. url: "http://182.92.193.64:8002/api/api_gateway?method=camera.camera_manage.ctrl_camera",
  116. data: {
  117. device_id: device_id,
  118. ctrl: ctrl,
  119. movenum: movenum,
  120. }
  121. }).then((res) => {
  122. })
  123. }
  124. }
  125. function stopConfigCamera() {
  126. $.ajax({
  127. type: "POST",
  128. url: "http://182.92.193.64:8002/api/api_gateway?method=camera.camera_manage.ctrl_camera",
  129. data: {
  130. device_id: device_id,
  131. ctrl: "stop",
  132. },
  133. });
  134. }
  135. $(function() {
  136. var str = window.location.search.substr(1)
  137. var arr = str.split('&')
  138. var device_id = arr[0].split('=')[1]
  139. var accessToken = arr[1].split('=')[1]
  140. setTimeout(() => {
  141. var url = "ezopen://open.ys7.com/" + device_id + "/1.hd.live"
  142. var player = new EZUIKit.EZUIPlayer({
  143. id: 'myPlayer',
  144. url: url,
  145. autoplay: true,
  146. accessToken: accessToken,
  147. decoderPath: 'js/',
  148. width:1000,
  149. height: 800,
  150. });
  151. player.play();
  152. }, 500)
  153. var width=$('.direc').width()
  154. $('.direc').height(width)
  155. })
  156. </script>
  157. </html>