Class PlayerConfig.Builder
- java.lang.Object
-
- com.longtailvideo.jwplayer.configuration.PlayerConfig.Builder
-
- Enclosing class:
- PlayerConfig
public static class PlayerConfig.Builder extends java.lang.Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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
playlistIndex(java.lang.Integer playlistIndex)
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)
SetsTextureView
to be the view where video content will be rendered Notice that by defaultSurfaceView
is using In case of usingTextureView
DRM streams will not be shown TextureView should be used only if SurfaceView does not meet your needs.
-
-
-
Method Detail
-
file
public PlayerConfig.Builder file(java.lang.String file)
- Parameters:
file
- URL to a single video file, audio file, or live stream to play.
-
image
public PlayerConfig.Builder image(java.lang.String image)
- Parameters:
image
- URL to a poster image to display before playback starts.
-
mute
public PlayerConfig.Builder mute(java.lang.Boolean mute)
- Parameters:
mute
- Configures if the player should be muted during playback.
-
autostart
public PlayerConfig.Builder autostart(java.lang.Boolean autostart)
- Parameters:
autostart
- Whether the player will attempt to begin playback automatically when a page is loaded.
-
nextUpOffset
public PlayerConfig.Builder nextUpOffset(java.lang.Integer nextUpOffset)
- Parameters:
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.
-
nextUpOffsetPercentage
public PlayerConfig.Builder nextUpOffsetPercentage(java.lang.Integer nextUpOffsetPercentage)
- Parameters:
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.
-
repeat
public PlayerConfig.Builder repeat(java.lang.Boolean repeat)
- Parameters:
repeat
- Configures if the player should loop content after a playlist completes.
-
controls
public PlayerConfig.Builder controls(java.lang.Boolean controls)
- Parameters:
controls
- Whether to display the video controls (control bar and display icons).
-
displayTitle
public PlayerConfig.Builder displayTitle(java.lang.Boolean displayTitle)
- Parameters:
displayTitle
- Configures if the title of a media file should be displayed.
-
displayDescription
public PlayerConfig.Builder displayDescription(java.lang.Boolean displayDescription)
- Parameters:
displayDescription
- Configures if the description title of a media file should be displayed.
-
stretching
public PlayerConfig.Builder stretching(java.lang.String stretching)
- Parameters:
stretching
- Resize images and video to fit player dimensions. Must be one of the STRETCHING_ constants.
-
nextUpDisplay
public PlayerConfig.Builder nextUpDisplay(java.lang.Boolean nextUpDisplay)
- Parameters:
nextUpDisplay
- Configures whether the Next Up modal is displayed.
-
preload
public PlayerConfig.Builder preload(java.lang.Boolean preload)
- Parameters:
preload
- Tells the player if content should be loaded prior to playback. Useful for faster playback speed.
-
playlist
public PlayerConfig.Builder playlist(java.util.List<PlaylistItem> playlist)
- Parameters:
playlist
- The playlist of media to play in your player.
-
playlistIndex
public PlayerConfig.Builder playlistIndex(java.lang.Integer playlistIndex)
- Parameters:
playlistIndex
- The playlist Index of media to start playing in your player. Its 0 indexed. A positive value is an index from the start of the playlist. A negative number is an index from the end of the playlist. i.e. setting value -1 would end up playing the last video on the playlist.
-
captionsConfig
public PlayerConfig.Builder captionsConfig(CaptionsConfig captionsConfig)
- Parameters:
captionsConfig
- The captions configuration to apply to your player.
-
logoConfig
public PlayerConfig.Builder logoConfig(LogoConfig logoConfig)
- Parameters:
logoConfig
- The logo configuration to apply to your player.
-
skinConfig
public PlayerConfig.Builder skinConfig(SkinConfig skinConfig)
- Parameters:
skinConfig
- The skin configuration to apply to your player.
-
relatedConfig
public PlayerConfig.Builder relatedConfig(RelatedConfig relatedConfig)
- Parameters:
relatedConfig
- The related plugin configuration to apply to your player.
-
sharingConfig
public PlayerConfig.Builder sharingConfig(SharingConfig sharingConfig)
- Parameters:
sharingConfig
- The sharing plugin configuration to apply to your player.
-
advertising
public PlayerConfig.Builder advertising(AdvertisingBase advertising)
- Parameters:
advertising
- The advertising configuration and schedule to apply to your player.
-
playbackRates
public PlayerConfig.Builder playbackRates(PlaybackRateConfig playbackRateConfig)
-
allowCrossProtocolRedirects
public PlayerConfig.Builder allowCrossProtocolRedirects(java.lang.Boolean allowCrossProtocolRedirects)
-
useTextureView
public PlayerConfig.Builder useTextureView(boolean useTextureView)
SetsTextureView
to be the view where video content will be rendered Notice that by defaultSurfaceView
is using In case of usingTextureView
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.- Parameters:
useTextureView
- whether use TextureView as the View where video content is playing true to useTextureView
false to useSurfaceView
-
build
public PlayerConfig build()
-
-