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, boolean isSkipabilityEnabled, boolean skipAfterCompletion, boolean playOnMute, @NonNull() String placementType)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.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 -
-
Method Detail
-
createVastConfig
@NonNull() static POBVastPlayerConfig createVastConfig(@Nullable() JSONObject rawBid, boolean isSkipabilityEnabled, boolean skipAfterCompletion, boolean playOnMute, @NonNull() String placementType)
Builds the VastPlayer config from raw bid Json response or returns default VastPlayer config
- Parameters:
rawBid- the raw bid of JSONObject typeisSkipabilityEnabled- State of skip behaviorskipAfterCompletion- Parameter to indicate default skip is after completionplayOnMute- Sound on/off value by default- Returns:
if Video is present and not empty in bid then method returns new VastPlayerConfig object else returns default VastPlayer config
-
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
-
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
-
-
-
-