PHP& MySQL Video Playlist (JW Player)

One more thing…

You can add code to “beef” up the page to add a class where if the lastUpdated date is x number of months old that it changes colors. In this way, the user will notice when a video or playlist has not been updated in a certain time. I use that type of feature for webpages. The lastUpdated date/time turns red if it has not be changed in a year. Or yellow for 6 months… Whatever… Since this color change only shows up on the ADMIN pages, only the administrators notice this color change. All normal users on the live site never see a color change.

Just an idea… Share the ideas and you will see better sites in the world… LOL

I did those, but the DIV is not loaded with the time stamp. The reason I want to do it this ways is because I don’t want it to look like a text box… just text.

That’s a funny quote :slight_smile:

Sorry, forgot text in DIV’s are handled a bit different…

Do this change in the javascript part, and let me know…

  document.getElementById('lastUpdated').innerText = VideoDataArray[3];

DIV do not have a standard “value”…

This does bring up a few issues. This may not work on Chrome or FireFox. Once you have the entire site working under IE, we will have to test it all in FF and Chrome. (These are the only ones I would worry about.) Some code is a little changed for other browsers. Some use .textcontent not .innertext !!! Yikes!

no luck.

OK, it works on explorer, not on FF (My main browser).

If this is going to be an issue, then I will keep in a text box… maybe I can control the look with css.

OK, I got. I reverted back to the form field as it is easy to style with CSS!
This way we avoid those browser issues.

OK, back to the real stuff…

As you probably noticed, I added the $videoAuthor variable and also passed through the javascript. However, I have to more fields in the database: videoLocation and videoImage. BUt I don’t know what to do with these since the videoLocation and videoImage fields will be populated with the upload form, right?

Also, and back to the videoAdmminUPDATE.php, it’s rendering an unwanted behaviour. For instance, if you update the video name, it creates a new one in the database. If I only update the author and description, then it’s fine.

Well, first the text stored into DIV’s can be fixed this way…

fieldname.innerText = fieldname.textContent = “whatever”;

What this does is to set the same name of the field to different ways in the correct order to the value.
On FF it fixes it and On IE it fixes it. A trick I just found. (We may have other issues when testing on various browsers later on…)

