请选择 进入手机版 | 继续访问电脑版
帖子
帖子
用户
博客
课程
123下一页
返回列表 发新帖
显示全部楼层
13
帖子
0
勋章
139
Y币

haikangVideo模块demo示例

[复制链接]
发表于 2019-7-3 10:00:21
haikangVideo 模块封装了海康威视android SDK,提供实时监控的预览、回放和基本云台控制功能。
点击进入模块详情
  1. <!DOCTYPE html>
  2. <html>
  3.         <head>
  4.                 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  5.                 <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
  6.                 <title>frame1</title>
  7.                 <script type="text/javascript" src = "../script/api.js"></script>
  8.                 <style>
  9.                                         .control{
  10.                                                 position: absolute;
  11.                                                 bottom:5px;
  12.                                                 width: 100%;
  13.                                                 height: 200px;
  14.                                 }
  15.                 </style>
  16.         </head>
  17.         <body>
  18.                 <div class="control" id="demo" mbsc-form>
  19.                         <div class="mbsc-form-group">
  20.                                 <table style="text-align: center;margin:auto;">
  21.                                         <tr>
  22.                                                 <td style="width:10%">起始时间:</td>
  23.                                                 <td style="width:100px">年<input type="text" id="startYear" style="width:60px" value="2019"></td>
  24.                                                 <td style="width:100px">月<input type="text" id="startMonth" style="width:60px" value="03"></td>
  25.                                                 <td style="width:100px">日<input type="text" id="startDay" style="width:60px" value="03"></td>
  26.                                         </tr>
  27.                                         <tr>
  28.                                                 <td style="width:10%"></td>
  29.                                                 <td style="width:100px">时<input type="text" id="startHour" style="width:60px" value="12"></td>
  30.                                                 <td style="width:100px">分<input type="text" id="startMinute" style="width:60px" value="23"></td>
  31.                                                 <td style="width:100px">秒<input type="text" id="startSecond" style="width:60px" value="34"></td>
  32.                                         </tr>
  33.                                         <tr>
  34.                                                 <td style="width:10%">结束时间:</td>
  35.                                                 <td style="width:100px">年<input type="text" id="stopYear" style="width:60px" value="2019"></td>
  36.                                                 <td style="width:100px">月<input type="text" id="stopMonth" style="width:60px" value="03"></td>
  37.                                                 <td style="width:100px">日<input type="text" id="stopDay" style="width:60px" value="03"></td>
  38.                                         </tr>
  39.                                         <tr>
  40.                                                 <td style="width:10%"></td>
  41.                                                 <td style="width:100px">时<input type="text" id="stopHour" style="width:60px" value="13"></td>
  42.                                                 <td style="width:100px">分<input type="text" id="stopMinute" style="width:60px" value="23"></td>
  43.                                                 <td style="width:100px">秒<input type="text" id="stopSecond" style="width:60px" value="34"></td>
  44.                                         </tr>
  45.                                 </table>
  46.                         </div>
  47.                         <div class="mbsc-form-group">
  48.                         <table style="text-align: center;margin:auto;">
  49.                                 <tr>
  50.                                         <td><button onclick="playback()">回放</button></td>
  51.                                         <td><button onclick="stop()">停止</button></td>
  52.                                         <td><button onclick="pause()">暂停</button></td>
  53.                                         <td><button onclick="restart()">继续</button></td>
  54.                                 </tr>

  55.                         </table>
  56.                 </div>
  57.                 </div>
  58.                 <script>
  59.                         var video;
  60.                         apiready = function(){
  61.                                 video=api.require("haikangVideo");
  62.                                 openView();
  63.                 };

  64.                 function openView(){
  65.                         video.open({
  66.                                   // ip:'111.207.240.51',
  67.                                   // port:'18008',
  68.                                   // user:'admin',
  69.                                   // pwd:'12345',
  70.                                   // channel:'1',
  71.                                 // ip:'112.44.108.20',
  72.                                 // port:'8000',
  73.                                 // user:'admin',
  74.                                 // pwd:'12345',
  75.                                 // channel:'1',
  76.                                 ip:'221.210.134.180',
  77.                                 port:'8001',
  78.                                 user:'admin',
  79.                                 pwd:'admin6383',
  80.                                 channel:'1',
  81.                                 dwStreamType:"0",
  82.                                 rect:{
  83.                                         h:api.frameHeight-300
  84.                                 },
  85.                                 fixedOn: api.frameName,
  86.                                 fixed: true
  87.                         },function(ret, err){
  88.                                         if(ret.status){

  89.                                         }else{
  90.                                                 alert("回放失败!"+JSON.stringify(err));
  91.                                         }
  92.                         })
  93.                 }

  94.                 function playback(){
  95.                         video.playback({
  96.                                 startYear:$api.byId("startYear").value,
  97.                           startMonth:$api.byId("startMonth").value,
  98.                           startDay:$api.byId("startDay").value,
  99.                           startHour:$api.byId("startHour").value,
  100.                           startMinute:$api.byId("startMinute").value,
  101.                           startSecond:$api.byId("startSecond").value,
  102.                           stopYear:$api.byId("stopYear").value,
  103.                           stopMonth:$api.byId("stopMonth").value,
  104.                           stopDay:$api.byId("stopDay").value,
  105.                           stopHour:$api.byId("stopHour").value,
  106.                           stopMinute:$api.byId("stopMinute").value,
  107.                           stopSecond:$api.byId("stopSecond").value,
  108.                                 channel:'3'
  109.                         },function(ret, err){
  110.                                 if(!ret.status){
  111.                                         alert(err.msg);
  112.                                 }
  113.                         })
  114.                 }

  115.                         function pause(){
  116.                                 video.playpause();
  117.                         }

  118.                         function stop(){
  119.                                 video.stopplayback();
  120.                         }

  121.                         function restart(){
  122.                                 video.playrestart();
  123.                         }

  124.                 </script>
  125.         </body>
  126. </html>
复制代码



1
帖子
0
勋章
12
Y币
楼主,能不能上变焦功能
216
帖子
5
勋章
5745
Y币
有定制版有这样的功能。需要可以联系。qq 176142998
0
帖子
0
勋章
5745
Y币
为啥显示的黑屏
13
帖子
0
勋章
139
Y币

要点击回放按钮,时间段估计也得调整一下,调成最近的时间,以前的视频可能删掉了
1
帖子
0
勋章
12
Y币
楼主能不能上IOS版
13
帖子
0
勋章
139
Y币
xlf0995 发表于 2019-11-7 14:42
楼主能不能上IOS版

后面会考虑加上ios版
1
帖子
0
勋章
12
Y币
eillcc 发表于 2019-11-7 19:42
后面会考虑加上ios版

望眼欲穿啊,买了安卓的用的挺好。楼主有计划什么时候上吗
13
帖子
0
勋章
139
Y币
xlf0995 发表于 2019-11-7 22:57
望眼欲穿啊,买了安卓的用的挺好。楼主有计划什么时候上吗

我还得抽空研究一下
1
帖子
0
勋章
12
Y币
eillcc 发表于 2019-11-8 13:33
我还得抽空研究一下

变焦的好搞也可以搞一下,这样用的人估计更多了
123下一页
您需要登录后才可以回帖 登录

本版积分规则