Class PlayerConfig.Builder
java.lang.Object
com.jwplayer.pub.api.configuration.PlayerConfig.Builder
- Enclosing class:
- PlayerConfig
-
Constructor Summary
ConstructorsConstructorDescriptionBuilder()
Default builder constructor.Builder
(PlayerConfig src) This constructor will fill the builder with data from an existing PlayerConfig in case you need to duplicate and make a small change -
Method Summary
Modifier and TypeMethodDescriptionadvertisingConfig
(AdvertisingConfig advertisingConfig) allowCrossProtocolRedirects
(Boolean allowCrossProtocolRedirects) build()
displayDescription
(Boolean displayDescription) displayTitle
(Boolean displayTitle) logoConfig
(LogoConfig logoConfig) Defines a logo which is overlayed on the player.nextUpOffset
(Integer nextUpOffset) nextUpOffsetPercentage
(Integer nextUpOffsetPercentage) playbackRates
(double[] playbackRates) Sets the player's "Dashboard Player Configuration Key" (`pid`) used by JWDashboard analytics.playlist
(List<PlaylistItem> playlist) playlistIndex
(Integer playlistIndex) playlistUrl
(String playlistUrl) relatedConfig
(RelatedConfig relatedConfig) stretching
(String stretching) thumbnailPreview
(Integer thumbnailPreview) useTextureView
(boolean useTextureView) Setsandroid.view.TextureView
to be the view where video content will be rendered Notice that by defaultandroid.view.SurfaceView
is using In case of usingandroid.view.TextureView
DRM streams will not be shown TextureView should be used only if SurfaceView does not meet your needs.
-
Constructor Details
-
Builder
public Builder()Default builder constructor. -
Builder
This constructor will fill the builder with data from an existing PlayerConfig in case you need to duplicate and make a small change- Parameters:
src
-
-
-
Method Details
-
file
- Parameters:
file
- URL to a single video file, audio file, or live stream to play.
-
image
- Parameters:
image
- URL to a poster image to display before playback starts.
-
mute
- Parameters:
mute
- Configures if the player should be muted during playback.
-
autostart
- Parameters:
autostart
- Whether the player will attempt to begin playback automatically when a page is loaded.
-
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.
-
playerId
Sets the player's "Dashboard Player Configuration Key" (`pid`) used by JWDashboard analytics. - precondition: The playerID must already exist in the JW Dashboard property associated with the License Key, or else it will be ignored by the analytics platform. - note: Not to be confused with the JS player's `id` property, which is a reference used to tag the actual element/object (such as the `div` in a web browser context).- Parameters:
playerId
-
-
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
- Parameters:
repeat
- Configures if the player should loop content after a playlist completes.
-
displayTitle
- Parameters:
displayTitle
- Configures if the title of a media file should be displayed.
-
displayDescription
- Parameters:
displayDescription
- Configures if the description title of a media file should be displayed.
-
thumbnailPreview
- Parameters:
thumbnailPreview
- Configures if the thumbnail preview above the seekbar when is seeking through a video should be displayed.
-
stretching
- Parameters:
stretching
- Resize images and video to fit player dimensions. Must be one of the STRETCHING_ constants.
-
preload
- Parameters:
preload
- Tells the player if content should be loaded prior to playback. Useful for faster playback speed.
-
playlist
- Parameters:
playlist
- The playlist of media to play in your player.
-
playlistUrl
- Parameters:
playlistUrl
- The playlist URL to play in your player.
-
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.
-
advertisingConfig
- Parameters:
advertisingConfig
- The advertising configuration and schedule to apply to your player.
-
uiConfig
- Parameters:
uiConfig
- The uiConfig plugin configuration to apply to your player.
-
logoConfig
Defines a logo which is overlayed on the player.- Parameters:
logoConfig
-
-
playbackRates
- Parameters:
playbackRates
- The custom playback rate options to display in the settings menu.
-
allowCrossProtocolRedirects
-
useTextureView
Setsandroid.view.TextureView
to be the view where video content will be rendered Notice that by defaultandroid.view.SurfaceView
is using In case of usingandroid.view.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.- Parameters:
useTextureView
- whether use TextureView as the View where video content is playing true to useandroid.view.TextureView
false to useandroid.view.SurfaceView
-
build
-