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?