Skip to main content
Participant
Feb 8, 2011 12:54 PM UTC
Answered

How to get readers of the stream

The question is, how I can create function on server-side, that returns users count reading current stream.

For example:

Client.prototype.returnStreamCount = function(streamName)

{

     ??????????????????

     return count;

}

I read all server-side API, and find only one function that can help me: getLiveStreamStats() - but how to use it on server?

    This topic is closed to new replies. Start a new post to keep the conversation going.
    SE_0208Correct answer
    Participating Frequently
    Feb 9, 2011 4:36 AM UTC

    Yes thats one way to do it or you can do it via http commands (for http you would have to modify Users.xml).

    Its always better to do it on server-side according to me as the server-side scripts are under your control. Also its always recommended that you don't open 1111 to outside world - so its best to do it on server side - you can always write client which just makes calls to server-side function and gets necessary information. I hope now you understand why it is better to do it on server than on client.

    3 replies

    Participating Frequently
    Feb 8, 2011 3:01 PM UTC

    You can call getLiveStreamStats() from server-side too if you want to use that. You can call it same ways as you would from client.

    Translate
    Stasks65Author
    Participant
    Feb 8, 2011 3:32 PM UTC

    So, I need to create NetConnection on server-side, to rtmp://localhost:1111/admin, and then get data I need, using this connection??? looks like a convoluted way )))

    Translate
    SE_0208Correct answer
    Participating Frequently
    Feb 9, 2011 4:36 AM UTC

    Yes thats one way to do it or you can do it via http commands (for http you would have to modify Users.xml).

    Its always better to do it on server-side according to me as the server-side scripts are under your control. Also its always recommended that you don't open 1111 to outside world - so its best to do it on server side - you can always write client which just makes calls to server-side function and gets necessary information. I hope now you understand why it is better to do it on server than on client.

    Translate