MediaMelon
  • MediaMelon SDK Integration
  • MediaMelon SDK Events
  • MediaMelon Player SDK Integration
    • React Native
      • React Native Video v5.2.0 with Mediamelon SDK
      • React Native Video v6.4.2 with Mediamelon SDK
    • Web SDK
      • VideoJS Web with Mediamelon Analytics
      • VideoJS Web with Google DAI
      • Shaka Player Web v4
      • MediaMelon Web Kaltura Player Plugin Integration Document
      • NexPlayer Web v4
      • THEOPlayer Web
      • JWPlayer Web
      • Radiant Player Web
      • ChromeCast Player
      • HLSJS Player Web
      • HbbTV SDK
      • Comcast PDK 6
      • Bitmovin Web Player
      • HTML5 Player Web
      • Flow Player Web
      • DashJS Player Web
      • Castlabs Player Web
      • Cordova Plugin Toast (Smart TV)
      • Custom Player Web SDK
      • Plyr Player Web with MediaMelon Analytics
      • React Player SDK with IMA
    • Android SDK
      • App Analytics SDK
      • Bitmovin Android v3.73 with Content Provider Metrics
      • Exoplayer v2.13.2 integration with MediaMelon SDK
      • Exoplayer v2.17.1 with Mediamelon SDK
      • Exoplayer v2.12.2 integration with MediaMelon SDK
      • EXOPlayer-Android(V2.14.2) MediaMelon SDK with Google IMA DAI
      • EXOPlayer-Android(V2.17.1) MediaMelon SDK with Google IMA DAI
      • Exoplayer v2.11
      • Exoplayer v2.18.1 with Mediamelon SDK
      • Theoplayer v6.0.0 with Mediamelon SDK
      • Theoplayer v4.12.6 with Mediamelon SDK
      • Theoplayer v7.5.0 with Mediamelon SDK
      • Exoplayer v2.13.3 integration with MediaMelon SDK
      • Kaltura Android Player Integration with Mediamelon SDK
      • Media3 v1.3.0 and ExoPlayer 2.19.1 with MediaMelon SDK
      • Media3 v1.3.1 with MediaMelon SDK
      • MediaMelon Android Media3 v1.1.1 SDK Integration Document
      • Media3Player-Android(V1.3.0) MediaMelon SDK with Google IMA
    • Roku SDK
      • Roku SDK
      • Roku with RAF SDK
      • Roku with IMA SDK
    • iOS SDK
      • AVPlayer (Cocoapods)
      • AVPlayer with Google DAI SDK ( Framework )
      • AVPlayer Quality Of Experience SDK
      • AVPlayer Generic Framework
      • AVPlayer with Google DAI (Cocoapods)
      • Bitmovin iOS v3.44 with Content Provider Metrics
      • THEOPlayer XCFramework
      • THEOplayer (Cocoapods)
      • MediaMelon iOS Kaltura Player Plugin Integration Document
    • tvOS SDK
      • AVPlayer tvOS XCFramework
      • THEOPlayer tvOS XCFramework
    • Toast SDK
    • Custom Player C++ SDK
    • C++ SDK QoE Ads
    • Ad Integrations
      • Google IMA
      • FreeWheel
      • ServerSide.AI
  • SmartSight Analytics
    • Product Features
    • QBR Streaming
  • SmartSight API's
    • API Overview
      • Metric and Dimensions Dictionary
      • General Guidelines
      • Video Experience
      • Ad Experience
      • Smartquery Insights
      • Errors
      • Alerts
    • Use-case dictionary
Powered by GitBook
On this page
  • Prerequisites
  • Step 1: Set up the build environment
  • Step 2: Include and Configure the MediaMelon Plugin

Was this helpful?

  1. MediaMelon Player SDK Integration
  2. Android SDK

Kaltura Android Player Integration with Mediamelon SDK

This document provides a step by step guide to integrate the Mediamelon SDK with the Kaltura Player 4.2.59

PreviousExoplayer v2.13.3 integration with MediaMelon SDKNextMedia3 v1.3.0 and ExoPlayer 2.19.1 with MediaMelon SDK

Last updated 1 year ago

Was this helpful?

Prerequisites

  • Kaltura Player Playtkit

  • MediaMelon Kaltura Player Plugin (com.github.MediamelonSDK:mm-KalturaPlayer:1.1.1)

  • IMADAISample from

  • Allsamples folder from ( AllSamples folder and BasicPluginSetup need to be at the same level )

