Skip to content

Commit

Permalink
Warn about slow links with toast notifications (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
karth295 committed May 22, 2016
1 parent 4983282 commit 44563ca
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,13 @@
feed: feed.id
error: console.error
onmessage: (msg, jsep) ->
if msg["videoroom"] == "event"
console.log("TODO: do we care about this event?", msg)
else if msg["videoroom"] == "slow_link"
toastr.warning("Slow connection (remote stream " + feed.display + ")", JSON.stringify(msg["videoroom"]))
else
console.log("Unhandled event", msg)

if jsep
remote_feed.createAnswer
jsep: jsep
Expand Down Expand Up @@ -186,6 +193,10 @@
console.log "TODO: handle detaching streams"
else if msg["videoroom"] == "error"
console.error msg["error"]
else if msg["videoroom"] == "slow_link"
toastr.warning("Slow connection (local stream)", JSON.stringify(msg["videoroom"]["current-bitrate"]))
else
console.error("Unhandled event", msg)

if jsep
plugin_handle.handleRemoteJsep
Expand Down

0 comments on commit 44563ca

Please sign in to comment.