h5.html 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  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: 400px;
  40. height:400px;
  41. background: url('./image/monitor/1.png');
  42. background-size: 100% auto;
  43. background-repeat: no-repeat;
  44. position: relative;
  45. }
  46. .direc div {
  47. width: 50px;
  48. height: 50px;
  49. position: absolute;
  50. }
  51. .top {
  52. top: 0;
  53. left: 50px
  54. }
  55. .bottom {
  56. bottom: 0;
  57. left: 50px
  58. }
  59. .left {
  60. left: 0;
  61. top: 50px
  62. }
  63. .right {
  64. right: 0;
  65. top: 50px
  66. }
  67. #box {
  68. height: 800px;
  69. width: 100%;
  70. background: #000;
  71. }
  72. </style>
  73. <script type="text/javascript" src="./js/ezuikit.js"></script>
  74. </head>
  75. <body>
  76. <div id="box">
  77. <div id="myPlayer"></div>
  78. </div>
  79. <div class="btn-box">
  80. <div class="more" ontouchstart="configCamera('move', 8)" ontouchend="stopConfigCamera()">
  81. <image src="./image/monitor/3.png" mode="widthFix"></image>
  82. </div>
  83. <div class="direc">
  84. <div class="top" ontouchstart="configCamera('move', 0)" ontouchend="stopConfigCamera()">
  85. </div>
  86. <div class="bottom" ontouchstart="configCamera('move', 1)" ontouchend="stopConfigCamera()">
  87. </div>
  88. <!-- <div class="photo" ontouchstart="configCamera('takephoto', '')">
  89. </div> -->
  90. <div class="left" ontouchstart="configCamera('move', 2)" ontouchend="stopConfigCamera()">
  91. </div>
  92. <div class="right" ontouchstart="configCamera('move', 6)" ontouchend="stopConfigCamera()">
  93. </div>
  94. </div>
  95. <div class="less" ontouchstart="configCamera('move', 9)" ontouchend="stopConfigCamera()">
  96. <image src="./image/monitor/2.png" mode="widthFix"></image>
  97. </div>
  98. </div>
  99. </body>
  100. <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
  101. <!-- uni 的 SDK -->
  102. <script type="text/javascript" src="https://js.cdn.aliyun.dcloud.net.cn/dev/uni-app/uni.webview.1.5.2.js"></script>
  103. <script type="text/javascript">
  104. //上下左右和拍照
  105. function configCamera(ctrl, movenum) {
  106. if (ctrl == "takephoto") {
  107. $.ajax({
  108. type: "POST",
  109. url: "http://182.92.193.64:8002/api/api_gateway?method=camera.camera_manage.camera_takephoto",
  110. data: {
  111. device_id: device_id,
  112. }
  113. }).then((res) => {
  114. if (res.data.data) {
  115. var data = JSON.parse(res.data.data);
  116. var picUrl = data.data.picUrl;
  117. } else {
  118. console.log(res.data.message)
  119. }
  120. });
  121. } else {
  122. //上下左右、放大、缩小
  123. $.ajax({
  124. type: "POST",
  125. url: "http://182.92.193.64:8002/api/api_gateway?method=camera.camera_manage.ctrl_camera",
  126. data: {
  127. device_id: device_id,
  128. ctrl: ctrl,
  129. movenum: movenum,
  130. }
  131. }).then((res) => {
  132. })
  133. }
  134. }
  135. function stopConfigCamera() {
  136. $.ajax({
  137. type: "POST",
  138. url: "http://182.92.193.64:8002/api/api_gateway?method=camera.camera_manage.ctrl_camera",
  139. data: {
  140. device_id: device_id,
  141. ctrl: "stop",
  142. },
  143. });
  144. }
  145. $(function() {
  146. // var width = $('.direc').width()
  147. // $('.direc').height(width)
  148. var str = window.location.search.substr(1)
  149. var arr = str.split('&')
  150. var device_id = arr[0].split('=')[1]
  151. var accessToken = arr[1].split('=')[1]
  152. console.log(device_id)
  153. console.log(accessToken)
  154. setTimeout(() => {
  155. var url = "ezopen://open.ys7.com/" + device_id + "/1.hd.live"
  156. var player = new EZUIKit.EZUIPlayer({
  157. id: 'myPlayer',
  158. url: url,
  159. autoplay: true,
  160. accessToken: accessToken,
  161. decoderPath: 'js',
  162. width: 1000,
  163. height: 800,
  164. });
  165. player.play();
  166. }, 1000)
  167. })
  168. document.addEventListener('UniAppJSBridgeReady', function() {
  169. uni.webView.getEnv(function(res) {
  170. console.log(res)
  171. console.log('当前环境:' + JSON.stringify(res));
  172. });
  173. uni.postMessage({
  174. data: {
  175. action: 'postMessage'
  176. }
  177. });
  178. // uni.webView.navigateTo(...)
  179. });
  180. </script>
  181. </html>