基础库 2.9.0 开始支持,低版本需做兼容处理。
小程序插件:支持,需要小程序基础库版本不低于 2.9.1
微信 Windows 版:支持
微信 Mac 版:支持
相关文档: 多人音视频对话
功能描述
移除被动断开实时语音通话事件的监听函数
参数
function listener
onVoIPChatInterrupted 传入的监听函数。不传此参数则移除所有监听函数。
错误
| 错误码 | 错误信息 | 说明 |
|---|---|---|
| -1 | 由于退后台,导致会话中断 | |
| -2 | 由于电话接入,导致会话中断 | |
| -1000 | 由于系统原因,导致会话中断 |
示例代码
const listener = function (res) { console.log(res) }
wx.onVoIPChatInterrupted(listener)
wx.offVoIPChatInterrupted(listener) // 需传入与监听时同一个的函数对象