com.adobe.mediacore.timeline.advertising
Class Ad

java.lang.Object
  extended by com.adobe.mediacore.timeline.advertising.Ad

public final class Ad
extends Object


Method Summary
static Ad cloneAd(Ad ad, long duration, int id)
           
static Ad createAd(MediaResource.Type type, long duration, int id, AdAsset primaryAsset, List<AdAsset> companionAssets, ContentTracker contentTracker)
          Creates a new ad instance.
static Ad createCustomAdMarker(MediaResource.Type type, long duration, int id, AdAsset primaryAdAsset)
           
 boolean equals(Ad otherAd)
           
 List<AdAsset> getCompanionAssets()
           
 ContentTracker getContentTracker()
           
 long getDuration()
           
 int getId()
           
 AdAsset getPrimaryAsset()
          The primary asset represent the main asset of the ad.
 MediaResource.Type getType()
          Ads types influence the playback timeline.
 boolean isClickable()
          Verifies if that upon viewing the primary asset of an ad, the user can choose to be redirected to an provided url in the native web browser or within an in-app browser.
 boolean isCustomAdMarker()
           
 String toString()
          Returns a String representation of the current ad.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getPrimaryAsset

public final AdAsset getPrimaryAsset()
The primary asset represent the main asset of the ad. This is displayed when introducing an ad in the playback timeline.

Returns:
The primary asset for the ad

getCompanionAssets

public final List<AdAsset> getCompanionAssets()
Returns:
The companion assets for the ad

getType

public final MediaResource.Type getType()
Ads types influence the playback timeline. Only linear ads supported in HLS format.

Returns:
The type of the ad.

getDuration

public final long getDuration()
Returns:
Duration of the ad in milliseconds

getId

public int getId()
Returns:
The ad id.

isCustomAdMarker

public boolean isCustomAdMarker()
Returns:
true if the ad is a custom ad marker

getContentTracker

public ContentTracker getContentTracker()

createAd

public static Ad createAd(MediaResource.Type type,
                          long duration,
                          int id,
                          AdAsset primaryAsset,
                          List<AdAsset> companionAssets,
                          ContentTracker contentTracker)
Creates a new ad instance.

Parameters:
type - The media item type.
duration - The ad duration.
id - The ad id.
contentTracker -
Returns:
The ad instance.

createCustomAdMarker

public static Ad createCustomAdMarker(MediaResource.Type type,
                                      long duration,
                                      int id,
                                      AdAsset primaryAdAsset)

cloneAd

public static Ad cloneAd(Ad ad,
                         long duration,
                         int id)

equals

public boolean equals(Ad otherAd)

isClickable

public boolean isClickable()
Verifies if that upon viewing the primary asset of an ad, the user can choose to be redirected to an provided url in the native web browser or within an in-app browser.

Returns:
true if the ad can redirect the user to an url provided by the ad server

toString

public String toString()
Returns a String representation of the current ad. As an ad can have a significant amount of custom metadata associated with it, we will not include metadata content in this representation.

Overrides:
toString in class Object
Returns:
a string containing the url, type, duration and id