diff options
Diffstat (limited to 'web/js/session.js')
-rw-r--r-- | web/js/session.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/web/js/session.js b/web/js/session.js index e6cbc21e..e93f0516 100644 --- a/web/js/session.js +++ b/web/js/session.js @@ -1,4 +1,4 @@ -function Session(atx, hid, msd) { +function Session(streamer, atx, hid, msd) { // var self = this; /********************************************************************************/ @@ -53,6 +53,7 @@ function Session(atx, hid, msd) { $("link-led").className = "led-green"; $("link-led").title = "Connected"; tools.debug("Session: socket opened:", event); + streamer.loadInitialState(); atx.loadInitialState(); msd.loadInitialState(); hid.setSocket(__ws); @@ -66,7 +67,9 @@ function Session(atx, hid, msd) { if (event.msg_type === "pong") { __missed_heartbeats = 0; } else if (event.msg_type === "event") { - if (event.msg.event === "atx_state") { + if (event.msg.event === "streamer_state") { + streamer.setState(event.msg.event_attrs); + } else if (event.msg.event === "atx_state") { atx.setState(event.msg.event_attrs); } else if (event.msg.event === "msd_state") { msd.setState(event.msg.event_attrs); @@ -90,8 +93,9 @@ function Session(atx, hid, msd) { clearInterval(__ping_timer); __ping_timer = null; } - hid.setSocket(null); + streamer.clearState(); atx.clearState(); + hid.setSocket(null); __ws = null; setTimeout(function() { $("link-led").className = "led-yellow"; |