The $videoAuther should be used if you have more than one person uploading videos when site is live.
The $videoLocation should eventually be the “path” to the video. If they are always all uploaded to the same folder, then, it is not needed as we can hard code the code to add it in. (I hardcode it. I use one folder called “Videos” and add “Videos/” . $filename wherever a filename is used.
The $videoImage is used for the thumbnail of the movie. This can be taken from the video later on as the first “frame” of the video. (I would not do it that way as a lot of time the first video frame is black.)

Hope that cleared it up…

Yeah, it all makes sense.

I will keep the lastUpdated as form field. With CSS I got to look exactly as I want it!
The coloring of lastUpdated idea is a great one.

I will read the other stuff you sent yesterday and get started on that one. I will keep the videoAuthor DB field for now, even I don’t immediately use it. Since this is a church website, and churches have different departments, I might want to give each department their own admin access, so that way they don’t call me for everything.

The video path can probably be hard coded, unless a different folder is used for the departments.

Yeah, I was thinking more like getting frame 20 or so from the videos to use as image.

Oh, yep! Getting a further frame for the thumbnails is a good idea! Perhaps an option for the user to select it or upload their own. That way if they have a scan of the videos owner or whatever, they might want to upload that instead of frame#20. I wouldn’t give them too make options. Show Frame#20 in a sample of the picture with a button, use this frame or LOAD-NEW-PICTURE… Something like that.

Yes, lots sent to you yesterday (or early this morning…) I have plans tonight, so it will be quieter from me!

Cool… one more thing, and this is concerning the naming of the videos as we spoke yesterday:

How about, during video upload, that the users enter a name for the video, and that the actual video file name is matched (renamed) to the one entered by the user. This way, we avoid having videoName with something like this:

videoName: My First Video
videoLocation:video9987452.flv

Instead it would be:videoName: mys first video ---- videoLocation: mys first video.flv

Yeah, it’s always a good idea to give users some options.

Well, you can do that if you make sure you remove all special chars and replace slashes and spaces with underlines, etc. I think of it a different way: If you have a videoName that a user types in and a videoFile that is selected by that user, the Name is what is displayed on the video list, not the filename AND, the filename already exists, so it is a valid Windows filename and there is no need to check it.

From the user’s standpoint, they see “My First Video” in the drop down, who cares about the filename. The only issue here is if that user leaves and the next one renames the filename to something else, you will have two videos uploaded with different names. (Waste of space.) But, how often will that happen?

These are all normal questions that you will ask yourself once the entire project is working. I always suggest that programmers kept a note list of problems THEY have while experimenting with the project and then go over that list later. Add to the list improvements that would be nice like the timestamp colors…

Anyway, got to run to the bank for a few minutes…

Yeah, and actually, I have been keeping some notes as I don’t want to slow the process with every little thing, like the lastUpdated thing. That way we concentrate on the most important items first.

I hear you about the video naming. The reason I want the file name and location (hyphens and underscores are OK) is that One can add a specific video, for instance, to any of the pages on the website. For instance, using I have a CP panel, integrated with tinyMCE (http://www.tinymce.com/) and tinyMCE AJAX FileUploader (phpletter.com) which allows me to edit the content richly (ie, bold, color, underline text) along with the option of inserting videos and images.

If for instance, we add story on the front page, we might pull a video from the videoLocation folder and add it to that single page. You can actually see this in action in maranatha.tv… Click on IGLESIA

That’s why I want the name of the videos to make some sense so they can be easily be searched for. Keep in mind that we are never displaying the videoLocation value to the web surfer. This is for managing the content only.

Yes, I hear you on it all. But, I don’t know your site. YOU know it and YOU know what’s best. I am just trying to suggest items that might help or give you an idea on some new aspect of options. I find that websites are very very personal to the creator of the site and the owners of the site. For me, I love the experimenting part and the getting the PUZZLE together. This one is coming along nicely. Just the playlist ADMIN to go and the rest is up to you!

Hi Ernie, here’s waht he have so far for videoAdmin part:maranatha.tv/VIDEOS/administrar/videoAdmin.php. Delete is not working, but I’ll get to that at a later time, I want to get started on the video uploading stuff.

I am at a loss. I don’t know how to continue. On page 8 on this thread you posted the info as to how to upload pictures. But we are working with uploading videos now. Is this just a reference on how the process work?

I was reading some of the sites you sent me… but man, it’s a lot from so many different angles. That’s what happens to me for hanging out with you LOL :slight_smile:

What you do think should be my next step?

I have stuff to do and probably won’t do much today, but hey, you never know!

Okay, first, is that ALL you need on the VideoADMIN page. By the way, it looks good and works as it should. Very Nice! Just one minor problem, you have to add “|Enter Author Name Here…” to the drop-down list at the bottom where you add-new-video… It comes up undefined…

Then, next step is to add the picture-upload code. I did send it to you, but, it was FORM based. I am researching a new way to do this without paging out to a form. So the page stays dynamic. I really like the dynamic feel to the page, you can have items all around the page and only the dynamic items change. Very fun stuff!

Where this is handled is in the ONCHANGE() function. In that function we have to add an IF-THEN to check for the last option being selected. If it is, this means ADD-NEW-VIDEO. At that point we have to allow the user to use the browse button and select a file which gets uploaded. I sent all of the code to do this, but, it is set up as a FORM. I think I have a better idea. I was thinking of a pop-up that would load the file and then close. What do you think of that? Code-wise it would be easy. Just pop-up a new window which would really be a FORM. When you press Submit, it would switch to a PHP page that would upload the file and then close itself. (Taking you back to the Enter-New-Name-Here display…) What do you think…

I just checked. Yes, I gave you code on page 8 which started with “To upload a picture”.

That code is a FORM side and a PHP file to process it. If you want to test this create two pages, one HTML/FORM with the first part of the code and a second PHP page with the other code. It will upload a file, but, you will have to set up the folder online first and test it all…

I will be gone tonight, but, I will try to figure out an upload pop-up for you. Shouldn’t be too hard! Later…

I like your idea of the Pop Up window., also how about having something like videoSample where an actual mini player (simplified) is displayed so the viewer can actually preview the video (and with the duration flashvar of the JW player we can actually limit length of the video). Probably a replace video button to change it.

Then the Upload will also show the mini player so the user can sor confirm what he is uploading. Does all this jargon make any sense?

Do the appropriate solution as you see it fit, and we’ll see how it comes out.

Good night!

YES YES YES! You are right on… I just solved this in a cool way…

First, nobody really cares about the author, right? You have a great idea of putting a small sample of the video there. That would be nice. AND, to make it better, create a small video or GIF that would animate an ARROW pointing down to the button below it which would say. UPDATE video.

How that would work is if a video was selected it would load into the small demo of the video and be playable, too. BUT, if they selected ADD-NEW-VIDEO, it would load the ARROW-VIDEO or GIF pointing to the update video button. That would be very understandable by anyone. AND, I just found code to do really nice pop-up code. We would have the UPDATE-VIDEO button bring up the PHP-POP-CODE form that would do the actual upload and would stay onscreen until the upload was complete and then dissappear. It would work nicely. BUT, got to go soon, so will have to send some code for you in the morning…

Here for 10 minutes if you have a quick question…

This project will turn out so beautiful. I have some design ideas for the end… a little surprise for you. I just sent you a personal message with some important details of the site.

Take a look and let me know your opinion. Take care.

Oh, I forgot about personal messages… I was going to give you one of my email addresses. But, the PM’s will work that way…

I have had a long night and can’t work on this now. I will look at the site in the morning and do the pop-up video-upload routines then. I think I should have time… Tomorrow…

Sponsor our Newsletter | Privacy Policy | Terms of Service