Commit 9bb64b7e by andrewlewis Committed by Oliver Woodman

Add support for setting companion ad slots

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=205373398
parent 0b8724cb
...@@ -13,8 +13,10 @@ ...@@ -13,8 +13,10 @@
* DRM: * DRM:
* Allow DrmInitData to carry a license server URL * Allow DrmInitData to carry a license server URL
([#3393](https://github.com/google/ExoPlayer/issues/3393)). ([#3393](https://github.com/google/ExoPlayer/issues/3393)).
* IMA: Fix behavior when creating/releasing the player then releasing * IMA:
`ImaAdsLoader` ([#3879](https://github.com/google/ExoPlayer/issues/3879)). * Fix behavior when creating/releasing the player then releasing
`ImaAdsLoader` ([#3879](https://github.com/google/ExoPlayer/issues/3879)).
* Add support for setting slots for companion ads.
* Fix issue playing DRM protected streams on Asus Zenfone 2 * Fix issue playing DRM protected streams on Asus Zenfone 2
([#4403](https://github.com/google/ExoPlayer/issues/4413)). ([#4403](https://github.com/google/ExoPlayer/issues/4413)).
* Add support for multiple audio and video tracks in MPEG-PS streams * Add support for multiple audio and video tracks in MPEG-PS streams
......
...@@ -38,6 +38,7 @@ import com.google.ads.interactivemedia.v3.api.AdsManager; ...@@ -38,6 +38,7 @@ import com.google.ads.interactivemedia.v3.api.AdsManager;
import com.google.ads.interactivemedia.v3.api.AdsManagerLoadedEvent; import com.google.ads.interactivemedia.v3.api.AdsManagerLoadedEvent;
import com.google.ads.interactivemedia.v3.api.AdsRenderingSettings; import com.google.ads.interactivemedia.v3.api.AdsRenderingSettings;
import com.google.ads.interactivemedia.v3.api.AdsRequest; import com.google.ads.interactivemedia.v3.api.AdsRequest;
import com.google.ads.interactivemedia.v3.api.CompanionAdSlot;
import com.google.ads.interactivemedia.v3.api.ImaSdkFactory; import com.google.ads.interactivemedia.v3.api.ImaSdkFactory;
import com.google.ads.interactivemedia.v3.api.ImaSdkSettings; import com.google.ads.interactivemedia.v3.api.ImaSdkSettings;
import com.google.ads.interactivemedia.v3.api.player.ContentProgressProvider; import com.google.ads.interactivemedia.v3.api.player.ContentProgressProvider;
...@@ -62,6 +63,7 @@ import java.lang.annotation.Retention; ...@@ -62,6 +63,7 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -396,6 +398,17 @@ public final class ImaAdsLoader extends Player.DefaultEventListener implements A ...@@ -396,6 +398,17 @@ public final class ImaAdsLoader extends Player.DefaultEventListener implements A
} }
/** /**
* Sets the slots for displaying companion ads. Individual slots can be created using {@link
* ImaSdkFactory#createCompanionAdSlot()}.
*
* @param companionSlots Slots for displaying companion ads.
* @see AdDisplayContainer#setCompanionSlots(Collection)
*/
public void setCompanionSlots(Collection<CompanionAdSlot> companionSlots) {
adDisplayContainer.setCompanionSlots(companionSlots);
}
/**
* Requests ads, if they have not already been requested. Must be called on the main thread. * Requests ads, if they have not already been requested. Must be called on the main thread.
* *
* <p>Ads will be requested automatically when the player is prepared if this method has not been * <p>Ads will be requested automatically when the player is prepared if this method has not been
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment