For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
StatusSupportDiscussionsLog inSign Up
Docs HomeAPI ReferenceVideo on DemandAI FeaturesLive StreamingVideo PlayerVideo DataCloud PlayoutRecipes
Docs HomeAPI ReferenceVideo on DemandAI FeaturesLive StreamingVideo PlayerVideo DataCloud PlayoutRecipes
  • Player SDKs
    • Introduction
  • Web player
    • Install the FastPix web player
    • Play uploaded videos
    • Handle playback errors
  • Android player
    • Install FastPix Android player
    • Set up the player
    • Play uploaded videos
    • Handle playback errors
  • iOS player
    • Install FastPix iOS player
    • Play uploaded videos
    • Handle playback errors
      • Set up on tvOS
  • Flutter player
    • Install FastPix Flutter player
    • Play uploaded videos
    • Handle playback errors
LogoLogo
StatusSupportDiscussionsLog inSign Up
On this page
  • Prerequisites
  • Usage example
iOS playerPlatforms

Set up on tvOS

Was this page helpful?
Previous

Changelog

Next
Built with

Learn how to integrate the FastPix Player SDK into your Apple TV application.

The FastPix Player SDK supports tvOS, letting you add video playback to Apple TV apps with the same features available for iOS.

Prerequisites

  • Add the SDK to your project using Swift Package Manager, following the same steps as for iOS installation.
  • Ensure your Xcode project supports tvOS as a deployment target.

Usage example

1import UIKit
2import AVKit
3import FastPixPlayerSDK
4
5class TVPlayerViewController: UIViewController {
6
7 lazy var playerViewController = AVPlayerViewController()
8
9 override func viewDidLoad() {
10 super.viewDidLoad()
11
12 self.prepareAvPlayerController()
13
14 let playbackOptions = PlaybackOptions(
15 streamType: "STREAM_TYPE",
16 playbackToken: "<YOUR_PLAYBACK_TOKEN>"
17 )
18
19 playerViewController.prepare(
20 playbackID: "<PLAYBACK_ID>",
21 playbackOptions: playbackOptions
22 )
23
24 playerViewController.player?.play()
25 }
26
27 func prepareAvPlayerController() {
28 addChild(playerViewController)
29 playerView.addSubview(playerViewController.view)
30 playerViewController.view.translatesAutoresizingMaskIntoConstraints = false
31
32 NSLayoutConstraint.activate([
33 playerViewController.view.leadingAnchor.constraint(equalTo: playerView.leadingAnchor),
34 playerViewController.view.trailingAnchor.constraint(equalTo: playerView.trailingAnchor),
35 playerViewController.view.topAnchor.constraint(equalTo: playerView.topAnchor),
36 playerViewController.view.bottomAnchor.constraint(equalTo: playerView.bottomAnchor)
37 ])
38
39 playerViewController.didMove(toParent: self)
40 }
41}

Replace STREAM_TYPE with "on-demand" or "live", and provide your actual playback ID and token.