#1  
Old 27th March 2010, 18:18
harddrop harddrop is offline
Junior Member
 
Join Date: Dec 2009
Posts: 1
Default Need help with isLive

Hi, I know how to show the XML file for my stream: http://xharddropx.channel-api.livest...2.0/livestatus .

I want my site to show Off Air in text when it's false and On Air when it's true, but I don't know how. Does anybody know the programming code I should put? Same with the amount of viewers.

If it helps, I transitioned from Ustream and this is what my code used to looked like:

<script type="text/javascript">
function set_status(status)
{
if (status == "offline")
{
document.getElementById("status").innerHTML = "<b>Live Stream: Off Air</b>";
}
else if (status == "live")
{
document.getElementById("status").innerHTML = "<b>Live Stream: On Air</b>";
}
else
{
document.getElementById("status").innerHTML = "<b>Live Stream: Error</b>";
}
}
</script>

<script type="text/javascript" src="http://api.ustream.tv/json/channel/hard-drop-tetris-channel/getValueOf/status?key=****&callback=set_status">
</script>

Also, I have a LiveStream API key now, but do I need one? Where do I put it?

Last edited by harddrop; 27th March 2010 at 18:26.
Reply With Quote
  #2  
Old 29th March 2010, 14:26
paul167 paul167 is offline
Livestream Software Engineer
 
Join Date: Sep 2008
Posts: 190
Default

Unfortunately, our API doesn't support JSON yet so we don't have a way for you to trigger it directly from your webpage because of cross-domain restrictions. We'll be adding JSON support soon though.
Reply With Quote
  #3  
Old 26th July 2011, 22:45
Moogie Moogie is offline
Junior Member
 
Join Date: Mar 2009
Posts: 3
Default

"Soon", in this case, apparently meaning "never". Bump because we should have this functionality by now.
Reply With Quote
  #4  
Old 27th July 2011, 10:52
paul167 paul167 is offline
Livestream Software Engineer
 
Join Date: Sep 2008
Posts: 190
Default

This functionality is now available. See for example:

http://xharddropx.channel-api.livest...?callback=test

Best,

Paul
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump