注:此范例转子 红叶的blog: http://blog.csdn.net/redleaf1995/archive/2008/03/12/2174122.aspx
此范例界面较为简单,支持播放列表 。建立播放列表的步骤为:
1)在文本框中输入媒体资源的地址,可以是HTTP地址,相对地址和绝对地址
2)点击“添加到媒体列表”按钮,将媒体资源信息放到媒体列表中
3)在媒体列表中,点击“添加”链接,将媒体加入到播放列表中
4)重复若干遍,加入所有歌曲
5)点击“播放选中的歌曲“,就开始播放 播放列表中的所有打勾的媒体文件
6)循环播放,部分代码贴出来了,但此范例没有实现此功能
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
<script language="JavaScript">...
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
function el(objname)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return document.getElementById(objname);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//增加一首歌到播放器列表,这样,播放器放完一首歌之后,会继续放下一首
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
function addmedia(url)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
// 取得当前的播放列表
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var playlist=Player.currentPlaylist;//新建一个指定URL的Media。
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var currMedia = Player.newMedia(url);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//把新建的Media item添加到播放器列表
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
playlist.appendItem(currMedia);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
function clearlist()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//Player.currentPlaylist.count返回列表中的歌曲数量
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
while(Player.currentPlaylist.count>0)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var item =Player.currentPlaylist.item(Player.currentPlaylist.count-1);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Player.currentPlaylist.removeItem(item); //从播放列表中删除项
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//清空播放列表
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
function clearPlaylist()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
clearlist();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var l_tb = el("tabPlayList");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var row_len = l_tb.rows.length;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
for(var i = 0; i < row_len; i++)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
l_tb.firstChild.removeChild(l_tb.firstChild.childNodes[0]);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//清空媒体列表
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
function clearMedialist()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var l_tb = el("tabMediaList");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var row_len = l_tb.rows.length;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
for(var i = 0; i < row_len; i++)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
l_tb.firstChild.removeChild(l_tb.firstChild.childNodes[0]);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//播放选中的歌曲
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
function addSeletedSongToPlayList()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
clearlist();
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var l_tb = el("tabPlayList");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var row_len = l_tb.rows.length;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(row_len == 0)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//alert("无歌曲");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
return;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
for(var i=0;i<row_len;i++)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var check = l_tb.rows[i].cells[0].childNodes[0];
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var songname = l_tb.rows[i].cells[1].innerText;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(check.checked==true)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
addmedia(songname);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
SetPlayMode(el("setplay").options[el("setplay").selectedIndex].value)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Player.controls.play(); //让播放器开始播放
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//添加文本输入框中的url到播放列表
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
function addUrlToList()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//addmedia(document.getElementById("songURL").value );
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var l_tb = el("tabMediaList");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var row_len = l_tb.rows.length;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var tr = document.createElement("tr");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var td = document.createElement("td");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var strSong = el("songURL").value;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var strHtml = strSong + " <a href='#' οnclick='addSong("" + strSong + "");'>添加</a>";
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
strHtml += " <a href='#' οnclick='removeSong(this.parentElement.parentElement);'>移除</a>";
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
td.innerHTML = strHtml;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
tr.appendChild(td);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
l_tb.firstChild.appendChild(tr);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
el("songURL").value = "http://";
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//添加文本输入框中的url到播放列表
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
function addSong(strSongName)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var l_tb = el("tabPlayList");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var row_len = l_tb.rows.length;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var tr = document.createElement("tr");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var td = document.createElement("td");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var strChecked = "<input type='checkbox' checked value='" + strSongName + "'>";
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
td.innerHTML = strChecked;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
tr.appendChild(td);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
td = document.createElement("td");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
td.innerHTML = strSongName;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
tr.appendChild(td);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
td = document.createElement("td");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var strHtml = " <a href='#' οnclick='removePlaySong(this.parentElement.parentElement);'>移除</a>";
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
td.innerHTML = strHtml;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
tr.appendChild(td);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
l_tb.firstChild.appendChild(tr);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//从媒体列表删除
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
function removeSong(tr)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var l_tb = el("tabMediaList");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
l_tb.firstChild.removeChild(tr);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//从播放列表删除
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
function removePlaySong(tr)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
var l_tb = el("tabPlayList");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
l_tb.firstChild.removeChild(tr);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
//到指定位置播放
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
function playposition()
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
Player.controls.currentPosition = parseFloat(el("txtPosition").value);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
el("txtPosition").value = "1.0";
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
function StartMeUp()...{Player.controls.play()}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
function ShutMeDown()...{Player.controls.stop()}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
function Pause()...{Player.controls.pause()}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
function Next()...{Player.controls.next()}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
function Prev()...{Player.controls.previous()}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
function Forward()...{Player.controls.fastForward()}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
function reverse()...{Player.controls.fastReverse()}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
function SetPlayMode(value)...{Player.settings.setMode(value,true)}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
function ChangeuiMode(value)...{Player.uiMode=value;}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
function AjustSound()...{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(event.srcElement.name=="turnup" && Player.settings.volume<=100)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{Player.settings.volume+=10}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(event.srcElement.name=="turndown" && Player.settings.volume>=0)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif)
...{Player.settings.volume-=10}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</script>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif)
<SCRIPT LANGUAGE = "JScript" FOR = "Player" EVENT = "MediaChange">...
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
el("spnCurrentMediaName").innerText = Player.currentMedia.name;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
el("spnCurrentMediaDuration").innerText = Player.currentMedia.durationString;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
el("spnCurrentMediaWidth").innerText = Player.currentMedia.imageSourceWidth;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
el("spnCurrentMediaHeight").innerText = Player.currentMedia.imageSourceHeight;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
el("spnCurrentMediaMarkerCount").innerText = Player.currentMedia.markerCount;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
el("spnCurrentSourceURL").innerText = Player.currentMedia.sourceURL;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</SCRIPT>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<object id="Player" width=300 height=300 classid="CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<param name="URL" value="test.wmv">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<param name="autoStart" value="1">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<param name="balance" value="0">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<param name="baseURL" value>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<param name="captioningID" value>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<param name="currentPosition" value="0">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<param name="currentMarker" value="0">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<param name="defaultFrame" value="0">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<param name="enabled" value="1">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<param name="enableErrorDialogs" value="0">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<param name="enableContextMenu" value="1">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<param name="fullScreen" value="0">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<param name="invokeURLs" value="1">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<param name="mute" value="0">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<param name="playCount" value="1">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<param name="rate" value="1">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<param name="SAMIStyle" value>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<param name="SAMILang" value>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<param name="SAMIFilename" value>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<param name="stretchToFit" value="0">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<param name="uiMode" value="full">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<param name="volume" value="100">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<param name="windowlessVideo" value="0">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</object>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<br>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<INPUT TYPE="BUTTON" NAME="BtnPlay" VALUE="播放" OnClick="StartMeUp()">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<INPUT TYPE="BUTTON" NAME="BtnStop" VALUE="停止" OnClick="ShutMeDown()">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<input type="BUTTON" name="BtnPause" value="暂停" onClick="Pause()">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<label>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<input name="turnup" type="button" id="turnup" value="+" onClick="AjustSound()">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
调节声音
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</label>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<input name="turndown" type="button" id="turndown" value="-" onClick="AjustSound()">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<br>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<input type="BUTTON" name="BtnNext" value="下一个" onClick="Next()">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<input type="BUTTON" name="BtnPrev" value="前一个" onClick="Prev()">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<INPUT TYPE="BUTTON" NAME="BtnForw" VALUE="快进" OnClick="Forward()">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<INPUT TYPE="BUTTON" NAME="BtnReve" VALUE="快退" OnClick="reverse()">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<br>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<label>播放模式</label>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<select id="setplay" name="setplay" onChange="SetPlayMode(this.options[this.selectedIndex].value)">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<option value="loop" >循环播放</option>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<option value="shuffle">随机播放</option>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</select>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<label>显示模式</label>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<select name="Changeui" onChange="ChangeuiMode(this.options[this.selectedIndex].value)">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<option value="none">none</option>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<option value="mini">mini</option>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<option value="invisible">invisible</option>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<option value="full" selected>full</option>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</select>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<br><br><br><br>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
媒体列表:<br>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<div id = "divMediaList">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<table id="tabMediaList">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</table>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</div>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<br>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
播放列表:<br>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<div id="divPlayList">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<table id="tabPlayList">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</table>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
</div>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<br>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
当前播放媒体信息:<br>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
名称:<span id="spnCurrentMediaName"></span><br>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
长度:<span id="spnCurrentMediaDuration"></span>秒<br>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
宽度:<span id="spnCurrentMediaWidth"></span>像素<br>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
高度:<span id="spnCurrentMediaHeight"></span>像素<br>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
标志数:<span id="spnCurrentMediaMarkerCount"></span><br>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
源地址:<span id="spnCurrentSourceURL"></span><br>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<br>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<br>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<INPUT TYPE = "BUTTON" ID = "play" Name="play" VALUE = "播放选中的歌曲" onClick = "addSeletedSongToPlayList();">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<INPUT TYPE = "BUTTON" ID = "clear" Name="clear" VALUE = "清空播放列表" onClick = "clearPlaylist();">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<INPUT TYPE = "BUTTON" ID = "clear" Name="clear" VALUE = "清空媒体列表" onClick = "clearMedialist();">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<br>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<input type="Text" name="songURL" value ="http://" size="33">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<INPUT TYPE = "BUTTON" ID = "add" Name="add" VALUE = "添加到媒体列表" onClick = "addUrlToList();">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<br>可输入:1)HTTP地址: 如http://www.aaa.com/xxx.mp3
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<br>2).相对位置: 如yyy.wmv
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<br>3).绝对位置: 如file:///D:/bbb/zzz.wma
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<br>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<br>
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<input type="button" onclick="alert(Player.versionInfo);" value="播放器版本">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<input type="button" onclick="alert(Player.controls.currentPosition);" value="获取当前位置">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
跳到<input type="text" id="txtPosition" size="5" value="1.0">秒播放
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
<input type="button" onclick="playposition();" value="确定">
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)