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

[Bug]Pjax导致自定义aplayer无法正常加载js #1498

Closed
EdenMoxe opened this issue May 7, 2024 · 3 comments
Closed

[Bug]Pjax导致自定义aplayer无法正常加载js #1498

EdenMoxe opened this issue May 7, 2024 · 3 comments

Comments

@EdenMoxe
Copy link

EdenMoxe commented May 7, 2024

使用的 Butterfly 版本? | What version of Butterfly are you use?

4.13.0

是否修改过主题文件? || Has the theme files been modified?

不是 (No)

使用的瀏覽器? || What browse are you using?

Chrome

使用的系統? || What operating system are you using?

Windows

依賴插件 | Package dependencies Information

├── hexo-deployer-git@4.0.0
├── hexo-filter-mathjax@0.9.0
├── hexo-generator-archive@2.0.0
├── hexo-generator-category@2.0.0
├── hexo-generator-index@3.0.0
├── hexo-generator-tag@2.0.0
├── hexo-renderer-ejs@2.0.0
├── hexo-renderer-mathjax@0.6.0
├── hexo-renderer-pandoc@0.4.0
├── hexo-renderer-pug@3.0.0
├── hexo-renderer-stylus@2.1.0
├── hexo-server@3.0.0
├── hexo-tag-aplayer@3.0.4
├── hexo-theme-butterfly@4.13.0
├── hexo-theme-landscape@1.0.0
├── hexo-wordcount@6.0.1
└── hexo@6.3.0

問題描述 | Describe the bug

  1. 新版特性问题:butterfly这个版本中似乎只支持文章标题靠左,引入mathjax后所有的公式也是靠左,而不是居中,观感比较差,请问有提供用户选择接口吗?或者以往哪些版本是可以使用居中标题和居中mathjax公式的?
  2. 我新建了一个名为Music的html页面用于音乐播放,但是Aplayer使用的pjax插件会导致第一次该页面js初始化失败,导致我建立的一个AplayerList第一次点击是无法获取歌曲列表的,必须刷新才能获取,而且点击播放歌曲后确实能实现全站播放,但是离开了重新进入Music页音乐器又会丢失;关闭pjax后列表正常加载,但是插入的Aplayer和我自己的Aplayer都无法实现全站播放了,故障复现可以看一下下面网站,请问有办法解决吗?以下是我那部分引入的Aplayer代码:
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.css">
<div id="aplayer" class="APlayer no-destroy"></div>
<script src="https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.js" ></script>
```{% aplayerlist %}
{  "narrow": false,
    "autoplay": false,
    "mode": "random",
    "showlrc": 3,
    "mutex": true,
    "theme": "#e6d0b2",
    "preload": "metadata",
    "listmaxheight": "513px",
    "width": "50%",
    "music": ["title": "遇见(live)","author": "炎明熹、姚焯菲","url": "/Song/Gigi炎明熹Chantel姚焯菲-遇见.mp3","lrc": "/Lyric/Gigi炎明熹Chantel姚焯菲-遇见.lrc"]
}
{% endaplayerlist %}

### 出現問題網站 | Website

https://www.edenmo.top/Music/
@EdenMoxe
Copy link
Author

EdenMoxe commented May 7, 2024

第一个问题已使用4.12版本,居中正常,希望后续新版本增加居中接口

@jerryc127
Copy link
Owner

  1. 我并没有更改 mathjax 的位置,不知道你指的是什么
  2. 使用pjax, 需要重新调用 aplayer,如何调用,建议谷歌和查看对应的 仓库文档。
    想要全站不间断的播放音乐,你只能把aplayer 写在 pjax 不加载的地方

@EdenMoxe
Copy link
Author

EdenMoxe commented May 8, 2024

mathjax公式靠左显示大概是浏览器第一次加载缓存问题,抱歉我犯了错误;我大概明白了pjax和aplayer调用逻辑,只能在pjax后调用aplayer,使用辅助函数记录播放状态,现在问题已经基本解决,感谢你的回复

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

No branches or pull requests

2 participants