JWPlayerItem

@objcMembers
public final class JWPlayerItem : NSObject, JWJSONEncodable, JWInitializableFromJSON

Defines a player item which contains the information about the media content.

  • Title of the player item.

    Declaration

    Swift

    public internal(set) var title: String? { get }
  • Short description of the player item.

    Declaration

    Swift

    public override var description: String { get }
  • Poster image url of the player item.

    Declaration

    Swift

    public internal(set) var posterImage: URL? { get }
  • Number of seconds from the start of a media asset when playback should begin.

    Declaration

    Swift

    public internal(set) var startTime: TimeInterval { get }
  • The player item’s media identifier.

    Declaration

    Swift

    public internal(set) var mediaId: String? { get }
  • URL to a feed that contains related items for a particular player item.

    Declaration

    Swift

    public internal(set) var recommendations: URL? { get }
  • Determines whether media should start automatically after loading. The default value is false.

    Declaration

    Swift

    @available(*, deprecated, message: "Instead read from JWPlayerConfiguration.autostart")
    public internal(set) var autostart: Bool { get }
  • An array of JWVideoSource objects representing multiple quality levels of a video.

    Seealso

    JWVideoSource

    Declaration

    Swift

    public internal(set) var videoSources: [JWVideoSource]! { get }
  • An array of JWMediaTrack objects providing captions for different languages or thumbnails images.

    Seealso

    JWMediaTrack

    Declaration

    Swift

    public internal(set) var mediaTracks: [JWMediaTrack]? { get }
  • The URL of the VMAP file to load.

    Note

    Used for JW and IMA.

    Declaration

    Swift

    public internal(set) var vmapURL: URL? { get }
  • An array of JWAdBreak objects that provide info about ad breaks.

    Seealso

    JWAdBreak

    Declaration

    Swift

    public internal(set) var adSchedule: [JWAdBreak]? { get }
  • A JWGoogleDAIStream object that provides info about either a VoD or Live stream.

    Declaration

    Swift

    public internal(set) var googleDAIStream: JWGoogleDAIStream? { get }
  • A dictionary that contains options used to customize the initialization of the asset.

    Note

    For more information, refer to Initialization Options

    Declaration

    Swift

    public internal(set) var assetOptions: [String : Any]? { get }
  • Array of metadata that an be passed externally to supplement the encoded metadata of the underlying media asset.

    Note

    Supersedes the external metadata specified in the JWPlayerConfiguration, for this player item.

    Note

    Capped at 5 metadata instances; the instances in excess will be excluded.

    Declaration

    Swift

    public internal(set) var externalMetadata: [JWExternalMetadata]? { get }

Internal properties

  • Returns a chapter track, if it exists.

    Declaration

    Swift

    public var chapterTrack: JWChapterTrack? { get }
  • Returns the captions tracks, if they exist.

    Declaration

    Swift

    public var captionTracks: [JWCaptionTrack] { get }
  • Returns a thumbnail track, if it exists.

    Declaration

    Swift

    public var thumbnailTrack: JWMediaTrack? { get }
  • Undocumented

    Declaration

    Swift

    public override func copy() -> Any
  • Overridden to check quickly and accurately if two player items are the same.

    Declaration

    Swift

    public override func isEqual(_ object: Any?) -> Bool

JWJSONEncodable

JWInitializableFromJSON

  • Calling this method converts the JSONObject into a JWPlayerItem.

    Declaration

    Swift

    public static func from(json: JSONObject) -> `Self`?

    Return Value

    A JWPlayerItem, or nil if it does not succeed.