arrow-left

All pages
gitbookPowered by GitBook
1 of 1

Loading...

The Ï„ Player API

setAudioFocus.

hashtag
setAudioFocus()

  • Dart API: setAudioFocusarrow-up-right.

hashtag
focus: parameter possible values are

  • AudioFocus.requestFocus (request focus, but do not do anything special with others App)

  • AudioFocus.requestFocusAndStopOthers (your app will have exclusive use of the output audio)

  • AudioFocus.requestFocusAndDuckOthers (if another App like Spotify use the output audio, its volume will be lowered)

hashtag
Other parameters :

Please look to to understand the meaning of the other parameters

Example:

</div>

AudioFocus.requestFocusAndKeepOthers (your App will play sound above others App)

  • AudioFocus.requestFocusAndInterruptSpokenAudioAndMixWithOthers

  • AudioFocus.requestFocusTransient (for Android)

  • AudioFocus.requestFocusTransientExclusive (for Android)

  • AudioFocus.abandonFocus (Your App will not have anymore the audio focus)

  • openAudioSession()arrow-up-right
    Dart
    Javascript
    
            myPlayer.setAudioFocus(focus: AudioFocus.requestFocusAndDuckOthers);
    
            Lorem ipsum ...