Skip to content

Commit

Permalink
Log connection status events
Browse files Browse the repository at this point in the history
  • Loading branch information
janlelis committed May 19, 2020
1 parent 42ea591 commit 52f8b74
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ export default {
},

warn(...args) {
console.log('WARNING', ...args)
console.warn('WARNING', ...args)
},

error(...args) {
console.log('ERROR', ...args)
console.error('ERROR', ...args)
},
}
24 changes: 23 additions & 1 deletion src/views/Room.vue
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export default {
})
rtc.on("local_stream_error", (error) => {
logger.log("local stream error", error)
logger.error("local stream error", error)
this.waiting = false
this.uiState = [UserMediaConfigurator, { error: "local_stream_error" }]
})
Expand Down Expand Up @@ -167,6 +167,28 @@ export default {
// logger.log("rtc session destroyed", peer)
// })
// CONNECTION STATUS
rtc.on("peer_connection_pending", (peer) => {
logger.log("peer connection pending", peer)
})
rtc.on("peer_connection_established", (peer) => {
logger.log("peer connection established", peer)
})
rtc.on("peer_connection_disconnected", (peer) => {
logger.warn("peer connection disconnected", peer)
})
rtc.on("peer_connection_closed", (peer) => {
logger.warn("peer connection closed", peer)
})
rtc.on("peer_connection_failed", (peer) => {
logger.error("peer connection failed", peer)
})
return rtc
},
joinRoom(userMediaConfig) {
Expand Down

0 comments on commit 52f8b74

Please sign in to comment.