Results 1 to 2 of 2

Thread: Creating movie of the day

  1. #1
    Join Date
    May 2007
    Location
    Albuquerque
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Creating movie of the day

    I am wanting to create a movie of the day. I understand that I can use php to grab the directory contents and send a filename to the player. Question is has anyone done this and how do I go about it?

  2. #2
    Join Date
    May 2007
    Location
    Albuquerque
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Talking Working Code

    Here's what we've come up with for a clip of the day.

    First off the Player calls an xml playlist. I have created the following php file to dynamically create the xml and feed it to the player to come up with the clip of the day.

    PHP Code:
    <?
    header 
    ("content-type: text/xml");
    $results = array();
    $directory "./media/"//Directory to search
    $handler opendir($directory);
    while (
    $file readdir($handler)) {
        if (
    $file != '.' && $file != '..' && !is_dir($file)) $results[] = $file;
    }
    closedir($handler);
    // the above reads files into an array
    $count count($results); // gets number of files in array
    $now getdate();  // get timestamp
    $day $now['yday']; // gets day of the year;
    $file $day&#37;$count; // takes day of year, divides by number of files and returns the left over.. 
    $fileToServe $results[$file]; // serve file left over.. 
    $fileName explode("."$fileToServe);

    ?>
    <playlist version="1" xmlns="http://xspf.org/ns/0/">
    <trackList> 
      
      <track>
       <title><?=$fileName[0]?></title>
       <location>ENTER DIRECTORY LOCATION HERE<?=$fileToServe?></location>
      </track>
    </trackList>
    </playlist>
    Let me know what you guys think! You can check out the working version on http://www.myownwoody.com see the 'Clip of the day' on the left column.

    Thanks,

    - Woody

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
  •