0

Recently I recognized Android's behavior:

  1. start video playback in one application (in my case it's Netflix Android app)
  2. go to Youtube Android app - Netflix video preview goes into PIP mode and playback is rolling
  3. in Youtube app start a video - then Netflix PIP playback stops

How is that possible and what api is used to inform the other app to stop it's playback? Does it happen independently from the Netflix/ Youtube app on the level of Android OS itself? Is it described somewhere?

Marian Paździoch
  • 8,813
  • 10
  • 58
  • 103

1 Answers1

0

Apps manage audio focus by calling requestAudioFocus() and abandonAudioFocus().

Apps must also register an AudioManager.OnAudioFocusChangeListener with both calls in order to receive callbacks and manage their own audio level.

Antonis Radz
  • 3,036
  • 1
  • 16
  • 34