Package com.ooyala.pulse
Class OmidAdSession
- java.lang.Object
-
- com.ooyala.pulse.OmidAdSession
-
public class OmidAdSession extends java.lang.Object
This class is used to request OMID ad session.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
addFriendlyObstructions(java.util.List<FriendlyObstruction> friendlyObstructions)
This method can be used to add friendly obstructions if they haven't been sent already while creating OMID ad session usingcreateOmidAdSession(PulseVideoAd, Context, View, String, List)
.static void
createOmidAdSession(PulseVideoAd pulseVideoAd, android.content.Context context, android.view.View adView, java.lang.String contentUrl)
This method is used to create OMID ad session and should be called before playing ad content, otherwise ad session events will not be recorded and viewable impression events will not be tracked.static void
createOmidAdSession(PulseVideoAd pulseVideoAd, android.content.Context context, android.view.View adView, java.lang.String contentUrl, java.util.List<FriendlyObstruction> friendlyObstructions)
This method is used to create OMID ad session and should be called before playing ad content, otherwise ad session events will not be recorded and viewable impression events will not be tracked.static void
registerAdView(android.view.View adView)
Utility method to update ad view.static void
removeAllFriendlyObstructions()
Remove all registered friendly obstructions.static void
removeFriendlyObstructions(java.util.List<FriendlyObstruction> friendlyObstructions)
Remove registered friendly obstructions.
-
-
-
Method Detail
-
createOmidAdSession
public static void createOmidAdSession(@NonNull PulseVideoAd pulseVideoAd, @NonNull android.content.Context context, @NonNull android.view.View adView, java.lang.String contentUrl, java.util.List<FriendlyObstruction> friendlyObstructions)
This method is used to create OMID ad session and should be called before playing ad content, otherwise ad session events will not be recorded and viewable impression events will not be tracked. If there aren't any friendlyObstructions, you should callcreateOmidAdSession(PulseVideoAd, Context, View, String)
method instead.- Parameters:
pulseVideoAd
- ThePulseVideoAd
that should be displayed.context
- Application Context of the running application.adView
- The native view that OMID should consider for viewability tracking.contentUrl
- The deep link URL for the app screen that is displaying the ad.friendlyObstructions
- The friendly obstructions that OMID will exclude from all viewability calculations. Notify all verification providers that the ad session has started and ad view tracking will begin.
-
createOmidAdSession
public static void createOmidAdSession(@NonNull PulseVideoAd pulseVideoAd, @NonNull android.content.Context context, @NonNull android.view.View adView, java.lang.String contentUrl)
This method is used to create OMID ad session and should be called before playing ad content, otherwise ad session events will not be recorded and viewable impression events will not be tracked. This method should be called when there aren't any friendlyObstructions to register, otherwise you should callcreateOmidAdSession(PulseVideoAd, Context, View, String, List)
It is possible to register friendlyObstructions later on as well, when they appear during the ad playback, by callingaddFriendlyObstructions(List)
- Parameters:
pulseVideoAd
- ThePulseVideoAd
that should be displayed.context
- Application Context of the running application.adView
- The native view that OMID should consider for viewability tracking.contentUrl
- The deep link URL for the app screen that is displaying the ad. Notify all verification providers that the ad session has started and ad view tracking will begin.
-
registerAdView
public static void registerAdView(android.view.View adView)
Utility method to update ad view. If the view changes at a subsequent time due to a fullscreen expansion or for a similar reason, you should always update the ad view reference to whatever is appropriate at that time. If an ad view is already registered for the current session, that ad view will be automatically unregistered and the new ad view will be registered in its place. This method will have no effect if called after the ad session has finished.- Parameters:
adView
- The native view which should be registered for viewability tracking.- Throws:
java.lang.IllegalArgumentException
- if the supplied ad view is null.
-
addFriendlyObstructions
public static void addFriendlyObstructions(java.util.List<FriendlyObstruction> friendlyObstructions)
This method can be used to add friendly obstructions if they haven't been sent already while creating OMID ad session usingcreateOmidAdSession(PulseVideoAd, Context, View, String, List)
. This method will have no effect if called after the OMID ad session has finished.- Parameters:
friendlyObstructions
- The friendly obstructions to be excluded from all ad session viewability calculations.
-
removeFriendlyObstructions
public static void removeFriendlyObstructions(java.util.List<FriendlyObstruction> friendlyObstructions)
Remove registered friendly obstructions. This method will have no effect if called after the OMID ad session has finished.- Parameters:
friendlyObstructions
- The friendly obstructions to be removed from the list of registered friendly obstructions.
-
removeAllFriendlyObstructions
public static void removeAllFriendlyObstructions()
Remove all registered friendly obstructions. This method will have no effect if called after the OMID ad session has finished.
-
-