Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

新增自动播放背景音乐功能 #29

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

DaXiongRen
Copy link

新增的功能与程序原有的功能不冲突
新增有以下几点:

  • 在index.html中加了几行有关音频播放的代码
  • 增加了两个音频文件,音频文件来源于羊了个羊小程序的背景音乐
  • 增加了一个js文件,里面的代码主要用于监听页面的动作来触发音乐播放

index.html Outdated
@@ -7,6 +7,12 @@
<title>鱼了个鱼</title>
<script charset="UTF-8" id="LA_COLLECT" src="//sdk.51.la/js-sdk-pro.min.js"></script>
<script>LA.init({id: "JonPnywkOzKkLXdw",ck: "JonPnywkOzKkLXdw"})</script>
<script type="text/javascript" src="/src/assets/musics/auto-music.js"></script>
<!-- 微信上进入页面是会自动播放的 其它浏览器打开需要触碰一下页面任意地方才会播放 -->
<div class="video_exist play_yinfu" id="audio_btn" style="display: block;z-index:999999;">
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

class 用短横分割好一些

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好的,我去修改下。

<!-- 微信上进入页面是会自动播放的 其它浏览器打开需要触碰一下页面任意地方才会播放 -->
<div class="video_exist play_yinfu" id="audio_btn" style="display: block;z-index:999999;">
<div id="yinfu" class="rotate"></div>
<audio preload="auto" autoplay="autoplay" id="audio" src="/src/assets/musics/1.mp3" loop="loop"></audio>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vercel 国外部署访问本来就有点慢,音乐可能会影响资源的加载

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants