Configure your application to use the Wowza Flowplayer Apple SDK
This page describes how to configure your iOS or tvOS application so you can work with the Wowza Flowplayer Apple SDK, its API, and the integrated player.
Set an access token
The Info.plist file contains information about the configuration for your iOS or tvOS application. To allow the player to display content in your application, you must update your target's Info.plist file.
You can add the token value in Xcode, as mentioned here. For information about getting an access token, see Create or revoke a player token in Wowza Video.
- In the Project Navigator for your Xcode project, click the Info.plist file.
- Click the + icon to add a Key property to the Information Property List.
- Add the new FPAccessToken property, set it to a string type, and enter the token in the Value column.
Configure the SDK
To function smoothly and avoid unwanted errors or crashes, you must configure the Wowza Flowplayer Apple SDK during app startup. This step enables users to load the SDK and edit its configuration options according to their specific requirements.
important
It's important to call the configuration method before using any other API from the SDK. By doing so, you ensure the SDK is correctly initialized and ready to handle subsequent API calls.
As in the following example, you can configure the SDK using the AppDelegate.swift file:
// AppDelegate.swift
func application(_: UIApplication, didFinishLaunchingWithOptions _: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
Flowplayer.current.accessToken = /* Set the accessToken programmatically */
Flowplayer.current.config = /* Add your desired configuration options here */
Flowplayer.current.configure()
return true
}
Configuration option are outlined in the following table.
Configuration property | Description |
---|---|
loggerEnabled | Indicates if logging is enabled (default) or disabled for the SDK. Set to false to disable logging. |
loggerLevels: [LogLevel] | Defines the logger levels to be used when logging SDK events. Includes info, error, and warning by default. |
Configure your audio session
To enableAVPlayer
to play audio on physical devices, you must use the AVAudioSession
object to configure your application's audio session. This should be done before starting any video or audio playback. When retrieving a shared audio session, set it to the .playback
category, as shown in the following example:try! AVAudioSession.sharedInstance().setCategory(.playback)