Class PlaylistItem

java.lang.Object
com.jwplayer.pub.api.media.playlists.PlaylistItem
All Implemented Interfaces:
android.os.Parcelable

public class PlaylistItem extends Object implements android.os.Parcelable
An item in a Playlist.
  • Field Details

    • mTitle

      public String mTitle
    • mDescription

      public String mDescription
    • mFile

      public final String mFile
    • mImage

      public String mImage
    • mMediaId

      public final String mMediaId
    • mFeedId

      public final String mFeedId
    • mRecommendations

      public final String mRecommendations
    • mSources

      public final List<MediaSource> mSources
    • mTracks

      public final List<Caption> mTracks
    • mAdSchedule

      public final List<AdBreak> mAdSchedule
    • mVmapUrlOrXML

      public final String mVmapUrlOrXML
    • mStartTime

      public final Double mStartTime
    • mDuration

      public final Integer mDuration
    • mHttpHeaders

      @Nullable public final Map<String,String> mHttpHeaders
      HTTP Headers that should be used when requesting this playlist item
    • mMediaDrmCallback

      public final MediaDrmCallback mMediaDrmCallback
      The MediaDrmCallback that is used for key and provisioning requests.
    • mImaDaiSettings

      public final ImaDaiSettings mImaDaiSettings
    • mDrmConfig

      public final DrmConfig mDrmConfig
    • mUserInfo

      public final org.json.JSONObject mUserInfo
    • mExternalMetadata

      public final List<ExternalMetadata> mExternalMetadata
      A list of external metadata in the video the user wishes to receive a meta event
    • mLiveSyncDuration

      public final double mLiveSyncDuration
      The target live sync duration in seconds for live streams.

      When set, the player will attempt to maintain this offset behind the live edge during playback. This is useful for live streams where captions or other processing need additional buffer time beyond the player's default proximity to the live edge.

      A value of 0 means unset (use the player's default behavior). Valid range is 5-45 seconds; values outside this range are clamped.

    • CREATOR

      public static final android.os.Parcelable.Creator<PlaylistItem> CREATOR
  • Method Details

    • setImage

      public void setImage(String image)
    • setTitle

      public void setTitle(@Nullable String title)
      Sets the title of this playlist item.
      Parameters:
      title - The new title for this item.
    • setDescription

      public void setDescription(@Nullable String description)
      Sets the description of this playlist item.
      Parameters:
      description - The new description for this item.
    • getTitle

      @Nullable public String getTitle()
      Returns:
      Title of the item. This is displayed inside of the player prior to playback, as well as in the visual playlist. This can be hidden with the PlayerConfig.setDisplayTitle() option.
    • getDescription

      @Nullable public String getDescription()
      Returns:
      Short description of the item. It is displayed below the title. This can be hidden with the PlayerConfig.setDisplayDescription() option.
    • getFile

      public String getFile()
      Returns:
      The media file for this playlist item.
    • getImage

      @Nullable public String getImage()
      Returns:
      Poster image URL. Displayed before and after playback.
    • getMediaId

      @Nullable public String getMediaId()
      Returns:
      Unique identifier of this item. Used by advertising, analytics and discovery services.
    • getFeedId

      @Nullable public String getFeedId()
      Returns:
      Unique identifier of this item. Used by related/recommendation services.
    • getRecommendations

      @Nullable public String getRecommendations()
      Returns:
      URL to a feed that contains related items for a particular playlist item.
    • getStartTime

      @Nullable public Double getStartTime()
      Returns:
      URL to a feed that contains related items for a particular playlist item.
    • getDuration

      @Nullable public Integer getDuration()
      Returns:
      the display duration for the item set in seconds
    • getSources

      @NonNull public List<MediaSource> getSources()
      Returns:
      Used for quality toggling and alternate sources.
    • getTracks

      @NonNull public List<Caption> getTracks()
      Returns:
      Include captions, chapters, and thumbnails for media.
    • getAdSchedule

      @Nullable public List<AdBreak> getAdSchedule()
      Returns:
      Schedule advertising for a specific media file.
    • getVMAPSchedule

      @Nullable public String getVMAPSchedule()
      Returns:
      Either a local, remote URL of the vmap file, or a VMAP (XML) string.
    • getMediaDrmCallback

      public MediaDrmCallback getMediaDrmCallback()
      Returns:
      DRM callback instance -- used for Widevine DRM.
    • getDrmConfig

      public DrmConfig getDrmConfig()
      Returns:
      DRM config
    • getUserInfo

      public org.json.JSONObject getUserInfo()
      Returns:
      User Info that will be sent to Chromecast receiver (aside from Studio DRM info)
    • getHttpHeaders

      @Nullable public Map<String,String> getHttpHeaders()
      Returns:
      HTTP Headers to include with requests for this media file.
    • getImaDaiSettings

      @Nullable public ImaDaiSettings getImaDaiSettings()
      Returns:
      The IMA DAI settings for this playlist item
    • getExternalMetadata

      @Nullable public List<ExternalMetadata> getExternalMetadata()
      Returns:
      The External Metadata for this playlist Item
    • getLiveSyncDuration

      public double getLiveSyncDuration()
      Returns the target live sync duration in seconds for live streams.

      When configured, this controls how far behind the live edge the player targets during playback. A higher value increases the buffer between the player and the live edge, which can help with caption synchronization and other processing that needs more time.

      Use case: Live streams with captions that require additional processing time. Setting this to 10-15 seconds gives caption decoders enough lead time to stay in sync, rather than relying on the player's default proximity to the live edge.

      Risks and considerations:

      • Higher values increase the delay between the live broadcast and what the viewer sees. For latency-sensitive content (sports, auctions, interactive events), this trade-off should be carefully evaluated.
      • This setting overrides any target offset hints provided by the stream manifest (e.g., HLS EXT-X-SERVER-CONTROL). If the manifest specifies an optimized offset, this value will take precedence.
      • Only affects live stream playback. This value is ignored for VOD content.
      • Very low values (near the 5-second minimum) may cause buffering on poor network conditions since there is less buffer between the player and the live edge.
      Returns:
      The target offset in seconds behind the live edge, or 0 if not set (player uses its default behavior).
      See Also:
    • 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