Results 1 to 9 of 9

Thread: Creating and Managing Playlist Files (Long)

  1. #1

    Default Creating and Managing Playlist Files (Long)

    I wasn't sure which fora would be appropriate for this discussion, but this one seemed as good as any.

    I am starting this thread because I am interested in running all videos as a play list, allowing me to insert logos or commercials either before or after a video is played. Hard coding a standard playlist is no problem, but I would like to interact with vShare so that any video that is uploaded becomes a playlist automatically. I almost feel like I am trying to solve a rubix cube with missing stickers, so I wanted to start a discussion where others who are interested in the topic can chime in with their ideas.

    Here is what I have done so far...

    Preparation

    To begin with there are two basic steps I did when preparing to work on playlists:

    1. Downloaded the newest version of the flv player. I know that the newer version is capable of running playlists, and I wasn't sure about the version 3.8 player that comes with vshare, so I updated mine.

    2. Created a short, 4 second logo type video to test in conjunction with the videos that get uploaded to the site. For purposes of keeping this discussion simple, I will just refer to it as logo.flv

    First Attempt - /include/player.inc

    Sometimes the simplest solutions work best, so I wanted to start out with the most simple, basic approach I could just to see what happened. In the player.inc file, the section where it refers to the file to play is:

    Code:
    so.addVariable("file","{$config["baseurl"]}/flvideo/$video_flvdoname");
    I thought to myself, how nice would it be if all I had to do was list multiple files, such as list my logo video, then this code, and have every page automatically play both files in sequence. So, I tried modifying it to be:

    Code:
    so.addVariable("file","{$config["baseurl"]}/flvideo/logo.flv");
    so.addVariable("file","{$config["baseurl"]}/flvideo/$video_flvdoname");
    This had no change on my site that I could see. Whenever I went to a video and played it, it played like it always had, but no sign of my logo flv. So then I thought, maybe I have to number them, so I tried this:

    Code:
    so.addVariable("file1","{$config["baseurl"]}/flvideo/logo.flv");
    so.addVariable("file2","{$config["baseurl"]}/flvideo/$video_flvdoname");
    That didn't get the desired effect at all. Nothing would play. So I reverted back to the original player.inc and decided to take a different approach.

    Second Attempt - XML Playlist

    The next logical approach seemed to be to create an xml playlist and to try referencing that, since I can apparently only list one file. So I made an xml file like the following:

    Code:
    <playlist version="1" xmlns="http://xspf.org/ns/0/">
      <title>Standard Playlist</title> 
      <info>http://www.sportsgamingtv.com</info> 
      <annotation>Standard Playlist File</annotation> 
    <trackList>
    <track>
      <title>Sports Gaming TV</title> 
      <location>http://www.sportsgamingtv.com/flvideo/logo.flv</location> 
      <info>http://www.sportsgamingtv.com/</info> 
      <album>preroll</album> 
      </track>
    <track>
      <title>Member Video</title> 
      <creator>Sports Gaming TV</creator> 
      <location>{$config["baseurl"]}/flvideo/$video_flvdoname</location> 
      <image>{$config["baseurl"]}/thumb/$video_id.jpg</image> 
      </track>
      </trackList>
      </playlist>
    After uploading the playlist, I then went back to player.inc and edited the file line once more, to be:

    Code:
    so.addVariable("file","{$config["baseurl"]}/xmlplaylist.xml");
    This is as close as I have been able to get. When I did this, my logo flv will play, but then it ends without playing the second video. It also only does this one time. If I hit play a second time, it just tries forever to connect/load.

    I tried editing the playlist to remove $config, and to even just replace the baseurl section entirely with http://www.mysite.com - nothing got a result that was any different.

    What's Next?

    I can't help but feel that I'm zeroing in on this. I think going the xml route is the appropriate way to do it, but I'm doing something wrong with how I'm calling for the uploaded file to be referenced.

    Any ideas?
    This member is now known as Sitting Out

  2. #2
    Join Date
    May 2007
    Posts
    686

    Default

    Yeah i have tried what you suggested above about a month ago and gave my details and scripting to the admin, it was concluded nearly impossible to get it resolved.

  3. #3
    Join Date
    Jun 2007
    Posts
    197

    Default

    With PHP it could be resolved but as XML this will not work.

    Th Agriya player I install for users has been created using a PHP file to feed the information, and infact most of the scripts I've created have been created using PHP as the source and not XML.

    Regards,
    Mat.
    ------------------------------------
    Make an arse of yourself:
    http://www.youtwatonline.com
    ------------------------------------

  4. #4

    Default

    Quote Originally Posted by zeffer
    Yeah i have tried what you suggested above about a month ago and gave my details and scripting to the admin, it was concluded nearly impossible to get it resolved.
    I am certain that it can be done. I think I am just overlooking something that someone else might find so simple that they wonder why I'm overlooking it.

    btw, there is a newer version of the player than the one you have. The one you have did not properly detect the end of the video (in some cases), and there have been a few other fixes aded to it.


    Quote Originally Posted by galnet
    With PHP it could be resolved but as XML this will not work.

    Th Agriya player I install for users has been created using a PHP file to feed the information, and infact most of the scripts I've created have been created using PHP as the source and not XML.
    I think the process of making it work right with vShare will be more or less the same with either player (I think - haven't used the other player). I originally started out by trying to use XML playlist because that's how it was done on the site for the author of the player. I get this to work good if I want to make a playlist that points to specific files, just not if I want it to call files up in the manner that vShare does.

    My instinct tells me this has to somehow be possible with XML (if I can get one file to play, then surely there must be a way to get both), but maybe pointing to a php file is the way to go. I did try to make a simple php file but nothing would load up. I'll have to step back and wrap my mind around this one.
    This member is now known as Sitting Out

  5. #5

    Default

    Ok, I made my first pass at trying to do this with php. I started, again, with the /include/player.inc to revise the "file" flashvar. At first I just changed it to be:

    Code:
    so.addVariable("file","{$config["baseurl"]}/playlist.php);
    Based on the advice of someone more familiar with this player, I later changed that to be:

    Code:
    so.addVariable("file",escape("http://my.site.com/playlist.php?file=video_filename") );
    However, that still did not get the desired result. In fact, I got the same result with playlist.php as I did using an XML file. I believe the problem is with the code inside playlist.php though, so I tried changing it up a number of different ways.

    - the entire file enclosed with <?php and ?>
    - the $ prompts wrapped with <?php echo and ; ?> (but not the whole file being within <?php
    - both of the above at the same time
    - neither of the above

    When I tried neither of the above, that got the closest result, in that it would play the first file (direct linked to an flv), but noth the one that uses $video_flvdoname (obviously, since it did not contain <?php anywhere. Even though it was wrong, I was still happy to at least see something play. lol.

    After that I got desparate, and wrapped the entire file with <?php again, and the opened each line of the document with echo " and closed each line with \n"; That did not work either.

    As it stands right now, I have the testlist.php set as:

    Code:
    <?php
    
    <playlist version="1" xmlns="http://xspf.org/ns/0/">
    <title>Standard Playlist</title>
    <info>http://www.sportsgamingtv.com</info>
    <annotation>Standard Playlist File</annotation>
    <trackList>
    <track>
    <title>Sports Gaming TV</title>
    <location>http://www.sportsgamingtv.com/flvideo/118824154064749921.flv</location>
    <info>http://www.sportsgamingtv.com/</info>
    </track>
    <track>
    <title>Member Video</title>
    <creator>Sports Gaming TV</creator>
    <location>http://www.sportsgamingtv.com/flvideo/$video_flvdoname</location>
    <image>http://www.sportsgamingtv.com/thumb/$video_flvdoname</image>
    </track>
    </trackList>
    </playlist>
    
    ?>
    So, at the end of this experiment, I am still in the same spot I was at the end of the xml experiment. I do believe I am on the right track though. I'm going to keep checking this out. If anyone has a suggestion, feel free to add it. I'm by no means an expert in php and basically have to learn as I go where this process is concerned.
    This member is now known as Sitting Out

  6. #6

    Default

    Ok, I got a little help from a couple of generous individuals on another forum that I think helped to put me a step in the right direction.

    The first guy suggested that I wrap my entire playlist file into a single echo tag, and use single quote on anything between the tags. I tried this, and it was a partial success. I could see the player once again, and it played the first (preroll/logo) video, just not the uploaded video. But still, it was a step in the right direction.

    The second guy suggested that I write my playlist like this:

    Code:
    <?php
    
    $video_flvdoname = (isset($_GET['file'])) ? strval($_GET['file']) : 'video.flv';
    
    if (strpos($video_flvdoname, '.flv') === false)
    {
    $video_flvdoname = $video_flvdoname . '.flv';
    }
    
    $video_flvdoname = 'http://www.sportsgamingtv.com/flvideo/' . $video_flvdoname;
    
    print <<<END
    <?xml version='1.0' encoding='UTF-8'?>
    <playlist version="1" xmlns="http://xspf.org/ns/0/">
    <title>Standard Playlist</title>
    <info>http://www.sportsgamingtv.com</info>
    <annotation>Standard Playlist File</annotation>
    <trackList>
    <track>
    <title>Sports Gaming TV</title>
    <location>http://www.sportsgamingtv.com/flvideo/118824154064749921.flv</location>
    <info>http://www.sportsgamingtv.com/</info>
    </track>
    <track>
    <title>Member Video</title>
    <creator>Sports Gaming TV</creator>
    <location>$video_flvdoname</location>
    <image>$video_flvdoname</image>
    </track>
    </trackList>
    </playlist>
    END;
    
    ?>
    And then change the "file" flashvar that calls it to this:

    Code:
    so.addVariable("file",escape("http://www.sportsgamingtv.com/flvideo/testlist.php?file=118824154064749921"));
    So I tried this as well. I got the same result. I could see the player, and it played the logo video that is first in the play list, but it did not play the uploaded file.

    It's still not there yet, but I really feel like it's a step in the right direction. I'm wondering now if there is another file or coding in another portion of vshare that is prohibiting this from working correctly.

    Any ideas?
    This member is now known as Sitting Out

  7. #7
    Join Date
    Jun 2007
    Location
    Montgomery AL
    Posts
    14

    Default

    Hey,
    Something you might want to try is to call the PHP by itself with a known good flv file passed to it in the query string. This way you can see if the video is being added to the XML output. That was one of the issues I had, for some reason it wouldn't ouput the path to the FLV file. The other issue I was running into was my lack of knowledge in PHP 5.X. I'm a .NET programmer by day and a PHP hack by night so I'm a little behind on the PHP framework for XML...

    Dapanther

  8. #8

    Default

    What I've come to discover is that I was not seeing the first video in the playlist. It has to do with this flashvar

    Code:
    so.addVariable("file",escape("http://www.sportsgamingtv.com/flvideo/testlist.php?file=118824154064749921"));
    118824154064749921.flv was the first file in the playlist, so when I saw it, I thought the play list was starting, but not continuing. However, I've since removed it from the playlist file entirely, and that is still all that I am getting. So doing the flashvar in that manner must simply be pointing the player to that file.

    Of course, when I remove the ?file=118824154064749921 part of the flashvar nothing will load, so I'm not entirely sure what to make of it.
    This member is now known as Sitting Out

  9. #9

    Default

    I thought I would pop back in and leave another reply to myself. It's getting late, and I want to make sure I can jump back into my thought process tomorrow.

    I think rather than there being a problem with that flashvar, it has to be a problem with the playlist.php calling upon $video_flvdoname. I originally used that because that is how the original flashvar called up the file, but now I'm beginning to think that is wrong.

    If you open view_video.tpl, you see that where the embedded code gets generated creates the file name as:

    Code:
    &file={$baseurl}/flvideo/{$vinfo[0].flvdoname}
    So maybe I should be trying to work with $vinfo[0].flvdoname instead of using $video_flvdoname.
    This member is now known as Sitting Out

Similar Threads

  1. I tried creating a poll and now I get this error
    By DeeperImage in forum Installation Support
    Replies: 1
    Last Post: 09-16-2008, 12:46 AM
  2. Not creating USER Directorys!
    By docrst in forum Installation Support
    Replies: 6
    Last Post: 06-20-2008, 12:28 AM
  3. Creating A new Page
    By west in forum Template Modifications
    Replies: 4
    Last Post: 02-16-2008, 02:08 AM
  4. HOW LONG to import vids
    By ourlordstv in forum General Discussions
    Replies: 8
    Last Post: 01-08-2008, 12:57 PM
  5. Long videos not playing correctly.
    By GhostFreak in forum Installation Support
    Replies: 19
    Last Post: 08-29-2007, 04:51 AM

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
  •