mirror of
https://github.com/dirtydishes/dreamio.git
synced 2026-06-06 21:38:15 +00:00
Keep audio session warm on native resume
This commit is contained in:
parent
ae5fb256ae
commit
f0226c651d
6 changed files with 602 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue