Results 1 to 7 of 7

Thread: Counting live viewers

  1. #1
    Join Date
    Jul 2012
    Posts
    14

    Default Counting live viewers

    Is there a way to monitor and see how many viewers have connected to a live stream?


  2. #3
    Join Date
    Sep 2011
    Posts
    1,934

    Default

    Hi
    The post that was here should have been posted in the Showcase, please post advertisements in the Showcase section in future.

    Jason

  3. #4

    Default

    sorry,

    i'm using somebody's code on the google

    <?php
     function xml2array($xml) {
          $arXML=array();
          $arXML['name']=trim($xml->getName());
          $arXML['value']=trim((string)$xml);
          $t=array();
          foreach($xml->attributes() as $name => $value) $t[$name]=trim($value);
          $arXML['attr']=$t;
          $t=array();
          foreach($xml->children() as $name => $xmlchild) $t[$name]=xml2array($xmlchild);
          $arXML['children']=$t;
          return($arXML);
       }
    
    function getIt($host,$user,$pass){
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, "http://".$host.":8086/connectioncounts");
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_USERPWD, $user.":".$pass);
        curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST);
        $output = curl_exec($ch);
        $info = curl_getinfo($ch);
        curl_close($ch);
    
        $xml = simplexml_load_string ($output);
        $x = xml2array($xml);
        return array($x["children"]["ConnectionsTotal"]["value"],$x["children"]["ConnectionsCurrent"]["value"]);
    }
    
    // configure /conf/publish.password
    $x = getIt("localhost","username","password");
    
    #echo $x[0]." ".$x[1];
    #echo $x[0]." ".$x[1];
    
    $t = time() * 500;
    // The y value is a random number
    
    // Create a PHP array and echo it as JSON
    $c = preg_replace('/[^0-9]/', '', $x[1]);
    settype($c, "integer");
    $ret = array($t, $c);
    echo json_encode($ret);
    ?>

  4. #5
    Join Date
    Jul 2012
    Posts
    14

    Default

    Quote Originally Posted by sathishkumarkps View Post
    Thanks! This was exactly what I was looking for.

  5. #6

    Default

    can anybody tell how to see online stream in wowza....... that which viewer is online .....for the live video chat..........

  6. #7

Similar Threads

  1. 5 live-lowlatency video's with thousands viewers. How much of them?
    By chocking_u in forum Performance Tuning Discussion
    Replies: 3
    Last Post: 12-12-2013, 11:55 PM
  2. viewers not getting the live feed even after refreshing browser
    By coskel22 in forum Live Streaming and Encoder Discussion
    Replies: 10
    Last Post: 07-25-2012, 06:30 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •