Skip to content

Commit

Permalink
Add warning when changing speakerOn:false on unsupported devices
Browse files Browse the repository at this point in the history
  • Loading branch information
ipavlidakis committed Feb 7, 2025
1 parent b769808 commit 8c9003e
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ final class StreamAudioSession: @unchecked Sendable, ObservableObject {
) {
guard currentDevice.deviceType == .phone else {
if activeCallSettings.speakerOn != session.currentRoute.isSpeaker {
log.warning(
"AudioSession cannot be switched to speakerOn:\(activeCallSettings.speakerOn) as the current device doesn't have an earpiece. Changing back CallSettings to speakOn:\(session.currentRoute.isSpeaker)",
subsystems: .audioSession
)
delegate?.audioSessionAdapterDidUpdateCallSettings(
self,
callSettings: activeCallSettings
Expand Down

0 comments on commit 8c9003e

Please sign in to comment.