Skip to content

Commit

Permalink
add seekable
Browse files Browse the repository at this point in the history
  • Loading branch information
kingslay committed Dec 21, 2023
1 parent 5d9d1dd commit 7cb1838
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Sources/KSPlayer/AVPlayer/KSPlayerLayer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ open class KSPlayerLayer: UIView {
if time.isInfinite || time.isNaN {
completion(false)
}
if player.isReadyToPlay {
if player.isReadyToPlay, player.seekable {
player.seek(time: time) { [weak self] finished in
guard let self else { return }
if finished, autoPlay {
Expand Down
6 changes: 1 addition & 5 deletions Sources/KSPlayer/SwiftUI/KSVideoPlayerView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ public struct KSVideoPlayerView: View {
private var playerCoordinator = KSVideoPlayer.Coordinator()
@Environment(\.dismiss)
private var dismiss
@FocusState
private var controllerFocused: Bool
public let options: KSOptions
@State
public var url: URL {
Expand Down Expand Up @@ -160,9 +158,7 @@ public struct KSVideoPlayerView: View {
}
}
.onExitCommand {
if controllerFocused {
controllerFocused = false
} else if playerCoordinator.isMaskShow {
if playerCoordinator.isMaskShow {
playerCoordinator.isMaskShow = false
} else {
dismiss()
Expand Down

0 comments on commit 7cb1838

Please sign in to comment.