Class PlaylistItem

java.lang.Object
com.jwplayer.pub.api.media.playlists.PlaylistItem

public class PlaylistItem extends Object
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

      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 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 <any> CREATOR
  • Method Details

    • setImage

      public void setImage(String image)
    • setTitle

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

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

      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

      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

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

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

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

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

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

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

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

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

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

      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 JSONObject getUserInfo()
      Returns:
      User Info that will be sent to Chromecast receiver (aside from Studio DRM info)
    • getHttpHeaders

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

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

      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()
    • writeToParcel

      public void writeToParcel(Parcel dest, int flags)