mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
add connection status event.
This commit is contained in:
parent
78c3613f3e
commit
471b26ace5
@ -9,6 +9,7 @@ import NekoState from '../types/state'
|
||||
|
||||
export interface NekoEvents {
|
||||
// connection events
|
||||
['connection.status']: (status: 'connected' | 'connecting' | 'disconnected') => void
|
||||
['connection.webrtc.sdp']: (type: 'local' | 'remote', data: string) => void
|
||||
['connection.webrtc.sdp.candidate']: (type: 'local' | 'remote', data: RTCIceCandidateInit) => void
|
||||
['connection.disconnect']: (message: string) => void
|
||||
|
@ -455,6 +455,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
@Watch('state.connection.status')
|
||||
onConnectionChange(status: 'connected' | 'connecting' | 'disconnected') {
|
||||
this.events.emit('connection.status', status)
|
||||
}
|
||||
|
||||
clear() {
|
||||
// destroy video
|
||||
if (this._video) {
|
||||
|
Loading…
Reference in New Issue
Block a user