mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
add webrtc_stats to state.
This commit is contained in:
parent
0aef325c5b
commit
1fee7acaab
@ -86,6 +86,7 @@
|
|||||||
authenticated: false,
|
authenticated: false,
|
||||||
websocket: this.websocket.supported ? 'disconnected' : 'unavailable',
|
websocket: this.websocket.supported ? 'disconnected' : 'unavailable',
|
||||||
webrtc: this.webrtc.supported ? 'disconnected' : 'unavailable',
|
webrtc: this.webrtc.supported ? 'disconnected' : 'unavailable',
|
||||||
|
webrtc_stats: null,
|
||||||
type: 'none',
|
type: 'none',
|
||||||
},
|
},
|
||||||
video: {
|
video: {
|
||||||
@ -363,7 +364,7 @@
|
|||||||
this.websocket.send('signal/candidate', candidate)
|
this.websocket.send('signal/candidate', candidate)
|
||||||
})
|
})
|
||||||
this.webrtc.on('stats', (stats: WebRTCStats) => {
|
this.webrtc.on('stats', (stats: WebRTCStats) => {
|
||||||
console.log(stats)
|
Vue.set(this.state.connection, 'webrtc_stats', stats)
|
||||||
})
|
})
|
||||||
this.webrtc.on('connecting', () => {
|
this.webrtc.on('connecting', () => {
|
||||||
Vue.set(this.state.connection, 'webrtc', 'connecting')
|
Vue.set(this.state.connection, 'webrtc', 'connecting')
|
||||||
|
@ -14,9 +14,18 @@ export interface Connection {
|
|||||||
authenticated: boolean
|
authenticated: boolean
|
||||||
websocket: 'unavailable' | 'disconnected' | 'connecting' | 'connected'
|
websocket: 'unavailable' | 'disconnected' | 'connecting' | 'connected'
|
||||||
webrtc: 'unavailable' | 'disconnected' | 'connecting' | 'connected'
|
webrtc: 'unavailable' | 'disconnected' | 'connecting' | 'connected'
|
||||||
|
webrtc_stats: WebRTCStats | null
|
||||||
type: 'webrtc' | 'fallback' | 'none'
|
type: 'webrtc' | 'fallback' | 'none'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface WebRTCStats {
|
||||||
|
bitrate: number
|
||||||
|
packetLoss: number
|
||||||
|
fps: number
|
||||||
|
width: number
|
||||||
|
height: number
|
||||||
|
}
|
||||||
|
|
||||||
/////////////////////////////
|
/////////////////////////////
|
||||||
// Video
|
// Video
|
||||||
/////////////////////////////
|
/////////////////////////////
|
||||||
|
Loading…
Reference in New Issue
Block a user