Class 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.
    • 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)
    • 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 class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toJson

        public org.json.JSONObject toJson()
        Specified by:
        toJson in interface com.longtailvideo.jwplayer.utils.Jsonable
      • cloneList

        public static java.util.List<AdBreak> cloneList​(java.util.List<AdBreak> src)