SpeakerHijackingStrategy

@available(iOS 12.0, *)
@objc(BDKSpeakerHijackingStrategy)
public enum SpeakerHijackingStrategy : Int

Options specifying whether and when the Kaleyra Video SDK should override the audio output to the speaker automatically when a call is started or answered. These options will be applied only on devices supporting both an ear and a loud speaker (iPhones).

  • The audio output is never routed automatically to the phone speaker. Audio will be reproduced through the ear speaker. Users can still change the audio route at any time using the audio output picking view presented in the Call UI (on both System and Kaleyra Video call UI).

    Declaration

    Swift

    case never = 0
  • The audio output is always routed automatically to the phone speaker no matter if the call is an audio only call, nor if the application is in background and device is locked (CallKit). Users can still change the audio route at any time using the audio output picking view presented in the Call UI (on both System and Kaleyra Video call UI).

    Declaration

    Swift

    case always = 1
  • The audio output is routed automatically to the phone speaker only if the ongoing call is a video call. If the ongoing call is an audio only call this option will act as never strategy. If, however, the ongoing call is an audio upgradable call the audio will be routed automatically to the phone speaker when the user upgrades to a video call but only if she has never changed the audio route explicitly (changing the audio output from the System or Kaleyra Video call UI), or implicitly (plugging-in a set of earphones or a bluetooth device). This strategy will be applied even when the application is in background and the user is answering the call from the system UI (CallKit) or from lock screen.

    Declaration

    Swift

    case video = 2
  • The audio output is routed automatically to the phone speaker only if the ongoing call is a video call and the app is in foreground or when it enters foreground. This strategy acts as video, this strategy however will not override the audio route to the speaker until the application has entered foreground state. This means that if the user answers a video call from lock screen, audio will be played through the ear speaker until the user unlocks her phone and launches your app, only then the audio will start playing through the loud speaker. As always, if the user changes the audio route explicitly or implicitly the Kaleyra Video SDK will continue honouring the user choice without making any change to the audio route automatically.

    Declaration

    Swift

    case videoForeground = 3