## Step 1: Add the SDK to your Project

You have several options for integrating the Player SDK into your 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 [CocoaPods repository](🔗). Execute `pod repo update` first to add the new source, then execute `pod install` 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 14.1 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` file and replace the `Version Number` with the desired version of the SDK.



Then specify `BitmovinPlayer` as a dependency of the desired target. Here is an example of a `Package.swift` file:



:warning: **_Note:_** 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`.

### Adding the SDK to your Project directly

As an alternative to CocoaPods, you can download all the needed **XCFramework** releases from our CDN. You can find the URLs to all Player related XCFrameworks in the **.podspec** file of the desired SDK version in our [CocoaPods repository](🔗):



From Player version **3.42.0** onwards, it is required to also include the XCFramework of our `AnalyticsCollector`. The URL to the Analytics XCFramework can be found in the **.podspec** file of the desired SDK version in our [CocoaPods repository](🔗) (Note: the minimum required version is **3.0.0**):



Then, using Xcode, just drag and drop all downloaded XCFrameworks into your project.

## Step 2: Set up the Player

### Configure the player license key

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



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

### Create the Player

You can create a `Player` instance with analytics tracking either with the default configuration,



or using a custom config:



### Configure the Source

Creating a `SourceConfig` based on a given Stream URL:



### Load the Source

Load the created `Source` into the `Player`:



_Note:_ 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 using SwiftUI or UIKit

Create a view that is provided by the SDK with either SwiftUI or UIKit. This view will be used for rendering the video:



See our [examples](🔗) for more details. There, you can find simple SwiftUI sample applications, including BasicPlayback for iOS and BasicPlaybackTV for tvOS. For UIKit support, have a look at our BasicUIKit sample for iOS and BasicUIKitTV sample for tvOS.

See [listening to events](🔗) for details on how to get notified about certain events from the Player.

## Step 3: Configure your Player and Analytics License

### Allowlist your Bundle Identifiers

In order to use the player with analytics in your app, you have to allowlist the bundle identifier of your app into which you are integrating the SDK. This is a security mechanism and protects your license from being used elsewhere.

Allowlisting can be done in the [Dashboard](🔗) under **Player > Licenses** and **Analytics > Licenses**.



## Summary

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

Next, you can

  • browse our [API reference](🔗).

  • download fully working [examples](🔗) and explore more features in our GitHub repository.

  • choose additional platforms to deploy on in our [Getting Started Hub](🔗) and try our no-code wizards.

  • get real-time insights into your iOS Player via our [Analytics Dashboard](🔗).

  • see if some of the questions you might have are answered in our [Community](🔗) and ask your own!