---
title: TVPlayer
framework: tvmlkit
role: symbol
role_heading: Class
path: tvmlkit/tvplayer
---

# TVPlayer

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

## Declaration

```swift
class TVPlayer
```

## Overview

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

- [init(player:)](tvmlkit/tvplayer/init(player:).md)
- [player](tvmlkit/tvplayer/player.md)
- [playlist](tvmlkit/tvplayer/playlist.md)

### Controlling Playback

- [next()](tvmlkit/tvplayer/next().md)
- [pause()](tvmlkit/tvplayer/pause().md)
- [previous()](tvmlkit/tvplayer/previous().md)
- [state](tvmlkit/tvplayer/state.md)
- [TVPlaybackState](tvmlkit/tvplaybackstate.md)
- [dispatch(event:userInfo:completion:)](tvmlkit/tvplayer/dispatch(event:userinfo:completion:).md)
- [TVPlaybackEvent](tvmlkit/tvplaybackevent.md)
- [TVPlaybackEventMarshaling](tvmlkit/tvplaybackeventmarshaling.md)
- [TVPlaybackCustomEventUserInfo](tvmlkit/tvplaybackcustomeventuserinfo.md)

### Inspecting Media Items

- [setCurrentMediaItem(toItemAtIndex:)](tvmlkit/tvplayer/setcurrentmediaitem(toitematindex:).md)
- [previousMediaItem](tvmlkit/tvplayer/previousmediaitem.md)
- [currentMediaItem](tvmlkit/tvplayer/currentmediaitem.md)
- [nextMediaItem](tvmlkit/tvplayer/nextmediaitem.md)

### Instance Methods

- [present(animated:)](tvmlkit/tvplayer/present(animated:).md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### Custom Player

- [TVMediaItem](tvmlkit/tvmediaitem.md)
- [TVPlaylist](tvmlkit/tvplaylist.md)
