David House

Using AVKit to Play Video

David House | Nov 16, 2018

Playing video is a fundamental feature for tvOS applications. In this video you will learn how to get the basic video player working by utilizing classes from AVKit and AVFoundation. After this video you will know how to play video and keep the native video experience for users.

The video from this lesson has the following license: Big Buck Bunny is licensed under the Creative Commons Attribution 3.0 license. (c) copyright 2008, Blender Foundation

For the more curious...

AVKit
AVFoundation
BNR Guide to Swift
iOS & Swift Courses

Subscribers Only

Transcripts are for subscribers. Create an account today to access our collection of screencasts, skill packs, and more.

Subscribers Only

Project files are only available for subscribers. Create an account today to access our collection of screencasts, skill packs, and more.

Need Help?

If you get stuck, try starting a discussion with Big Nerd Ranch experts in the community tab.

Getting Started with tvOS

This screencast is part of a skill pack called Getting Started with tvOS.

Using AVKit to Play Video

5 minutes

Playing video is a fundamental feature for tvOS applications. In this video you will learn how to get the basic video player working by utilizing classes from AVKit and AVFoundation. After this video you will know how to play video and keep the native video experience for users.

Setting Metadata for Video

7 minutes

The native video player experience on tvOS includes an information panel that provides the user with details about the currently playing video. In this video, we will discuss how to populate this metadata to make it visible to the user. After this video, you will be able to do the same in your applications.

Video Navigation Markers

8 minutes

When users need to navigate through your video content, they want to do so with ease. The native tvOS user controls are powerful, but can be augmented by navigation markers that make it easy to skip to specific parts of your content. In this video we will explore the AVKit API that allows these markers to be created.

Video Overlays

7 minutes

In this video we will see how to add content on top of a playing video on tvOS. This technique is useful for adding logos, chapter titles, advertisement information, and more, without having those items be embedded in the video itself. After this video you will know how to accomplish this in your applications.

Controlling Video Player Dismissal

8 minutes

When a video is playing full screen on tvOS, by default it will capture pressing menu on the Siri remote and will dismiss the video player. In this video we will discuss how to change this behavior and why you might want this extra control.

Playing Video in a Subview

6 minutes

Playing full screen video on tvOS gives the user access to the full native experience, including all the functionality of the Siri Remote. There are some designs that call for video to play in just a portion of the screen. In this video we will create a video player that plays video to a sub-view in our view controller.

Interstitial Content Markers

7 minutes

Video content frequently contains interstitial content such as advertisements or interludes. In this video we will explore the AVKit provided classes for marking interstitial points in your videos.

Time Based Overlays

7 minutes

In a video player application, it is common to perform certain tasks when the user reaches various points throughout the video playback. This can be used for analytics, storing the users progress, or for adding overlay views on top of the video. In this screencast, we will examine the AVFoundation API that allows you to create and observe points of time in the video playback and update overlay views accordingly.

Related Screencasts

Explore other screencasts related to this topic.

Interstitial Content Markers

7 minutes

Video content frequently contains interstitial content such as advertisements or interludes. In this video we will explore the AVKit provided classes for marking interstitial points in your videos.

Create a Welcome Message on Initial Launch

8 minutes

Performing tasks when an application is first launched is a common practice to give users important information about the application. In this video, we will discuss one technique for implementing first launch logic, as well as how to quickly test this code.

Looping Multiple Videos on AppleTV

11 minutes

The Apple TV can be setup as a Kiosk that plays a series of videos on a loop at a business or school location. In this video, we will use AVFoundation to allow the videos to play one after the other in an infinite loop.

Controlling Video Player Dismissal

8 minutes

When a video is playing full screen on tvOS, by default it will capture pressing menu on the Siri remote and will dismiss the video player. In this video we will discuss how to change this behavior and why you might want this extra control.

Finding and Fixing Memory Issues

7 minutes

Incorrectly managing memory in our applications can result in hard to find bugs and possible crashes. In this video, we will explore the Memory Graph debugging tool in Xcode and how you can use it to find and fix strong reference cycles in closures.

Protocol Oriented Dependency Injection

8 minutes

Tight coupling between view controllers in your application can lead to difficult maintenance as you add and remove features. This video will explore how using Protocols can make our Dependency Injection more loosely coupled. This improves the flexibility of the code and makes our application easier to change.