<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gbk" />
<title>mp3 music player</title>
<script src="../jquery-1.5.1.js" type="text/javascript"></script>
<script type="text/javascript">
var musiclist = ["1.wav","Jailsalmer.wav","3.wav"];
var playerhandler = "";
var currentmusic = 0;
function addSeletedSongToPlayList( index)
{
var Player = document.getElementById("Player");
var total = musiclist.length;
var i = 1;
playerhandler = setInterval(function(){
if (Player.playState == 1)
{
console.debug("i:"+i);
if(i>total) i = 0;
Player.controls.stop();
Player.URL = musiclist[i];
Player.controls.play();
currentmusic = i;
i++;
}
}, 1000);
}
function stopwmp()
{
var Player = document.getElementById("Player");
clearTimeout(playerhandler);
Player.controls.stop();
}
function closeWin()
{
window.opener=null;
window.open('','_self');
window.close();
}
function getMusicList(i) {
var Player = document.getElementById("Player");
Player.controls.stop();
Player.URL = musiclist[i];
Player.controls.play();
addSeletedSongToPlayList();
}
/*
str +='<object id="wmplayer" width="200" height="30" attr1="attrValue1" ';
str +='type="application/x-oleobject" ';
str +='classid="clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6"> ';
str +='<param name="url" value="c:\musicss\test1\爱很简单.mp3"> ';
str +='<param name="autostart" value="0"> ';
str +='</object> ';
*/
function musictypesuccess(res)
{
var str = "";
for(var i=0; i<res.length; i++)
{
str +='<div><a href="javascript:void(0)" οnclick=\'getMusicList("'+i+'")\'>'+res[i]+'</a></div>';
}
$("#menu").html(str);
}
function getMusicType() {
musictypesuccess(musiclist);
}
$(document).ready(function() {
//window.open("index.html","_SELF",
//"fullscreen=no,height=400,width=800,status=no,toolbar=no,menubar=no,location=no,resizable=no");
getMusicType();
$("#stopwmp").click(function(){
stopwmp();
});
$("#closewmp").click(function(){
closeWin();
});
});
</script>
</head>
<body>
<div id="container">
<div id="menu"></div>
<div id="media">
<object id="Player" width="100%" height="64" type="application/x-ms-wmp">
<param name="URL" value="">
<param name="autoStart" value="true">
<param name="balance" value="0">
<param name="baseURL" value>
<param name="captioningID" value>
<param name="currentPosition" value="0">
<param name="currentMarker" value="0">
<param name="defaultFrame" value>
<param name="enabled" value="1">
<param name="enableErrorDialogs" value="0">
<param name="enableContextMenu" value="1">
<param name="fullScreen" value="0">
<param name="invokeURLs" value="1">
<param name="mute" value="0">
<param name="playCount" value="1">
<param name="rate" value="1">
<param name="SAMIStyle" value>
<param name="SAMILang" value>
<param name="SAMIFilename" value>
<param name="stretchToFit" value="0">
<param name="uiMode" value="full">
<param name="volume" value="100">
<param name="windowlessVideo" value="0">
</object>
<input type="button" name="stopwmp" id="stopwmp" value="停止"/>
<input type="button" name="closewmp" id="closewmp" value="关闭"/>
</div>
</div>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gbk" />
<title>mp3 music player</title>
<script src="../jquery-1.5.1.js" type="text/javascript"></script>
<script type="text/javascript">
var musiclist = ["1.wav","Jailsalmer.wav","3.wav"];
var playerhandler = "";
var currentmusic = 0;
function addSeletedSongToPlayList( index)
{
var Player = document.getElementById("Player");
var total = musiclist.length;
var i = 1;
playerhandler = setInterval(function(){
if (Player.playState == 1)
{
console.debug("i:"+i);
if(i>total) i = 0;
Player.controls.stop();
Player.URL = musiclist[i];
Player.controls.play();
currentmusic = i;
i++;
}
}, 1000);
}
function stopwmp()
{
var Player = document.getElementById("Player");
clearTimeout(playerhandler);
Player.controls.stop();
}
function closeWin()
{
window.opener=null;
window.open('','_self');
window.close();
}
function getMusicList(i) {
var Player = document.getElementById("Player");
Player.controls.stop();
Player.URL = musiclist[i];
Player.controls.play();
addSeletedSongToPlayList();
}
/*
str +='<object id="wmplayer" width="200" height="30" attr1="attrValue1" ';
str +='type="application/x-oleobject" ';
str +='classid="clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6"> ';
str +='<param name="url" value="c:\musicss\test1\爱很简单.mp3"> ';
str +='<param name="autostart" value="0"> ';
str +='</object> ';
*/
function musictypesuccess(res)
{
var str = "";
for(var i=0; i<res.length; i++)
{
str +='<div><a href="javascript:void(0)" οnclick=\'getMusicList("'+i+'")\'>'+res[i]+'</a></div>';
}
$("#menu").html(str);
}
function getMusicType() {
musictypesuccess(musiclist);
}
$(document).ready(function() {
//window.open("index.html","_SELF",
//"fullscreen=no,height=400,width=800,status=no,toolbar=no,menubar=no,location=no,resizable=no");
getMusicType();
$("#stopwmp").click(function(){
stopwmp();
});
$("#closewmp").click(function(){
closeWin();
});
});
</script>
</head>
<body>
<div id="container">
<div id="menu"></div>
<div id="media">
<object id="Player" width="100%" height="64" type="application/x-ms-wmp">
<param name="URL" value="">
<param name="autoStart" value="true">
<param name="balance" value="0">
<param name="baseURL" value>
<param name="captioningID" value>
<param name="currentPosition" value="0">
<param name="currentMarker" value="0">
<param name="defaultFrame" value>
<param name="enabled" value="1">
<param name="enableErrorDialogs" value="0">
<param name="enableContextMenu" value="1">
<param name="fullScreen" value="0">
<param name="invokeURLs" value="1">
<param name="mute" value="0">
<param name="playCount" value="1">
<param name="rate" value="1">
<param name="SAMIStyle" value>
<param name="SAMILang" value>
<param name="SAMIFilename" value>
<param name="stretchToFit" value="0">
<param name="uiMode" value="full">
<param name="volume" value="100">
<param name="windowlessVideo" value="0">
</object>
<input type="button" name="stopwmp" id="stopwmp" value="停止"/>
<input type="button" name="closewmp" id="closewmp" value="关闭"/>
</div>
</div>
</body>
</html>