PHP video web Player code example

Source: Internet
Author: User
Keywords Web Programming PHP Tutorials
Tags code connect console data development different example function

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 section I wrote a simple PHP tutorial video page player code.

? 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;
}
?>
<html>
<head>
<title><?= $title? >-Online Playback </title>

</head>


<body bgcolor= "#FFFFFF" text= "#000000" leftmargin= "0" topmargin= "0" >
<?php

//mediaplayer Play


if (eregi (". mid$", $movieurl) | | eregi (". avi$", $movieurl) | | eregi (". asf$", $movieurl) | | Eregi (". asx$", $movieurl) | | Eregi (". wmv$", $movieurl) | | Eregi (". wma$", $movieurl))


{


?&gt;


&lt;object classid= "Clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95" type= "Application/x-oleobject" width=350 280 align= "Middle" standby= Loading Microsoft? Windows? Media Player rs ... "id=" MediaPlayer1 "&gt;


&lt;param name= "Transparentatstart" value= "True" &gt;


&lt;param name= "transparentatstop" value= "True" &gt;


&lt;param name= "Animationatstart" value= "true" &gt;


&lt;param name= "AutoStart" value= "True" &gt;


&lt;param name= "Autorewind" value= "true" &gt;


&lt;param name= "displaysize" value= "0" &gt;


&lt;param name= "AutoSize" value= "false" &gt;


&lt;param name= "Showdisplay" value= "false" &gt;


&lt;param name= "ShowStatusBar" value= "true" &gt;


&lt;param name= "Showcontrols" value= "true" &gt;


&lt;param name= "FileName" value= "&lt;?= $movieurl?&gt;" &gt;


&lt;param name= "Volume" value= "0" &gt;


&lt;embed src= "width=" height=280 autostart= "true" align= "Middle" transparentatstart= "true" Transparentatstop= "true" animationatstart= "true" autorewind= "true" displaysize= "0" autosize= "false" showdisplay= " False "showstatusbar="-1 "showcontrols=" true "Filename=" &lt;?= $movieurl?&gt; "volume=" 0 "&gt;


&lt;/embed&gt;


&lt;/object&gt;


 


&lt;?php


}elseif (Eregi (". ra$", $movieurl) | | eregi (". mp3$", $movieurl) | | eregi (". rm$", $movieurl) | | eregi (". ram$", $ Movieurl)) {


//realplayer playing


?&gt;


&lt;object id= "video" classid= "CLSID:CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA" height= "280" "WIDTH=" Center "&gt;


&lt;param name= "_extentx" value= "9260" &gt;


&lt;param name= "_extenty" value= "6350" &gt;


&lt;param name= "AUTOSTART" value= "1" &gt;


&lt;param name= "SHUFFLE" value= "0" &gt;


&lt;param name= "PREFETCH" value= "0" &gt;


&lt;param name= "nolabels" value= "0" &gt;


&lt;param name= "SRC" value= "&lt;?= $movieurl?&gt;" &gt;


&lt;param name= "CONTROLS" value= "Imagewindow" &gt;


&lt;param name= "CONSOLE" value= "Clip1" &gt;


&lt;param name= "LOOP" value= "0" &gt;


&lt;param name= "numloop" value= "0" &gt;


&lt;param name= "CENTER" value= "0" &gt;


&lt;param name= "maintainaspect" value= "0" &gt;


&lt;param name= "BackgroundColor" value= "#000000" &gt;&lt;embed src= "4.rpm" type= "Audio/x-pn-realaudio-plugin" "Clip1" controls= "Imagewindow" height= "console=" width= "352" autostart= "false" &gt;


&lt;/object&gt;&lt;br&gt;


&lt;object id= "video" classid= "CLSID:CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA" height= "width=" Center "&gt;


&lt;param name= "_extentx" value= "9260" &gt;


&lt;param name= "_extenty" value= "1058" &gt;


&lt;param name= "AUTOSTART" value= "1" &gt;


&lt;param name= "SHUFFLE" value= "0" &gt;


&lt;param name= "PREFETCH" value= "0" &gt;


&lt;param name= "nolabels" value= "0" &gt;


&lt;param name= "CONTROLS" value= "Controlpanel,statusbar" &gt;


&lt;param name= "CONSOLE" value= "Clip1" &gt;


&lt;param name= "LOOP" value= "0" &gt;


&lt;param name= "numloop" value= "0" &gt;


&lt;param name= "CENTER" value= "0" &gt;


&lt;param name= "maintainaspect" value= "0" &gt;


&lt;param name= "BackgroundColor" value= "#000000" &gt;&lt;embed type= "Audio/x-pn-realaudio-plugin" CONSOLE= "Clip1" "Controlpanel,statusbar" height= "controls=" width= "275" autostart= "false" &gt;


&lt;/object&gt;


 

<?php


}elseif (Eregi (". swf$", $movieurl)) {
Flash played

?>
<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>

?
}
?>

Related Article

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.