IMA Media3 v1.3.0 SDK Integration Document

This procedure describes the MediaMelon SDK(with Google IMA) Integration with a Media3 Android . This is a sample integration done with the sample application from the Google IMA.

Prerequisites:

  1. Google IMA DAI Sample app and Documentation.

  2. MediaMelon SmartSight SDK maven dependencies or smartstreaming-release.aar.

  3. MediaMelon-assigned Customer ID.

Note: If you do not know your Customer ID contact MediaMelon at [email protected]

Step 1: Set up the build environment

The SDK should be added to the build environment and the required network permissions should be enabled.

Using Maven:

  1. Add the following library to BasicExample/app/build.gradle :-

dependencies {
    .
    .
    implementation 'com.google.ads.interactivemedia.v3:interactivemedia:3.24.0'
    implementation 'androidx.media3:media3-exoplayer:1.3.0'
    implementation 'com.github.MediamelonSDK:mm-sdk-media3-ima-android:1.0.3'
    .
    .
}

Using ARR:

  1. Copy smartstreaming-release.aar provided with the release package to BasicExample/app/

  2. Add the following library to BasicExample/app/build.gradle :-

Step 2: Import the required MediaMelon SDK Classes:

Step 2.1: Add the below imports to:

BasicExample/app/src/main/java/com/google/ads/interactivemedia/v3/samples/videoplayerapp/MyActivity.java

Step 2.2: Add the below imports to:

BasicExample/app/src/main/java/com/google/ads/interactivemedia/v3/samples/samplevideoplayer/SampleVideoPlayer.java

Step 2.3: Add the below imports to:

BasicExample/app/src/main/java/com/google/ads/interactivemedia/v3/samples/videoplayerapp/SampleAdsWrapper.java

Step 3: Integrate MediaMelon SDK

The below steps describe the procedure to integrate the MediaMelon SDK into the application.

Note - Only the code written inside the <MediaMelon Integration> tag is to be added for MediaMelon-specific integration, the rest of the code above and below the <MediaMelon Integration> tag is shown just to give a context, as shown below:-

Step 3.1: Add the following code to:

BasicExample/app/src/main/java/com/google/ads/interactivemedia/v3/samples/samplevideoplayer/SampleVideoPlayer.java

Step 3.2: Add the following code to:

BasicExample/app/src/main/java/com/google/ads/interactivemedia/v3/samples/videoplayerapp/MyActivity.java

Variable
Description

PLAYER_NAME

String containing the player version (e.g. “Bitmovin_Android_Player_2.28.0”).

CUSTOMER_ID

String containing your MediaMelon-assigned Customer ID.

SUBSCRIBER_ID

String containing your subscriber’s ID. If you do not use subscriber IDs, enter null

DOMAIN_NAME

String containing your section of your subscriber or assets. (Optional)

SUBSCRIBER_TYPE

String containing the subscriber type (e.g. “Free”, “Paid”). If you do not use subscriber types, enter null

SUBSCRIBER_TAG

String containing an additional subscriber-specific information. This is sent in clear (not hashed) to SmartSight and it is advised to not send sensitive information in this field.

ASSET_ID

String containing Asset Id.

ASSET_NAME

String containing Asset Name.

VIDEO_ID

String containing your video’s ID. If you do not use videos IDs, enter null.

PLAYER_BRAND

String containing the player brand (e.g. “bitmovin”).

PLAYER_MODEL

String containing the player model. For example - This could be a variant of player. Say name of third party player used by organisation. Or any human readable name of the player.

PLAYER_VERSION

String containing the player version.

Step 3.3: Add the following code to:

BasicExample/app/src/main/java/com/google/ads/interactivemedia/v3/samples/videoplayerapp/SampleAdsWrapper.java

Step 4: AD Event callbacks from the SDK.

A list of all Google IMA DAI AD events can be found here.

Last updated