HTML5怎么使多个网页播放音乐同步 我想弄切换网页后音乐不会停止,还是继续播放

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了HTML5怎么使多个网页播放音乐同步 我想弄切换网页后音乐不会停止,还是继续播放相关的知识,希望对你有一定的参考价值。

参考技术A 1.全页AJAX做成SPA页面
2.实时存储歌曲的播放时间(可以用cookie),切换页面的时候再读取时间播放器跳转到此时间进行播放。
参考技术B 实现方法不刷新请求页面,可以研究下“jquery.pjax.js”库

网页设计,怎么做歌词与音乐同步?

怎么在以下这段播放器代码修改可以显示歌词并与音乐同步?
Ctrl+C请自重!
<!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">
<title>无标题文档</title>
<style type="text/css">
<!--
body
margin-left: 0px;
margin-top: 0px;
margin-bottom: 0px;
background-image: url();
background-color: #000000;
margin-right: 0px;

.style1 color: #00CC33
.style3
color: #CCCCCC;
font-family: "楷体_GB2312";
font-size: large;

-->
</style>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) //reloads the window if Nav4 resized
if (init==true) with (navigator) if ((appName=="Netscape")&&(parseInt(appVersion)==4))
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage;
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();

MM_reloadPage(true);
//-->
</script>
</head>
<body>
<TABLE width="100%" height="45">
<TR>
<TD width="201" height="15" style="FILTER: alpha (opacity=90,style=3)"><P align=center><EMBED style="FILTER: Xray" src=http://vfile.home.news.cn/music/public/vd05/200904/19/93/MUfs0520090419170054529327f0.mp3 width=300 height=45 type=audio/mpeg ShowStatusBar="1" volume="100%" autostart="true" loop="- 1"> </P></TD>
<TD width="579" style="FILTER: alpha (opacity=70,style=3)"><div align="center"><span class="style1">
</TR>
</TABLE>
</body>
</html>

参考技术A 推荐用Flex或Flash编写播放器读取txt文件。
开始嵌入一个时间函数,播放器进行解析。
Lrc的格式我没试过,你可以尝试一下。
详细脚本文件百度吧。

以上是关于HTML5怎么使多个网页播放音乐同步 我想弄切换网页后音乐不会停止,还是继续播放的主要内容,如果未能解决你的问题,请参考以下文章

html5实现 音乐播放器歌词同步怎么实现的

html5怎么设置多首背景音乐?

谷歌浏览器网页不能播放音乐,显示没有用于显示此内容的插件

怎么在html里插音乐 在html里插音乐的方法简述

网页设计,怎么做歌词与音乐同步?

如何在linux 播放网页音乐