MediaMelon Android Media3 v1.2.1 SDK Integration Document

This guide provides detailed instructions on integrating the Android MediaMelon SDK with the Media3 v1.2.1 player

Step 1: Prerequisites

Step 2: Set up the build environment

Step 3: Import Packages

Step 4: Register and Initialise SDK

Step 5: Report Ended State

Step 1: Prerequisites

  • Media3 - v1.2.1 sample application.

  • MediaMelon Media3 SDK Maven dependencies or the provided AAR file is necessary.

Step 2: Set up the build environment

$MEDIA3PROJECT = {Media3 - v1.2.1}

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

Using Maven:

  1. Add MediaMelon Media3 Maven dependency to $MEDIA3PROJECT/demos/main/build.gradle

dependencies {
   ...
  implementation 'com.github.MediamelonSDK:mm-sdk-media3-v1.2.1-android:1.0.5'
}

Using AAR:

  1. Copy mmsmartstreaming-media3.aar provided in the release package for the Media3 project. Example $MEDIA3PROJECT/demos/main/mmsmartstreaming-media3.aar .

  2. 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.

circle-info

The enableLogTrace() feature should be enabled for testing during the integration process. Set this to False before releasing the player to production.

circle-info

CUSTOMER_ID is your MediaMelon assigned Customer ID. If you do not know your Customer ID contact MediaMelon at [email protected].

Step 5: Report Ended State

In $MEDIA3PROJECT/demos/main/src/main/java/androidx/media3/demo/main/PlayerActivity.java

Last updated