Step 1: Set up the build environment

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

  1. Copy mediamelonplugin-release.aar provided with the release package to the libs folder ( create one if its not already there ) in the BasicPluginsSetup project

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

dependencies {
  .
  .
  .
  //<!-- <MMSmartStreaming 1b> -->
   implementation 'com.github.MediamelonSDK:mm-KalturaPlayer:1.1.1'
  //<!-- </MMSmartStreaming 1b> -->
  
}

Add network permissions to IMADAISample/app/manifests/AndroidManifest.xml

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

<!-- <MMSmartStreaming 1c> -->
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<!-- </MMSmartStreaming 1c> -->

Step 2: Include and Configure the MediaMelon Plugin

The MediaMelon plugin needs to be configured . The following steps need to be executed.

Step 2a: Import packages

The MediaMelon plugin package needs to be imported in the following file

IMADAISample/app/com/kaltura/playkit/samples/imadaisample/MainActivity.java

// <MMSmartStreaming 2a>
import com.kaltura.playkit.plugins.mediamelon.*;
// </MMSmartStreaming 2a>
// <MMSmartStreaming 2a>
import com.kaltura.playkit.plugins.mediamelon.*
// <MMSmartStreaming 2a>

Step 2b: Configure the Plugin

Add the following function createPluginConfigs in the file IMADAISample/app/com/kaltura/playkit/samples/imadaisample/MainActivity.java

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        //Initialize media config object.
        createMediaConfig();

        //Create plugin configurations.
        PKPluginConfigs pluginConfigs = createIMADAIPlugin();
        pluginConfigs = createMMPluginConfigs(pluginConfigs);

        //Create instance of the player with plugin configurations.
        player = PlayKitManager.loadPlayer(this, pluginConfigs);
.....
}

private PKPluginConfigs createMMPluginConfigs(PKPluginConfigs pkPluginConfigs) {
        //First register your SamplePlugin.
        PlayKitManager.registerPlugins(this, MediamelonPlugin.factory);

        //Initialize plugin configuration object.

        if(pkPluginConfigs == null) {
            //Initialize plugin configuration object.
            pkPluginConfigs = new PKPluginConfigs();
        }

        //Set jsonObject to the main pluginConfigs object.
        pkPluginConfigs.setPluginConfig(MediamelonPlugin.factory.getName(),  createJson() );

        //Return created and populated object.
        return pkPluginConfigs;
    }

