你的位置:| 首页网站建设歌词同步的播放器→文章正文  
文章导航


歌词同步的播放器

<html>
<head>
<title>歌词同步的播放器</title>
<meta http-equiv="content-Type" content="text/html;charset=gb2312">
<!--把下面代码加到<head>与</head>之间-->
<style type="text/css">
body{font-size:12px;line-height:20px;margin-top:5px;margin-right:0px;margin-bottom:0px;margin-left:0px;}
td{font-size:12px;line-height:20px;}
#lrcollbox td, #lrcollbox font{font-size:12px;}
#lrcoll td{color:#0080C0;cursor:default;}
#lrcbox{color:#00FF00;}
#lrcfilter{filter:alpha(opacity=0);}
#lrcbc{color:#00FF00;}
</style>
</head>
<body>
<!--把下面代码加到<body>与</body>之间-->
<table border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td width="360" valign="top"><object classid="clsid:6bf52a52-394a-11d3-b153-00c04f79faa6" id="yyqqplayer" width="360" height="45">
<param name="AutoStart" value="-1">
<param name="url" value="music/geqi/soft/dsangdn.mp3">
<param name="volume" value="100">
<param name="enablecontextmenu" value="0">
<param name="enableerrordialogs" value="0">
<param name="PlayCount" value="10">
</object><br>
<div style="background-color:#000000; padding-left:1em;"><a style="color:#00FFFF" href="javascript:copyToClipBoard('lrcdata');">把歌词复制到剪贴板</a></div>
<div id="lrcollbox" style="overflow:hidden; height:260; width:360; background-color:#000000;">
<table border="0" cellspacing="0" cellpadding="0" width="100%" id="lrcoll" style="position:relative; top: -20px;" oncontextmenu="return false;">
<tr>
<td nowrap height="20" align="center" id="lrcwt1"></td>
</tr>
<tr>
<td nowrap height="20" align="center" id="lrcwt2"></td>
</tr>
<tr>
<td nowrap height="20" align="center" id="lrcwt3"></td>
</tr>
<tr>
<td nowrap height="20" align="center" id="lrcwt4"></td>
</tr>
<tr>
<td nowrap height="20" align="center" id="lrcwt5"></td>
</tr>
<tr>
<td nowrap height="20" align="center" id="lrcwt6"></td>
</tr>
<tr>
<td nowrap height="20" align="center">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td nowrap height="20"><span id="lrcwt7" style="height:20"></span></td>
</tr>
<tr style="position:relative; top: -20px; z-index:6">
<td nowrap height="20">
<div id="lrcfilter" style="overflow:hidden; width:100%; color:#00FF00; height:20"></div>
</td>
</tr>
</table>
</td>
</tr>
<tr style="position:relative; top: -20px">
<td nowrap height="20" align="center">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td nowrap height="20"><span id="lrcbox" style="height:20">lrc歌词加载中……</span></td>
</tr>
<tr style="position:relative; top: -20px; z-index:6;">
<td nowrap height="20">
<div id="lrcbc" style="overflow:hidden; height:20; width:0;"></div>
</td>
</tr>
</table>
</td>
</tr>
<tr style="position:relative; top: -40px;">
<td nowrap height="20" align="center" id="lrcwt8"></td>
</tr>
<tr style="position:relative; top: -40px;">
<td nowrap height="20" align="center" id="lrcwt9"></td>
</tr>
<tr style="position:relative; top: -40px;">
<td nowrap height="20" align="center" id="lrcwt10"></td>
</tr>
<tr style="position:relative; top: -40px;">
<td nowrap height="20" align="center" id="lrcwt11"></td>
</tr>
<tr style="position:relative; top: -40px;">
<td nowrap height="20" align="center" id="lrcwt12"></td>
</tr>
<tr style="position:relative; top: -40px;">
<td nowrap height="20" align="center" id="lrcwt13"></td>
</tr>
</table>
</div>
</td>
</tr>
</table>
<span id="lrcdata">
<!--
[00:04.40]
[00:15.53]
[00:16.85]就算前世没有过约定
[00:22.24]今生我们都曾痴痴等
[00:28.87]茫茫人海走到一起算不算缘份
[00:35.55]何不把往事看淡在风尘
[00:42.26]只为相遇那一个眼神
[00:48.97]彼此敞开那一扇心门
[00:55.56]风雨走过千山万水依然那样真
[01:02.27]只因有你陪我这一程
[01:08.91]多少旅途多少牵挂的人
[01:17.70]多少爱会感动这一生
[01:22.15]只有相爱相知相依相偎的两个人
[01:28.87]才能相伴走过风雨旅程
[01:35.48]多少故事多少想念的人
[01:42.15]多少情会牵绊这一生
[01:48.80]只有相爱相知相依相偎的两个人
[01:55.47]才能搀扶走过这一生
[02:01.71]
[02:29.11]就算前世没有过约定
[02:35.46]今生我们都曾痴痴等
[02:42.23]茫茫人海走到一起算不算缘份
[02:48.77]何不把往事看淡在风尘
[02:51.34]只为相遇那一个眼神
[03:02.13]彼此敞开那一扇心门
[03:08.76]风雨走过千山万水依然那样真
[03:15.40]只因有你陪我这一程
[03:21.80]多少旅途多少牵挂的人
[03:28.84]多少爱会感动这一生
[03:35.57]只有相爱相知相依相偎的两个人
[03:42.09]才能相伴走过风雨旅程
[03:48.79]多少故事多少想念的人
[03:55.50]多少情会牵绊这一生
[04:02.15]只有相爱相知相依相偎的两个人
[04:08.78]才能搀扶走过这一生
[04:15.53]多少旅途多少牵挂的人
[04:22.16]多少爱会感动这一生
[04:28.99]只有相爱相知相依相偎的两个人
[04:35.48]才能相伴走过风雨旅程
[04:42.12]多少故事多少想念的人
[04:48.84]多少情会牵绊这一生
[04:55.54]只有相爱相知相依相偎的两个人
[05:02.14]才能搀扶走过这一生
[05:09.63]
-->
</span>
<script language="JavaScript">
var lrc0;
var lrc1;
var min;
lrcobj = new lrcClass(lrcdata.innerHTML.slice(4,-3));
function lrcClass(tt)
{
this.inr = [];
this.min = [];
this.oTime = 0;
this.dts = -1;
this.dte = -1;
this.dlt = -1;
this.ddh;
this.fjh;
lrcbc.style.width = 0;
if(/\[offset\:(\-?\d+)\]/i.test(tt))
this.oTime = RegExp.$1/1000;
tt = tt.replace(/\[\:\][^$\n]*(\n|$)/g,"$1");
tt = tt.replace(/\[[^\[\]\:]*\]/g,"");
tt = tt.replace(/\[[^\[\]]*[^\[\]\d]+[^\[\]]*\:[^\[\]]*\]/g,"");
tt = tt.replace(/\[[^\[\]]*\:[^\[\]]*[^\[\]\d\.]+[^\[\]]*\]/g,"");
tt = tt.replace(/<[^<>]*[^<>\d]+[^<>]*\:[^<>]*>/g,"");
tt = tt.replace(/<[^<>]*\:[^<>]*[^<>\d\.]+[^<>]*>/g,"");
while(/\[[^\[\]]+\:[^\[\]]+\]/.test(tt))
{
tt = tt.replace(/((\[[^\[\]]+\:[^\[\]]+\])+[^\[\r\n]*)[^\[]*/,"\n");
var zzzt = RegExp.$1;
/^(.+\])([^\]]*)$/.exec(zzzt);
var ltxt = RegExp.$2;
var eft = RegExp.$1.slice(1,-1).split("][");
for(var ii=0; ii<eft.length; ii++)
{
var sf = eft[ii].split(":");
var tse = parseInt(sf[0],10) * 60 + parseFloat(sf[1]);
var sso = { t:[] , w:[] , n:ltxt }
sso.t[0] = tse-this.oTime;
this.inr[this.inr.length] = sso;
}
}
this.inr = this.inr.sort( function(a,b){return a.t[0]-b.t[0];} );
for(var ii=0; ii<this.inr.length; ii++)
{
while(/<[^<>]+\:[^<>]+>/.test(this.inr[ii].n))
{
this.inr[ii].n = this.inr[ii].n.replace(/<(\d+)\:([\d\.]+)>/,"%=%");
var tse = parseInt(RegExp.$1,10) * 60 + parseFloat(RegExp.$2);
this.inr[ii].t[this.inr[ii].t.length] = tse-this.oTime;
}
lrcbc.innerHTML = "<font>"+ this.inr[ii].n.replace(/&/g,"&").replace(/</g,"<").replace
(/>/g,">").replace(/%=%/g,"</font><font>") +"</font>";
var fall = lrcbc.getElementsByTagName("font");
for(var wi=0; wi<fall.length; wi++)
this.inr[ii].w[this.inr[ii].w.length] = fall[wi].offsetWidth;
this.inr[ii].n = lrcbc.innerText;
}
for(var ii=0; ii<this.inr.length-1; ii++)
this.min[ii] = Math.floor((this.inr[ii+1].t[0]-this.inr[ii].t[0])*10);
this.min.sort(function(a,b){return a-b});
min = this.min[0]/2;
this.run = function(tme)
{
if(tme<this.dts || tme>=this.dte)
{
var ii;
for(ii=this.inr.length-1; ii>=0 && this.inr[ii].t[0]>tme; ii--){}
if(ii<0) return;
this.ddh = this.inr[ii].t;
this.fjh = this.inr[ii].w;
this.dts = this.inr[ii].t[0];
this.dte = (ii<this.inr.length-1)?this.inr[ii+1].t[0]:yyqqplayer.currentMedia.duration;
lrcwt1.innerText = this.retxt(ii-7);
lrcwt2.innerText = this.retxt(ii-6);
lrcwt3.innerText = this.retxt(ii-5);
lrcwt4.innerText = this.retxt(ii-4);
lrcwt5.innerText = this.retxt(ii-3);
lrcwt6.innerText = this.retxt(ii-2);
lrcwt7.innerText = this.retxt(ii-1);
lrcfilter.innerText = this.retxt(ii-1);
lrcwt8.innerText = this.retxt(ii+1);
lrcwt9.innerText = this.retxt(ii+2);
lrcwt10.innerText = this.retxt(ii+3);
lrcwt11.innerText = this.retxt(ii+4);
lrcwt12.innerText = this.retxt(ii+5);
lrcwt13.innerText = this.retxt(ii+6);
this.print(this.retxt(ii));
if(this.dlt==ii-1)
{
clearTimeout(lrc0);
if(lrcoll.style.pixelTop!=0) lrcoll.style.top = 0;
golrcoll(0);
clearTimeout(lrc1);
lrcfilter.filters.alpha.opacity = 100;
golrcolor(0);
}
else if(parseInt(lrcoll.style.top)!=-20)
{
clearTimeout(lrc0);
lrcoll.style.top = -20;
clearTimeout(lrc1);
lrcfilter.filters.alpha.opacity = 0;
}
this.dlt = ii;
}
var bbw = 0;
var ki;
for(ki=0; ki<this.ddh.length && this.ddh[ki]<=tme; ki++)
bbw += this.fjh[ki];
var kt = ki-1;
var sc = ((ki<this.ddh.length)?this.ddh[ki]:this.dte) - this.ddh[kt];
var tc = tme - this.ddh[kt];
bbw -= this.fjh[kt] - tc / sc * this.fjh[kt];
if(bbw>lrcbox.offsetWidth)
bbw = lrcbox.offsetWidth;
lrcbc.style.width = Math.round(bbw);
}
this.retxt = function(i)
{
return (i<0 || i>=this.inr.length)?"":this.inr[i].n;
}
this.print = function(txt)
{
lrcbox.innerText = txt;
lrcbc.innerText = txt;
}
this.print("www.haneng.info");
lrcwt1.innerText = "";
lrcwt2.innerText = "";
lrcwt3.innerText = "";
lrcwt4.innerText = "";
lrcwt5.innerText = "";
lrcwt6.innerText = "";
lrcwt7.innerText = "";
lrcfilter.innerText = "";
lrcwt8.innerText = "";
lrcwt9.innerText = "";
lrcwt10.innerText = "";
lrcwt11.innerText = "";
lrcwt12.innerText = "";
lrcwt13.innerText = "";
}
function lrcrun()
{
with(yyqqplayer)
{
lrcobj.run(controls.currentPosition);
}
if(arguments.length==0) setTimeout("lrcrun()",10);
}
function golrcoll(s)
{
lrcoll.style.top = -(s++)*2;
if(s<=9)
lrc0 = setTimeout("golrcoll("+s+")",min*10);
}
function golrcolor(t)
{
lrcfilter.filters.alpha.opacity = 110-(t++)*10;
if(t<=10)
lrc1 = setTimeout("golrcolor("+t+")",min*10);
}
window.onerror = function()
{return true;}
lrcrun();
//复制歌词到剪贴板
function copyToClipBoard(lyric){
var clipBoardContent=document.getElementById(lyric).innerHTML;
//过滤时间标签
clipBoardContent = clipBoardContent.replace(/\[0.*?\]/gi, "" );
clipBoardContent = clipBoardContent.replace(/<!--/, "" );
clipBoardContent = clipBoardContent.replace(/-->/, "" );
window.clipboardData.clearData();
window.clipboardData.setData("Text",clipBoardContent);
alert("歌词复制成功!");
}
</script>
</body>
</html>

 
公司简介 在线客服 客服中心 意见反馈 相关法律 隐私条款 广告服务 友情链接
Q链:515347638  电子邮箱:hanen@126.com 粤ICP备05086553