Class POBVastPlayerConfig.ConfigBuilder
-
- All Implemented Interfaces:
public class POBVastPlayerConfig.ConfigBuilderAn internal builder class for video config
-
-
Field Summary
Fields Modifier and Type Field Description public final static intDEFAULT_WRAPPER_URI_TIMEOUTpublic final static intDEFAULT_MEDIA_URI_TIMEOUTpublic final static intDEFAULT_VIDEO_SKIP_AFTERpublic final static intDEFAULT_ENDCARD_SKIP_AFTERpublic final static intDEFAULT_SKIPpublic final static booleanDEFAULT_PLAY_ON_MUTE
-
Constructor Summary
Constructors Constructor Description POBVastPlayerConfig.ConfigBuilder(int minDuration, int maxDuration)Builder class constructor with recommended params
-
Method Summary
Modifier and Type Method Description static POBVastPlayerConfigcreateVastConfig(@Nullable() JSONObject rawBid, @NonNull() POBAdType adType)Builds the VastPlayer config from raw bid Json response or returns default VastPlayer config. POBVastPlayerConfig.ConfigBuilderskipAfter(int skipAfter)Optional setter to set Skip after config Number of seconds a video must play before skipping is enabled; only applicable if the ad is skippable. POBVastPlayerConfig.ConfigBuildersetSkipAfterCompletionEnabled(boolean isSkipAfterCompletion)Optional setter to set skipAfterCompletion state. POBVastPlayerConfig.ConfigBuilderskipMin(int skipMin)Optional setter to set Skip min config Videos of total duration greater than this number of seconds can be skippable; only applicable if the ad is skippable. POBVastPlayerConfig.ConfigBuilderskip(int skip)Value indicates if the ad is skippable ('skip' = 1) Setter which indicates if the player will allow the video to be skipped, where 0 = no, 1 = yes POBVastPlayerConfig.ConfigBuilderwrapperUriTimeout(int wrapperTagUriTimeout)Optional setter to set wrapper Uri timeout POBVastPlayerConfig.ConfigBuildermediaUriTimeout(int mediaFileUriTimeout)Optional setter to set media file Uri timeout POBVastPlayerConfigbuild(boolean isSkipabilityEnabled)Build POBVastPlayerConfig with provided params POBVastPlayerConfig.ConfigBuilderendCardSkipAfter(int skipAfter)Optional setter to set Skip after for end card. POBVastPlayerConfig.ConfigBuildershowEndCardNavigationControl(boolean showEndCardNavigationControl)Method to set the set the showControlButtonOnEndCard value. POBVastPlayerConfig.ConfigBuildersetPlayOnMute(boolean playOnMute)Setter method to play media with sound On/Off. POBVastPlayerConfig.ConfigBuildersetBackButtonEnabled(boolean backButtonEnabled)Method to set hardware back button enabled or not POBVastPlayerConfig.ConfigBuildersetCtaOverlayEnabled(boolean enabled)Enables or disables CTA overlay (from bid or VAST creative). -
-
Method Detail
-
createVastConfig
@NonNull() static POBVastPlayerConfig createVastConfig(@Nullable() JSONObject rawBid, @NonNull() POBAdType adType)
Builds the VastPlayer config from raw bid Json response or returns default VastPlayer config. The configuration is determined based on the ad type (rewarded, fullscreen, app open, etc.).
- Parameters:
rawBid- the raw bid JSON object containing video configuration parametersadType- the ad type used to determine video player behavior including skip settings, mute state, and fullscreen properties- Returns:
configured POBVastPlayerConfig based on the video parameters from bid response, or default VastPlayerConfig if video config is not present in the bid
-
skipAfter
POBVastPlayerConfig.ConfigBuilder skipAfter(int skipAfter)
Optional setter to set Skip after config Number of seconds a video must play before skipping is enabled; only applicable if the ad is skippable. Default value is 16
- Parameters:
skipAfter- the skipAfter value in int- Returns:
ConfigBuilder for POBVastPlayerConfig
-
setSkipAfterCompletionEnabled
POBVastPlayerConfig.ConfigBuilder setSkipAfterCompletionEnabled(boolean isSkipAfterCompletion)
Optional setter to set skipAfterCompletion state. Indicate default skip is after completion
- Parameters:
isSkipAfterCompletion- boolean value of state, false by default.- Returns:
ConfigBuilder for POBVastPlayerConfig
-
skipMin
POBVastPlayerConfig.ConfigBuilder skipMin(int skipMin)
Optional setter to set Skip min config Videos of total duration greater than this number of seconds can be skippable; only applicable if the ad is skippable. Default value is 0
- Parameters:
skipMin- the skipMin value in int- Returns:
ConfigBuilder for POBVastPlayerConfig
-
skip
POBVastPlayerConfig.ConfigBuilder skip(int skip)
Value indicates if the ad is skippable ('skip' = 1) Setter which indicates if the player will allow the video to be skipped, where 0 = no, 1 = yes
- Parameters:
skip- the skipable value 0 = no, 1 = yes- Returns:
ConfigBuilder for POBVastPlayerConfig
-
wrapperUriTimeout
POBVastPlayerConfig.ConfigBuilder wrapperUriTimeout(int wrapperTagUriTimeout)
Optional setter to set wrapper Uri timeout
- Parameters:
wrapperTagUriTimeout- the wrapperUriTimeout in millisecond's- Returns:
configBuilder for POBVastPlayerConfig
-
mediaUriTimeout
POBVastPlayerConfig.ConfigBuilder mediaUriTimeout(int mediaFileUriTimeout)
Optional setter to set media file Uri timeout
- Parameters:
mediaFileUriTimeout- the mediaUriTimeout in millisecond's- Returns:
configBuilder for POBVastPlayerConfig
-
build
POBVastPlayerConfig build(boolean isSkipabilityEnabled)
Build POBVastPlayerConfig with provided params
- Parameters:
isSkipabilityEnabled- State of skip behavior- Returns:
instance of POBVastPlayerConfig
-
endCardSkipAfter
POBVastPlayerConfig.ConfigBuilder endCardSkipAfter(int skipAfter)
Optional setter to set Skip after for end card. Number of seconds a end card must be shown before skipping is enabled; only applicable if the ad is skippable. Default value is 5 minutes.
- Parameters:
skipAfter- the skipAfter value in minutes- Returns:
ConfigBuilder for POBVastPlayerConfig
-
showEndCardNavigationControl
POBVastPlayerConfig.ConfigBuilder showEndCardNavigationControl(boolean showEndCardNavigationControl)
Method to set the set the showControlButtonOnEndCard value. This property helps to decides whether to show the control button on end card.
- Parameters:
showEndCardNavigationControl- boolean value.- Returns:
ConfigBuilder for POBVastPlayerConfig
-
setPlayOnMute
POBVastPlayerConfig.ConfigBuilder setPlayOnMute(boolean playOnMute)
Setter method to play media with sound On/Off.
- Parameters:
playOnMute- should play on mute- Returns:
Updated instance of config builder.
-
setBackButtonEnabled
POBVastPlayerConfig.ConfigBuilder setBackButtonEnabled(boolean backButtonEnabled)
Method to set hardware back button enabled or not
-
setCtaOverlayEnabled
POBVastPlayerConfig.ConfigBuilder setCtaOverlayEnabled(boolean enabled)
Enables or disables CTA overlay (from bid or VAST creative). When false, CTA overlay will not be shown (e.g. for native ad type).
- Parameters:
enabled- true to allow CTA overlay, false to disable it- Returns:
this builder for chaining
-
-
-
-