<!--
{
  "availability" : [
    "tvOS: 12.0.0 - 18.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "TVMLKit",
  "identifier" : "/documentation/TVMLKit/TVPlaylist",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "TVMLKit"
    ],
    "preciseIdentifier" : "c:objc(cs)TVPlaylist"
  },
  "title" : "TVPlaylist"
}
-->

# TVPlaylist

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

```
class TVPlaylist
```

## Overview

A `TVPlaylist` object contains read-only information about a playlist associated with the JavaScript player. You can use this information with your own custom <doc://com.apple.documentation/documentation/AVFoundation/AVPlayer> objects exposed through a [`TVPlayer`](/documentation/TVMLKit/TVPlayer) object. For example, you can retrieve album information from the JavaScript player and play the track through a `TVPlayer` object.

## Topics

### Retrieving Playlist Information

[`var mediaItems: [TVMediaItem]`](/documentation/TVMLKit/TVPlaylist/mediaItems)

An array of media items contained in the playlist.

[`var userInfo: [String : Any]?`](/documentation/TVMLKit/TVPlaylist/userInfo)

User-defined metadata, like a developer-specific identifier, for a playlist.

[`var repeatMode: TVPlaylist.RepeatMode`](/documentation/TVMLKit/TVPlaylist/repeatMode-swift.property)

A mode that determines how media items are replayed.

[`enum RepeatMode`](/documentation/TVMLKit/TVPlaylist/RepeatMode-swift.enum)

The modes that indicate how or whether media items can be replayed.

[`var endAction: TVPlaylist.EndAction`](/documentation/TVMLKit/TVPlaylist/endAction-swift.property)

An action that causes media playback to end.

[`enum EndAction`](/documentation/TVMLKit/TVPlaylist/EndAction-swift.enum)

The actions that cause media playback to end.

## Relationships

### Conforms To

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`Hashable`](/documentation/Swift/Hashable)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`Equatable`](/documentation/Swift/Equatable)

[`CVarArg`](/documentation/Swift/CVarArg)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)