Skip to content

Commit

Permalink
fix #687
Browse files Browse the repository at this point in the history
  • Loading branch information
kingslay committed Dec 18, 2023
1 parent a4015a4 commit e37c425
Show file tree
Hide file tree
Showing 4 changed files with 261 additions and 170 deletions.
4 changes: 2 additions & 2 deletions Sources/KSPlayer/AVPlayer/KSVideoPlayer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,8 @@ extension KSVideoPlayer: UIViewRepresentable {

extension KSVideoPlayer.Coordinator: KSPlayerLayerDelegate {
public func player(layer: KSPlayerLayer, state: KSPlayerState) {
self.state = state
onStateChanged?(layer, state)
if state == .readyToPlay {
playbackRate = layer.player.playbackRate
if let subtitleDataSouce = layer.player.subtitleDataSouce {
Expand All @@ -229,8 +231,6 @@ extension KSVideoPlayer.Coordinator: KSPlayerLayerDelegate {
} else {
isMaskShow = true
}
self.state = state
onStateChanged?(layer, state)
}

public func player(layer _: KSPlayerLayer, currentTime: TimeInterval, totalTime: TimeInterval) {
Expand Down
4 changes: 3 additions & 1 deletion Sources/KSPlayer/MEPlayer/AudioUnitPlayer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ public final class AudioUnitPlayer: AudioOutput {
currentRender = nil
}

deinit {}
deinit {
pause()
}
}

extension AudioUnitPlayer {
Expand Down
Loading

0 comments on commit e37c425

Please sign in to comment.