Alright, I will try to best explain this as I can.
I am building a website for someone, and they asked me today if I could add a feature, and I am unsure how to go about it. Basically, upload a video to their site to a folder, and a player be embedded in the videos page. Now when a video is uploaded, the player's playlist is updated with the new video.
Any ideas on how to accomplish this? They don't want to use YouTube, they want to use their own server and video player. See side note, as wanting to accomplish the same thing but with videos...so aggravating. I have this one some bugs to finish and I can turn it over to them for reviewing and final touch ups before completing the work. Any help would be appreciated!
-Side note:
I added a flash photo album that allows them to upload photos and the album auto updates with the new pictures.-
Video player [SOLVED]
- Jackolantern
- Posts: 10893
- Joined: Wed Jul 01, 2009 11:00 pm
Re: Video player
Honestly I would look for something open source to do this. The issue is that to make the video uploading even half-way user friendly, you need to be automatically converting the video file formats on the server. Flash, Silverlight and HTML5 all call for specific video file formats (HTML5 actually requires 2 different formats to play in all browsers), and they are not the typical formats users have. So once you consider the automatic video converting functionality, and all of the video organization and display options, it would likely be better to find something already available. Particularly considering how many of these surely must exist, since "YouTube clone" is up there in popularity with social network, email site, etc., and likely has dozens of options online.
The indelible lord of tl;dr
- SpiritWebb
- Posts: 3107
- Joined: Sun Jul 12, 2009 11:25 pm
Re: Video player
I got one in place now, but getting an error using copy(), but if I change it to move_uploaded_file() no errors, but no upload happens. See code below:
PHP Code:
HTML to upload:
PHP Code:
Code: Select all
// Start video upload -----------------------------------------------
if(isset($_POST['vsubmit'])){
// get the original filename
$video = $_FILES['vupload']['name'];
// video storing folder, make sure you indicate the right path
$folder = "../videos/";
//video checking if exist or the input field is not empty
if($video){
// creating a filename
$filename = $folder . $video;
// uploading video file to specified folder
$copied = copy($_FILES['vupload']['tmp_name'], $filename); // <--- If I change it to move_uploaded_file() no error and nothing happens. If I change it to copy(), it says its empty.
// checking if upload successful
if (!$copied){
// creating variable for the purpose of checking:
// 0 - unsuccessful, 1 - successfull
$ok = 0;
var_dump($_FILES);
} else {
$ok = 1;
}
}
}
// End video upload -------------------------------------------------
Code: Select all
<td bgcolor="#FFDDDD"><form id="form4" name="vidUpload" action="" method="post" enctype="multipart/form-data">
<br />
<input type="file" name="vupload">
<input type="submit" name="vsubmit" value="Upload Video">
<<<< ONLY: allowed
</form></td>
- SpiritWebb
- Posts: 3107
- Joined: Sun Jul 12, 2009 11:25 pm
Re: Video player
I got it to generate the playlist and play music, just still cannot get it to upload the file from my previous post.
- SpiritWebb
- Posts: 3107
- Joined: Sun Jul 12, 2009 11:25 pm
Re: Video player
Here is the var_dump($_FILES) that is displayed if it didn't upload:
Code: Select all
array (size=1)
'vupload' =>
array (size=5)
'name' => string '04 O Holy Night.mp3' (length=19)
'type' => string '' (length=0)
'tmp_name' => string '' (length=0)
'error' => int 1
'size' => int 0
- SpiritWebb
- Posts: 3107
- Joined: Sun Jul 12, 2009 11:25 pm
Re: Video player
I fixed the problem. Videos uploading successfully, playlist automatically updating with new video. Apparently the video CAN NOT have any spaces in the title when uploading!
- Jackolantern
- Posts: 10893
- Joined: Wed Jul 01, 2009 11:00 pm
Re: Video player [SOLVED]
Glad you got it working Is this a publicly-available video site solution?
The indelible lord of tl;dr
- SpiritWebb
- Posts: 3107
- Joined: Sun Jul 12, 2009 11:25 pm
Re: Video player [SOLVED]
As in terms of something like YouTube? No, its for a paranormal group's website. So they can upload their videos and share without uploading to a video hosting and posting an embed option!
If thats not what you meant, you lost me!
If thats not what you meant, you lost me!