mirror of
https://github.com/yattee/yattee.git
synced 2025-01-10 11:30:32 +05:30
Run play action async
This commit is contained in:
parent
ea0db9533a
commit
fca7b7a1a7
@ -1,3 +1,4 @@
|
||||
import CoreMedia
|
||||
import Defaults
|
||||
import SDWebImageSwiftUI
|
||||
import SwiftUI
|
||||
@ -62,6 +63,7 @@ struct VideoCell: View {
|
||||
}
|
||||
|
||||
private func playAction() {
|
||||
DispatchQueue.main.async {
|
||||
guard video.videoID != Video.fixtureID else {
|
||||
return
|
||||
}
|
||||
@ -80,17 +82,18 @@ struct VideoCell: View {
|
||||
return
|
||||
}
|
||||
|
||||
var playAt: TimeInterval?
|
||||
var playAt: CMTime?
|
||||
|
||||
if playNowContinues,
|
||||
!watch.isNil,
|
||||
!watch!.finished
|
||||
{
|
||||
playAt = watch!.stoppedAt
|
||||
playAt = .secondsInDefaultTimescale(watch!.stoppedAt)
|
||||
}
|
||||
|
||||
player.play(video, at: playAt, inNavigationView: inNavigationView)
|
||||
}
|
||||
}
|
||||
|
||||
private var playNowContinues: Bool {
|
||||
watchedVideoPlayNowBehavior == .continue
|
||||
|
Loading…
Reference in New Issue
Block a user