I have one question for the video url.
I am trying to make a video upload. so this is my basic video upload code :
<?php
include_once '../includes.php';
if(isset($_POST['submit']))
{
$name = $_FILES['file']['name'];
$temp = $_FILES['file']['tmp_name'];
move_uploaded_file($temp,"uploaded/".$name);
$url = "http://localhost:8888/videouploadandplayback/uploaded/$name";
mysql_query("INSERT INTO `video` VALUE ('','$name','$url')");
}
?>
in this code $url
section is video url.
and this is my watch.php
code:
<?php
if(isset($_GET['id']))
{
$id = $_GET['id'];
$query = mysql_query("SELECT * FROM `video` WHERE id='$id'");
while($row = mysql_fetch_assoc($query))
{
$name = $row['name'];
$url = $row['url'];
}
echo "You are watching ".$name."<br />";
echo "<video id='my_video_1' class='video-js vjs-default-skin'
controls preload='none' width='640px' height='267px' data-setup='{}'>
<source src='$url' type='video/mp4' />
</video>";
}
else
{
echo "Error!";
}
?>
in this code <source src='$url' type='video/mp4' />
section shows like this :
<source src="http://localhost:8888/videouploadandplayback/uploaded/158382524199979_46659.mp4" type="video/mp4">
but i want to change it for example like this :
<source src="http://localhost:8888/videouploadandplayback/uploaded/x5Wa88Bq" type="video/mp4">
How do I make a URL (Like Youtube)in this way?