Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit d0e9c26

Browse files
update
1 parent 347761f commit d0e9c26

File tree

3 files changed

+3
-13
lines changed

3 files changed

+3
-13
lines changed

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

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ import CoreImage
1616
@MainActor
1717
public protocol AbstractPlayer: AnyObject {
1818

19-
/// Observes the status property of the new player item.
20-
var itemStatusObserver: NSKeyValueObservation? { get set }
21-
2219
/// An optional property that stores the current video settings.
2320
///
2421
/// This property holds an instance of `VideoSettings` or nil if no settings have been configured yet.
@@ -225,18 +222,17 @@ extension AbstractPlayer{
225222
}
226223

227224
player.seek(to: seekTime) { [weak self] success in
228-
self?.seekCompletion(success: success, autoPlay: play)
225+
Task { @MainActor in
226+
self?.seekCompletion(success: success, autoPlay: play)
227+
}
229228
}
230229
}
231230

232231
private func seekCompletion(success: Bool, autoPlay: Bool) {
233232
guard let player = player else { return }
234233
let currentTime = CMTimeGetSeconds(player.currentTime())
235-
236-
Task { @MainActor in
237234
delegate?.didSeek(value: success, currentTime: currentTime)
238235
autoPlay ? play() : pause()
239-
}
240236
}
241237

242238
/// Seeks to the start of the video.

‎Sources/swiftui-loop-videoplayer/view/player/ios/ExtPlayerUIView.swift‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,6 @@ internal class ExtPlayerUIView: UIView, ExtPlayerProtocol {
5959
/// of an `AVPlayer`.
6060
internal var volumeObserver: NSKeyValueObservation?
6161

62-
/// Observes the status property of the new player item.
63-
internal var itemStatusObserver: NSKeyValueObservation?
64-
6562
/// The delegate to be notified about errors encountered by the player.
6663
weak var delegate: PlayerDelegateProtocol?
6764

‎Sources/swiftui-loop-videoplayer/view/player/mac/ExtPlayerNSView.swift‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,6 @@ internal class ExtPlayerNSView: NSView, ExtPlayerProtocol {
6060
/// of an `AVPlayer`.
6161
internal var volumeObserver: NSKeyValueObservation?
6262

63-
/// Observes the status property of the new player item.
64-
internal var statusObserver: NSKeyValueObservation?
65-
6663
/// The delegate to be notified about errors encountered by the player.
6764
weak var delegate: PlayerDelegateProtocol?
6865

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /