Class AdBreak
- java.lang.Object
-
- com.longtailvideo.jwplayer.media.ads.AdBreak
-
- All Implemented Interfaces:
com.longtailvideo.jwplayer.utils.Jsonable
public class AdBreak extends java.lang.Object implements com.longtailvideo.jwplayer.utils.JsonableAn ad break.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAdBreak.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.util.List<AdBreak>cloneList(java.util.List<AdBreak> src)booleanequals(java.lang.Object obj)AdTypegetAdType()java.util.Map<java.lang.String,java.lang.String>getCustomParams()java.lang.StringgetOffset()AdSourcegetSource()java.util.List<java.lang.String>getTag()inthashCode()static AdBreakparseJson(java.lang.String jsonStr)static AdBreakparseJson(org.json.JSONObject json)voidsetAdType(AdType adType)voidsetCustomParams(java.util.Map<java.lang.String,java.lang.String> custParams)voidsetOffset(java.lang.String offset)voidsetSource(AdSource adSource)voidsetTag(java.lang.String... tags)voidsetTag(java.util.List<java.lang.String> tags)org.json.JSONObjecttoJson()
-
-
-
Constructor Detail
-
AdBreak
public AdBreak(java.lang.String offset, AdSource adSource, java.lang.String... tags)Convenience constructor for V2->V3 migrations
-
AdBreak
public AdBreak(AdBreak src)
-
AdBreak
public AdBreak(AdBreak.Builder builder)
-
-
Method Detail
-
setSource
public void setSource(AdSource adSource)
- Parameters:
adSource- The ad source for this ad break -- VAST, IMA, or FW
-
setTag
public void setTag(java.lang.String... tags)
- Parameters:
tags- The ad tags that are called during the configured ad break.
-
setTag
public void setTag(java.util.List<java.lang.String> tags)
- Parameters:
tags- The ad tags that are called during the configured ad break.
-
setOffset
public void setOffset(java.lang.String offset)
- Parameters:
offset- When to play the configured ad tag. "pre": Ad plays as a preroll "post": Ad plays as a postroll "xx%": Ad plays after xx% of the content number: Ad plays after the specified number of seconds
-
setAdType
public void setAdType(@NonNull AdType adType)- Parameters:
adType- This should be set to NONLINEAR if you want to force the player to render a nonlinear ad in the ad response.
-
setCustomParams
public void setCustomParams(@Nullable java.util.Map<java.lang.String,java.lang.String> custParams)- Parameters:
custParams- Allows for passing custom parameters to an ad break, which then pass through to the URL requested from the ad server.
-
getSource
public AdSource getSource()
- Returns:
- The ad source for this ad break -- VAST, IMA, or FW
-
getTag
public java.util.List<java.lang.String> getTag()
- Returns:
- The ad tags that are called during the configured ad break.
-
getOffset
public java.lang.String getOffset()
- Returns:
- When to play the configured ad tag.
-
getAdType
@NonNull public AdType getAdType()
- Returns:
- The ad type -- LINEAR or NONLINEAR.
-
getCustomParams
@Nullable public java.util.Map<java.lang.String,java.lang.String> getCustomParams()
- Returns:
- The custom parameters for this ad break.
-
parseJson
public static AdBreak parseJson(org.json.JSONObject json) throws org.json.JSONException
- Throws:
org.json.JSONException
-
parseJson
public static AdBreak parseJson(java.lang.String jsonStr)
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toJson
public org.json.JSONObject toJson()
- Specified by:
toJsonin interfacecom.longtailvideo.jwplayer.utils.Jsonable
-
-