1.0.1 • Published 1 year ago

@zengruofanzrf/base-audio v1.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

remark

对讲功能由于受谷歌浏览器安全策略限制,页面是强制使用HTTPS协议访问的,如果想采用HTTP协议,请按照对讲功能调用过程中的提示进行设置。

Installation

You can install this package with npm.

npm

$ npm install -S @zengruofanzrf/base-audio

Usage

获取机器人 音频通道channelId

调用接口 /robotservice/device/selectDeviceChannel.action?deviceId = 机器人id, 返回的数组过滤出name = '音频' 的通道

获取 音频通道url

调用接口 /robotservice/device/getVideoUrl.action?channelId=上一步获取的 音频通道channelId

import { openIntercom, openMonitor, stopAudio } from '@zengruofanzrf/base-audio'

# 使用对讲
stopAudio() // 先关闭对讲监听
const [auth, msg] = openIntercom(音频通道url)
说明:
如果auth 返回false,则弹出msg内容告知用户按照msg内容去设置即可

# 使用监听
stopAudio() // 先关闭对讲监听
openMonitor(音频通道url)

LICENSE

MIT