mirror of
https://github.com/yattee/yattee.git
synced 2025-01-08 22:07:10 +00:00
move onReceive to the chapter header in VideoDetails
This commit is contained in:
parent
d361ef01d4
commit
4ca8adc4dd
@ -1,4 +1,3 @@
|
|||||||
import CoreMedia
|
|
||||||
import Foundation
|
import Foundation
|
||||||
import SDWebImageSwiftUI
|
import SDWebImageSwiftUI
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
@ -24,15 +23,6 @@ import SwiftUI
|
|||||||
.contentShape(Rectangle())
|
.contentShape(Rectangle())
|
||||||
}
|
}
|
||||||
.buttonStyle(.plain)
|
.buttonStyle(.plain)
|
||||||
.onReceive(
|
|
||||||
NotificationCenter.default
|
|
||||||
.publisher(for: .getTimeUpdatesNotification)
|
|
||||||
.receive(on: DispatchQueue.main)
|
|
||||||
) { notification in
|
|
||||||
if let cmTime = notification.object as? CMTime {
|
|
||||||
player.updateTime(cmTime)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var verticalChapter: some View {
|
var verticalChapter: some View {
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import CoreMedia
|
||||||
import Defaults
|
import Defaults
|
||||||
import Foundation
|
import Foundation
|
||||||
import SDWebImageSwiftUI
|
import SDWebImageSwiftUI
|
||||||
@ -485,6 +486,15 @@ struct VideoDetails: View {
|
|||||||
.padding(.horizontal)
|
.padding(.horizontal)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.onReceive(
|
||||||
|
NotificationCenter.default
|
||||||
|
.publisher(for: .getTimeUpdatesNotification)
|
||||||
|
.receive(on: DispatchQueue.main)
|
||||||
|
) { notification in
|
||||||
|
if let cmTime = notification.object as? CMTime {
|
||||||
|
player.updateTime(cmTime)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user