Lumen help
CDN Load Balancer can be easily integrated into your iOS app in just a few simple steps using our AVPlayer plugin for iOS. In this guide, we will show you how to integrate our AVPlayer plugin.
Not into tutorials?
Framework installation
CDN Load Balancer plugin for AVPlayer is delivered as an Xcode framework and is available on Cocoapods.
CocoaPods
Note: Cocoapods 1.6.0 + is recommended
To get the plugin into your Xcode project using CocoaPods, specify this in your Podfile:
Then, run the following command:
Configuration
In the Project Navigator, right click on "Info.plist", and "Open as" → "Source Code". Add the following lines with the right parameters values.
Set the client delivery key
In the Project Navigator, right click on the main target "Info.plist", and "Open as" → "Source Code".
Add the following lines with the values of the right parameters:
Here, the key element contained in DeliveryClient refers to the deliveryClientKey that you will find in the Account section of the CDN Load Balancer Dashboard. If you don't have a DeliveryClientKey, you can register for a free trial account on our website.
We strongly recommend to set the delivery client key in Info.plist
. However, if not possible, it is also possible to pass your delivieryClientKey during the initialization step.
Code integration
Plugin initialization
Initialize the CDN Load Balancer plugin from the AppDelegate
.
LMDeliveryClientPlugin
and start itLMDeliveryClientPlugin
instances. It can be easily configured as such:The video should now be playing as expected.
viewDidDisappear(:bool)
or any callback terminating the player lifecycle.Additional options
You can pass additional options during the creation of a LMDeliveryClientPlugin
Troubleshooting
OFF
. it can be overridden during a LMDeliveryClientPlugin
Creation: You can also use LumenStatsView
, a utils library that allows the display of CDN Load Balancer information on the device. For more information, please follow the Monitoring Tools documentation.