Class

TVPlayer

A customizable native media player used to control playback from the JavaScript player used in an Apple TV client-server app.

Declaration

@interface TVPlayer : NSObject

Overview

You create a new TVPlayer object using your custom AVPlayer object. You can then play media items that are associated with the JavaScript media player using the new player. For example, you can add gestures, overlays, and other custom features to your TV player.

Topics

Setting Up the Player

- initWithPlayer:

Creates a new customizable player from an existing player.

player

The customizable media player.

playlist

The playlist for the media player.

Controlling Playback

- next

Plays the next media item in the playlist.

- pause

Pauses the currently playing item.

- previous

Plays the previous media item in the playlist.

state

The current state of the player.

TVPlaybackState

The possible states of a player.

- dispatchEvent:userInfo:completion:

Dispatches custom playback events to the JavaScript environment.

TVPlaybackEvent

Extend this structure to send your custom playback events to the JavaScript environment.

TVPlaybackEventMarshaling

A protocol used for sending and receiving information across the JavaScript bridge.

TVPlaybackCustomEventUserInfo

The user information used in a custom playback event.

Inspecting Media Items

- changeToMediaItemAtIndex:

Sets the current media item to the designated media item.

previousMediaItem

The previously selected media item.

currentMediaItem

The currently selected media item.

nextMediaItem

The next media item in the playlist.

Instance Methods

Relationships

Inherits From

See Also

Custom Player

TVMediaItem

A single audio or video item associated with the Apple TV JavaScript player.

TVPlaylist

A collection of media items associated with the Apple TV JavaScript player.