Apicloud 接入海康摄像头
1准备工作 , 加载apicloud 海康视频模块。
引入 SDK 重新生成项目测试 再config.xml写入appid
话不多说直接上代码
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' });
切记 一定要放在方法内使用