SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Wizard
    Join Date
    Nov 2003
    Location
    United Kingdom
    Posts
    2,120
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Problem with getting metadata from flv file

    Hi,

    I am using the following script:

    PHP Code:
    session_start();
    error_reporting(0);
    if(
    $_SESSION['_________________'] == "_______________"){

    $openf="$_GET[id]".".flv";

    Header("Content-Type: video/x-flv");
    Header("Content-Length: " filesize("$openf"));

    readfile($openf);

    I am using this so that I can stop hotlinking of my flv files. The only problem is that I can calling this through another script using something like

    videos.php?id=2323

    When calling a video using the script above my flv video player doesn't seem to work properly or any other flv video player that I use. I don't think that the player can read the meta data from the flv file.

    Am I doing something wrong. I know that when I call the flv file directly then it works with the flv player, but when I use this script it doesn't work.

    The problem is that I set a preload buffer to 5 sec's and the video just starts straight away so it keeps cutting as it is moving through the video faster than what it is loading plus the loader bar doesn't work properly.

    Can you please help.

    How can I get the metadata for the file. Is there a certain header that I need or something. Well I belive it is to do with the metadata anyway, but if I am wrong then please tell me how I can work around this problem.

    Thanks!.

  2. #2
    Who turned the lights out !! Mandes's Avatar
    Join Date
    May 2005
    Location
    S.W. France
    Posts
    2,496
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Not sure if its your problem but your not sending the filename

    PHP Code:
    header('Content-Disposition: attachment; filename="'.$openf.'"'); 
    A Little Knowledge Is A Very Dangerous Thing.......
    That Makes Me A Lethal Weapon !!!!!!!!

    Contract PHP Programming

  3. #3
    SitePoint Wizard
    Join Date
    Nov 2003
    Location
    United Kingdom
    Posts
    2,120
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It didn't do anything.

  4. #4
    Community Advisor silver trophy

    Join Date
    Nov 2006
    Location
    UK
    Posts
    2,547
    Mentioned
    40 Post(s)
    Tagged
    1 Thread(s)
    What kind of server is it running on, windows 2003 doesn't have mimetype setup for flv correctly out of the box.

    Also, try comparing the responses to the dynamically generated data method versus the statically embedded flv method that you had working using charles web debugging proxy

  5. #5
    SitePoint Member
    Join Date
    Apr 2006
    Location
    Hamburg
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi John,

    I scripted an .flv upload module a time ago and had to
    check the .flv MIME type using the definition:

    application/octet-stream

    I don't know if that will solve your problem, I just noticed
    that you defined an other MIME type.

    best regards - Luckyfella

  6. #6
    SitePoint Wizard
    Join Date
    Nov 2003
    Location
    United Kingdom
    Posts
    2,120
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I use a unix server. Should I use application/octet-stream then as the file is a flv file so I have to mime it that way I would have thought.


Bookmarks

Posting Permissions

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