Class PlayerConfig

  • All Implemented Interfaces:
    android.os.Parcelable

    public final class PlayerConfig
    extends java.lang.Object
    implements android.os.Parcelable
    Player configuration used to set up the player, contains all basic configuration attributes from XML custom attrs or the builder, along with Playlist and Advertising settings.
    • Field Detail

      • STRETCHING_UNIFORM

        public static final java.lang.String STRETCHING_UNIFORM
        Will fit JW Player dimensions while maintaining aspect ratio.
        See Also:
        Constant Field Values
      • STRETCHING_FILL

        public static final java.lang.String STRETCHING_FILL
        Will zoom and crop video to fill dimensions, maintaining aspect ratio.
        See Also:
        Constant Field Values
      • STRETCHING_EXACT_FIT

        public static final java.lang.String STRETCHING_EXACT_FIT
        Will fit JW Player dimensions without maintaining aspect ratio.
        See Also:
        Constant Field Values
      • STRETCHING_NONE

        public static final java.lang.String STRETCHING_NONE
        Displays the actual size of the video file with black borders.
        See Also:
        Constant Field Values
      • THUMBNAIL_PREVIEW_TEXT

        public static final int THUMBNAIL_PREVIEW_TEXT
        Will display the text in the thumbnail preview
        See Also:
        Constant Field Values
      • THUMBNAIL_PREVIEW_IMAGE

        public static final int THUMBNAIL_PREVIEW_IMAGE
        Will display the image in the thumbnail preview
        See Also:
        Constant Field Values
      • THUMBNAIL_PREVIEW_TEXT_AND_IMAGE

        public static final int THUMBNAIL_PREVIEW_TEXT_AND_IMAGE
        Will display the text and the in the thumbnail preview
        See Also:
        Constant Field Values
      • DEFAULT_ALLOW_CROSS_PROTOCOL_REDIRECTS

        public static final boolean DEFAULT_ALLOW_CROSS_PROTOCOL_REDIRECTS
        Configuration values
        See Also:
        Constant Field Values
      • mMute

        public final java.lang.Boolean mMute
      • mAutostart

        public final java.lang.Boolean mAutostart
      • mNextUpOffset

        public final java.lang.Integer mNextUpOffset
      • mNextUpOffsetPercentage

        public final java.lang.Integer mNextUpOffsetPercentage
      • mRepeat

        public final java.lang.Boolean mRepeat
      • mDisplayTitle

        public final java.lang.Boolean mDisplayTitle
      • mDisplayDescription

        public final java.lang.Boolean mDisplayDescription
      • mThumbnailPreview

        public final java.lang.Integer mThumbnailPreview
      • mStretching

        public final java.lang.String mStretching
      • mPreload

        public final java.lang.Boolean mPreload
      • mPlaylist

        public final java.util.List<PlaylistItem> mPlaylist
      • mPlaylistUrl

        public final java.lang.String mPlaylistUrl
      • mPlaylistIndex

        public final java.lang.Integer mPlaylistIndex
      • mPlayerId

        public final java.lang.String mPlayerId
      • mRelatedConfig

        public final RelatedConfig mRelatedConfig
        Configuration subobjects
      • mUiConfig

        public final UiConfig mUiConfig
      • mLogoConfig

        public final LogoConfig mLogoConfig
      • mPlaybackRates

        public final double[] mPlaybackRates
        Playback Rates
      • mAllowCrossProtocolRedirects

        public final java.lang.Boolean mAllowCrossProtocolRedirects
        Enables/disables cross-protocol redirects handling within ExoPlayer.
      • mUseTextureView

        public final boolean mUseTextureView
        Enables/disables using TexttureView as the view where video content is rendering.
      • CREATOR

        public static final android.os.Parcelable.Creator<PlayerConfig> CREATOR
    • Method Detail

      • useTextureView

        public boolean useTextureView()
        Returns:
        whether default view where video content should be rendered is set to TextureView
      • getPlayerId

        public java.lang.String getPlayerId()
        Returns:
        Player's identifier.
      • getMute

        public boolean getMute()
        Returns:
        Configures if the player should be muted during playback.
      • getAutostart

        public boolean getAutostart()
        Returns:
        Whether the player will attempt to begin playback automatically when a page is loaded.
      • getNextUpOffset

        public int getNextUpOffset()
        Returns:
        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.
      • getNextUpOffsetPercentage

        public int getNextUpOffsetPercentage()
        Returns:
        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 0 means this property was not set 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.
      • getRepeat

        public boolean getRepeat()
        Returns:
        Configures if the player should loop content after a playlist completes.
      • getDisplayTitle

        public boolean getDisplayTitle()
        Returns:
        Configures if the title of a media file should be displayed.
      • getDisplayDescription

        public boolean getDisplayDescription()
        Returns:
        Configures if the description title of a media file should be displayed.
      • getThumbnailPreview

        @NonNull
        public java.lang.Integer getThumbnailPreview()
        Returns:
        Configures if the thumbnail preview above the seekbar when is seeking through a video should be displayed.
      • getStretching

        @NonNull
        public java.lang.String getStretching()
        Returns:
        Resize images and video to fit player dimensions. Must be one of the STRETCHING_ constants.
      • getPreload

        public boolean getPreload()
        Returns:
        Tells the player if content should be loaded prior to playback. Useful for faster playback speed.
      • getPlaylist

        @Nullable
        public java.util.List<PlaylistItem> getPlaylist()
        Returns:
        The playlist of media to play in your player.
      • getPlaylistUrl

        @Nullable
        public java.lang.String getPlaylistUrl()
        Returns:
        The playlist URL to play in your player.
      • getPlaylistIndex

        public java.lang.Integer getPlaylistIndex()
        Returns:
        The playlist index configured to start with in your playlist.
      • getRelatedConfig

        public RelatedConfig getRelatedConfig()
        Returns:
        The related plugin configuration to apply to your player.
      • getAdvertisingConfig

        @Nullable
        public AdvertisingConfig getAdvertisingConfig()
        Returns:
        The advertising configuration and schedule to apply to your player.
      • getUiConfig

        @NonNull
        public UiConfig getUiConfig()
        Returns:
        The uiConfig configuration to apply to your player.
      • getLogoConfig

        @Nullable
        public LogoConfig getLogoConfig()
        Returns:
        The logo configuration which is overlayed on the player.
      • getPlaybackRates

        @NonNull
        public double[] getPlaybackRates()
        Returns:
        Playback rates values
      • getAllowCrossProtocolRedirects

        public boolean getAllowCrossProtocolRedirects()
      • describeContents

        public int describeContents()
        Specified by:
        describeContents in interface android.os.Parcelable
      • writeToParcel

        public void writeToParcel​(android.os.Parcel dest,
                                  int flags)
        Specified by:
        writeToParcel in interface android.os.Parcelable