[object Object] Icon

Encoding
Learn how to create, start, manage and modify Encodings

[object Object] Icon

Player
Learn how to create, start, manage and modify Players

[object Object] Icon

Analytics
Learn how to create, start, manage and modify Analyticss

Docs Home
User shortcuts for search
Focus by pressing f
Hide results by pressing Esc
Navigate via   keys

iOS / tvOS SDK

The following tutorials show you how to configure, integrate and customize your Player on iOS.

Quick Start GuideLink Icon

This Quick Start Video will walk you the initial steps to run the iOS/tvOS SDK Example Repository using Apple XCode! In no time you will get started with Player & Analytics, for which you'll need the code snippet below!

Get Started with your own ProjectLink Icon

The following steps will walk you through adding the SDK to an new or existing XCode Project step by step. If you don't know yet how to start such a project, please visit this Apple Developer Guide first, or try the Quick Start Guide above first :)

Step 1: Add the SDKLink Icon

Add the Player SDK to the Project Using CocoaPods

Add the following lines to the Podfile of your project and replace the Version Number with the desired version of the SDK. All available versions are listed in the cocoapod repository.

Execute pod repo update first to add the new source and execute pod install after to install the new BitmovinPlayer dependency.

Using Swift Package Manager

Swift Package Manager is a tool for managing the distribution of Swift frameworks. It integrates with the Swift build system to automate the process of downloading, compiling, and linking dependencies.

Using Xcode

To integrate using Xcode 13, open your Project file and specify it in Project > Package Dependencies using the following URL:

Using Package.swift

To integrate using Apple's Swift package manager, add the following as a dependency to your Package.swift and replace the Version Number with the desired version of the SDK.

And then specify the BitmovinPlayer as a dependency of the desired Target. Here is an example of a Package.swift file:

Limitation

Executing swift build from the command line is currently not supported. Open the Package in Xcode if you are developing another Package depending on BitmovinPlayer.

Add the Player SDK to the Project directly

As an alternative to CocoaPods, you can download the XCFramework release from our CDN. Therefore you can use the URL to the XCFramework from the podspec file in the according version in the cocoapod repositoryor using this link: (Replacing Version Number with the desired version of the SDK) https://cdn.bitmovin.com/player/ios_tvos/'Version Number'/BitmovinPlayer.zip

Then, when using Xcode, just drag and drop the downloaded XCFramework into your project.

Step 2: Setup the PlayerLink Icon

Configure the license key

Add the license key to the <dict> in Info.plist:

Alternatively you can also add the license key programmatically to the PlayerConfig via PlayerConfig.key.

Create the Player

Creating a Player instance either with a default or a custom config:

Configure the Source

Creating a SourceConfig based on a given Stream URL:

Load a Source

Load the created Source into a Player:

When there is no need to access the Source instance before loading it, it is also possible to directly load a SourceConfig into the Player.

Create a PlayerView

Create a view provided by the SDK which will be used for rendering the video:

Step 3: Configure your Player LicenseLink Icon

Allowlist Bundle Identifiers

In order to use the player in your app you have to allowlist the bundle identifier of your app for which you want to enable the player. This is a security mechanism and protects your license from being used elsewhere.

Domain allowlisting can be done in the dashboard under Player -> Licenses.

ScreenshotDashboardLicensesNoinlineSvg

Step 4: Final ReviewLink Icon

In this tutorial you learned how to add the Bitmovin Player iOS SDK to your project, set up the player license, use the Player and how to configure it.

Now you can start having a look at the configuration options and adapt the player to your needs.

More ExamplesLink Icon

You can find many more fully functional code examples in our Github Repository.

Github

Give us feedback