// Json parameters for configuring plugin
private JsonObject createJson() {
        JsonObject optJson = new JsonObject();

        // Main config goes here.
        optJson.addProperty("customerId", "18410666590");
        optJson.addProperty("domainName", "EladDomain");
        optJson.addProperty("subscriberId", "SubscriberId");
        optJson.addProperty("subscriberType", "SubscriberType");
        optJson.addProperty("subscriberTag", "SubscriberTag");
        optJson.addProperty("doHash", false);
        optJson.addProperty("playerName", "KALTURA PLAYER");

        optJson.addProperty("playerVersion", PlayKitManager.VERSION_STRING);

        // Set ContentMetadata for every asset played.
        optJson.addProperty("assetId", "1234");
        optJson.addProperty("assetName", "My IMA Asset");
        optJson.addProperty("videoId", "5678");
        optJson.addProperty("seriesTitle", "Test Series");
        optJson.addProperty("episodeNumber", "1");
        optJson.addProperty("season", "2");
        optJson.addProperty("contentType", "Episode");
        optJson.addProperty("drmProtection", "WideVine");
        optJson.addProperty("genre", "Romance,Horror");

        // Set Application data.
        optJson.addProperty("appName", "KalturaApp");
        optJson.addProperty("appVersion", "v1.0.0");

        // Set metadata for device.
        optJson.addProperty("deviceMarketingName", "Oneplus6");
        optJson.addProperty("videoQuality", "4K-HDR");
        optJson.addProperty("deviceId", "abcd-efgh-ijkl-mnop");
        optJson.addProperty("isDisableManifestFetch", false);

        // Set CustomTags.
        JsonObject optCustomJson = new JsonObject();

        optCustomJson.addProperty("param1", "12345");
        optCustomJson.addProperty("param2", "Sandbox Watch");
        optCustomJson.addProperty("param3", "12345");
        optCustomJson.addProperty("param4", "54321");
        optCustomJson.addProperty("param5", "1_nd547djd");
        optCustomJson.addProperty("householdId", "12345");
        optCustomJson.addProperty("properties", "{'key':'value'}");
        optCustomJson.addProperty("playerStartupTime", "12345");
        optCustomJson.addProperty("username", "123456789");
        optCustomJson.addProperty("seriesId", "123454321");
        
        optJson.addProperty("customTags", optCustomJson.toString() );
        

        return optJson;
    }

    private fun createJson(): JsonObject? {
        val optJson = JsonObject()

        // Main config goes here.
        optJson.addProperty("customerId", "18410666590")
        optJson.addProperty("domainName", "EladDomain")
        optJson.addProperty("subscriberId", "SubscriberId")
        optJson.addProperty("subscriberType", "SubscriberType")
        optJson.addProperty("subscriberTag", "SubscriberTag")
        optJson.addProperty("doHash", false)
        optJson.addProperty("playerName", "KALTURA PLAYER")
        optJson.addProperty("playerVersion", PlayKitManager.VERSION_STRING)

        // Set ContentMetadata for every asset played.
        optJson.addProperty("assetId", "1234")
        optJson.addProperty("assetName", "My IMA Asset")
        optJson.addProperty("videoId", "5678")
        optJson.addProperty("seriesTitle", "Test Series")
        optJson.addProperty("episodeNumber", "1")
        optJson.addProperty("season", "2")
        optJson.addProperty("contentType", "Episode")
        optJson.addProperty("drmProtection", "WideVine")
        optJson.addProperty("genre", "Romance,Horror")

        // Set Application data.
        optJson.addProperty("appName", "KalturaApp")
        optJson.addProperty("appVersion", "v1.0.0")

        // Set metadata for device.
        optJson.addProperty("deviceMarketingName", "Oneplus6")
        optJson.addProperty("videoQuality", "4K-HDR")
        optJson.addProperty("deviceId", "abcd-efgh-ijkl-mnop")
        optJson.addProperty("isDisableManifestFetch", false)

        // Set CustomTags.
        val optCustomJson =  JsonObject()

        optCustomJson.addProperty("param1", "12345")
        optCustomJson.addProperty("param2", "Sandbox Watch")
        optCustomJson.addProperty("param3", "12345")
        optCustomJson.addProperty("param4", "54321")
        optCustomJson.addProperty("param5", "1_nd547djd")
        optCustomJson.addProperty("householdId", "12345")
        optCustomJson.addProperty("properties", "{'key':'value'}")
        optCustomJson.addProperty("playerStartupTime", "12345")
        optCustomJson.addProperty("username", "123456789")
        optCustomJson.addProperty("seriesId", "123454321")
        
        optJson.addProperty("customTags", optCustomJson.toString() )
        
        return optJson
    }
    
    
    private fun createIMADAIPlugin(): PKPluginConfigs {


        //First register your SamplePlugin.
        PlayKitManager.registerPlugins(this, MediamelonPlugin.factory)

        //Initialize plugin configuration object.
        val pluginConfigs = PKPluginConfigs()
    .....
        //Initialize + Configure  IMADAIConfig object
        pluginConfigs.setPluginConfig(IMADAIPlugin.factory.name, daiConfigVodHls2)

        //Set jsonObject to the main pluginConfigs object.
        pluginConfigs.setPluginConfig(MediamelonPlugin.factory.getName(), createJson())

    .....
    }
    

Variables to be configured are as follows

Variable
Description

playerName

String containing the Player Name.

customerId

String containing your MediaMelon-assigned Customer ID.

subscriberId

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

domainName

String containing your section of your subscriber or assets.

subscriberType

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

subscriberTag

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.

assetId

String containing Asset Id.

assetName

String containing Asset Name.

videoID

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

contentType

String containing type of the Content. For example - "Movie", "Special", "Clip", "Scene Epis Lifts".

genre

String containing Genre of the content. For example - "Comedy", "Horror".

drmProtection

Widevine, Fairplay, Playready etc. Unknown means content is protected, but protection type is unknown. For clear contents, do not set this field

episodeNumber

String containing sequence number of the Episode.

season

String containing the Season. For example - "Season1".

seriesTitle

String containing Title of the Series.

playerBrand

String containing Player Brand.

playerModel

String containing 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.

playerVersion

String containing Player Version.

appName

String containing the name of the application

appVersion

String containing the version of the application

deviceMarketingName

String containing the marketing name associated with the device

deviceId

String containing the device id

videoQuality

String containing the video quality supported by the device

Any variable not part of the list above will need to be set as a custom tag

Any variable which is not part of the above list will need to be set as a custom tag by the plugin library

https://github.com/kaltura/playkit-android
https://github.com/kaltura/playkit-android-samples/tree/develop/
https://github.com/kaltura/playkit-android-samples/tree/develop/AllSamples