public class AdBreak
extends java.lang.Object
implements com.longtailvideo.jwplayer.utils.Jsonable
Modifier and Type | Class and Description |
---|---|
static class |
AdBreak.Builder |
Constructor and Description |
---|
AdBreak(AdBreak.Builder builder) |
AdBreak(AdBreak src) |
AdBreak(java.lang.String offset,
AdSource adSource,
java.lang.String... tags)
Convenience constructor for V2->V3 migrations
|
Modifier and Type | Method and Description |
---|---|
static java.util.List<AdBreak> |
cloneList(java.util.List<AdBreak> src) |
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() |
static AdBreak |
parseJson(org.json.JSONObject json) |
static AdBreak |
parseJson(java.lang.String jsonStr) |
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.util.List<java.lang.String> tags) |
void |
setTag(java.lang.String... tags) |
org.json.JSONObject |
toJson() |
public AdBreak(java.lang.String offset, AdSource adSource, java.lang.String... tags)
public AdBreak(AdBreak src)
public AdBreak(AdBreak.Builder builder)
public void setSource(AdSource adSource)
adSource
- The ad source for this ad break -- VAST, IMA, or FWpublic void setTag(java.lang.String... tags)
tags
- The ad tags that are called during the configured ad break.public void setTag(java.util.List<java.lang.String> tags)
tags
- The ad tags that are called during the configured ad break.public void setOffset(java.lang.String offset)
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 secondspublic void setAdType(@NonNull AdType adType)
adType
- This should be set to NONLINEAR if you want to force the player to render a nonlinear ad in the ad response.public void setCustomParams(@Nullable java.util.Map<java.lang.String,java.lang.String> custParams)
custParams
- Allows for passing custom parameters to an ad break, which then pass through to the URL requested from the ad server.public AdSource getSource()
public java.util.List<java.lang.String> getTag()
public java.lang.String getOffset()
@NonNull public AdType getAdType()
@Nullable public java.util.Map<java.lang.String,java.lang.String> getCustomParams()
public static AdBreak parseJson(org.json.JSONObject json) throws org.json.JSONException
org.json.JSONException
public static AdBreak parseJson(java.lang.String jsonStr)
public org.json.JSONObject toJson()
toJson
in interface com.longtailvideo.jwplayer.utils.Jsonable