Compare commits

...

9 Commits

Author SHA1 Message Date
imsyy
ea822f91e8 🐞 fix: 修复失败后无法尝试下一曲 2025-11-18 16:12:23 +08:00
imsyy
5e260ffc0d 🐞 fix: 修复进度调节单位错误 2025-11-18 15:29:37 +08:00
imsyy
e3dcde71e8 Merge branch 'dev-lyric' into dev 2025-11-18 15:22:25 +08:00
底层用户
7de1355f18 Merge pull request #573 from MoYingJi/docs-it
docs: 小改 Issue Template
2025-11-17 14:19:59 +08:00
MoYingJi
0d66ced637 docs: 小改 Issue Template 2025-11-16 00:29:09 +08:00
底层用户
ae1ee71e75 Merge pull request #567 from MoYingJi/fix-ldc
fix(player): 修复极端状态下播放异常
2025-11-14 09:29:01 +08:00
底层用户
84d9c999eb Merge pull request #566 from MoYingJi/docs-it
docs: 更新 Issue Template
2025-11-14 09:28:14 +08:00
MoYingJi
1a36fbf1d5 fix(player): 修复极端状态下播放异常
由于 `jumpSeek` 现在会减去 `offset`,可能会导致当 `offset` 超出预期时引发一些奇怪的行为
2025-11-14 03:06:29 +08:00
MoYingJi
e0e62cd906 docs: 更新 Issue Template 2025-11-14 01:14:46 +08:00
2 changed files with 62 additions and 10 deletions

View File

@@ -1,35 +1,75 @@
name: 遇到问题
description: 关于使用过程中遇到的问题
title: 请填写标题
labels: [bug]
body:
- type: input
- type: markdown
attributes:
value: |
---
在此之前,我们默认你已经知道该如何提问。简而言之,**你要精确地描述问题并提供充足的信息**
此外,如果需要,你可以使用 <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>I</kbd> 打开开发者工具为我们提供信息
- type: checkboxes
validations:
required: false
attributes:
label: "检查清单"
description: |
我们需要了解一些信息,你需要检查下面的检查项 <br />
**这里并不是每一个检查项都必要,根据你的真实情况勾选即可**
options:
- label: "我已检索仓库中所有的 Issues确保我**没有重复提交问题**;或有相似 Issue但我觉得我的情况不包含在那个相似 Issue 之内"
- label: "我已经找到了可以复现这个问题的方法,并且写在了下面的「具体信息」中"
- label: "此问题可以在我的设备和当前环境中**稳定复现**"
- label: "此问题可以在最新版本 (Latest Release) 中复现"
- label: "此问题是在我更新到当前版本后**才**出现的"
- type: dropdown
validations:
required: true
attributes:
label: "是网页端还是客户端"
placeholder: "客户端"
options:
- "客户端"
- "网页端"
default: 0
- type: input
validations:
required: true
attributes:
label: "当前系统环境"
placeholder: "win11"
placeholder: "Windows 11"
- type: input
validations:
required: true
required: false
attributes:
label: "当前 Node.js 及 npm 版本"
placeholder: "v18.16.0 / v9.6.7"
placeholder: "如:v18.16.0 / v9.6.7 (选填)"
- type: input
validations:
required: true
attributes:
label: "当前版本"
placeholder: "v1.0.0"
description: |
填写关于软件里的或 Releases 中版本号即可 <br />
如果是自行构建或从 GitHub Actions 下载的开发版,还需要提供 Commit ID
placeholder: "如v1.0.0"
- type: textarea
id: other
attributes:
label: "具体信息"
description: "请填写完整的复现步骤和遇到的问题,包括但不限于报错信息、控制台输出、网络请求等"
description: |
请填写完整的复现步骤和遇到的问题,还请尽量提供所有可能的信息,提供包括但不限于:
- 分步的复现步骤,可以使用 `1. xxx` (换行) `2. xxx` 的格式
- 截图(如果结合复现步骤还是无法详细表述,甚至可以录屏)
- 开发者工具中的:控制台输出报错、网络请求等
- 出现问题的在线歌曲链接、出现问题的文件(本地歌曲、歌词等)的下载链接
等信息,以更好地帮助我们解决你的问题
placeholder: "请填写具体的复现步骤和遇到的问题"

View File

@@ -106,7 +106,7 @@ class Player {
}
if (!this.player.playing()) return;
const currentTime = this.getSeek();
const duration = Math.floor(this.player.duration() * 1000);
const duration = this.getDuration();
// 计算进度条距离
const progress = calculateProgress(currentTime, duration);
// 计算歌词索引(支持 LRC 与逐字 YRC对唱重叠处理
@@ -298,7 +298,7 @@ class Player {
}
// 恢复进度仅在明确指定且大于0时才恢复避免切换歌曲时意外恢复进度
if (seek && seek > 0) {
const duration = Math.floor(this.player.duration() * 1000);
const duration = this.getDuration();
// 确保恢复的进度有效且距离歌曲结束大于2秒
if (duration && seek < duration - 2000) {
this.setSeek(seek);
@@ -507,6 +507,7 @@ class Player {
}
// 超过次数:切到下一首或清空
this.retryInfo.count = 0;
this.switching = false;
if (dataStore.playList.length > 1) {
window.$message.error("当前歌曲播放失败,已跳至下一首");
await this.nextOrPrev("next");
@@ -914,6 +915,10 @@ class Player {
console.warn("⚠️ Player not ready for seek");
return;
}
if (time < 0 || time > this.getDuration()) {
console.warn("⚠️ Invalid seek time", time);
time = Math.max(0, Math.min(time, this.getDuration()));
}
this.player.seek(time / 1000);
statusStore.currentTime = time;
}
@@ -926,6 +931,13 @@ class Player {
if (!this.player || this.player.state() !== "loaded") return 0;
return Math.floor(this.player.seek() * 1000);
}
/**
* 获取播放时长
* @returns 播放时长(单位:毫秒)
*/
getDuration(): number {
return Math.floor(this.player.duration() * 1000);
}
/**
* 设置播放速率
* @param rate 播放速率