标签:
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
<script type="text/javascript">
function el(objname){
return document.getElementById(objname);
}
//添加歌曲到播放列表
function addmedia(url){
var playList = Player.currentPlayList;
var currentUrl = player.newMedia(url);
playList.appendItem(currMedia);
}
//清空播放列表
function clearLists(){
//返回列表中的歌曲数目
while(Play.currentPlayList.count>0){
var item = Player.currentPlayList.item(Play.currentPlayList.count-1);
Player.currentPlayList.removeitem(item);
}
}
function clearPlayList(){
clearLists();
var L_tb = el("tabPlayList");
var row_len = L_tb.rows.length;
for(var i;i<row_len;i++){
L_tb.firstChild.removeChild(L_tb.firstChild.childNodes[0]);
}
}
//清空媒体播放列表
function clearMediaList(){
var L_tb = el("tabMediaList");
var row_len =L_tb.rows.length;
for(var i;i<row_len;i++){
L_tb.firstChild.removeChild(L_tb.firstChild.childNodes[0]);
}
}
//播放选中歌曲
function addSelectedSongToPlayList(){
clearLists();
var L_tb = el("tabPlayList");
var row_len = L_tb.rows.length;
if(row_len == 0){
alert("There is no song");
return;
}
for(var i;i<row_len;i++){
var check = L_tb.rows[i].cell[0].childNodes[0];
var songName = L_tb.rows[i].cells[1].innerText;
if(check.checked == true){
addmedia(songName);
}
}
setPlayMode(el("setplay").options[el("setplay").selectedIndex].value);
Player.controls.play();
}
////添加文本输入框中的url到播放列表
function addUrlToList(){
//addmeida(document.getElementById("songUrl").value);
var L_tb = el("tabMediaList");
var row_len = L_tb.rows.length;
var tr = document.createElement("tr");
var td = document.createElement("td");
var strSong = el("songUrl").value;
var strHtml = strSong + " <a href=‘#‘ onclick=‘addSong("" + strSong + "");‘>添加</a>";
strHtml += " <a href=‘#‘ onclick=‘removeSong(this.parentElement.parentElement);‘>移除</a>";
td.innerHTML = strHtml;
tr.appendChild(td);
l_tb.firstChild.appendChild(tr);
el("songURL").value = "http://";
}
////添加文本输入框中的url到播放列表
function addSong(strSngName){
var L_tb = el("tabPlayList");
var row_len = L_tb.rows.length;
var tr = document.createElement("tr");
var td = document.createElement("td");
var strChecked = "<input type=‘checkbox‘ checked value=‘"+ strSongNameqwe+"‘>";
td.innerHTML = strChecked;
tr.appendChild(td);
td.innerHTML = strSngName;
tr.appendChild(td);
var strHTML = " <a href=‘#‘ onclick=‘removePlaySong(this.parentElement.parentElement)‘>remove</a>";
}
td.innerHTML = strHtml;
tr.appendChild(td;
tr.firstChild.appendChild(td);
}
//从媒体列表删除
function removeSong(tr){
var L_tb = el("tabMediaList");
L_tb.firstChild.removeChild(tr);
}
//从播放列表删除
function removePlaySong(tr){
var L_tb = el("tabPlayList");
L_tb.firstChild.removeChild(tr);
}
//到指定位置播放
function palyPosition(){
Player.controls.currentPosition = parseFloat(el("txtPosition").value);
el("txtPosition").value = "1.0";
}
function startMeup(){Player.controls.play()};
function startMeDown(){Player.controls.stop()};
function Next(){Player.controls.next()}
function Prev(){Player.controls.previous()}
function Forward(){Player.controls.fastForward()}
function reverse(){Player.controls.fastReverse()}
function SetPlayMode(value){Player.settings.setMode(value,true)}
function showMode(value){Player.uiMode=value;}
function ajustSound(){
if(event.srcElement.name=="turnup" && Player.settings.volume<=100)
{Player.settings.volume+=10}
if(event.srcElement.name=="turndown" && Player.settings.volume>=0)
{Player.settings.volume-=10}
}
</script>
<script type="text/javascript">
el("currentMediaName").innerText = Player.currentMedia.name;
el("currentMediaDuration").innerText = Player.currentMedia.durationString;
el("currentMediaWidth").innerText = Player.currentMedia.imageSourceWidth;
el("currentMediaHeight").innerText = Player.currentMedia.imageSourceHeight;
el("currentMediaMarkerCount").innerText = Player.currentMedia.markerCount;
el("currentSourceURL").innerText = Player.currentMedia.sourceURL;
</script>
</head>
<body>
<object id = "player" width="400px" height="400px" classid="CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6">
<param value="URL" name="test.vmv">
<param value="1" name="autoStart">
<param value="0" name="balance">
<param value name="baseUrl">
<param value name="captioningID">
<param value="0" name="currentPosition">
<param value="0" name="currentMarker">
<param value="0" name="defaultFrame">
<param value="1" name="enabled">
<param value="0" name="enableErrorDialogs">
<param value="1" name="enableContentMenu">
<param value="1" name="invokeUrls">
<param value="0" name="mute">
<param value="1" name="playCount">
<param value="1" name="rate">
<param value name="SAMIStyle">
<param value name="SAMILang">
<param value name="SAMIFilename">
<param value="0" name="stretchToFit">
<param value="full" name="uiMode">
<param value="100" name="volume">
<param value="0" name="windowlessVideo">
</object>
<br>
<input type="button" value="