2012-04-17 225 views

回答

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&amp;autostart=false&amp;width=500&amp;height=395&amp;image=<?php echo $image; ?>&amp;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> 
+0

如果在計算機上安裝了閃存(SWF)/可用於瀏覽器 – 2012-04-17 11:06:02

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&amp;show_comments=true&amp;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&amp;show_comments=true&amp;auto_play=true&amp;repeat=1" type="application/x-shockwave-flash" width="100%" loop="yes" autoresume="1" repeat="1"> 
    </embed> 
</object> 
0

你可以試試Flash播放器。我認爲它會滿足你的要求。當然,你應該安裝flash播放器,但幾乎所有的互聯網用戶都在他們的機器上安裝了flash播放器。

1

開源的jPlayer運行良好,而且是非常可定製的 - 使用HTML/CSS的界面。如果可以的話,將使用HTML5,如果不是,則回退到Flash。需要jQuery。

網站:http://jplayer.org/

0

使用本<audio controls><source src="<?php echo $pathtofile ?>" type="audio/mpeg">Error loading</audio>這對我的作品。