audio - How to handle failed AudioFocus requests in Android? -
i working on application has media playing features.
i honor audiofocus. first request audifocus:
audiomanager.requestaudiofocus(new customonaudiofocuschangelistener(), audiomanager.stream_music, audiomanager.audiofocus_gain); this call returns either audiofocus_request_failed or audiofocus_request_granted. guess shouldn't start playback if receive audiofocus_request_failed. do?
will customonaudiofocuschangelistener notified when focus becomes available or when got autofocus_request_granted starts getting updates?
should inform user , ask him try again later? or retry programmatically after time?
thanks in advance
what depends on how want app react. shouldn't start playing, may want message user. or if non-critical, may silently ignore failure , move on.
i believe updates on listener on success. updates if you're lowered can choose duck output or pause until regain.
Comments
Post a Comment