优化弹幕加载提示

This commit is contained in:
mtvpls
2025-12-04 20:17:25 +08:00
parent cc5563bff2
commit e2d0a62c2a
4 changed files with 53 additions and 10 deletions
+15
View File
@@ -1809,6 +1809,9 @@ function PlayPageClient() {
}
} catch (error) {
console.error('获取弹幕剧集列表失败:', error);
if (artPlayerRef.current) {
artPlayerRef.current.notice.show = '弹幕加载失败:无法获取剧集列表';
}
}
}
@@ -1825,6 +1828,9 @@ function PlayPageClient() {
setDanmakuMatches(searchResult.animes);
setShowDanmakuSourceSelector(true);
setDanmakuLoading(false);
if (artPlayerRef.current) {
artPlayerRef.current.notice.show = `找到 ${searchResult.animes.length} 个弹幕源,请选择`;
}
return;
}
@@ -1874,12 +1880,21 @@ function PlayPageClient() {
}
} else {
console.warn('未找到剧集信息');
if (artPlayerRef.current) {
artPlayerRef.current.notice.show = '弹幕加载失败:未找到剧集信息';
}
}
} else {
console.warn('未找到匹配的弹幕');
if (artPlayerRef.current) {
artPlayerRef.current.notice.show = '未找到匹配的弹幕,可在弹幕选项卡手动搜索';
}
}
} catch (error) {
console.error('自动搜索弹幕失败:', error);
if (artPlayerRef.current) {
artPlayerRef.current.notice.show = '弹幕加载失败,请检查网络或稍后重试';
}
} finally {
setDanmakuLoading(false);
}