Skip to main content
April 28, 2011
Question

Retrieving List of Live Streams Names with Status Publishing

  • April 28, 2011
  • 1 reply
  • 1997 views

Hi,

i have a website like ustream, where user can register and create  live channels and publish live video using FMLE.

Now i want to check wether a particular channel is online or offline.

I have stream name for particular channel. My website is coded in PHP.

I have tried using getLiveStreamStats function, it works fine where the XML file is not heavy. I mean number of subscribers are less. Then i can just check the Publisher Tag. if it exists that means stream video is live, else not.

But problem arrives when the number of subscribers are high. The XML file do not loads in PHP, and it takes too much time to load the page.

Any suggestions what can be done to just check if the xml file has publisher tag. and display if the stream is live or not

    This topic has been closed for replies.

    1 reply

    Nikhil_Kalyan
    Participating Frequently
    April 28, 2011

    Hi,

    I am not sure why the XML takes a while to load on PHP, but you may want to use the other administration API getLiveStreams() instead of get LiveStreamStats() API.

    The difference between the two is that, while the API that you use have the subscriber info also added to the response (which might take little more time given your subscriber load is high), the othre API has only information about the live streams that are published and that are actively publishing. So it might well suit your requirement.


    Please try that and let us know if that helps.

    Thank you !

    April 28, 2011

    Hi,

    I already tried getLiveStreams() it works good but there is an issue with this.

    It also shows live streams that are not actually live. I mean to say that if someone opened the player with no live video, then that also comes in list. becoz that stream is buffering in the player.


    It means if there is no publisher for a particular stream, but there are subscribers, that also considered as live in this function. This function is not depend on Publishers only.

    Nikhil_Kalyan
    Participating Frequently
    April 28, 2011

    The documentation says this about getLiveStreams API :

    "an array of strings containing the names of all the live streams that are currently publishing to the specified instance of an application".


    I am not sure why it should behave otherwise, especially when this API is specifically demarcated not to have subscriber info. Unfortunately it does so !! I gave it a try too !

    Something that should probably get fixed either in the documentation or in FMS. Thanks to you for getting this identified.

    For your case, it seems we dont have many other options left with except again to use getLiveStreamStats , but why dont you take a look at getNetStreamStats as well?

    Thank you !