Can you tell me how to disable the ad UI in version 3.89.0?

Product

Player

Question

Hello developers,
I recently saw a post in the community mentioning that AdsManager is no longer used. As a result, I realized that when updating to the latest version, I couldn’t receive the values passed through the ImaConfig.onAdsManagerAvailable callback.
However, I’m facing an issue. In some community posts, I’ve noticed that the ad UI (countdown, skip button) is still visible, and I want to remove this UI. How can I achieve this?
I’ve tried the following configuration, but it doesn’t remove the UI:

AdvertisingConfig(
schedule = listOf(AdItem(“pre”, AdSource(AdSourceType.Ima, adUrl))),
imaUiElements = emptyList(),
ima = ImaConfig(
preferredUiType = ImaUiType.Disabled
)
)

Additionally, I used to receive callbacks for the remaining ad time, current time, and skip offset time through AdsManager. Could someone guide me on where I can now receive these callbacks?
Any help or insights would be greatly appreciated. Thanks in advance!

Hi @suein1209 and welcome to the community!

For ads managed through IMA, hiding certain UI elements isn’t always possible since IMA sometimes restricts UI customization. Regarding your Bitmovin API setup, you’re close! However, you’re using one deprecated configuration property.

Currently, you’re setting ImaConfig.prefferredUiType to ImaUiType.Disabled defining UI elements within the AdvertisingConfig.
I would recommend to set the UI elements on the ImaConfig.preferredUiElements, though there should be no functional difference.

As mentioned, IMA might not allow to disable the UI or certain UI elements, in which case the player will emit warnings.
If the UI can’t be disabled, you’ll see a DisablingImaUiFailed event, and when it if preferred UI elements can’t be applied, a ApplyingImaUiElementPreferenceFailed event will be emitted by the player.

Generally, we do not recommend to directly interact with the AdsManager. The Bitmovin API surface should provide all the information you need. If that’s not the case, feel free to point out those specific short comings and we can find and create further solutions for your use-case.
The duration and the current playback time of the ad is provided by the player through the same API as for the main content. While an ad is playing (Player.isAd), you can use Player.duration and Player.currentTime to get the duration and position in the current ad. Further you can listen for the TimeChanged event.
To get the skip offset you need to listen to the AdStarted, which contains the skipOffset duration as well as some other ad specific properties.

Lastly, do I understand you correctly that the ImaConfig.onAdsManagerAvailable callback is not called when you schedule an IMA ad? If that’s the case, could you please provide us the steps to reproduce this issue? (If possible, best would be of course a minimal code sample)

Let me know if something is unclear or new questions arise!

Best,
Matthias