public static class PlayerConfig.Builder
extends java.lang.Object
Constructor and Description |
---|
Builder()
Default builder constructor.
|
Builder(android.content.res.TypedArray a)
This constructor will fill the builder with data from the typed array.
|
Modifier and Type | Method and Description |
---|---|
PlayerConfig.Builder |
advertising(AdvertisingBase advertising) |
PlayerConfig.Builder |
allowCrossProtocolRedirects(java.lang.Boolean allowCrossProtocolRedirects) |
PlayerConfig.Builder |
autostart(java.lang.Boolean autostart) |
PlayerConfig |
build() |
PlayerConfig.Builder |
captionsConfig(CaptionsConfig captionsConfig) |
PlayerConfig.Builder |
controls(java.lang.Boolean controls) |
PlayerConfig.Builder |
displayDescription(java.lang.Boolean displayDescription) |
PlayerConfig.Builder |
displayTitle(java.lang.Boolean displayTitle) |
PlayerConfig.Builder |
file(java.lang.String file) |
PlayerConfig.Builder |
image(java.lang.String image) |
PlayerConfig.Builder |
logoConfig(LogoConfig logoConfig) |
PlayerConfig.Builder |
mute(java.lang.Boolean mute) |
PlayerConfig.Builder |
nextUpDisplay(java.lang.Boolean nextUpDisplay) |
PlayerConfig.Builder |
nextUpOffset(java.lang.Integer nextUpOffset) |
PlayerConfig.Builder |
nextUpOffsetPercentage(java.lang.Integer nextUpOffsetPercentage) |
PlayerConfig.Builder |
playbackRates(PlaybackRateConfig playbackRateConfig) |
PlayerConfig.Builder |
playlist(java.util.List<PlaylistItem> playlist) |
PlayerConfig.Builder |
preload(java.lang.Boolean preload) |
PlayerConfig.Builder |
relatedConfig(RelatedConfig relatedConfig) |
PlayerConfig.Builder |
repeat(java.lang.Boolean repeat) |
PlayerConfig.Builder |
sharingConfig(SharingConfig sharingConfig) |
PlayerConfig.Builder |
skinConfig(SkinConfig skinConfig) |
PlayerConfig.Builder |
stretching(java.lang.String stretching) |
PlayerConfig.Builder |
useTextureView(boolean useTextureView)
Sets
TextureView to be the view where video content will be rendered
Notice that by default SurfaceView is using
In case of using TextureView DRM streams will not be shown
TextureView should be used only if SurfaceView does not meet your needs. |
public Builder()
public Builder(android.content.res.TypedArray a)
a
- public PlayerConfig.Builder file(java.lang.String file)
file
- URL to a single video file, audio file, or live stream to play.public PlayerConfig.Builder image(java.lang.String image)
image
- URL to a poster image to display before playback starts.public PlayerConfig.Builder mute(java.lang.Boolean mute)
mute
- Configures if the player should be muted during playback.public PlayerConfig.Builder autostart(java.lang.Boolean autostart)
autostart
- Whether the player will attempt to begin playback automatically when a page is loaded. Set to 'viewable' to have player autostart if 50% is viewable.public PlayerConfig.Builder nextUpOffset(java.lang.Integer nextUpOffset)
nextUpOffset
- Configures when the Next Up card displays when transitioning between playlist items. A positive value is an offset from the start of the video. A negative number is an offset from the end of the video.public PlayerConfig.Builder nextUpOffsetPercentage(java.lang.Integer nextUpOffsetPercentage)
nextUpOffsetPercentage
- Configures when the Next Up card displays during playback based on the percentage of the
duration.
A positive value is a percentage offset from the start of the video.
A negative number is a percentage offset from the end of the video
i.e. setting the value to 50 will result in the Next Up card showing when half of the
video is played.
Setting the value to -25 will result in the Next Up card showing when playback reaches 75% of the video duration.
Takes precedence over nextupOffset if both properties are set.public PlayerConfig.Builder repeat(java.lang.Boolean repeat)
repeat
- Configures if the player should loop content after a playlist completes.public PlayerConfig.Builder controls(java.lang.Boolean controls)
controls
- Whether to display the video controls (control bar and display icons).public PlayerConfig.Builder displayTitle(java.lang.Boolean displayTitle)
displayTitle
- Configures if the title of a media file should be displayed.public PlayerConfig.Builder displayDescription(java.lang.Boolean displayDescription)
displayDescription
- Configures if the description title of a media file should be displayed.public PlayerConfig.Builder stretching(java.lang.String stretching)
stretching
- Resize images and video to fit player dimensions. Must be one of the STRETCHING_ constants.public PlayerConfig.Builder nextUpDisplay(java.lang.Boolean nextUpDisplay)
nextUpDisplay
- Configures whether the Next Up modal is displayed.public PlayerConfig.Builder preload(java.lang.Boolean preload)
preload
- Tells the player if content should be loaded prior to playback. Useful for faster playback speed.public PlayerConfig.Builder playlist(java.util.List<PlaylistItem> playlist)
playlist
- The playlist of media to play in your player.public PlayerConfig.Builder captionsConfig(CaptionsConfig captionsConfig)
captionsConfig
- The captions configuration to apply to your player.public PlayerConfig.Builder logoConfig(LogoConfig logoConfig)
logoConfig
- The logo configuration to apply to your player.public PlayerConfig.Builder skinConfig(SkinConfig skinConfig)
skinConfig
- The skin configuration to apply to your player.public PlayerConfig.Builder relatedConfig(RelatedConfig relatedConfig)
relatedConfig
- The related plugin configuration to apply to your player.public PlayerConfig.Builder sharingConfig(SharingConfig sharingConfig)
sharingConfig
- The sharing plugin configuration to apply to your player.public PlayerConfig.Builder advertising(AdvertisingBase advertising)
advertising
- The advertising configuration and schedule to apply to your player.public PlayerConfig.Builder playbackRates(PlaybackRateConfig playbackRateConfig)
public PlayerConfig.Builder allowCrossProtocolRedirects(java.lang.Boolean allowCrossProtocolRedirects)
public PlayerConfig.Builder useTextureView(boolean useTextureView)
TextureView
to be the view where video content will be rendered
Notice that by default SurfaceView
is using
In case of using TextureView
DRM streams will not be shown
TextureView should be used only if SurfaceView does not meet your needs. One example is
where smooth animations or scrolling of the video surface is required prior to Android N.
For this case, it’s preferable to use TextureView only when SDK_INT is less than 24
(Android N) and SurfaceView otherwise.useTextureView
- whether use TextureView as the View where video content is playing
true to use TextureView
false to use SurfaceView
public PlayerConfig build()