mirror of
https://github.com/yattee/yattee.git
synced 2026-07-21 06:42:01 +00:00
Add audio-only music mode
Persistent per-platform mode that plays only the audio track to save bandwidth and speed up loads. When enabled, stream selection picks the best audio-only stream (preferred language, codec, bitrate) and never fetches the video URL; toggling mid-video reloads at the current position using the quality-switch path (live vid=no toggling is avoided due to A/V desync). - Toggle row in the player quality/settings sheet on iOS, macOS and tvOS, next to lock controls - New audioMode control button type (red when active) for player controls and mini player layouts - Picking a video quality explicitly turns the mode off; audio track picks keep it on and now work while audio-only is playing - Stream URL refresh preserves audio-only playback instead of resurrecting video - Queue preloads and history entries resolved before a toggle are discarded so selection re-runs with the current mode - tvOS player shows the video thumbnail instead of a black screen during audio-only playback - PiP button hidden for audio-only streams
This commit is contained in:
@@ -382,6 +382,7 @@ struct PlayerControlsView: View {
|
||||
panscanValue: panscanValue,
|
||||
isPanscanAllowed: isPanscanAllowed,
|
||||
isAutoPlayNextEnabled: appEnvironment?.settingsManager.queueAutoPlayNext ?? true,
|
||||
isAudioModeEnabled: appEnvironment?.settingsManager.audioOnlyModeEnabled ?? false,
|
||||
yatteeServerURL: appEnvironment?.instancesManager.yatteeServerInstances.first { $0.isEnabled }?.url,
|
||||
deArrowBrandingProvider: appEnvironment?.deArrowBrandingProvider,
|
||||
onClose: onClose,
|
||||
@@ -395,6 +396,11 @@ struct PlayerControlsView: View {
|
||||
onToggleAutoPlayNext: {
|
||||
appEnvironment?.settingsManager.queueAutoPlayNext.toggle()
|
||||
},
|
||||
onToggleAudioMode: { [weak appEnvironment] in
|
||||
guard let appEnvironment else { return }
|
||||
let enabled = !appEnvironment.settingsManager.audioOnlyModeEnabled
|
||||
Task { await appEnvironment.playerService.setAudioMode(enabled) }
|
||||
},
|
||||
onShowSettings: onShowSettings,
|
||||
onPlayNext: onPlayNext,
|
||||
onPlayPrevious: onPlayPrevious,
|
||||
|
||||
Reference in New Issue
Block a user