livedh
v1.0.4
Published
百度直播数字人-JSSDK(对外版)
Readme
百度直播数字人-JSSDK
安装
npm i livedh使用示例
import {DigitalHumanV2 as DigitalHuman} from 'livedh';
DigitalHuman.logger.setLevels(['debug', 'log', 'error']);
const dHuman = new DigitalHuman({
cuid: '', // 用户的唯一id
appname: '', // 业务标记
signToken: '', // 请替换为实际的签名token
baseURL: 'https://xx.xx.com', // 开发时,服务器根地址。线上至空''
logLevel: ['error'], // 日志等级
});
dHuman.event.on('rtc:error', error => {
// "WebRTC error... {"code":0,"name":"NotAllowedError","message":"Permission denied"}"
});
const res = await dHuman.fetchRoom({
ak: '',
agent_id: '',
desire_render_type: '2', // 云端渲染
rtc: {
remotevideoviewid: 'therevideo',
}
});
...更多参看examples
