Skip to content

Commit

Permalink
fix: playerStartPos when continuously play
Browse files Browse the repository at this point in the history
  • Loading branch information
Char1ei committed Jul 8, 2023
1 parent 0407d53 commit aa36629
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion BilibiliLive/Component/Video/VideoPlayerViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class VideoNextProvider {
playSeq = seq
}

private var index = 1
private var index = 0
private let playSeq: [PlayInfo]
func reset() {
index = 0
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit aa36629

Please sign in to comment.