Media3 IMA SDK Integration Document
This guide provides detailed instructions on integrating the Android MediaMelon IMA SDK with the Media3 player.
Step 1: Prerequisites
Step 2: Set up the build environment
Step 3: Import Packages
Step 4: Register and Initialise SDK
Step 5: Report Experiment Name
Step 6: Report Sub-Property Id
Step 7: Report View Session
Step 8: Report Player Resolution
Step 9: Report Custom Errors
Step 10: Report Ended State
Step 11: Enable IMA/DAI Ad tracking
Step 1: Prerequisites
Media3 sample application.
MediaMelon Media3 SDK Maven dependencies or the provided AAR file is necessary.
Step 2: Set up the build environment
The SDK files should be added to the build environment and the required network permissions should be enabled.
Using Maven:
Add MediaMelon Media3 Maven dependency to
$MEDIA3PROJECT/demos/main/build.gradle
Using AAR:
Copy
mmsmartstreaming.aarprovided in the release package for the Media3 project. Example$MEDIA3PROJECT/demos/main/mmsmartstreaming.aar.Add the following library to
$MEDIA3PROJECT/demos/main/build.gradle:-
Add network permissions to $MEDIA3PROJECT/demos/main/src/main/AndroidManifest.xml
Step 3: Import Packages
$MEDIA3PROJECT/demos/main/src/main/java/androidx/media3/demo/main/PlayerActivity.java
Step 4: Register and Initialise SDK
The player application must register the SDK and provide player information once the player is initialized. Please note that values provided in this integration step persist across video sessions.
The SDK must be initialized at the start of each video session. Initialization includes setting the application context, initializing the playback session, and indicating the intent for playback with the SDK.
Step 5: Report Experiment Name
Step 6: Report Sub-Property Id
Step 7: Report View Session Id
Step 8: Report Player Resolution
Step 9: Report Custom Errors
Step 10: Report Ended State
Report ENDED state in PlayerActivity when playback ends.
Step 11: Enable IMA/DAI Ad tracking
Add the following steps to enable IMA/DAI Ad tracking
11.a: IMA Ad Tracking
11.b: DAI Ad Tracking
The function onAdsManagerLoaded is part of AdsLoader.AdsLoadedListener
Last updated