js-dahua-talk

1.2.0 • Public • Published

js-audio-talk

npm 或 yarn 安装

yarn add js-dahua-talk

引用

import { Talker2 } from 'js-dahua-talk'







const startButton = document.getElementById('start')

const stopButton = document.getElementById('stop')

let talker= null

startButton.onclick = () => {
  
  talker = new Talker({socketUrl: 'ws://192.168.1.108:40001/talk'})

  talker.start()

}



stopButton.onclick = () => {

	talker.stop()

}

注意

通过 MediaDevices.getUserMedia() 获取用户多媒体权限时,需要注意其只工作于以下三种环境:

  • localhost 域

  • 开启了 HTTPS 的域

  • 使用 file:/// 协议打开的本地文件

http环境下解决方法

参考文档

https://recorder.zhuyuntao.cn/

https://github.com/rochars/alawmulaw

Readme

Keywords

none

Package Sidebar

Install

npm i js-dahua-talk

Weekly Downloads

1

Version

1.2.0

License

MIT

Unpacked Size

8.67 kB

Total Files

3

Last publish

Collaborators

  • wd_wangqiyue