一、主页面(采用jsp实现) <%@ page language="java" contentType="text/html; charset=gb2312" pageEncoding="gb2312"%> <%@page import="org.accp.jwebplayer.biz.MusicBiz"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>Insert title here</title> <mce:script type="text/javascript"><!-- //保存当前播放曲目在列表中的索引 var index = 0; //var timer = null; function $(oid){ return document.getElementById(oid); } //到指定位置播放 function playposition() { $('wmp').controls.currentPosition = parseFloat($("position").value); $("position").value = "1.0"; } function showMusicInfo(){ $('spnCurrentMediaName').innerText = $('wmp').currentMedia.name; $('spnCurrentMediaDuration').innerText = $('wmp').currentMedia.durationString; $('spnCurrentMediaWidth').innerText = $('wmp').currentMedia.imageSourceWidth; $('spnCurrentMediaHeight').innerText = $('wmp').currentMedia.imageSourceHeight; $('spnCurrentMediaMarkerCount').innerText=$('wmp').currentMedia.markerCount; $('spnCurrentSourceURL').innerText = $('wmp').currentMedia.sourceURL; } //下一首 function next(){ if (index<$('playList').options.length-1){ index++; $('wmp').URL=$('playList').options[index].value; $('playList').selectedIndex=index; showMusicInfo(); } } //上一首 function pre(){ if (index>0){ index--; $('wmp').URL=$('playList').options[index].value; $('playList').selectedIndex=index; showMusicInfo(); } } //检查播放器的状态 //function checkState(){ // if ($('wmp').playState==1){ // next(); // } // window.setTimeout("checkState()",2000); //} //当浏览器加载完毕之后播放列表里面的第一首歌曲 window.οnlοad=function(){ $('wmp').URL=$('playList').valu