Skip to content

Commit ab49399

Browse files
committed
Update AbstractPlayer.swift
1 parent 0a61908 commit ab49399

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,15 @@ extension AbstractPlayer{
142142
/// - Parameter time: The target time to seek to in the video timeline.
143143
func seek(to time: Double) {
144144
guard let player = player, let duration = player.currentItem?.duration else {
145+
delegate?.didSeek(value: false, currentTime: time)
145146
return
146147
}
147148

149+
guard duration.value != 0 else{
150+
delegate?.didSeek(value: false, currentTime: time)
151+
return
152+
}
153+
148154
let endTime = CMTimeGetSeconds(duration)
149155
let seekTime : CMTime
150156

0 commit comments

Comments
 (0)