Skip to content

Commit 52d55d3

Browse files
committed
refactoring
1 parent d48dc08 commit 52d55d3

File tree

3 files changed

+1
-23
lines changed

3 files changed

+1
-23
lines changed

Sources/swiftui-loop-videoplayer/protocol/view/LoopingPlayerProtocol.swift

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,6 @@ public protocol LoopingPlayerProtocol: AbstractPlayer, LayerMakerProtocol{
5050
/// - player: The AVQueuePlayer to observe for errors.
5151
func setupObservers(for item: AVPlayerItem, player: AVQueuePlayer)
5252

53-
/// Responds to changes in the playback status of an AVPlayerItem.
54-
///
55-
/// - Parameter item: The AVPlayerItem whose status changed.
56-
func handlePlayerItemStatusChange(_ item: AVPlayerItem)
57-
5853
/// Responds to errors reported by the AVQueuePlayer.
5954
///
6055
/// - Parameter player: The AVQueuePlayer that encountered an error.
@@ -171,17 +166,6 @@ internal extension LoopingPlayerProtocol {
171166
errorObserver = nil
172167
}
173168

174-
175-
/// Responds to changes in the status of an AVPlayerItem.
176-
///
177-
/// This method checks if the status of the AVPlayerItem indicates a failure.
178-
/// If a failure occurs, it notifies the delegate about the error.
179-
/// - Parameter item: The AVPlayerItem whose status has changed to be evaluated.
180-
func handlePlayerItemStatusChange(_ item: AVPlayerItem) {
181-
guard item.status == .failed, let error = item.error else { return }
182-
delegate?.didReceiveError(.remoteVideoError(error))
183-
}
184-
185169
/// Responds to errors reported by the AVPlayer.
186170
///
187171
/// If an error is present, this method notifies the delegate of the encountered error,

Sources/swiftui-loop-videoplayer/view/loop/player/ios/LoopingPlayerUIView.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ class LoopingPlayerUIView: UIView, LoopingPlayerProtocol {
3838
/// The queue player that plays the video items.
3939
internal var player: AVQueuePlayer?
4040

41-
/// Observer for the status of the AVPlayerItem.
42-
internal var statusObserver: NSKeyValueObservation?
43-
4441
/// Observer for errors from the AVQueuePlayer.
4542
internal var errorObserver: NSKeyValueObservation?
4643

Sources/swiftui-loop-videoplayer/view/loop/player/mac/LoopingPlayerNSView.swift

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import AppKit
1818
/// This class handles the initialization and management of a looping video player with customizable video gravity.
1919
@available(macOS 11.0, *)
2020
@MainActor @preconcurrency
21-
class LoopingPlayerNSView: NSView, LoopingPlayerProtocol {
21+
class LoopingPlayerNSView: NSView, LoopingPlayerProtocol {
2222

2323
/// `filters` is an array that stores CIFilter objects used to apply different image processing effects
2424
internal var filters: [CIFilter] = []
@@ -40,9 +40,6 @@ class LoopingPlayerNSView: NSView, LoopingPlayerProtocol {
4040
/// The queue player that plays the video items.
4141
internal var player: AVQueuePlayer?
4242

43-
/// Observer for the status of the AVPlayerItem.
44-
internal var statusObserver: NSKeyValueObservation?
45-
4643
/// Observer for errors from the AVQueuePlayer.
4744
internal var errorObserver: NSKeyValueObservation?
4845

0 commit comments

Comments
 (0)