Skip to content

AdMob conflicts with ExoPlayer: Codec hijacking causes crashes and improper audio focus management #1032

@MihaiCristianCondrea

Description

@MihaiCristianCondrea

Versions

Media3: 1.8.0
AdMob: 25.1.0

Devices that reproduce the issue

Devices with Qualcomm/QTI chipsets utilizing the hardware decoder component: c2.qti.vp9.decoder

  • Pixel 8 Pro
  • Nothing Phone 3A Pro
  • Lenovo Yoga Tab+

Reproduction steps

  • Set up an Android application layout containing two distinct components:

    • A standalone Google AdMob banner view (AdView / Native MediaView)
    • A primary Media3 PlayerView placed sequentially in the view hierarchy.
  • Begin continuous media playback inside the primary ExoPlayer instance.

  • After ExoPlayer starts playback, trigger ad load of type audio-video ad

Note

We found a fallback. We can catch the ERROR_CODE_DECODING_RESOURCES_RECLAIMED and force the player to start again prepare() -> play(). Even though this is not a proper, best-practice fix, we still encountered several times where the player ended up in a loop of prepare() -> play()

Expected result

  • AdMob heaving a handleAudioFocus() handler, to proper gain audio focus permission from the ExoPlayer and also releasing back audio focus
  • AdMob should not be that intrusive with tacking over of the codecs (crashing the exoplayer)

Actual result

When the video AdView starts loading and starts the playback, 2 issues occur:

  • ExoPlayer onPlayerError listener receive ERROR_CODE_DECODING_RESOURCES_RECLAIMED which glitch the player and make it stop.
  • The AdView (video/audio) does not release the audio focus. There is a glitch/bug because the ExoPlayer ends up in a continuous buffering...

There is no audio-focus handleAudioFocus() exchange between this type of ad and ExoPlayer (with handleAudioFocus = true)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions