2021-12-19 22:47:04 +05:30
|
|
|
import Defaults
|
2021-10-06 01:50:09 +05:30
|
|
|
import Foundation
|
|
|
|
import SwiftUI
|
|
|
|
|
|
|
|
struct PlayerQueueRow: View {
|
|
|
|
let item: PlayerQueueItem
|
|
|
|
var history = false
|
|
|
|
@Binding var fullScreen: Bool
|
|
|
|
|
|
|
|
@EnvironmentObject<PlayerModel> private var player
|
|
|
|
|
2021-12-19 22:47:04 +05:30
|
|
|
@Default(.closePiPOnNavigation) var closePiPOnNavigation
|
|
|
|
|
2021-10-06 01:50:09 +05:30
|
|
|
var body: some View {
|
|
|
|
Group {
|
|
|
|
Button {
|
|
|
|
player.addCurrentItemToHistory()
|
|
|
|
|
|
|
|
if history {
|
2021-10-14 03:35:19 +05:30
|
|
|
player.playHistory(item)
|
2021-10-06 01:50:09 +05:30
|
|
|
} else {
|
|
|
|
player.advanceToItem(item)
|
|
|
|
}
|
|
|
|
|
|
|
|
if fullScreen {
|
|
|
|
withAnimation {
|
|
|
|
fullScreen = false
|
|
|
|
}
|
|
|
|
}
|
2021-12-19 22:47:04 +05:30
|
|
|
|
|
|
|
if closePiPOnNavigation, player.playingInPictureInPicture {
|
|
|
|
player.closePiP()
|
|
|
|
}
|
2021-10-06 01:50:09 +05:30
|
|
|
} label: {
|
2021-10-23 02:19:31 +05:30
|
|
|
VideoBanner(video: item.video, playbackTime: item.playbackTime, videoDuration: item.videoDuration)
|
2021-10-06 01:50:09 +05:30
|
|
|
}
|
|
|
|
.buttonStyle(.plain)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|