mirror of
https://github.com/yattee/yattee.git
synced 2024-11-13 01:28:22 +00:00
61a4951831
- player is now a separate window on macOS - add setting to disable pause when player is closed (fixes #40) - add PiP settings: * Close PiP when starting playing other video * Close PiP when player is opened * Close PiP and open player when application enters foreground (iOS/tvOS) (fixes #37) - new player placeholder when in PiP, context menu with exit option
41 lines
1.0 KiB
Swift
41 lines
1.0 KiB
Swift
import Defaults
|
|
import Foundation
|
|
import SwiftUI
|
|
|
|
struct PlayerQueueRow: View {
|
|
let item: PlayerQueueItem
|
|
var history = false
|
|
@Binding var fullScreen: Bool
|
|
|
|
@EnvironmentObject<PlayerModel> private var player
|
|
|
|
@Default(.closePiPOnNavigation) var closePiPOnNavigation
|
|
|
|
var body: some View {
|
|
Group {
|
|
Button {
|
|
player.addCurrentItemToHistory()
|
|
|
|
if history {
|
|
player.playHistory(item)
|
|
} else {
|
|
player.advanceToItem(item)
|
|
}
|
|
|
|
if fullScreen {
|
|
withAnimation {
|
|
fullScreen = false
|
|
}
|
|
}
|
|
|
|
if closePiPOnNavigation, player.playingInPictureInPicture {
|
|
player.closePiP()
|
|
}
|
|
} label: {
|
|
VideoBanner(video: item.video, playbackTime: item.playbackTime, videoDuration: item.videoDuration)
|
|
}
|
|
.buttonStyle(.plain)
|
|
}
|
|
}
|
|
}
|