BDKSpeakerHijackingStrategy

Objective-C

enum BDKSpeakerHijackingStrategy {}

Swift

enum BDKSpeakerHijackingStrategy : UInt

Options specifying whether and when the Bandyer 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 ouput picking view presented in the Call UI (on both System and Bandyer call UI).

    Declaration

    Objective-C

    BDKSpeakerHijackingStrategyNever = 0

    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 ouput picking view presented in the Call UI (on both System and Bandyer call UI).

    Declaration

    Objective-C

    BDKSpeakerHijackingStrategyAlways = 1

    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 BDKSpeakerHijackingStrategyNever 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 explictly (changing the audio output from the System or Bandyer 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

    Objective-C

    BDKSpeakerHijackingStrategyVideo = 2

    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 stategy acts as BDKSpeakerHijackingStrategyVideo, 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 explictly or implicitly the BandyerSDK will continue honoring the user choice without making any change to the audio route automatically.

    Declaration

    Objective-C

    BDKSpeakerHijackingStrategyVideoForeground = 3

    Swift

    case videoForeground = 3