在web开发中经常会碰到一些简单的视频播放功能,但现在的视频格式不同,并且可以动态增加,所以我们就必须把视频保存到数据哦,好了下面我们来看我写的段简单的 php视频网页播放器代码吧。
复制代码 代码如下:
<?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']."' ");
//控制下载
$url2="admin/";//存放软件的路径
if($localaddress)
{
$newname=$localaddress;
$movieurl=$url2.$newname;
}
?>
<html>
<head>
<title><?=$title?>-在线播放 jb51.net</title>
</head>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0">
<?php
//MediaPlayer播放
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="/UploadFiles/2021-04-02/"></embed>
</object>
<?php
}elseif(eregi(".ra$",$movieurl)|| eregi(".mp3$",$movieurl) || eregi(".rm$",$movieurl) || eregi(".ram$",$movieurl) ){
//RealPlayer播放的
?>
<object ID="video" CLASSID="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" HEIGHT="280" WIDTH="350" 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" CONSOLE="Clip1" CONTROLS="ImageWindow" HEIGHT="240" WIDTH="352" AUTOSTART="false">
</object><br>
<object ID="video" CLASSID="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" HEIGHT="40" WIDTH="350" 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" CONTROLS="ControlPanel,StatusBar" HEIGHT="60" WIDTH="275" AUTOSTART="false">
</object>
<?php
}elseif(eregi(".swf$",$movieurl)) {
//flashplayer播放的
?>
<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="350" height="280">
<param name="movie" value="<?=$movieurl?>">
<param name="quality" value="High">
<embed src="/UploadFiles/2021-04-02/<?=$movieurl?>"></object>
<?
}
?>
复制代码 代码如下:
<?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']."' ");
//控制下载
$url2="admin/";//存放软件的路径
if($localaddress)
{
$newname=$localaddress;
$movieurl=$url2.$newname;
}
?>
<html>
<head>
<title><?=$title?>-在线播放 jb51.net</title>
</head>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0">
<?php
//MediaPlayer播放
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="/UploadFiles/2021-04-02/"></embed>
</object>
<?php
}elseif(eregi(".ra$",$movieurl)|| eregi(".mp3$",$movieurl) || eregi(".rm$",$movieurl) || eregi(".ram$",$movieurl) ){
//RealPlayer播放的
?>
<object ID="video" CLASSID="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" HEIGHT="280" WIDTH="350" 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" CONSOLE="Clip1" CONTROLS="ImageWindow" HEIGHT="240" WIDTH="352" AUTOSTART="false">
</object><br>
<object ID="video" CLASSID="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" HEIGHT="40" WIDTH="350" 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" CONTROLS="ControlPanel,StatusBar" HEIGHT="60" WIDTH="275" AUTOSTART="false">
</object>
<?php
}elseif(eregi(".swf$",$movieurl)) {
//flashplayer播放的
?>
<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="350" height="280">
<param name="movie" value="<?=$movieurl?>">
<param name="quality" value="High">
<embed src="/UploadFiles/2021-04-02/<?=$movieurl?>"></object>
<?
}
?>
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
暂无评论...
更新日志
2024年11月25日
2024年11月25日
- 凤飞飞《我们的主题曲》飞跃制作[正版原抓WAV+CUE]
- 刘嘉亮《亮情歌2》[WAV+CUE][1G]
- 红馆40·谭咏麟《歌者恋歌浓情30年演唱会》3CD[低速原抓WAV+CUE][1.8G]
- 刘纬武《睡眠宝宝竖琴童谣 吉卜力工作室 白噪音安抚》[320K/MP3][193.25MB]
- 【轻音乐】曼托凡尼乐团《精选辑》2CD.1998[FLAC+CUE整轨]
- 邝美云《心中有爱》1989年香港DMIJP版1MTO东芝首版[WAV+CUE]
- 群星《情叹-发烧女声DSD》天籁女声发烧碟[WAV+CUE]
- 刘纬武《睡眠宝宝竖琴童谣 吉卜力工作室 白噪音安抚》[FLAC/分轨][748.03MB]
- 理想混蛋《Origin Sessions》[320K/MP3][37.47MB]
- 公馆青少年《我其实一点都不酷》[320K/MP3][78.78MB]
- 群星《情叹-发烧男声DSD》最值得珍藏的完美男声[WAV+CUE]
- 群星《国韵飘香·贵妃醉酒HQCD黑胶王》2CD[WAV]
- 卫兰《DAUGHTER》【低速原抓WAV+CUE】
- 公馆青少年《我其实一点都不酷》[FLAC/分轨][398.22MB]
- ZWEI《迟暮的花 (Explicit)》[320K/MP3][57.16MB]