Class

TVContentItem

An object that describes either a piece of content or a container for other content items.

Declaration

@interface TVContentItem : NSObject

Overview

The exact details of what a content item is are dependent on your app. For example, a content item might be a piece of media or it might provide access to news or other content available to your app.

To create a description of a piece of content, create a content identifier object and then use this object to initialize a new TVContentItem object. Then, set any other properties that are appropriate for the object you are creating. Most of the properties are optional, and many properties apply only to certain kinds of content. Inspect an existing TVContentItem object to retrieve the media and playback properties, such as the duration of the content or when the content was last played.

Topics

Initializing a Content Item

- initWithContentIdentifier:

Initializes a new content item.

- initWithCoder:

Returns an object initialized from data in a given unarchiver.

Reading a Content Item’s Identifier

contentIdentifier

The content identifier that uniquely identifies this item.

Inspecting the General Display Properties

These properties describe the item to be displayed..

badgeCount

A badging integer for this item.

title

The localized string title of the item.

topShelfItems

An array of content items that are the items of a section.

Accessing Image Resources

imageURL

A URL giving the location of the image to be displayed for this content item.

- imageURLForTraits:

Retrieve the URL for the image that best matches the specified traits.

TVContentItemImageTrait

Traits describing the type of image you want.

Inspecting the Content Properties

These properties are used to describe the underlying content item.

creationDate

The date when the content item was created, or the date when it was first broadcast, or some other kind of origination date.

duration

The amount of time required to play the media to completion.

expirationDate

The date when the user will no longer be able to access the item.

imageShape

The intended aspect ratio or shape of the content image.

TVContentItemImageShape

An enumerated type that identifies the shape in which the content item should be displayed.

Inspecting the Playback Properties

currentPosition

The index location, measured in seconds, at which the user last played this item.

hasPlayedToEnd

A Boolean value indicating whether the user can be considered to have finished this item.

lastAccessedDate

The date when the user last accessed this item.

Inspecting the Application Launch Properties

The application launch properties are URLs that the system can use to launch your app. Each URL specifies the content item to be launched and the action to be taken. You are responsible for creating a URL scheme and adding code to your app so that it can respond when these URLs are invoked.

displayURL

A URL that causes the app which created this content item to display a description screen for the item.

playURL

A URL that causes the app which created this content item to begin playing the item at the user's current position.

Relationships

Inherits From

See Also

Content

TVContentIdentifier

An object that uniquely identifies media content in either a single piece or a collection.

Deprecated
TVTopShelfImageSizeForShape

Returns the ideal size for an image, according to its particular shape and style.

Deprecated