PHP web Player's code for playing online video (automatically judging and selecting video file types) _php tips

Source: Internet
Author: User
Tags prefetch shuffle
In the Web development will often encounter some simple video playback function, but now the video format is different, and can be dynamically increased, so we have to save the video to the data Oh, okay, let's look at the paragraph I wrote a simple PHP video web playerCode it.
Copy Code code as follows:

? Php
Include './admin/connect.php ';
@extract ($db->get_one ("select * from Movieinfo where id= '". $_get[' id ']. "));
$db->query ("Update movieinfo set playnum=playnum+1 where id= '". $_get[' id ']. "' ");
Control Downloads
$url 2= "admin/";//Store The path of the software
if ($localaddress)
{
$newname = $localaddress;
$movieurl = $url 2. $newname;
}
?>
<title><?= $title? >-play jb51.net</title> Online

<body bgcolor= "#FFFFFF" text= "#000000" leftmargin= "0" topmargin= "0" >
<?php
MediaPlayer Playback
if (Eregi (". mid$", $movieurl) | | eregi (". avi$", $movieurl) | | eregi (". asf$", $movieurl) | | Eregi (". asx$", $movieurl) | | Eregi (". wmv$", $movieurl) | | Eregi (". wma$", $movieurl))
{
?>
<object classid= "Clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95" type= "Application/x-oleobject" width=350 height= 280 align= "Middle" standby= "Loading Microsoft?" Windows? Media Player components ... "id=" MediaPlayer1 ">
<param name= "Transparentatstart" value= "True" >
<param name= "Transparentatstop" value= "True" >
<param name= "Animationatstart" value= "ture" >
<param name= "AutoStart" value= "True" >
<param name= "Autorewind" value= "true" >
<param name= "displaysize" value= "0" >
<param name= "AutoSize" value= "false" >
<param name= "Showdisplay" value= "false" >
<param name= "ShowStatusBar" value= "ture" >
<param name= "Showcontrols" value= "ture" >
<param name= "FileName" value= "<?= $movieurl?>" >
<param name= "Volume" value= "0" >
<embed src= "" width= "height=280 autostart=" true "align=" Middle "transparentatstart=" true "transparentatstop=" True ' animationatstart= ' ture ' autorewind= ' true ' displaysize= ' 0 ' autosize= ' false ' showdisplay= ' false ' showstatusbar= ' -1 "showcontrols=" ture "filename=" <?= $movieurl?> "volume=" 0 ">
</embed>
</object>
<?php
}elseif (Eregi) (". ra$", $movieurl) | | eregi (". mp3$", $movieurl) | | eregi (". rm$", $movieurl) | | eregi (". ram$", $movieurl)) {
RealPlayer Play the
?>
<object id= "video" classid= "CLSID:CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA" height= "280" width= "align=" "Center" >
<param name= "_extentx" value= "9260" >
<param name= "_extenty" value= "6350" >
<param name= "AUTOSTART" value= "-1" >
<param name= "SHUFFLE" value= "0" >
<param name= "PREFETCH" value= "0" >
<param name= "nolabels" value= "0" >
<param name= "SRC" value= "<?= $movieurl?>" >
<param name= "CONTROLS" value= "Imagewindow" >
<param name= "CONSOLE" value= "Clip1" >
<param name= "LOOP" value= "0" >
<param name= "Numloop" value= "0" >
<param name= "CENTER" value= "0" >
<param name= "Maintainaspect" value= "0" >
<param name= "BackgroundColor" value= "#000000" ><embed src= "4.rpm" type= "Audio/x-pn-realaudio-plugin" "Clip1" controls= "Imagewindow" height= "console=" width= "352" autostart= "false" >
</object><br>
<object id= "video" classid= "CLSID:CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA" height= "" Width= "align=" "Center" >
<param name= "_extentx" value= "9260" >
<param name= "_extenty" value= "1058" >
<param name= "AUTOSTART" value= "-1" >
<param name= "SHUFFLE" value= "0" >
<param name= "PREFETCH" value= "0" >
<param name= "nolabels" value= "0" >
<param name= "CONTROLS" value= "Controlpanel,statusbar" >
<param name= "CONSOLE" value= "Clip1" >
<param name= "LOOP" value= "0" >
<param name= "Numloop" value= "0" >
<param name= "CENTER" value= "0" >
<param name= "Maintainaspect" value= "0" >
<param name= "BackgroundColor" value= "#000000" ><embed type= "Audio/x-pn-realaudio-plugin" CONSOLE= "Clip1" "Controlpanel,statusbar" height= "controls=" width= "275" autostart= "false" >
</object>

<?php

}elseif (Eregi (". swf$", $movieurl)) {
Flashplayer Play the
?>
<object classid= "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" id= obj1 "codebase=" http:// download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0 "border=" 0 "width=" "height=" 280 ">
<param name= "movie" value= "<?= $movieurl?>" >
<param name= "Quality" value= "High" >
<embed src= "<?= $movieurl?>" pluginspage= "http://www.macromedia.com/go/getflashplayer" type= "application/" X-shockwave-flash "Name=" obj1 "width=" height= "280" >
</object>
?
}
?>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.