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.Jsonable
An ad break.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AdBreak.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)
boolean
equals(java.lang.Object obj)
AdType
getAdType()
java.util.Map<java.lang.String,java.lang.String>
getCustomParams()
java.lang.String
getOffset()
AdSource
getSource()
java.util.List<java.lang.String>
getTag()
int
hashCode()
static AdBreak
parseJson(java.lang.String jsonStr)
static AdBreak
parseJson(org.json.JSONObject json)
void
setAdType(AdType adType)
void
setCustomParams(java.util.Map<java.lang.String,java.lang.String> custParams)
void
setOffset(java.lang.String offset)
void
setSource(AdSource adSource)
void
setTag(java.lang.String... tags)
void
setTag(java.util.List<java.lang.String> tags)
org.json.JSONObject
toJson()
-
-
-
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:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toJson
public org.json.JSONObject toJson()
- Specified by:
toJson
in interfacecom.longtailvideo.jwplayer.utils.Jsonable
-
-