html调用lrc
发布网友
发布时间:2022-04-27 06:51
我来回答
共5个回答
热心网友
时间:2022-06-28 01:06
<HTML><HEAD><TITLE>MP3试听</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<STYLE type=text/css>
.prelrc{font-size:12px;margin-left:12px;color:#000000}
.nowlrc{font-weight:bold;font-size:12px;margin-left:12px;color:#ff5a00}
*{margin:0;padding:0}
body{background:#D7DFE6;background-image:url(http://imgs.zhangmen.baidu.com/imgs/bdbg.gif);background-repeat:repeat-x;margin:0;font-size:12px;font-family:SimSun}
img{border:0}
a{color:#00c}
#Head_div {height:60px;width:400px}
#Usr_div {float:right;margin:30px 20px 10px;width:350px}
#Usr_div {margin:30px 0 10px 20px;width:190px}
#Logo_div {margin:13px 0 10px 3px;width:145px;float:left;}
#Lrc_div {position:absolute;width:350px;height:100%;float:left;margin-top:-60px;margin-left:8px;}
#url_div {margin:30px 10px 22px 5px;width:350px}
#song_div {margin:5px 10px 5px 5px}
#S_div {background:#E0E6F7;border:1px solid #A0BACD;width:350px;margin-bottom:10px}
#SongNum_div {clear:both}
#plus_div {float:left;background:url(http://imgs.zhangmen.baidu.com/imgs/cd.gif) no-repeat 10px;padding:10px 30px;text-decoration:underline;color:blue;}
#next_div {float:right;background:url(http://imgs.zhangmen.baidu.com/imgs/next.gif) no-repeat 1px 10px;padding:10px 15px;text-decoration:underline;color:blue;}
#pre_div {float:right;background:url(http://imgs.zhangmen.baidu.com/imgs/pre.gif) no-repeat 1px 10px;padding:10px 15px;text-decoration:underline;color:blue;}
#InP_div {margin:2px;clear:both}
#arrowright_div {float:left;height:500px;width:10px;}
#arrowright_div img {position:absolute;top:85px;left:0;cursor:pointer;}
#rightIfrm_div {float:left;width:420px;margin-top:-60px}
#MngIfrm_div {}
#leftAd_div {width:350px;float:left;margin-left:10px;margin-top:420px;}
</STYLE>
</HEAD>
<script src="http://box.zhangmen.baidu.com/js/bd_syncLRC.js"></script>
<script language="VBScript">
Function bdBytes2Str(vIn)
strReturn = ""
For i = 1 To LenB(vIn)
ThisCharCode = AscB(MidB(vIn,i,1))
If ThisCharCode < &H80 Then
strReturn = strReturn & Chr(ThisCharCode)
Else
NextCharCode = AscB(MidB(vIn,i+1,1))
strReturn = strReturn & Chr(CLng(ThisCharCode) * &H100 + CInt(NextCharCode))
i = i + 1
End If
Next
bdBytes2Str = strReturn
End Function
</script>
<BODY>
<div id="Head_div">
<div id="Logo_div"> </div>
<div id="Usr_div"> </div>
</div>
<div id="arrowright_div">
<img src="http://imgs.zhangmen.baidu.com/imgs/arrowright1.gif" id="Res_div" alt="隐藏音乐盒" onclick="reWin()" style="filter:fliph" />
</div>
<div id="rightIfrm_div" style="display:none">
<div id="MngIfrm_div" style="display:none">
<iframe id="try_iframe" name="try_iframe" src="" align="top" width="100%" height="512px" marginwidth="0" marginheight="0" frameborder="0" scrolling="no"></iframe>
</div>
<div style="display:none" id="leftAd_div"></div>
</div>
<script language="javascript" type="text/javascript">
var txtEp="展开音乐盒";
var txtTb="隐藏音乐盒";
var isLoadIf = false; //是否已加载
var try_iframe = window.frames[0];
var search_location = window.location.href;
var ext_mb = false; //是否需要展开
var is_ext_mb = false; //是否已经展开
var woffset = 0;
//if(!(document.body.clientWidth >= 380 && document.body.clientWidth <= 404) && !(document.body.clientWidth >= 795 && document.body.clientWidth <= 815)) woffset = 30;
if(search_location.indexOf("gate=2") > 0 || search_location.indexOf("gate=5") > 0) ext_mb = true;
function reWin() {
var mngIfrm_div = document.getElementById("MngIfrm_div");
var rightIfrm_div = document.getElementById("rightIfrm_div");
var res_div = document.getElementById("Res_div");
if(mngIfrm_div.style.display!="none") {
mngIfrm_div.style.display="none";
res_div.src="http://imgs.zhangmen.baidu.com/imgs/arrowright1.gif";
res_div.style.filter="fliph";
res_div.alt=txtEp;
is_ext_mb = false;
if(hasAds) { //有广告
if(hasLrc) { //有歌词
res_div.style.marginLeft="420px";
rightIfrm_div.style.display="inline";
} else { //无歌词
rightIfrm_div.style.display="none";
res_div.style.marginLeft="0px";
showAdRight(arrBaiAds[18]);
document.getElementById("Lrc_div").style.marginLeft = "8";
window.moveTo((screen.width - 399) / 2, 0);
window.resizeTo(399 + woffset, 600);
}
} else { //无广告
rightIfrm_div.style.display="none";
document.getElementById("Lrc_div").style.marginLeft = "8";
window.moveTo((screen.width - 399) / 2, 0);
window.resizeTo(399 + woffset, 600);
}
} else {
document.getElementById("Lrc_div").style.marginLeft = "3";
//window.moveBy(-421,0);
if(screen.width > 800) window.moveTo(100, 0); else window.moveTo(0, 0);
window.resizeTo(810 + woffset, 600);
mngIfrm_div.style.display="inline";
rightIfrm_div.style.display="inline";
if(!isLoadIf) {
search_location = search_location.replace("mt", "box");
document.getElementById("try_iframe").src= search_location;
try_iframe = window.frames[0];
isLoadIf = true;
}
document.getElementById("Blrc").style.display = "inline";
document.getElementById("LrcShower_div").style.display = "inline";
document.getElementById("lrctellall_div").style.display = "none";
res_div.src="http://imgs.zhangmen.baidu.com/imgs/arrowright1.gif";
res_div.style.filter="normal";
res_div.style.marginLeft="0px";
res_div.alt=txtTb;
is_ext_mb = true;
}
if(is_ext_mb)
document.getElementById("leftAd_div").style.marginTop = "5px";
else
document.getElementById("leftAd_div").style.marginTop = "230px";;
}
function cclsDiv() {
if(document.getElementById("MngIfrm_div").style.display!="none") {
try_iframe.qaz.value='none'
}
}
function ggetClk() {
try{document.attachEvent("onmouseup",cclsDiv)}
catch (e){document.addEventListener("mouseup",cclsDiv, false)}
}
</script>
<div id="Lrc_div">
<div id="url_div">歌曲出处:<a id="song_url" href="http://218.89.188.156/1/mp3/x/299.wma">http://218.89.188.156/1/mp3/x/299.wma</a></div>
<div id="song" style="display:none">害我受了伤</div><div id="singer" style="display:none">王蓉</div>
<div id="song_div">歌曲试听:<b>害我受了伤 ... </b></div>
<div id="S_div">
<div id="player_div">
<object id="MediaPlayer1" width="350" height="68" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95"
codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715"
align="baseline" border="0" standby="Loading Microsoft Windows Media Player components..."
type="application/x-oleobject">
<param name="invokeURLs" value="0">
<param name="FileName" value="http://218.89.188.156/1/mp3/x/299.wma">
<param name="ShowControls" value="1">
<param name="ShowPositionControls" value="0">
<param name="ShowAudioControls" value="1">
<param name="ShowTracker" value="1">
<param name="ShowDisplay" value="0">
<param name="ShowStatusBar" value="1">
<param name="AutoSize" value="0">
<param name="ShowGotoBar" value="0">
<param name="ShowCaptioning" value="0">
<param name="AutoStart" value="1">
<param name="PlayCount" value="0">
<param name="AnimationAtStart" value="0">
<param name="TransparentAtStart" value="0">
<param name="AllowScan" value="0">
<param name="EnableContextMenu" value="1">
<param name="ClickToPlay" value="0">
<param name="DefaultFrame" value="datawindow">
<embed src="http://218.89.188.156/1/mp3/x/299.wma" align="baseline" border="0" width="350" height="68"
type="application/x-mplayer2"
pluginspage="http://www.microsoft.com/isapi/redir.dll?prd=windows&sbp=mediaplayer&ar=media&sba=plugin&"
name="MediaPlayer" showcontrols="1" showpositioncontrols="0"
showaudiocontrols="1" showtracker="1" showdisplay="0"
showstatusbar="1"
autosize="0"
showgotobar="0" showcaptioning="0" autostart="1" autorewind="0"
animationatstart="0" transparentatstart="0" allowscan="1"
enablecontextmenu="1" clicktoplay="0"
defaultframe="datawindow" invokeurls="0">
</embed>
</object>
</div>
<div id="SongNum_div">
<div id="plus_div" onclick="if(!isLoadIf) {window.document.getElementById('plus_a').target='mt';reWin();} else {try_iframe.Controller(event);if(!is_ext_mb) reWin();return false;}"><a id="plus_a" style="cursor:hand;">放入我的音乐盒</a></div>
<div id="next_div" onclick="try_iframe.Controller(event);return false;"><a id="next_a" style="cursor:hand;">下一首</a></div>
<div id="pre_div" onclick="try_iframe.Controller(event);return false;"><a id="pre_a"" style="cursor:hand;">上一首</a></div>
</div>
</div>
<div style="display:none;clear:both" id="Blrc">
<div style="border:#B4C2E2 1px solid;font-size:12px;text-align:left;width:350px">
<table width="350px" style="background:#ECEDED" cellspacing="0" cellpadding="0"><tr><td style="padding:5px 10px 1px;text-align:left;font-size:12px;"><b>歌词:</b></td><td style="text-align:right"></td></tr></table>
<div style="display:none;height:276px;width:350px;line-height:20px;overflow-y:scroll;overflow-x:hidden;background:#fff;display:none" id="LrcShower_div"></div>
</div>
</div>
<div style="display:none" id="lrctellall_div"></div>
<div id="InP_div">
<a href="http://post.baidu.com/f?kw=%B0%D9%B6%C8MP3%CA%D4%CC%FD" target="_blank">意见与反馈</a> <a href="http://www.baidu.com/search/listencopyright.html" target=_blank style="color:#666666">权利声明</a>
</div>
<!-- script type="text/javascript" src="js/jslog.js"></script> -->
<script>
/*@cc_on @*/
/*@set @dLrc=false @*/
var isFF=(navigator.userAgent.toLowerCase().indexOf("firefox")!=-1)
var hasLrc
var pID=null;
function init(lrcID) {
/*@if (@dLrc)
jslog.info("begin init lrcID=" + lrcID);
@end
@*/
document.onkeydown=function(){if(window.event.keyCode==8){window.event.returnValue=false;}else if(window.event.keyCode>=112&&window.event.keyCode<=123){window.event.keyCode=0;window.event.returnValue = false;};};
document.getElementById("plus_a").contentEditable = false;
document.getElementById("pre_a").contentEditable = false;
document.getElementById("next_a").contentEditable = false;
document.getElementById("plus_div").contentEditable = false;
document.getElementById("pre_div").contentEditable = false;
document.getElementById("next_div").contentEditable = false;
if (isFF) {
document.getElementById("arrowright_div").style.display = "none";
document.getElementById("plus_div").style.display = "none";
document.getElementById("Lrc_div").style.marginRight = "15px";
};
document.getElementById("next_div").style.display = "none";
document.getElementById("pre_div").style.display = "none";
if(document.getElementById('MediaPlayer1')){pID="MediaPlayer1"}
else{
if(document.getElementById('RealPlayer1')){pID="RealPlayer1"}
}
if(lrcID && lrcID != "" && lrcID != "0" && lrcID != 0) {
/*@if (@dLrc)
jslog.info("load lrcID:" + lrcID);
@end
@*/
var re=new RegExp("^[0-9]+$");
var d= lrcID.match(re)
hasLrc=(d!=null&&d!=""&&parseInt(lrcID)>0)
if(!isFF){
if(hasLrc){
document.getElementById('Blrc').style.display="";
document.getElementById('LrcShower_div').style.display="";
if(typeof(lrcInterface)=="function"){
lrcInterface(pID,lrcID);
}else{
document.getElementById('LrcShower_div').innerHTML="<br><br><br><br><br><br><span style='font-size:12px;margin-left:12px'> 可能是因为网络的原因,系统没有找到合适的歌词。请稍后重试</span>";
}
}//end if(hasLrc)
}//end if(!isFF)
} else {
/*@if (@dLrc)
jslog.info("hasLrc = false");
@end
@*/
hasLrc = false;
tmpLrcContent = "";
tmpLrcs = new Array();
document.getElementById('LrcShower_div').innerHTML = "<br><br><br><br><br><br><span style='font-size:12px;margin-left:12px'> 抱歉,系统未找到对应歌词。";
/*@if (@dLrc)
jslog.info("end init");
@end
@*/
}//if(lrcID)结束
}//init
var reg = new RegExp("(^|&)"+ "si" +"=([^&]*)(&|$)");
var r = window.location.search.substr(1).match(reg);
if (r!=null) {
arrPar = r[0].split(";;")
//alert("r[0]: "+r[0]);
lrcID = arrPar[2];
init(lrcID);
}//if (r!=null)结束
</script>
</div>
<!--广告-->
<div id="ad_script_div"></div>
<div id="show_flag" style="display:none"></div>
<script src="http://box.zhangmen.baidu.com/js/bd_Adv.js"></script>
</BODY>
</HTML>
热心网友
时间:2022-06-28 01:06
楼主看到了5楼的代码里有
<script language="javascript" type="text/javascript">
就该知道, 这里面有很多的jsp代码,这样的话,改成html后肯定是不能用的了
所以, 就不能改成html的
热心网友
时间:2022-06-28 01:07
你是要歌词和歌曲一起的嘛?用千千静听就不错。不太明 白你说的。
热心网友
时间:2022-06-28 01:08
QQ 329929118
我可以搞成本地的
就是调用本的lrc歌词
热心网友
时间:2022-06-28 01:08
直接看一下百度MP3的源码就行了.