Getting started with Flowplayer iOS SDK
Table of contents
This section gives you an introduction to the core features of the Flowplayer SDK iOS and lists all the requirements for adding the SDK into an iOS Project.
This guide assumes that you have basic understanding of iOS development and that you are familiar with Xcode and Swift.
This documentation was written for version 3.5.1
Flowplayer iOS SDK.
Introduction
The Flowplayer iOS SDK is a native media player, written entirely in Swift and provides an easy-to-use API which enables developers to create beautiful iOS applications that play audio and video both locally and over the Internet.
The Flowplayer iOS SDK uses AVPlayer as its core and therefore takes advantage of all its powerful features. The SDK supports adaptive streaming technologies such as HLS, as well as the most popular single container formats, such as MP4, MP3, AVI, and several more.
Our example apps are available open source on Github and it will help you better understand how to integrate the Flowplayer SDK iOS into your project.
Migration v2 to v3
Module rename
The main public module that needs to be imported to use Flowplayer SDK has been renamed from:
FlowplayerCore
to Flowplayer
. Now FlowplayerCore
is an internal module and is used by Flowplayer
and should not be used or imported.
// import FlowplayerCore << Remove
import Flowplayer
Supported features
Some of the most important features of the Flowplayer iOS SDK include but are not limited to:
- HLS, MP4, MP3, AVI formats.
- Full screen playback and configurable device orientation management.
- Callbacks for monitoring a wide range of player events.
- IMA3 based VAST and VMAP ads.
- Customizable user interface.
- Analytics for Flowplayer platform videos (Flowplayer-hosted and registered remote assets) with the Analytics plugin
Prerequisites
In order to be able to compile and run your application using the Flowplayer iOS SDK, the following few requirements need to be met.
Minimum iOS version
The Flowplayer iOS SDK is available to devices running iOS version 12.0+.
Dependencies
The Flowplayer iOS SDK depends on the following two dependencies:
- Rollbar:
1.12.14
- Google Interactive Media Ads (IMA):
3.14.5
Add the SDK to your project
Once you have met all the prerequisites, you are ready to add the Flowplayer iOS SDK to your project and start developing.
You can add the SDK in one of the following 2 ways:
CocoaPods setup
Add Flowplayer
together with its dependencies to your Podfile
:
pod 'Flowplayer', '~> 3.4.0'
Execute pod install
and you're ready to go.
Manual setup
- Download the binary framework of Flowplayer iOS SDK from here.
- As mentioned earlier, the Flowplayer iOS SDK depends on Rollbar and Google IMA which you need to download as well.
- Next you need to link and embed the frameworks into your target:
- Flowplayer (Main framework)
- FlowplayerCore (Supporting framework)
- Google IMA
- Rollbar
- Build your project.
Your target's Build Phases should look similar to this:
Update Info.plist
In your target's Info.plist
file add a new string with the key FlowplayerAccessToken
and set the value to your Flowplayer access token, in order to enable the player to play content.
Flowplayer tokens can be created and revoked from the Flowplayer Dashboard