video player

Discussion in 'PHP' started by jbzcc, Nov 26, 2008.

  1. #1
    Hi everyone, please need a php script for this. I have some movie thrillers on my site which is not via you tube. Viewers can play the thrillers and watch on my site. However i need a script that will show number of times each thriller was played. Thanks for all replies
     
    jbzcc, Nov 26, 2008 IP
  2. EricBruggema

    EricBruggema Well-Known Member

    Messages:
    1,740
    Likes Received:
    28
    Best Answers:
    13
    Trophy Points:
    175
    #2
    Then you need a script wich can count how many times a video is loaded, ain't very simple but doable!
     
    EricBruggema, Nov 28, 2008 IP
  3. misbah

    misbah Active Member

    Messages:
    265
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    68
    #3
    you can try this
    http://www.jeroenwijering.com/
    Code (markup):
    and if you want count how many times a video is loaded, you need database
     
    misbah, Nov 28, 2008 IP
  4. jbzcc

    jbzcc Peon

    Messages:
    110
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Hi I did not see any code, thanks! The videos are on the site, i just need script to show number of times it is played.
     
    jbzcc, Nov 28, 2008 IP
  5. JenniP

    JenniP Peon

    Messages:
    250
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Without a proper video delivery system such as the one pointed at earlier (although pointing at www.bitsontherun.com would have been more descriptive) its pretty difficult, there are a few metrics you can capture though.

    You can count your page views on that page as to how many visitors have loaded the video.

    Then you can look at your web logs for the downloads of the FLV, if the download size = the size of the .flv someone downloaded the whole file (Of course doesnt mean it actually played it), if the size of the download is less than the size of the .FLV they did a downloaded some of the file.

    Although it costs more using a system like Bits on the Run or Ooyala will give you these kinds of stats as part of the package.

    Jen
     
    JenniP, Nov 28, 2008 IP
  6. jbzcc

    jbzcc Peon

    Messages:
    110
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I am using fliqz and when i log in i see number of plays at the back end bu t i wish to see it on front end too
     
    jbzcc, Nov 28, 2008 IP
  7. misbah

    misbah Active Member

    Messages:
    265
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    68
    #7
    first you need database...
    for exampe your database have log table
    and log table have video_id, total, and url field
    CREATE TABLE `foo`.`log` (
    `video_id` INT NOT NULL ,
    `total` INT NOT NULL ,
    `url` VARCHAR( 100 ) NOT NULL ,
    PRIMARY KEY ( `video_id` )
    ) ENGINE = MYISAM 
    Code (markup):
    after that you need connect your database, select your database and update your database every time member access your video.
    $link = mysql_connect('localhost', 'mysql_user', 'mysql_password');
    if (!$link) {
       die('Not connected : ' . mysql_error());
    }
    
    $db_selected = mysql_select_db('foo', $link);
    if (!$db_selected) {
       die ('Can\'t use foo : ' . mysql_error());
    }
    
    $url = 'http://'.$_SERVER['HTTP_HOST'].'/'.$_SERVER['PHP_SELF'];
    $sql = "SELECT total FROM foo WHERE url = '$url'";
    $result = mysql_query($sql);
    
    if (!$result) {
       $message  = 'Invalid query: ' . mysql_error() . "\n";
       $message .= 'Whole query: ' . $query;
       die($message);
    }
    $row = mysql_fetch_assoc($result)) {
    mysql_free_result($result);
    $sql = (mysql_num_rows($result) > 0) ? 'UPDATE foo SET total = '. ($row['total'] + 1) : "INSERT INTO foo (total, url) VALUES ('1', $url)";
    
    mysql_query($sql) or die(mysql_error());
    
    $total = ($row['total'] > 0) ? $row['total'] + 1 : 1;
    echo "total : $total";
    
    PHP:
     
    misbah, Nov 28, 2008 IP
  8. JenniP

    JenniP Peon

    Messages:
    250
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Have you tried asking fliqz? They may have a webservice or some other way. Other than that its write a PHP script to log in and screen scrape.

    Jen
     
    JenniP, Nov 28, 2008 IP
  9. jbzcc

    jbzcc Peon

    Messages:
    110
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Appreciate will give this a try.
     
    jbzcc, Nov 28, 2008 IP
  10. jbzcc

    jbzcc Peon

    Messages:
    110
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    I have asked Fliqz. I have to pay montly fee to get the service. Almost 100/m :(


     
    jbzcc, Nov 28, 2008 IP
  11. jbzcc

    jbzcc Peon

    Messages:
    110
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Appreciate will give it a trial!


     
    jbzcc, Nov 28, 2008 IP