Skip to content

Commit 6f85a7d

Browse files
committed
Update AbstractPlayer.swift
1 parent 4909327 commit 6f85a7d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Sources/swiftui-loop-videoplayer/protocol/player/AbstractPlayer.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ extension AbstractPlayer{
174174
let endTime = CMTimeGetSeconds(duration)
175175
let seekTime : CMTime
176176

177-
if time <= 0 {
177+
if time < 0 {
178178
// If the time is negative, seek to the start of the video
179179
seekTime = .zero
180180
} else if time >= endTime {
@@ -186,10 +186,10 @@ extension AbstractPlayer{
186186
let seekCMTime = CMTime(seconds: time, preferredTimescale: duration.timescale)
187187
seekTime = seekCMTime
188188
}
189-
189+
190190
player.seek(to: seekTime){ [weak self] value in
191191
let currentTime = CMTimeGetSeconds(player.currentTime())
192-
self?.delegate?.didSeek(value: value, currentTime: currentTime)
192+
self?.delegate?.didSeek(value: value, currentTime: seekTime.seconds)
193193
}
194194
}
195195

0 commit comments

Comments
 (0)