PHP& MySQL Video Playlist (JW Player)

Back in the groove of things!

Be easy on your hands! LOL… Have most of the downloader figured out.
Also, got the FTP set up… More in awhile…

OK… just so you know, all the admin pages will eventually be part of the current admin section already in place http://maranatha.web44.net/administrar/

Check your PM in a second I will send login info again…

Here’s how the Video Admin page is looking so far: http://maranatha.web44.net/administrar/dbvideos/_CP/videoAdmin.php

Looks good. I had to run to my Mom’s for awhile… Sorry…

Okay, is the video being pulled from the database? Or, is it just canned?

I have a question on the pop-up changes I am looking at…
Is the copy on the site okay for me to play with? I can fix it up nicely…

And, how about lowering the left video-edit square a little so the top matches the preview…???
I think it will look better. (Not important, just noticed it…)

You can change things at will, just let me know of the changes so I don’t replace it when I upload stuff.

The videos are coming from the DB. What happens is I don’t know how to use the switch javascript we used with input fields. I tried calling and input filed from the player and it did not work. Just take a quick look at the source videoAdmin.php on the server.

Sorry, pal, the phone has been crazy. I have to leave in an hour, so limitted time. Will do more later when I get home. Tomorrow is also free…

I think as far as the video preview, that you would have to make it one large DIV and load the entire player inside of it. All of the code for the preview including the playlist would have to be stuck in there. You would use the playlist (album) from the DB and put it into the rest of the code and then SLAM it into the DIV and tell it to play. Try it and tomorrow I will help more with it.

Looking at the pop-up code for the next 45 minutes or so…

OK. But I am still having the issue of selected the current video, as selected from the playlist. And still how to reload the div with all the relevant data. I am still confuse but I will to see what can I do with it. Thanks.

You had sent a personal note, I answered it with a link on how to load content into the player. I will test this tomorrow if you can’t get it working. (Or maybe late tonight when I get back!) Good luck with it…

Thanks. I just read it… believe or not I already had that done before… Remember that old site? http://movimiento22.com/videoplayer/videos.html

It’s exactly… How silly me. The only difference is that nis not DB driven since that List was created mannually. At the time I create these I had no clue of what a database even was. SO I should be able to get that out of the way tonight… FEELING GOOOOOD!

I also sent you another PM.

To anyone following this thread, one problem with the JW video player was how to load an entire playlist into a player already onscreen. Now we found the way and hopefully will get this baby working soon…

JJ-DR, I found that a few days before, but didnt get it read completely till this afternoon.
Manually is just the same, you just have to pull the data from the DB and “string” it into the playlist
and load it all. Then, you will have to tell the player to start. If you get stuck, post and I will look at
it when I get back… Good luck!

Oh, yes, I remember the old site… !!! I liked the way it looked like a movie theater…

Great… I’m banging it baby!

I am having issues. I am trying to adapt to the LongTail sample: http://www.longtailvideo.com/support/jw-player/jw-player-for-flash-v5/16025/loading-new-content-into-the-player

It is much simpler than what I had in that old site. The issue here is that the onChange() is already used to fill the input values in the form:
[php]<select id=“videoSelect” name=“videoSelect” onChange=“videoChanged();” ;>[/php]

Now I am trying to add to that load() to that string and I am stuck because I don’t how to target the specific values of the player:Title, Video Location, Image, description. This is what I have so far but I don’t know how to properly use load: [php]<select id=“videoSelect” name=“videoSelect” onChange=“videoChanged().jwplayer().load();” ;>[/php]

Well, leave it the same…Onchange=videchanged…

Then, inside the VideoChanged() function, you can do the items it did before and
after those, add the jwplayer.load, etc… That one change of the drop-down with both
fill in the text fields and then, load it into the player. This will allow for changes in the text
fields and the player will play a demo of that video if asked for…

Hope that made sense…

Huh? Not MUCH sense to me… Sorry LOL, not quite sure how to do that. Can you be a bit more specific?

Well, leave this the same:
<select id=“videoSelect” name=“videoSelect” onChange=“videoChanged();” ;>

Then, in the actual function:
There you would would have the same as before, which loads the Video-Name and Video-Description.
BUT, add after that, the code to reload the JW player with the video from the DB…

Well, if that does not make sense, I will lay it out for you in the morning… Not real clear right now.
Need some sleep… But, I think we can finish this up in the next few days… Much more tomorrow!

On it.Here’s the javascript so far
[php]script language=“JavaScript” type=“text/javascript”>
function videoChanged(){
var VideoDataArray = document.getElementById(‘videoSelect’).value.split(’|’);

document.getElementById(‘videoName’).value = VideoDataArray[0];
document.getElementById(‘videoDescription’).value = VideoDataArray[1];
document.getElementById(‘videoLocation’).value = VideoDataArray[2];
document.getElementById(‘lastUpdated’).value = VideoDataArray[3];
document.getElementById(‘image’).value = VideoDataArray[4];
jwplayer().load();
}[/php]

How do I connect the parts to load? For instance, I just need the videoName, VideoDescription,VideoLocation, and image to load. WHat goes inside of load? Do I need to add query there?

Sorry, they were changing my power meter to some sort of automatic one, so no power…

Well, you would have to put the playlist code into a variable and then put in the insert the parts from the database where they belong.

In your Javascript code, it would have to be something like:

var playlist = “playlist partial code” + VideoDataArray[0] + “playlist partial code” + VideoDataArray[1]+etc…

Basically, you have to manually build the actual playlist from the layout of a playlist inserting the live data from the database… If you need actual code, let me know and I can drum some up for you…

I am trying this, but no luck
[php]
function videoChanged(){
var VideoDataArray = document.getElementById(‘videoSelect’).value.split(’|’);

document.getElementById(‘videoName’).value = VideoDataArray[0];
document.getElementById(‘videoDescription’).value = VideoDataArray[1];
document.getElementById(‘videoLocation’).value = VideoDataArray[2];
document.getElementById(‘lastUpdated’).value = VideoDataArray[3];
document.getElementById(‘image’).value = VideoDataArray[4];

<?php function playlist(){ $dbConn =include('video_functions.php'); $query = mysql_query('SELECT * FROM videos'); while ($row = mysql_fetch_array($query)){ $location = $row['videoLocation']; $description = $row['videoDescription']; $videoName = $row['videoName']; $image = $row['image']; }} ?>

onClick=“jwplayer().load(<?php playlist();?>)”;
}

I the query inside a php function instead of a variable. I find it easier this way.
[/php]

Well, we talked a lot about playlist’s early on. They are basically something like this:

{file: “VIDEOS/filename.flv”, image: “THUMBS/filename.jpg”, title: “video title”, description: “text data” },

So, in Javascript to create this for one video to be able to use it for a video playlist you would have to do something like:

var $playlist=’{file: “VIDEOS/’ + $videoName + '”, image: “THUMBS/’ + $image + '”, title: “’ + $videoName + '”, description: “’ + $description + '” }’;

Not sure about that, but, you would put it at the end of the post you just showed. Then, display it to see if it builds the playlist correctly. If it does, that would go into your preview area as the new playlist when a video is selected. Then, you would have to send a “PLAY” command to the JWplayer using the link I sent yesterday… Let me know…

Sponsor our Newsletter | Privacy Policy | Terms of Service