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: Register SDK
  • Parameters passed in Registration call
  • Step 3: Initialize Session
  • Step 4: Report ended state when the Activity is destroyed

Was this helpful?

  1. MediaMelon Player SDK Integration
  2. Android SDK

Theoplayer v7.5.0 with Mediamelon SDK

Prerequisites

  • MediaMelon SmartSight SDK smartstreaming_release.aar

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 smartstreaming-release.aar provided with the release package to the theoplayer project, Example app/libs/smartstreaming-release.aar

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

dependencies {
  .
  .
  .
   //<!-- <MMSmartStreaming 1a> -->
    api files ('smartstreaming-release.aar')
  //<!-- </MMSmartStreaming 1a> -->
}

Add network permissions to

app/src/main/AndroidManifest.xml

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

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

Step 2: Register SDK

The player application must register the SDK and provide player information once when the application launches. Please note that values provided in this integration step persist across video sessions. This is typically done when the player itself is initialized.

Step 2a: Import packages

app/src/main/java/com/theoplayer/theoplayerexample/MainActivity.java

// <MMSmartStreaming 2a>
import com.mediamelon.smartstreaming.MMQBRMode;
import com.mediamelon.smartstreaming.MMSmartStreaming;
import com.mediamelon.smartstreaming.MMSmartStreamingTheo;
import com.mediamelon.smartstreaming.MMSmartStreamingInitializationStatus;
import com.mediamelon.smartstreaming.MMSmartStreamingObserver;
import java.util.ArrayList;
import android.util.Log;
// </MMSmartStreaming 2a>

Step 2b: Registration

Perform registration tasks by modifying the onCreate() method in app/src/main/java/com/theoplayer/theoplayerexample/MainActivity.java

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

public void onCreate(Bundle savedInstanceState) {
  ...
   @Override
            public void onClick(View v) {
                if (theoPlayerView.getPlayer().isPaused()) {
                    theoPlayerView.getPlayer().play();
                } else {
                    theoPlayerView.getPlayer().pause();
                }
            }
        });
        //<MMSmartStreaming 2b>
        MMSmartStreamingTheo.enableLogTrace(<boolean>); //set to "false" before releasing player to production
        if (MMSmartStreamingTheo.getRegistrationStatus() == false){ //Check if it is the first time Registration process is done
            MMSmartStreamingExo2.setDeviceInfo($DEVICE_MARKETING_NAME);
            MMSmartStreamingExo2.registerMMSmartStreaming($PLAYERNAME, $CUSTOMERID, $SUBSCRIBERID, $DOMAINNAME, $SUBSCRIBERTYPE, $SUBSCRIBERTAG,$hashSubscriberId);
            MMSmartStreamingExo2.reportPlayerInfo("CustomPlayerName","Player_Version", "1.0");
            MMSmartStreamingExo2.getInstance().setContext(getApplicationContext()); //Please make sure to provide the application's context here, and not the activity's context
            MMSmartStreamingExo2.getInstance().reportAppInfo($APP_NAME,$APP_VERSION);
            MMSmartStreamingExo2.getInstance().reportVideoQuality($VIDEO_QUALITY);
            }
        // </MMSmartStreaming 2b>
  }
  • hashSubscriberID: To hash the subscriber ID, set it to true. To leave the subscriber ID un-hashed, set it to false.This is optional

Parameters passed in Registration call

Variable
Description

$PLAYERNAME

Player Name as in ExoPlayer, KalturaPlayer etc.

$CUSTOMERID

String containing your MediaMelon-assigned Customer ID.

$SUBSCRIBERID

String containing your subscriber’s ID. If you do not use subscriber IDs, leave it as it is.

$DOMAINNAME

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

$SUBSCRIBERTYPE

String containing the subscriber type (e.g. “Free”, “Paid”). If you do not use subscriber types, leave it as it is.

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

Step 3: Initialize Session

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.

app/src/main/java/com/theoplayer/theoplayerexample/MainActivity.java

// after player is initialised and not null anymore
    String mediaUrl = "get the mediaURL from your application"
    String assetId  = "assetID"; //enter you assetId here
    String assetName = "assetNAME"; // enter your assetname here
    String videoId = "videoID"; // enter your videoId here
    ContentMetadata cm  = new ContentMetadata();
    String episodeNumber = "EpisodeNumber";
    String season = "Season";
    String genre = "Genre";
    String drmProtection = "drmProtection";
    String contentType = "contentType";
    String title = "Title";
    cm.videoId=videoId;
    cm.seriesTitle=title;
    cm.season=season;
    cm.genre=genre;
    cm.episodeNumber=episodeNumber;
    cm.drmProtection=drmProtection;
    cm.contentType=contentType;
    cm.assetName=assetName;
    cm.assetId=assetId;
    JSONObject contentMetadata = cm.getJSONObject();
    //optional content metadata
    MMSmartStreamingTheo.getInstance().initializeSession(player, MMQBRMode.QBRModeDisabled, mediaUrl, null,contentMetadata,isLive);
  • isLive: Set it to true for a live video and false for a VOD video. This is optional.

Step 4: Report ended state when the Activity is destroyed

@Override
protected void onDestroy() {
    super.onDestroy();
    //MM
    MMSmartStreaming.getInstance().reportPlayerState(MMPlayerState.STOPPED);
    //MM
    theoPlayerView.onDestroy();
}
PreviousTheoplayer v4.12.6 with Mediamelon SDKNextExoplayer v2.13.3 integration with MediaMelon SDK

Last updated 11 months ago

Was this helpful?