Getting Started with the IVS iOS Player SDK
This document takes you through the steps involved in getting started with the Amazon IVS iOS player SDK.
We recommend that you integrate the player SDK via Swift Package Manager. (Alternately, you can integrate via CocoaPods or manually add the framework to your project.)
Recommended: Integrate the Player SDK (Swift Package Manager)
-
Download the Package.swift file from https://player.live-video.net/1.43.0/Package.swift
. -
In your project, create a new directory named AmazonIVSPlayer and add it to version control.
-
Put the downloaded Package.swift file in the new directory.
-
In Xcode, go to File > Add Package Dependencies and select Add Local...
-
Navigate to and select the AmazonIVSPlayer directory that you created, and select Add Package.
-
When prompted to Choose Package Products for AmazonIVSPlayer, select AmazonIVSPlayer as your Package Product by setting your application target in the Add to Target section.
-
Select Add Package.
Alternate Approach: Integrate the Player SDK (CocoaPods)
Important: CocoaPods is in maintenance mode (security fixes only) and after December 2026, no new packages or updates can be published to the CocoaPods repository. Existing packages will remain available but frozen. We recommend using Swift Package Manager for all new projects.
Releases are published via CocoaPods under the name AmazonIVSPlayer
.
Add this dependency to your Podfile:
pod 'AmazonIVSPlayer'
Run pod install
and the SDK will be available in your
.xcworkspace
.
Alternate Approach: Install the Framework Manually
-
Download the latest version from https://player.live-video.net/1.43.0/AmazonIVSPlayer.xcframework.zip
. -
Extract the contents of the archive.
AmazonIVSPlayer.xcframework
contains the SDK for both device and simulator. -
Embed
AmazonIVSPlayer.xcframework
by dragging it into the Frameworks, Libraries, and Embedded Content section of the General tab for your application target:
Create Player
The player object is IVSPlayer
. It can be initialized as shown
below:
Set Up Delegate
Delegate callbacks provide information on playback state, events, and errors. All callbacks are invoked on the main queue.
Display Video
The player displays video in a custom layer, IVSPlayerLayer
. The SDK
also provides IVSPlayerView
, a UIView
subclass backed by
this layer. Use whichever is more convenient for your application’s UI.
In both cases, display the video from a player instance by using the
player
property.
Load a Stream
The player loads the stream asynchronously. Its state indicates when it is ready to play.
Play a Stream
When the player is ready, use play
to begin playback. Use the
delegate interface or key-value observing on the state
property to
observe the state change. Here is an example of the delegate-based approach:
Pause On App Backgrounding
The player does not support playback while the app is in the background, but it does not need to be fully torn down. Pausing is sufficient; see the examples below.
Thread Safety
The player API is not thread safe. You should create and use a player instance from the application main thread.
SDK Size
The Amazon IVS player SDKs are designed to be as lightweight as possible. For current information about SDK size, see the Release Notes.
Important: When evaluating size impact, the size of the IPA produced by Xcode is not representative of the size of your app downloaded to a user’s device. The App Store performs optimizations to reduce the size of your app.
Putting It All Together
The following simple, view-controller snippet loads and plays a URL in a player
view. Note that the playerView
property is initialized from an
XIB/Storyboard, and its class is set to IVSPlayerView
in Interface
Builder using the Custom
Class section of the Identity Inspector.