In web development often encounter some simple video playback function, but now the video format is different, and can be dynamically added, so we have to save the video to the data Oh, OK, let's look at the paragraph I wrote a simple PHP video web player code bar.
Copy the Code code as follows:
Include './admin/connect.php ';
@extract ($db->get_one ("select * from Movieinfo where.$_get[' id '].");
$db->query ("Update movieinfo set playnum=playnum+1 where.$_get[' ID ']." ");
Control download
$url 2= "admin/";//the path where the software is stored
if ($localaddress)
{
$newname = $localaddress;
$movieurl = $url 2. $newname;
}
?>
<title><?= $title? >-online Play Jb51.net</title>
MediaPlayer Playback
if (Eregi (". mid$", $movieurl) | | eregi (". avi$", $movieurl) | | eregi (". asf$", $movieurl) | | Eregi (". asx$", $movieurl) | | Eregi (". wmv$", $movieurl) | | Eregi (". wma$", $movieurl))
{
?>
}elseif (Eregi (". ra$", $movieurl) | | eregi (". mp3$", $movieurl) | | eregi (". rm$", $movieurl) | | eregi (". ram$", $movieurl)) {
RealPlayer played by
?>
}elseif (Eregi (". swf$", $movieurl)) {
Flashplayer played by
?>
}
?>
The above describes the Soso music web player PHP Web player used to play online video code automatic judgment and select the type of video file, including the Soso music Web player content, I hope that the PHP tutorial interested friends have helped.