移除错误消息
This commit is contained in:
parent
346adfe6b6
commit
9b0d418abc
@ -95,18 +95,18 @@ export default class ClientList {
|
||||
option.onmessage(event, client)
|
||||
}
|
||||
}
|
||||
channel.onclose = event => {
|
||||
console.debug('对方关闭', channel.label, '数据通道')
|
||||
if (option && option.onclose) {
|
||||
option.onclose(event, client)
|
||||
}
|
||||
}
|
||||
channel.onerror = event => {
|
||||
console.error(data.name, '通道', channel.label, '发生错误')
|
||||
if (option && option.onerror) {
|
||||
option.onerror(event, client)
|
||||
}
|
||||
}
|
||||
//channel.onclose = event => {
|
||||
// console.debug('对方关闭', channel.label, '数据通道')
|
||||
// if (option && option.onclose) {
|
||||
// option.onclose(event, client)
|
||||
// }
|
||||
//}
|
||||
//channel.onerror = event => {
|
||||
// console.error(data.name, '通道', channel.label, '发生错误')
|
||||
// if (option && option.onerror) {
|
||||
// option.onerror(event, client)
|
||||
// }
|
||||
//}
|
||||
}
|
||||
webrtc.onicecandidate = event => {
|
||||
if (event.candidate) {
|
||||
@ -136,6 +136,11 @@ export default class ClientList {
|
||||
})
|
||||
return dc
|
||||
})
|
||||
//// 页面刷新前主动关闭所有数据通道并关闭 WebRTC 连接
|
||||
//window.addEventListener('beforeunload', event => {
|
||||
// channels.forEach(ch => ch.close())
|
||||
// webrtc.close()
|
||||
//})
|
||||
return { webrtc, channels }
|
||||
}
|
||||
if (data.type === 'list') {
|
||||
|
Loading…
Reference in New Issue
Block a user