2015: live: Show when a stream is not broadcasting.
authorDavid Thompson <dthompson2@worcester.edu>
Sat, 21 Mar 2015 15:04:44 +0000 (11:04 -0400)
committerDavid Thompson <dthompson2@worcester.edu>
Sat, 21 Mar 2015 15:04:44 +0000 (11:04 -0400)
2015/assets/js/stream.js

index a910e28e1ae14262d2ece679a2d3b1aba773cd0f..a0c116028ab86c1f996de3e95e1b126b7362fd3b 100644 (file)
@@ -246,11 +246,19 @@ app.view = function(ctrl) {
   }
 
   function renderStats() {
-    var info = app.validStreamInfo(stats) ? [
-      m("strong", stats.server_name),
-      " — ",
-      m("i", stats.server_description)
-    ] : null;
+    var info;
+
+    if(stats === app.nullStats) {
+      info = m("i", "not broadcasting");
+    } else if(app.validStreamInfo(stats)) {
+      info = [
+        m("strong", stats.server_name),
+        " — ",
+        m("i", stats.server_description)
+      ];
+    } else {
+      info = null;
+    }
 
     return m(".row", [
       m(".col-sm-8", info),