| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274 |
- <!doctype html>
- <html>
- <head>
- <meta charset="UTF-8">
- <title></title>
- <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
- <link href="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.css" rel="stylesheet">
- <link rel="stylesheet" href="../css/mui.min.css" />
- <link rel="stylesheet" href="../css/reset.css" />
- <link rel="stylesheet" href="../css/common.css" />
- <link rel="stylesheet" type="text/css" href="../css/equipjk.css" />
- <script src="../js/base.js" type="text/javascript" charset="utf-8"></script>
- <script src="https://open.ys7.com/sdk/js/1.3/ezuikit.js"></script>
- <style type="text/css">
- .headRightIcon{
- margin-top: 10px;
- }
- /*视频*/
-
- .videobox>video,
- .videobox {
- width: 100%;
- height: 4.5rem;
- background: #000;
- }
- /*控制*/
-
- .topCtrl {
- text-align: center;
- }
-
- .topCtrl>div {
- display: inline-block;
- width: 1.5rem;
- height: 1.5rem;
- background-size: 100%;
- }
-
- .addBtn {
- background: url(../images/jkadd.png);
- margin-right: 4rem;
- }
-
- .minusBtn {
- background: url(../images/jkminus.png);
- }
- .topCtrl{
- left: 0;
- right: 0;
- bottom: 6rem;
- height: 1.5rem;
- /*background: red;*/
- }
- .bottomCtrl {
- position: absolute;
- left: 0;
- right: 0;
- top: 5rem;
- bottom: 0;
- height: 6rem;
- background-size: 5.5rem 5.5rem;
- }
-
- .bottomCtrl div {
- position: absolute;
- width: 1.2rem;
- height: 1.2rem;
- left: 50%;
- }
-
- .upBtn {
- top: 1.45rem;
- margin-left: -0.6rem;
- }
-
- .dowmBtn {
- left: 50%;
- bottom: 1.65rem;
- margin-left: -0.6rem;
- }
-
- .leftBtn {
- top: 2.8rem;
- margin-left: -2rem;
- }
-
- .rightBtn {
- top: 2.8rem;
- margin-left: 0.8rem;
- }
-
- .lookImg {
- position: absolute;
- left: 0;
- top: 11rem;
- width: 100%;
- }
- .lookImg_img {
- margin-left: 1.3rem;
- }
- </style>
- </head>
- <body>
- <header class="mui-bar mui-bar-nav">
- <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
- <h1 class="mui-title" id="equip_name"></h1>
- <!--<a class="headRightIcon fa fa-file-image-o mui-pull-right" id="lookPhotoBtn"></a>-->
- </header>
- <div class="mui-content">
- <div class="videobox">
- <!--<video id="myPlayer" poster="" controls playsInline webkit-playsinline autoplay>
- <source src="rtmp://rtmp01open.ys7.com/openlive/fce902662a5a4acc86bc4ae771b45c92.hd" type="" />
- <source src="http://hls01open.ys7.com/openlive/fce902662a5a4acc86bc4ae771b45c92.hd.m3u8" type="application/x-mpegURL" />
- </video>-->
- </div>
- <div class="controlPanel">
- <div class="topCtrl">
- <div class="addBtn"></div>
- <div class="minusBtn"></div>
- <!--<div></div>-->
- </div>
- <div class="bottomCtrl">
- <div class="upBtn"></div>
- <div class="dowmBtn"></div>
- <div class="leftBtn"></div>
- <div class="rightBtn"></div>
- </div>
- <div class="lookImg" id="lookPhotoBtn">
- <img src="../images/jk_image.png" alt="" class="lookImg_img" />
- </div>
- </div>
- <script src="../js/jquery-2.1.0.js"></script>
- <script src="../js/mui.min.js"></script>
- <script src="https://open.ys7.com/sdk/js/1.3/ezuikit.js"></script>
- <script type="text/javascript">
- mui.init({
- gestureConfig:{
- tap: true, //默认为true
- doubletap: true, //默认为false
- longtap: true, //默认为false
- swipe: true, //默认为true
- drag: true, //默认为true
- hold:true,//默认为false,不监听
- release:true//默认为false,不监听
- }
- });
- var equipId;
- mui.plusReady(function() {
- var self = plus.webview.currentWebview();
- equipId = self.equipId;
- $('#equip_name').html('设备:'+equipId);
- mui.ajax('http://120.27.222.26/app_moni', {
- data: {
- id: equipId
- },
- dataType: 'json', //服务器返回json格式数据
- type: 'post', //HTTP请求类型
- timeout: 100000, //超时时间设置为10秒;
- beforeSend: function() {
- plus.nativeUI.showWaiting('请求中...');
- },
- complete: function() {
- plus.nativeUI.closeWaiting();
- },
- success: function(data) {
- console.log(JSON.stringify(data))
- if(data[0].code == 200) {
- StartPlay(data[0].data[0]);
- } else {
- mui.toast('请求失败');
- }
- },
- error: function(xhr, type, errorThrown) {
- mui.toast('请求失败');
- }
- });
-
- })
-
- $('.addBtn').on('longtap',function(){
- configCamera('move',8)
- })
- $('.addBtn').on('release',function(){
- configCamera('stop')
- })
- $('.minusBtn').on('hold',function(){
- configCamera('move',9)
- })
- $('.minusBtn').on('release',function(){
- configCamera('stop')
- })
- $('.upBtn').on('hold',function(){
- configCamera('move',0)
- })
- $('.upBtn').on('release',function(){
- configCamera('stop')
- })
- $('.dowmBtn').on('hold',function(){
- configCamera('move',1)
- })
- $('.dowmBtn').on('release',function(){
- configCamera('stop')
- })
- $('.leftBtn').on('hold',function(){
- configCamera('move',2)
- })
- $('.leftBtn').on('release',function(){
- configCamera('stop')
- })
- $('.rightBtn').on('hold',function(){
- configCamera('move',3)
- })
- $('.rightBtn').on('release',function(){
- configCamera('stop')
- })
- function configCamera(ctrl, movenum) {
- console.log(111111)
- $.ajax({
- // url: 'http://120.27.222.26/equipmanage_jk',
- url: 'http://120.27.222.26/jk_view',
- type: 'post',
- dataType: 'json',
- data: {
- id: equipId,
- ctrl: ctrl,
- movenum: movenum
- },
- beforeSend: function() {
- if(ctrl == 'takephoto') {
- loadFlage = layer.load();
- }
- },
- success: function(data) {
- // console.log(data)
- },
- error: function(xhr, type, errorThrown) {
- mui.toast('请求失败');
- }
- })
- }
-
- //预览函数
- function StartPlay(dat) {
- var jkmsg = dat
- var playHtml = "<video id='myPlayer' class='videoNum' poster='' controls playsinline webkit-playsinline autoplay>";
- playHtml += "<source src='" + jkmsg.hlsHd + "' type='' />";
- playHtml += "</video>";
- var script = document.createElement("script");
- script.type = "text/javascript";
- script.appendChild(document.createTextNode(" new EZUIPlayer('myPlayer');"));
- $(".videobox").html(playHtml);
- $(".videobox").append(script);
- }
- //进入定时拍照页面
- document.getElementById('lookPhotoBtn').addEventListener('tap', function() {
- mui.openWindow({
- url: 'lookImage_jk.html',
- id: 'lookImage_jk',
- extras: {
- 'equipId': equipId,
- // 'equipName':equipName
- },
- })
- })
- </script>
- </body>
- </html>
|