页面mp3播放器作

HTML代码:
<div>
<!-- 隐藏播放器,设置高宽为0-->
<object  name="playerIE"  classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"
codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,02,902"
standby="Loading Microsoft Windows Media Player..." type="application/x-oleobject" width="220" height="40" >
  	<param name="FileName" value="">
	<param name="autoStart" value="true">
	<param name="showControls" value="true">
	<!-- 自动重复 -->
	<param name="loop" value="false">
  <embed id="playerFF" src="audio/niftyPlayer.swf?file=''" width="220" height="40"  type="application/x-shockwave-flash"  pluginspage="http://www.macromedia.com/go/getflashplayer"> </embed>
</object>
</div>

<button onclick="Play();">Play</button>


控制脚本:
function Play(){

	var isIE = navigator.appName.indexOf("Microsoft");
	var player = 'audio/niftyPlayer.swf';
	function changeMusic(musicUrl){
		var media ;
		if(isIE < 0){
			media = document.getElementById("playerFF");
			//(参数由所使用的flash播放器决定):audio/niftyPlayer.swf?file=music02.mp3&as=1;
			media.src = player + '?file=' + musicUrl + '&as=1';
		}
		else{
			media = window.playerIE;
			media.setAttribute('FileName',musicUrl);
		}	
	};
	changeMusic('audio/yu.mp3');
};

存在问题:
1.在FF下,由于使用的是niftyPlayer。swf播放器,无法重复播放。
2.不支持歌词。

你可能感兴趣的:(html,脚本,Microsoft,Flash)