# Is there a way to not pause the player when Vast is empty?

**URL:** <https://community.bitmovin.com/t/is-there-a-way-to-not-pause-the-player-when-vast-is-empty/1544>\
**Category:** Support\
**Tags:** bitmovin-player, android, bitmovin\
**Created:** [November 28, 2022, 7:09pm UTC](https://community.bitmovin.com/t/is-there-a-way-to-not-pause-the-player-when-vast-is-empty/1544 "2022-11-28T19:09:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gledezma](https://sea1.discourse-cdn.com/flex015/user_avatar/community.bitmovin.com/gledezma/32/511_2.png) [@gledezma](https://community.bitmovin.com/u/gledezma)\
**Post date:** [November 28, 2022, 7:09pm UTC](https://community.bitmovin.com/t/is-there-a-way-to-not-pause-the-player-when-vast-is-empty/1544/1 "2022-11-28T19:09:05Z")

</div>

Hello there,

We are trying to schedule midroll ads with an AdServer that takes some macros to create a Vast, but if the macros don’t match with the configuration (ie: hour, country, type of content…), the AdServer returns an empty Vast that is processed as an AdError, pausing the player for a second and then continues with the content without problem.

As the title says, is there a way to bypass this pause/play when the Vast is empty?

---

<div class="post-metadata">

**Author:** ![Lukas](https://sea1.discourse-cdn.com/flex015/user_avatar/community.bitmovin.com/lukas/32/393_2.png) [@Lukas](https://community.bitmovin.com/u/Lukas)\
**Post date:** [November 29, 2022, 7:02am UTC](https://community.bitmovin.com/t/is-there-a-way-to-not-pause-the-player-when-vast-is-empty/1544/2 "2022-11-29T07:02:37Z")

</div>

Hi @gledezma,  
the Android Player pauses the main content in order to play back the ad. This behaviour is in place to guarantee that the ad is shown at the exact moment it was scheduled (i.e. at 25% or after some specific content).  
If the ad evaluates to an error ([PlayerEvent.AdError](https://cdn.bitmovin.com/player/android/3/docs/-player%20-module/com.bitmovin.player.api.event/-player-event/-ad-error/index.html) is emitted) as described in your use case, the main content is resumed. This is the `pause` → `play` that you are experiencing.

The behaviour can be improved by preloading the ad manifest before reaching the actual ad position in the main content. This allows the advertising SDK to evaluate the error early on and avoid the extra `pause`.

In the Bitmovin Android Player, the ad manifest preloading offset can be configured [here](https://cdn.bitmovin.com/player/android/3/docs/-player%20-module/com.bitmovin.player.api.advertising/-ad-item/preload-offset.html). A sensible value can be something between five and ten seconds depending on the performance of your ad server.

There is one major downside to increasing the preloading offset if your app supports background playback (documentation from [AdItem](https://cdn.bitmovin.com/player/android/3/docs/-player%20-module/com.bitmovin.player.api.advertising/-ad-item/index.html)):

> If the ad view group is removed or set the first time (e.g. by passing `null` to Player.setAdViewGroup or by moving the hosting app to the background) after an IMA [AdSource](https://cdn.bitmovin.com/player/android/3/docs/-player%20-module/com.bitmovin.player.api.advertising/-ad-source/index.html) has been loaded, the according [AdItem](https://cdn.bitmovin.com/player/android/3/docs/-player%20-module/com.bitmovin.player.api.advertising/-ad-item/index.html) is discarded. The same holds true if the ad view group is removed or set during ad playback.

This will - without suitable counter measures - result in scheduled ads not being played when the app is moved to the background.

Hope that helps. 🙂

---

<div class="post-metadata">

**Author:** ![gledezma](https://sea1.discourse-cdn.com/flex015/user_avatar/community.bitmovin.com/gledezma/32/511_2.png) [@gledezma](https://community.bitmovin.com/u/gledezma)\
**Post date:** [November 29, 2022, 2:47pm UTC](https://community.bitmovin.com/t/is-there-a-way-to-not-pause-the-player-when-vast-is-empty/1544/3 "2022-11-29T14:47:54Z")

</div>

Thank you very much for the quick answer

We will test this preload offset and let you know, we think is the solution we were looking for.

edit: it was the solution.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/bitmovin/original/1X/1ab86334145095b0af9c5b924fa3ae6d920b6482.png) [@system](https://community.bitmovin.com/u/system)\
**Post date:** [November 29, 2022, 3:48pm UTC](https://community.bitmovin.com/t/is-there-a-way-to-not-pause-the-player-when-vast-is-empty/1544/4 "2022-11-29T15:48:12Z")

</div>

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.
