帖子
帖子
用户
博客
课程
显示全部楼层
216
帖子
5
勋章
5909
Y币

hkIvms模块demo示例

[复制链接]
发表于 2019-6-26 21:06:30
hkIvms 封装了海康威视iVMS-8700平台视频手机端SDK,支持不登陆就直接可以实时预览摄像头,模块同时支持多开模式。

点击进入模块详情

  1. <!DOCTYPE html>
  2. <html>

  3. <head>
  4.     <title>Module Develop</title>
  5.     <meta charset="utf-8">
  6.     <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
  7.     <style type="text/css">
  8.         html,
  9.         body {
  10.             height: 100%
  11.         }

  12.         body {
  13.             background-color: #fff;
  14.             margin: 0;
  15.         }

  16.         #wrap {
  17.             height: 100%;
  18.             position: relative;
  19.         }

  20.         #header {
  21.             padding-top: 20px;
  22.             background-color: #5082c2;
  23.             height: 44px;
  24.             position: relative;
  25.         }

  26.         #header h1 {
  27.             font-size: 20px;
  28.             height: 44px;
  29.             line-height: 44px;
  30.             margin: 0em;
  31.             color: #fff;
  32.             margin-left: 100px;
  33.             margin-right: 100px;
  34.             text-align: center;
  35.         }

  36.         #main {
  37.             display: -webkit-box;
  38.             -webkit-box-orient: vertical;
  39.             -webkit-box-pack: center;
  40.         }

  41.         a.button {
  42.             display: -webkit-box;
  43.             -webkit-box-orient: vertical;
  44.             -webkit-box-pack: center;
  45.             -webkit-box-align: center;
  46.             height: 32px;
  47.             margin: 8px;
  48.             background-color: rgba(240, 240, 240, 1.0);
  49.             border-color: rgba(220, 220, 220, 1.0);
  50.             border-width: 2px;
  51.             border-style: solid;
  52.         }

  53.         a.active {
  54.             background-color: rgba(240, 240, 240, 0.7);
  55.         }
  56.     </style>
  57. </head>

  58. <body>
  59.     <div id="wrap">
  60.         <div id="main">
  61.             <a class="button" tapmode="active" onclick="openPlayer()">打开预览</a>
  62.             <a class="button" tapmode="active" onclick="closePlayer()">关闭预览</a>
  63.             <a class="button" tapmode="active" onclick="cleanPlayer()">清除所有预览</a>
  64.             <a class="button" tapmode="active" onclick="openAudio()">开启声音</a>
  65.             <a class="button" tapmode="active" onclick="closeAudio()">关闭声音</a>
  66.         </div>
  67.     </div>
  68. </body>
  69. <script type="text/javascript">
  70.     var demo = null;
  71.     apiready = function() {
  72.         demo = api.require('hkIvms');
  73.         if (!demo) {
  74.             alert("请添加模块后编译");
  75.             return;
  76.         }
  77.     }

  78.     function openPlayer() {
  79.         demo.openPlayer({
  80.             rect: {
  81.                 x: 0,
  82.                 y: api.frameHeight / 3,
  83.                 w: api.frameWidth / 2 - 5,
  84.                 h: api.frameHeight / 3
  85.             },
  86.             fixedOn: api.frameName,
  87.             fixed: true,
  88.             url: 'rtsp://218.77.102.231:554/pag://100.100.1.241:7302:f6f3616cd679455bba4299eed0915aba:0:MAIN:TCP?cnid=4&pnid=6'
  89.         }, function(ret, err) {
  90.             alert(JSON.stringify(ret) + "  " + JSON.stringify(err));
  91.         });
  92.         demo.openPlayer({
  93.             rect: {
  94.                 x: api.frameWidth / 2 + 5,
  95.                 y: api.frameHeight / 3,
  96.                 w: api.frameWidth / 2 - 5,
  97.                 h: api.frameHeight / 3
  98.             },
  99.             fixedOn: api.frameName,
  100.             fixed: true,
  101.             url: 'rtsp://218.77.102.231:554/pag://100.100.1.241:7302:f6f3616cd679455bba4299eed0915aba:0:MAIN:TCP?cnid=4&pnid=6'
  102.         }, function(ret, err) {
  103.             alert(JSON.stringify(ret) + "  " + JSON.stringify(err));
  104.         });
  105.     }

  106.     function closePlayer() {
  107.         demo.closePlayer({
  108.             index: 1
  109.         }, function(ret, err) {
  110.             alert(JSON.stringify(ret) + "  " + JSON.stringify(err));
  111.         });
  112.     }

  113.     function cleanPlayer() {
  114.         demo.cleanPlayer(function(ret, err) {
  115.             alert(JSON.stringify(ret) + "  " + JSON.stringify(err));
  116.         });
  117.     }

  118.     function openAudio() {
  119.         demo.openAudio({
  120.             index: 1
  121.         }, function(ret, err) {
  122.             alert(JSON.stringify(ret) + "  " + JSON.stringify(err));
  123.         });
  124.     }

  125.     function closeAudio() {
  126.         demo.closeAudio({
  127.             index: 1
  128.         }, function(ret, err) {
  129.             alert(JSON.stringify(ret) + "  " + JSON.stringify(err));
  130.         });
  131.     }
  132. </script>

  133. </html>
复制代码


90
帖子
2
勋章
2237
Y币
有存货?
216
帖子
5
勋章
5909
Y币

嗯。。。
23
帖子
0
勋章
214
Y币
你这个rtsp地址怎么生成的,我生成的都是
rtsp://admin:hc3**@183.66.178.**:554/h264/ch1/main/av_stream
rtsp://admin:hc3**@183.66.178.**:555/h264/ch1/main/av_stream
rtsp://admin:hc3**@183.66.178.**:556/h264/ch1/main/av_stream
所以用你的aplayer播放器播放不了除554 之外的。
216
帖子
5
勋章
5909
Y币
小杰java 发表于 2019-11-3 17:52
你这个rtsp地址怎么生成的,我生成的都是
rtsp://admin:hc3**@183.66.178.**:554/h264/ch1/main/av_stream
...

不清楚了,,这个模块内没做限制
6
帖子
0
勋章
827
Y币
你好,这个模块有摄像头上下左右转动,录像等功能吗
216
帖子
5
勋章
5909
Y币
BIP36191 · 2024-3-5 10:10你好,这个模块有摄像头上下左右转动,录像等功能吗

没有,只要sdk支持,可以定制
6
帖子
0
勋章
827
Y币
52yaoer · 2024-3-6 12:45没有,只要sdk支持,可以定制

定制海康和大华摄像头的功能怎么收费的
您需要登录后才可以回帖 登录

本版积分规则