mobile CCTV,mobile surveillance,police body worn cameras
标题:
Chrome浏览器对讲的问题
[打印本页]
author:
IBeli
time:
2020-4-8 19:45
标题:
Chrome浏览器对讲的问题
对讲功能,我开开发文档上面的demo是可以实现的,但是我按照demo些的代码,不行,只听到头盔发出“嘀”的一声,但是页面就上面没有图像和声音,浏览器控制台没有报错,我用的谷歌浏览器,请问,对讲有哪些需要注意的地方?相关代码如下:
this.session = new jSW.SWSession({
server: '127.0.0.1',
port: 9701,
onopen(sess: any) {
sess.swLogin({ user: `${credentials.username}`, password: `${credentials.password}` });
}
});
// 登录回调
this.session.swAddCallBack('login', (sender: any, event: any, json: any) => {
if (json.code === jSW.RcCode.RC_CODE_S_OK) {
} else {
this.logger.info(`账户或密码错误`);
}
});
// 获取设备列表回调
this.session.swAddCallBack('pulist', (sender: any, event: any, json: any) => {
if (json.code === jSW.RcCode.RC_CODE_S_OK) {
this.puList = this.session._arr_pu;
this.puList.forEach((item: any) => {
const random = Math.random();
item.random = random;
this.showdomList.push({ isHave: false, _id_pu: item._id_pu, domId: `dom${random}`, random })
});
console.log('this.puList:', this.puList);
}
});
const m_media = (jSW.MEDIADIR.AUDIOSEND) + (jSW.MEDIADIR.AUDIORECV);
const result = chanel.swOpenEx({
tag: this,
div: _this.getDomId(),
ismuti: true, // 设置可以被打开多次,
prototype: 'auto',
bovertcp: true,
media: m_media,
callback(options: any, response: any, event: any) {
const pthis = options.tag;
const code = response.emms.code;
if (code === 0) { // code === 0 成功
item.isOpen = true;
_this.addMediaToShowdomList(item, event.hdlg); // 唯一标识该路播放的句柄(关闭设备时需传入)
// 获取url
item.url = pthis.session.swGetPuChanel(`${item._id_pu}`, 0).swGetUrl();
_this.removeFlag();
} else if (code === 20106) {
_this.emptySpaceDomId();
_this.logger.info(`${item._name_pu} 未连接!`);
}
},
});
author:
IBeli
time:
2020-4-8 19:49
您好,需要等到获取设备列表成功之后,才能打开对讲。
等到pulist事件成功,再调用。
欢迎光临 mobile CCTV,mobile surveillance,police body worn cameras (http://bbs.besovideo.com:8067/)
Powered by Discuz! X3.2