mirror of
https://github.com/yattee/yattee.git
synced 2026-05-13 02:45:03 +00:00
Add tvOS setting to close video with Menu button
When enabled, the Siri remote Menu button stops playback and clears the queue instead of only collapsing the player, and the explicit top-bar close (X) button is hidden.
This commit is contained in:
@@ -170,15 +170,19 @@ struct TVPlayerControlsView: View {
|
||||
// Close button — stops playback and dismisses.
|
||||
// Menu button only hides the player (keeps background playback),
|
||||
// so an explicit Close is kept here, icon-only in the top bar.
|
||||
Button {
|
||||
onClose()
|
||||
} label: {
|
||||
Image(systemName: "xmark")
|
||||
.font(.system(size: 26, weight: .semibold))
|
||||
// When `tvOSMenuButtonClosesVideo` is enabled, the Menu button
|
||||
// takes over this role and the explicit button is hidden.
|
||||
if appEnvironment?.settingsManager.tvOSMenuButtonClosesVideo != true {
|
||||
Button {
|
||||
onClose()
|
||||
} label: {
|
||||
Image(systemName: "xmark")
|
||||
.font(.system(size: 26, weight: .semibold))
|
||||
}
|
||||
.buttonStyle(TVCloseButtonStyle())
|
||||
.focused($focusedControl, equals: .closeButton)
|
||||
.accessibilityLabel(Text("player.controls.close"))
|
||||
}
|
||||
.buttonStyle(TVCloseButtonStyle())
|
||||
.focused($focusedControl, equals: .closeButton)
|
||||
.accessibilityLabel(Text("player.controls.close"))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -667,6 +667,9 @@ struct TVPlayerView: View {
|
||||
} else if controlsVisible {
|
||||
// Fifth: hide controls
|
||||
hideControls()
|
||||
} else if appEnvironment?.settingsManager.tvOSMenuButtonClosesVideo == true {
|
||||
// Sixth (Menu-closes mode): fully close the video like the xmark button
|
||||
closeVideo()
|
||||
} else {
|
||||
// Sixth: dismiss player (controls already hidden)
|
||||
dismissPlayer()
|
||||
|
||||
Reference in New Issue
Block a user