mirror of
https://github.com/truewhile/MeBox.git
synced 2026-10-14 09:06:37 +08:00
优化
This commit is contained in:
@@ -102,7 +102,10 @@ export const danmakuAPI = {
|
||||
api
|
||||
.get<DanmakuFetchResult>(`/danmaku/${encodeURIComponent(mediaId)}`, {
|
||||
params: { kw: options.kw || undefined, episodeId: options.episodeId || undefined },
|
||||
timeout: 20_000,
|
||||
// 服务端依次做「16MB 前缀哈希 → 上游匹配 → 评论库」三段串行请求,每段的上游
|
||||
// 超时都是 20 秒。客户端要是也卡在 20 秒,就会在服务端正要降级返回(哈希超时
|
||||
// 后改按文件名搜索)时把请求撤掉:用户看不到弹幕,服务端还记一条 404。
|
||||
timeout: 45_000,
|
||||
})
|
||||
.then((r) => r.data),
|
||||
|
||||
|
||||
@@ -903,6 +903,13 @@ export function PlayerPage() {
|
||||
// 加载统一播放能力:115 云端清晰度 + 本地 HLS 清晰度。
|
||||
useEffect(() => {
|
||||
if (!mediaId) return
|
||||
// 远程 Emby 条目只存在于远程库里,本地 media 表没有它的伪 ID,问这个接口只会
|
||||
// 拿到 404(控制台里就是一条红字);而它的播放方式恒为「远程直连、不转码」,
|
||||
// 也没有任何可切换的档位。播放地址由 /api/stream/:id 负责解析。
|
||||
if (isRemoteEmbyID(mediaId)) {
|
||||
setPlaybackInfo(null)
|
||||
return
|
||||
}
|
||||
let cancelled = false
|
||||
mediaAPI
|
||||
.playbackInfo(mediaId)
|
||||
|
||||
Reference in New Issue
Block a user