Class PlayerConfig.Builder

java.lang.Object
com.jwplayer.pub.api.configuration.PlayerConfig.Builder
Enclosing class:
PlayerConfig

public static class PlayerConfig.Builder extends Object
  • Constructor Details

    • Builder

      public Builder()
      Default builder constructor.
    • Builder

      public 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
      Parameters:
      src -
  • Method Details

    • file

      public PlayerConfig.Builder file(String file)
      Parameters:
      file - URL to a single video file, audio file, or live stream to play.
    • image

      public PlayerConfig.Builder image(String image)
      Parameters:
      image - URL to a poster image to display before playback starts.
    • mute

      public PlayerConfig.Builder mute(Boolean mute)
      Parameters:
      mute - Configures if the player should be muted during playback.
    • autostart

      public PlayerConfig.Builder autostart(Boolean autostart)
      Parameters:
      autostart - Whether the player will attempt to begin playback automatically when a page is loaded.
    • nextUpOffset

      public PlayerConfig.Builder nextUpOffset(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.
    • playerId

      public PlayerConfig.Builder playerId(String 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

      public PlayerConfig.Builder nextUpOffsetPercentage(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(Boolean repeat)
      Parameters:
      repeat - Configures if the player should loop content after a playlist completes.
    • displayTitle

      public PlayerConfig.Builder displayTitle(Boolean displayTitle)
      Parameters:
      displayTitle - Configures if the title of a media file should be displayed.
    • displayDescription

      public PlayerConfig.Builder displayDescription(Boolean displayDescription)
      Parameters:
      displayDescription - Configures if the description title of a media file should be displayed.
    • thumbnailPreview

      public PlayerConfig.Builder thumbnailPreview(Integer thumbnailPreview)
      Parameters:
      thumbnailPreview - Configures if the thumbnail preview above the seekbar when is seeking through a video should be displayed.
    • stretching

      public PlayerConfig.Builder stretching(String stretching)
      Parameters:
      stretching - Resize images and video to fit player dimensions. Must be one of the STRETCHING_ constants.
    • preload

      public PlayerConfig.Builder preload(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(List<PlaylistItem> playlist)
      Parameters:
      playlist - The playlist of media to play in your player.
    • playlistUrl

      public PlayerConfig.Builder playlistUrl(String playlistUrl)
      Parameters:
      playlistUrl - The playlist URL to play in your player.
    • playlistIndex

      public PlayerConfig.Builder playlistIndex(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.
    • relatedConfig

      public PlayerConfig.Builder relatedConfig(RelatedConfig relatedConfig)
      Parameters:
      relatedConfig - The related plugin configuration to apply to your player.
    • advertisingConfig

      public PlayerConfig.Builder advertisingConfig(AdvertisingConfig advertisingConfig)
      Parameters:
      advertisingConfig - The advertising configuration and schedule to apply to your player.
    • uiConfig

      public PlayerConfig.Builder uiConfig(UiConfig uiConfig)
      Parameters:
      uiConfig - The uiConfig plugin configuration to apply to your player.
    • logoConfig

      public PlayerConfig.Builder logoConfig(LogoConfig logoConfig)
      Defines a logo which is overlayed on the player.
      Parameters:
      logoConfig -
    • playbackRates

      public PlayerConfig.Builder playbackRates(double[] playbackRates)
      Parameters:
      playbackRates - The custom playback rate options to display in the settings menu.
    • allowCrossProtocolRedirects

      public PlayerConfig.Builder allowCrossProtocolRedirects(Boolean allowCrossProtocolRedirects)
    • useTextureView

      public PlayerConfig.Builder useTextureView(boolean useTextureView)
      Sets android.view.TextureView to be the view where video content will be rendered Notice that by default android.view.SurfaceView is using In case of using android.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 use android.view.TextureView false to use android.view.SurfaceView
    • build

      public PlayerConfig build()