2021-10-05 20:20:09 +00:00
|
|
|
import Foundation
|
|
|
|
import SwiftUI
|
|
|
|
|
|
|
|
struct PlayerQueueRow: View {
|
|
|
|
let item: PlayerQueueItem
|
|
|
|
var history = false
|
|
|
|
@Binding var fullScreen: Bool
|
|
|
|
|
|
|
|
@EnvironmentObject<PlayerModel> private var player
|
|
|
|
|
|
|
|
var body: some View {
|
|
|
|
Group {
|
|
|
|
Button {
|
|
|
|
player.addCurrentItemToHistory()
|
|
|
|
|
|
|
|
if history {
|
2021-10-13 22:05:19 +00:00
|
|
|
player.playHistory(item)
|
2021-10-05 20:20:09 +00:00
|
|
|
} else {
|
|
|
|
player.advanceToItem(item)
|
|
|
|
}
|
|
|
|
|
|
|
|
if fullScreen {
|
|
|
|
withAnimation {
|
|
|
|
fullScreen = false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} label: {
|
2021-10-22 20:49:31 +00:00
|
|
|
VideoBanner(video: item.video, playbackTime: item.playbackTime, videoDuration: item.videoDuration)
|
2021-10-05 20:20:09 +00:00
|
|
|
}
|
|
|
|
.buttonStyle(.plain)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|