Class AdvertisingBase

  • All Implemented Interfaces:
    com.longtailvideo.jwplayer.utils.Jsonable
    Direct Known Subclasses:
    Advertising, ImaDaiAdvertising, VMAPAdvertising

    public abstract class AdvertisingBase
    extends java.lang.Object
    implements com.longtailvideo.jwplayer.utils.Jsonable
    The base class for Advertising settings.
    • Constructor Detail

      • AdvertisingBase

        public AdvertisingBase​(@NonNull
                               AdSource client)
    • Method Detail

      • getClient

        @NonNull
        public AdSource getClient()
      • setClient

        public void setClient​(@NonNull
                              AdSource client)
      • getSkipText

        public java.lang.String getSkipText()
      • setSkipText

        public void setSkipText​(java.lang.String skipText)
                         throws AdvertisingException
        Sets the text of the Skip button.

        Not supported with Google IMA.

        Throws:
        AdvertisingException - thrown when a Skip message is added to an IMA ad
      • getSkipMessage

        public java.lang.String getSkipMessage()
      • setSkipMessage

        public void setSkipMessage​(java.lang.String skipMessage)
                            throws AdvertisingException
        Sets a customized countdown message. Use the form Skip ad in xx seconds.

        Not supported with Google IMA.

        Throws:
        AdvertisingException
      • getSkipOffset

        public int getSkipOffset()
        Returns the current skip offset of the ad
        Returns:
        the current skip offset of the ad, or -1 if there's no offset.
      • setSkipOffset

        public void setSkipOffset​(int skipOffset)
                           throws AdvertisingException
        Sets the amount of time in seconds that you want an ad to be watched before it can be skipped.

        Not supported with Google IMA.

        Parameters:
        skipOffset - the amount of time in seconds that you want the ad to be watched.
        Throws:
        AdvertisingException
      • getAdMessage

        public java.lang.String getAdMessage()
      • setAdMessage

        public void setAdMessage​(java.lang.String adMessage)
                          throws AdvertisingException
        Sets a customized ad message. Use the form 'This ad will end in xx seconds.'.

        Not supported with Google IMA.

        Throws:
        AdvertisingException
      • getCueText

        public java.lang.String getCueText()
      • setCueText

        public void setCueText​(java.lang.String cueText)
                        throws AdvertisingException
        Sets the text that appears when a user mouses over a scheduled. advertisement on the seekbar.

        Not supported with Google IMA.

        Parameters:
        cueText - the text to display.
        Throws:
        AdvertisingException
      • setVpaidControls

        public void setVpaidControls​(java.lang.Boolean vpaidControls)
        Enables or disables forcing the display of controls during VPAID ads
        Parameters:
        vpaidControls -
      • getVpaidControls

        @Nullable
        public java.lang.Boolean getVpaidControls()
        Returns:
        Whether the display of controls is forced during VPAID ads
      • setRequestTimeout

        public void setRequestTimeout​(java.lang.Integer requestTimeout)
      • getRequestTimeout

        public java.lang.Integer getRequestTimeout()
      • setAdRules

        public void setAdRules​(AdRules adRules)
        Configures Ad Rules that control how frequently ads play back.
        Parameters:
        adRules -
      • getAdRules

        public AdRules getAdRules()
        Returns:
        Current Ad Rules configuration
      • toJson

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