RORK LABJP
MAX — Rork Max is built on Claude Code and Claude Opus 4.6, generating native Swift apps directly instead of React NativeAPPLE — Rork Max targets the whole Apple ecosystem: iPhone, iPad, Apple Watch, Apple TV, Vision Pro, and iMessageWORKFLOW — In practice, users settle into letting the AI scaffold while they rewrite the state management and data layer themselvesSEED — Rork raised a $15M seed led by Left Lane Capital in April, with Peak XV, True Ventures, and a16z Speedrun joiningPAPERLINE — Rork acquired app builder Paperline and says it will stay acquisitive to bring in engineering talentREVIEW — Three-month revisit reviews are growing, clarifying where the tool shines and where it doesn'tMAX — Rork Max is built on Claude Code and Claude Opus 4.6, generating native Swift apps directly instead of React NativeAPPLE — Rork Max targets the whole Apple ecosystem: iPhone, iPad, Apple Watch, Apple TV, Vision Pro, and iMessageWORKFLOW — In practice, users settle into letting the AI scaffold while they rewrite the state management and data layer themselvesSEED — Rork raised a $15M seed led by Left Lane Capital in April, with Peak XV, True Ventures, and a16z Speedrun joiningPAPERLINE — Rork acquired app builder Paperline and says it will stay acquisitive to bring in engineering talentREVIEW — Three-month revisit reviews are growing, clarifying where the tool shines and where it doesn't
Articles/App Dev
App Dev/2026-06-18Advanced

Building an Ambient Display App for Apple TV with Rork Max

Use the native Swift that Rork Max generates as a foundation for an Apple TV app that quietly plays on a loop. We cover Top Shelf, the focus engine, and seamless video loops, with the practical lessons that only surface in real operation.

Rork Max223tvOSApple TVSwift45AVPlayer

Premium Article

The thought came to me one evening: what if the artwork from my own wallpaper app simply played on the living-room TV? I had been running iPhone wallpaper apps as an indie developer for a few years, and I suddenly wanted to see them on a large screen. Apple TV tends to fall outside the usual no-code or cross-platform conversation, but once Rork Max started generating native Swift, it finally became a realistic option.

tvOS works quite differently from iPhone. There is no touch; instead of a finger, you operate through a concept called focus. It is also assumed to stay on for long stretches, so power draw and burn-in deserve attention. Here I will use a quiet "ambient display app" that just keeps playing video as a vehicle for walking through how to refine the Swift that Rork Max generates.

Why build Apple TV with Rork Max

Standard Rork builds cross-platform with React Native (Expo), but the heart of tvOS — the focus engine, Top Shelf, and low-level AVPlayer control — does not come naturally without native Swift. Rork Max generates native Swift for iPhone, iPad, Apple Watch, Apple TV, and Vision Pro, so when you are targeting Apple TV, this is the foundation.

My own rule of thumb is simple. When I want to ship iOS and Android together quickly, I use the React Native version; when I want to reach into Apple hardware or OS integration, I use Rork Max. Apple TV is a textbook case of the latter, because the cross-platform advantage simply does not exist here.

AspectReact Native RorkRork Max (native Swift)
tvOS supportEffectively unsupportedOfficially supported
Focus engineThin abstraction, awkwardNative in SwiftUI
Top Shelf extensionDifficultImplementable as an App Extension
Low-level video controlLimitedDirect AVFoundation access

If you ask Rork Max to "make an ambient app for Apple TV that plays video full-screen on a loop," it returns a SwiftUI scaffold. As-is, though, rough edges remain: it plays, but flashes black at the seam, or focus moves in ways you did not intend. Everything from here is the hand-work.

Building a seamless video loop

The first thing you hit is the loop seam. A naive implementation that rewinds the same clip with AVPlayer and seek(to: .zero) inserts a faint black frame on every rewind. On a large TV, that instant is clearly noticeable.

The fix is the combination of AVQueuePlayer and AVPlayerLooper. Internally it prefetches the next item and stitches playback without a gap.

import AVFoundation
import SwiftUI
 
final class AmbientPlayerModel: ObservableObject {
    let player: AVQueuePlayer
    private var looper: AVPlayerLooper?
 
    init(resourceName: String) {
        guard let url = Bundle.main.url(forResource: resourceName, withExtension: "mp4") else {
            self.player = AVQueuePlayer()
            return
        }
        let item = AVPlayerItem(url: url)
        let queue = AVQueuePlayer()
        // AVPlayerLooper handles the seamless loop
        self.looper = AVPlayerLooper(player: queue, templateItem: item)
        self.player = queue
        queue.isMuted = true
        queue.actionAtItemEnd = .advance
    }
 
    func start() { player.play() }
    func stop() { player.pause() }
}

The key is to keep AVPlayerLooper retained as a property. Make it a local variable and it gets released, and the loop stops. Rork Max's initial output often leaves this as a local variable, so I promote it to a property every time.

On the SwiftUI side, wrapping AVPlayerLayer thinly is easier to control than using VideoPlayer. VideoPlayer carries playback control UI that just gets in the way for an ambient use case.

struct PlayerLayerView: UIViewRepresentable {
    let player: AVQueuePlayer
 
    func makeUIView(context: Context) -> PlayerUIView {
        let view = PlayerUIView()
        view.playerLayer.player = player
        view.playerLayer.videoGravity = .resizeAspectFill
        return view
    }
    func updateUIView(_ uiView: PlayerUIView, context: Context) {}
}
 
final class PlayerUIView: UIView {
    override class var layerClass: AnyClass { AVPlayerLayer.self }
    var playerLayer: AVPlayerLayer { layer as! AVPlayerLayer }
}

Setting videoGravity to .resizeAspectFill fills the TV's aspect ratio without margins. My wallpaper assets have all sorts of aspect ratios, so switching this to .resizeAspect produced black bars on the sides and broke the ambient immersion.

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
Concrete code for seamless video loops using AVQueuePlayer and AVPlayerLooper
A Top Shelf extension that puts your work on the top row, starting the experience before launch
Practical criteria for balancing the tvOS focus engine with power use and always-on display
Secure payment via Stripe · Cancel anytime

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Rork Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • Copy-paste ready implementation code
  • New advanced guides published daily
  • $5/mo or $10 for lifetime access
View Membership →

Related Articles

App Dev2026-07-05
Rork Max (Swift) or the Standard Version (React Native): How to Decide as a Solo Developer
Stuck between Rork Max's native Swift and the standard React Native version? Here is a practical decision framework built from a solo developer's perspective, weighing cost, feature boundaries, and how easy each path is to migrate later.
App Dev2026-07-03
Making Your Rork Max App Resilient to Dropped and Restored Connections: Offline Detection and Retry with NWPathMonitor
Build networking that survives a lost signal in your Rork Max native Swift app with NWPathMonitor. Detect offline states, respect Low Data Mode and cellular, and auto-resend queued work on reconnect — all with working Swift code.
App Dev2026-07-03
Keeping Downloads Alive After Your Rork Max App Is Killed: Background URLSession Design and Relaunch Handling
How to design downloads in a Rork Max native Swift app so transfers continue in the OS daemon even after the app is suspended or terminated. Covers relaunch wiring, resumeData recovery, and measured isDiscretionary behavior with working code.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links
See all →