|
haikangVideo 模块封装了海康威视android SDK,提供实时监控的预览、回放和基本云台控制功能。
点击进入模块详情
- <!DOCTYPE html>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
- <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
- <title>frame1</title>
- <script type="text/javascript" src = "../script/api.js"></script>
- <style>
- .control{
- position: absolute;
- bottom:5px;
- width: 100%;
- height: 200px;
- }
- </style>
- </head>
- <body>
- <div class="control" id="demo" mbsc-form>
- <div class="mbsc-form-group">
- <table style="text-align: center;margin:auto;">
- <tr>
- <td style="width:10%">起始时间:</td>
- <td style="width:100px">年<input type="text" id="startYear" style="width:60px" value="2019"></td>
- <td style="width:100px">月<input type="text" id="startMonth" style="width:60px" value="03"></td>
- <td style="width:100px">日<input type="text" id="startDay" style="width:60px" value="03"></td>
- </tr>
- <tr>
- <td style="width:10%"></td>
- <td style="width:100px">时<input type="text" id="startHour" style="width:60px" value="12"></td>
- <td style="width:100px">分<input type="text" id="startMinute" style="width:60px" value="23"></td>
- <td style="width:100px">秒<input type="text" id="startSecond" style="width:60px" value="34"></td>
- </tr>
- <tr>
- <td style="width:10%">结束时间:</td>
- <td style="width:100px">年<input type="text" id="stopYear" style="width:60px" value="2019"></td>
- <td style="width:100px">月<input type="text" id="stopMonth" style="width:60px" value="03"></td>
- <td style="width:100px">日<input type="text" id="stopDay" style="width:60px" value="03"></td>
- </tr>
- <tr>
- <td style="width:10%"></td>
- <td style="width:100px">时<input type="text" id="stopHour" style="width:60px" value="13"></td>
- <td style="width:100px">分<input type="text" id="stopMinute" style="width:60px" value="23"></td>
- <td style="width:100px">秒<input type="text" id="stopSecond" style="width:60px" value="34"></td>
- </tr>
- </table>
- </div>
- <div class="mbsc-form-group">
- <table style="text-align: center;margin:auto;">
- <tr>
- <td><button onclick="playback()">回放</button></td>
- <td><button onclick="stop()">停止</button></td>
- <td><button onclick="pause()">暂停</button></td>
- <td><button onclick="restart()">继续</button></td>
- </tr>
- </table>
- </div>
- </div>
- <script>
- var video;
- apiready = function(){
- video=api.require("haikangVideo");
- openView();
- };
- function openView(){
- video.open({
- // ip:'111.207.240.51',
- // port:'18008',
- // user:'admin',
- // pwd:'12345',
- // channel:'1',
- // ip:'112.44.108.20',
- // port:'8000',
- // user:'admin',
- // pwd:'12345',
- // channel:'1',
- ip:'221.210.134.180',
- port:'8001',
- user:'admin',
- pwd:'admin6383',
- channel:'1',
- dwStreamType:"0",
- rect:{
- h:api.frameHeight-300
- },
- fixedOn: api.frameName,
- fixed: true
- },function(ret, err){
- if(ret.status){
- }else{
- alert("回放失败!"+JSON.stringify(err));
- }
- })
- }
- function playback(){
- video.playback({
- startYear:$api.byId("startYear").value,
- startMonth:$api.byId("startMonth").value,
- startDay:$api.byId("startDay").value,
- startHour:$api.byId("startHour").value,
- startMinute:$api.byId("startMinute").value,
- startSecond:$api.byId("startSecond").value,
- stopYear:$api.byId("stopYear").value,
- stopMonth:$api.byId("stopMonth").value,
- stopDay:$api.byId("stopDay").value,
- stopHour:$api.byId("stopHour").value,
- stopMinute:$api.byId("stopMinute").value,
- stopSecond:$api.byId("stopSecond").value,
- channel:'3'
- },function(ret, err){
- if(!ret.status){
- alert(err.msg);
- }
- })
- }
- function pause(){
- video.playpause();
- }
- function stop(){
- video.stopplayback();
- }
- function restart(){
- video.playrestart();
- }
- </script>
- </body>
- </html>
复制代码
|
|