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 }
-
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 }
-
A
JWGoogleDAIStream
object that provides info about either a VoD or Live stream.Seealso
JWGoogleDAIStream
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 OptionsDeclaration
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 theJWPlayerConfiguration
, for this player item.Note
Capped at 5 metadata instances; the instances in excess will be excluded.See also
JWExternalMetadata
Declaration
Swift
public internal(set) var externalMetadata: [JWExternalMetadata]? { get }
-
Custom attributes that you can associate with the item.
Use this property to attach a value that provides additional context to the media item. For example, you can attach flags for filtering logic elsewhere in the app, or additional JSON data to be included when serializing the item to be sent over the network, such as credentials for DRM casting to a Chromecast receiver.
Declaration
Swift
public internal(set) var userInfo: JSONObject? { get }
-
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
-
Declaration
Swift
public func toJSONObject() -> JSONObject
-
Calling this method converts the
JSONObject
into aJWPlayerItem
.Declaration
Swift
public static func from(json: JSONObject) -> `Self`?
Return Value
A
JWPlayerItem
, ornil
if it does not succeed.