Lumen help
Note: This integration is deprecated and will be sunset. We strongly recommend using Mesh Delivery Android SDK 22.01 and above.
Mesh Delivery for Streaming can be easily integrated with Kaltura Playkit into your Android and Android TV app, in just a few simple steps using our Legacy SDK for Android. In this guide, we will show you how to integrate legacy Mesh Delivery using Kaltura Playkit on Android.
Not into tutorials?
Dependencies
The easiest way to get the Lumen SDK is to add it as a Gradle dependency. We assume you are using Android Studio with the latest tools updates as recommended by Google. If not, write to us at cdnsupport@lumen.com.
Next, add the DNA PlayKit and Mesh Delivery dependency to the build.gradle file of your app module.
Android version requirement
Mesh Delivery is validated on Android Lollipop, version 5.0 and above.
Mesh Delivery can still be included as a dependency for build targets Android kitKat 4.4 and lower, however the peer-to-peer module will be disabled at runtime. Google doesn't support Android 4.4 and lower anymore.
Java version requirement
The latest versions of our SDK use the lambda feature of Java 8, which is supported by all Android devices.
As mentioned in the official documentation, you must configure your project with the following snippet:
Integrate Lumen SDK
1. Set streamrootKey
Before doing anything, you must set the streamrootKey as a metadata in the application manifest.
streamrootKey: Refers to your Lumen unique identifier that you will find in the Account section of the Mesh Delivery Dashboard. If you don't have one, you can ask for a free trial on our website.
Note: It is also possible to pass your streamrootKey at Lumen Delivery Client instantiation and initialization.
2. Create a new Lumen Delivery Client instance
Now that you have set the streamrootKey, you are able to create the Lumen Delivery Client instances.
Other DNA options can be called in the builder. Please refer to dnaConfig overview for android to learn more about them.
3. Give your player the new URL
Once you have a running instance of the SDK, you must retrieve the final URL and input it to your player instead of your original one. The SDK exposes a `ManifestUrl` method that will do it as expected.
4. Implement the playerInteractor
This player interactor module is how our SDK gets accurate metrics regarding the client session. The SDK will need the following information to work optimally:
6. Implement the BandwidthMeter
The BandwidthMeter allows for estimating the bandwidth needed to download video chunks. The SDK will need:
Please refer to the example below.
Then call the bandwidthListener in the builder.
6. Integrate the QoS Module (optional)
This QoS module will link Kaltura Playkit events to our SDK to get accurate metrics on the client session. If the QoS module is not implemented, a default module directly embedded in the SDK will be used instead.
The following is an example of the class to add to the app to do so.
You must then call the PlaykitQosModule in the builder.
7. Stop the Mesh Delivery Client
Once the video is done playing, you must stop the SDK you created earlier. Calling the following method will finish the ongoing tasks and release the resources.
8. Network security configuration
Starting with Android 9 (API level 28), cleartext support is disabled by default.
As Streamroot SDK works as a local HTTP proxy, it is required to do one of the following
More info can be found in the Android documentation.
Integrating with OvpMediaProvider
If you are using OVP content you will need to get the media using the OvpMediaProvider to remotely get your media. More information can be found in Kaltura's documentation.
This step must be done before creating the Mesh Delivery Client instance explained in Step 2.
You need to pass the media URL retrieved from the `OvpMediaProvider` to the SDK and then retrieve the `manifestUrl` to pass it to your player.
Hereunder is an example on how to do so.
Then, it is recommended to also pass the content Id in the builder using the mediaId fetched from the PKMediaSource.
Explore CDN services