From aa366295a51ae7160953147cecf2f9fc21e00444 Mon Sep 17 00:00:00 2001 From: Lei ZHAO Date: Sat, 8 Jul 2023 12:40:28 +1000 Subject: [PATCH] fix: playerStartPos when continuously play --- BilibiliLive/Component/Video/VideoPlayerViewController.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/BilibiliLive/Component/Video/VideoPlayerViewController.swift b/BilibiliLive/Component/Video/VideoPlayerViewController.swift index 5977daf0..40218bf0 100644 --- a/BilibiliLive/Component/Video/VideoPlayerViewController.swift +++ b/BilibiliLive/Component/Video/VideoPlayerViewController.swift @@ -29,7 +29,7 @@ class VideoNextProvider { playSeq = seq } - private var index = 1 + private var index = 0 private let playSeq: [PlayInfo] func reset() { index = 0 @@ -288,6 +288,8 @@ extension VideoPlayerViewController { let info = try? await WebRequest.requestPlayerInfo(aid: aid, cid: cid) if info?.last_play_cid == cid, let startTime = info?.playTimeInSecond, playData.dash.duration - startTime > 5, Settings.continuePlay { playerStartPos = startTime + } else { + playerStartPos = 0 } await playmedia(urlInfo: playData, playerInfo: info)