PHP的MP3播放器

类别:编程语言 点击:0 评论:0 推荐:

//play.php

<object classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width=300 height=300 hspace="0" vspace="0" align="top" id=video1 style="LEFT: 0px; TOP: 0px">

<param name="_ExtentX" value="5556">

<param name="_ExtentY" value="1588">

<param name="AUTOSTART" value="-1">

<param name="SHUFFLE" value="0">

<param name="PREFETCH" value="0">

<param name="NOLABELS" value="0">

 

//重点是这句

 

<param name="SRC" value="fileselect.php?file_name=hh.mp3">

//

 

<param name="CONTROLS" value="Imagewindow,StatusBar,ControlPanel">

<param name="CONSOLE" value="RAPLAYER">

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

</object>

 

//fileselect.php

<?php

$path = "D://My Music/";

//我把音乐文件放到的wwwroot外的文件夹下。

 

$filesize = filesize($path.$file_name);

 

header("Content-type: audio/mpeg");

header("Content-length: $filesize");

readfile($path.$file_name);

 

?>

本文地址:http://com.8s8s.com/it/it28056.htm