mirror of
https://github.com/yattee/yattee.git
synced 2024-12-22 21:43:41 +00:00
Fix stream state
This commit is contained in:
parent
2c275d9353
commit
a68d89cb6f
@ -67,6 +67,8 @@ final class PlayerModel: ObservableObject {
|
|||||||
|
|
||||||
func playVideo(_ video: Video) {
|
func playVideo(_ video: Video) {
|
||||||
if video.live {
|
if video.live {
|
||||||
|
self.stream = nil
|
||||||
|
|
||||||
playHlsUrl(video)
|
playHlsUrl(video)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -42,6 +42,7 @@ struct ContentView: View {
|
|||||||
.fullScreenCover(isPresented: $player.presentingPlayer) {
|
.fullScreenCover(isPresented: $player.presentingPlayer) {
|
||||||
VideoPlayerView()
|
VideoPlayerView()
|
||||||
.environmentObject(api)
|
.environmentObject(api)
|
||||||
|
.environmentObject(instances)
|
||||||
.environmentObject(navigation)
|
.environmentObject(navigation)
|
||||||
.environmentObject(player)
|
.environmentObject(player)
|
||||||
.environmentObject(subscriptions)
|
.environmentObject(subscriptions)
|
||||||
@ -51,6 +52,7 @@ struct ContentView: View {
|
|||||||
VideoPlayerView()
|
VideoPlayerView()
|
||||||
.frame(minWidth: 900, minHeight: 800)
|
.frame(minWidth: 900, minHeight: 800)
|
||||||
.environmentObject(api)
|
.environmentObject(api)
|
||||||
|
.environmentObject(instances)
|
||||||
.environmentObject(navigation)
|
.environmentObject(navigation)
|
||||||
.environmentObject(player)
|
.environmentObject(player)
|
||||||
.environmentObject(subscriptions)
|
.environmentObject(subscriptions)
|
||||||
|
@ -79,3 +79,10 @@ struct PlaybackBar: View {
|
|||||||
.keyboardShortcut(.cancelAction)
|
.keyboardShortcut(.cancelAction)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct PlaybackBar_Previews: PreviewProvider {
|
||||||
|
static var previews: some View {
|
||||||
|
PlaybackBar()
|
||||||
|
.injectFixtureEnvironmentObjects()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -159,7 +159,6 @@ struct VideoPlayerView: View {
|
|||||||
struct VideoPlayerView_Previews: PreviewProvider {
|
struct VideoPlayerView_Previews: PreviewProvider {
|
||||||
static var previews: some View {
|
static var previews: some View {
|
||||||
VideoPlayerView()
|
VideoPlayerView()
|
||||||
// .frame(minWidth: 1200, minHeight: 1400)
|
|
||||||
.injectFixtureEnvironmentObjects()
|
.injectFixtureEnvironmentObjects()
|
||||||
|
|
||||||
VideoPlayerView()
|
VideoPlayerView()
|
||||||
|
@ -18,6 +18,7 @@ struct Player: NSViewControllerRepresentable {
|
|||||||
let controller = PlayerViewController()
|
let controller = PlayerViewController()
|
||||||
|
|
||||||
controller.playerModel = player
|
controller.playerModel = player
|
||||||
|
player.controller = controller
|
||||||
|
|
||||||
return controller
|
return controller
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user