Apicloud 接入海康摄像头

1准备工做 , 加载apicloud 海康视频模块。 api

引入 SDK 从新生成项目测试 再config.xml写入appidapp

话很少说直接上代码 ide

video=api.require("haikangVideo"); video.open({ ip:ip, port:port, channel:'1', user:name, pwd:pwd, fixedOn: api.frameName, fixed: true, rect : { x : 0, y : api.frameHeight /5.5,
 w : api.frameWidth , h : api.frameHeight / 2 }, },function(ret, err){ if( ret.status ){ video.play(); }else{ alert( JSON.stringify( err ) ); } }); api.toast({ msg: '打开成功', duration: 2000, location: 'middle' });
View Code

 

切记 必定要放在方法内使用测试

相关文章
相关标签/搜索