online/offline status
  • Hi,

    i want to modify showinfo.js to show a message if there come no signal from server.
    for example if i disable in admin-panel the 3. source stream.

    want something like this:

    if(!offline){ //<--- need something like this
    obj.append("<div class='widget now-playing-bar'>" +
    "<h2 class='current track-metadata'>"+options.text.current+""+sd.currentTrack.getTitle()+"</h2>"+
    "<h3 class='next track-metadata' >"": "+sd.nextTrack.getTitle()+"</h3>" +                   
     } else {
    obj.append("<div class='widget now-playing-bar'>" +
    "<h2 class='current track-metadata'>Radio offline</h2>"+


    it would also help to know how to get the value of "Off Air Metadata" in System -> Streams on the left side.

    Post edited by bardia at 2014-07-10 22:18:57
  • 1 Comment sorted by
  • Vote Up0Vote Down Daniel JamesDaniel James
    Posts: 844Member, Sourcefabric Team
    Hi Bardia, I would suggest fixing this at the level of the API, so that the solution works for all widgets. Currently the live-info API does not export the specified off-air metadata when nothing is scheduled, instead it sends an empty string:
    Arguably, it should send the same off-air metadata as the stream, but that begs the question of whether Airtime should be allowed to go off-air. It might be appropriate for a live station that only broadcasts at certain times of the day.

    Please file a ticket if this is important for your station.