引入Aplayer后图片无法正常显示
作为一款轻便的H5音乐播放器,Aplayer插件提供了很好的界面和效果,比普通的HTML播放器更加方便美观。根据官方文档完成代码框架搭建后却发现背景图片莫名不显示了。。。原来一直调试时背景图片依靠浏览器缓存所以在本地服务器运行没有消失,等真正推送在无缓存页面打开才原形毕露。检查了本地的配置没有发现什么问题,而检查服务器时发现网页渲染CSS文件首行莫名多了:
1
<link rel="stylesheet" class="aplayer-secondary-style-marker" href="/assets/css/APlayer.min.css"><script src="/assets/js/APlayer.min.js" class="aplayer-secondary-script-marker"></script><script class="meting-secondary-script-marker" src="/assets/js/Meting.min.js"></script>
1
2aplayer:
asset_inject: false1
2
3
4
5<!-- require APlayer -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.css">
<script src="https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.js"></script>
<!-- require MetingJS -->
<script src="https://cdn.jsdelivr.net/npm/meting@2.0.1/dist/Meting.min.js"></script> //可选,Meting服务支持播放外链歌单1
2
3
4<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.css">
<div id="aplayer"></div>
<script src="https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.js" ></script>