我只是想知道我应该使用哪种音频播放器来允许我的访问者在我的基于PHP的网站上播放音频文件。
谢谢!
答案 0 :(得分:2)
试试这个
<?php
$path = "PATH OF YOUR AUDIO FILE";
$image = "PATH OF YOUR IMAGEFILE";;?>
<div class="demomain">
<br>
<div style="margin: 0 0 0 30px;" id="mediaspace" name="mediaspace"><embed height="395" width="500" flashvars="javascriptid=JW&autostart=false&width=500&height=395&image=<?php echo $image; ?>&file=<?php echo $path; ?>" allowfullscreen="true" wmode="transparent" allowscriptaccess="always" quality="high" name="JW" id="JW" style="undefined" src="http://player.longtailvideo.com/player4.6.swf" type="application/x-shockwave-flash"> </div>
<?php
echo '<script type="text/javascript">
var s1 = new SWFObject("","JW","500","395","9");
s1.addParam("allowscriptaccess", "always");
s1.addParam("wmode","transparent");
s1.addParam("allowfullscreen","true");
s1.addVariable("javascriptid", "JW");
s1.addVariable("autostart","false");
s1.addVariable("image","' . $image . '"));
s1.addVariable("width","500");
s1.addVariable("height","395");';
echo 's1.addVariable("file","' . $path . '");';
echo 's1.write("mediaspace");';
echo '</script>';
?>
</div>
答案 1 :(得分:2)
HTML 5有一个音频播放器标签,请看: http://www.w3schools.com/html5/att_audio_src.asp 主流浏览器支持它,但它取决于音频文件的格式
你可以看到:http://jplayer.org/一个jquery,
答案 2 :(得分:1)
开源jPlayer运行良好且可自定义 - 使用HTML / CSS作为界面。如果可以,将使用HTML5,否则将回退到Flash。需要jQuery。
答案 3 :(得分:0)
试试这个
<object height="81" width="100%">
<param name="movie" value="http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F32222617&show_comments=true&auto_play=true">
</param>
<param name="allowscriptaccess" value="always"></param>
<embed allowscriptaccess="always" height="81" src="http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F32222617&show_comments=true&auto_play=true&repeat=1" type="application/x-shockwave-flash" width="100%" loop="yes" autoresume="1" repeat="1">
</embed>
</object>
答案 4 :(得分:0)
您可以尝试使用Flash Player。我认为它符合您的要求。当然你应该安装了flash播放器,但几乎所有互联网用户都在他们的机器上安装了flash播放器。
答案 5 :(得分:0)