Keep audio session warm on native resume

This commit is contained in:
dirtydishes 2026-05-27 00:30:26 -04:00
parent ae5fb256ae
commit f0226c651d
6 changed files with 602 additions and 0 deletions

View file

@ -64,6 +64,17 @@ enum NativePlaybackTogglePolicy {
}
}
enum NativePlaybackAudioSessionPolicy {
static func shouldPrepareBeforePlayback(from state: NativePlaybackToggleState) -> Bool {
switch state {
case .paused, .stopped, .ended, .error:
return true
case .opening, .buffering, .playing, .unknown:
return false
}
}
}
enum NativePlaybackError: LocalizedError {
case backendUnavailable
case startupTimedOut