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
      • Complete integration example
  • Flutter player
    • Install FastPix Flutter player
    • Play uploaded videos
    • Handle playback errors
LogoLogo
StatusSupportDiscussionsLog inSign Up
On this page
  • Basic player setup
  • What’s next
iOS playerExamples

Complete integration example

Was this page helpful?
Previous

Install FastPix Flutter player

Next
Built with

A full example showing how to set up the FastPix iOS Player with video playback and data integration.

Basic player setup

This example creates a VideoPlayerViewController that configures an AVPlayerViewController, attaches it to the view hierarchy, and starts playback.

1import UIKit
2import FastPixPlayerSDK
3import AVKit
4
5class VideoPlayerViewController: UIViewController {
6
7 // Playback ID and Token for streaming (set dynamically)
8 var playbackID = ""
9 var playbackToken = ""
10
11 // Lazy initialization of AVPlayerViewController
12 lazy var playerViewController = AVPlayerViewController()
13
14 // MARK: - View Lifecycle
15
16 override func viewDidLoad() {
17 super.viewDidLoad()
18
19 // Prepare and attach the AVPlayerViewController to the view
20 prepareAvPlayerController()
21
22 // Start playback
23 playerViewController.player?.play()
24 }
25
26 // MARK: - AVPlayer Setup
27
28 /// Sets up the AVPlayerViewController and attaches it to the view hierarchy
29 func prepareAvPlayerController() {
30 // Add playerViewController as a child
31 playerViewController.willMove(toParent: self)
32 addChild(playerViewController)
33 view.addSubview(playerViewController.view)
34 playerViewController.didMove(toParent: self)
35
36 // Disable autoresizing mask constraints
37 playerViewController.view.translatesAutoresizingMaskIntoConstraints = false
38
39 // Constrain player view to safe area
40 NSLayoutConstraint.activate([
41 playerViewController.view.leadingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leadingAnchor),
42 playerViewController.view.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.trailingAnchor),
43 playerViewController.view.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor),
44 playerViewController.view.bottomAnchor.constraint(equalTo: view.safeAreaLayoutGuide.bottomAnchor)
45 ])
46 }
47}

What’s next

  • Monitor video data to enable analytics and pass playback metadata.
  • Build a custom player UI to replace the default controls.
  • Manage playlists to play multiple videos in sequence.