Skip navigation
estauss
Currently Being Moderated

Logs that show how many people watched a certain stream

Jul 25, 2013 1:19 PM

Hello,

 

I apoligize if that has been asked and and answered before.

 

I recently got a request to see how many people watched a paticular stream. Now I don't really know much about FMS. We are running FMS 3.5 and I set it up many years ago and have not touched it since.

 

I am just wondering if their is any easy way to determine how many people watched a stream.

 

Thanks

 
Replies
  • Currently Being Moderated
    Jul 31, 2013 6:37 AM   in reply to estauss

    Try admin api

     

    function timer1(){

        nc_admin.call("getLiveStreams", new onGetLiveStreams(), appName);

    }

     

    function onGetLiveStreams() {

        this.onResult = function(ans) {

         for (i = 0; i < ans.data.length; i++){

             nc_admin.call("getLiveStreamStats", new onGetLiveStreamStats(), appName , ans.data[i]);

         }

        }

     

    }

     

    function onGetLiveStreamStats(){

        this.onResult = function(info) {

             if (info.data.publisher){

                trace("info.data.name = " + info.data.publisher.name);

            }

               if (info.data.subscribers){

                   //how many people watched a stream.

                   trace("info.data.subscribers.length = " + info.data.subscribers.length);

            }

        }

    }

     

    application.onAppStart = function (){

        nc_admin.connect("rtmp://localhost:1111/admin", "admin_login", "admin_pass");

        setInterval(timer1, 15000);

    }

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 6, 2013 5:23 AM   in reply to LazyMax

    How would one implement these functions to display the current number of users watching a stream? I haven't used actionscript very much. Is there a way to display the number of users in the strobe media player?

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 6, 2013 5:32 AM   in reply to Mr.Dave

    You can try to use these calls on client side.

    Also you can send subscribers.length from AMS to your server via LoadVars and read this value from your server.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 6, 2013 6:33 AM   in reply to LazyMax

    I'm trying to use the admin api but I keep receiving error: netconnection.admin.commandfailed. I've verified the admin username and password are correct.

    Is this the correct syntax to use? For example if I was trying to getUsers on this event.

     

    My event path is : "C:\FMS\applications\livepkgr\_definst_\baseball"

    In Internet Explorer I enter the following URL: http://localhost:1111/admin/getUsers?auser=admin&apswd=password&appIns t="livepkgr/baseball/"

     

    Thanks for the help.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 6, 2013 6:53 AM   in reply to Mr.Dave

    Make sure under C:\Adobe Media Server 5\conf\Users.xml you have

     

     

     

    -

     

     

     

    And your server restarted after this edit.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 6, 2013 7:23 AM   in reply to Petro Bochan

    Not sure what I'm supposed to have? Did you leave some information out?

     

    Thanks!

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 6, 2013 7:33 AM   in reply to Mr.Dave

    -<AdminServer>

    -<HTTPCommands>

    <Enable>${USERS.HTTPCOMMAND_ALLOW}</Enable>

    <Allow>getUsers</Allow>

    <Deny>All</Deny>

    <Order>Deny,Allow</Order>

    </HTTPCommands>

    </AdminServer>

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 6, 2013 7:52 AM   in reply to Petro Bochan

    Thanks. I checked and I already have those admin command permissions defined. Would this be the correct syntax to issue an admin command for my event called 'baseball'?

     

    My event path is : "C:\FMS\applications\livepkgr\_definst_\baseball"

    In Internet Explorer I enter the following URL: http://localhost:1111/admin/getUsers?auser=admin&apswd=password&appIns t="livepkgr/baseball/"

     

    Thanks!

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 6, 2013 10:34 AM   in reply to Mr.Dave

    Quotes aren’t mandatory - http://localhost:1111/admin/getUsers?auser=admin <http://localhost:1111/admin/getUsers?auser=admin&apswd=amspass&appInst =livepkgr/_definst_/baseball> &apswd=amspass&appInst=livepkgr/_definst_/baseball. Apart from that, physical folder location doesn’t always map to RTMP address you use when connecting.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points