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: Integrate MediaMelon Player SDK Code to Basic Playback App
  • Step 3 : Report Content Metadata
  • Step 4: Report custom metadata (Optional)
  • Step 5: Report Ended State to the SDK
  • Step 6: Update assetInfo dynamically (Optional)

Was this helpful?

  1. MediaMelon Player SDK Integration
  2. Android SDK

Bitmovin Android v3.73 with Content Provider Metrics

This page describes the integration of the MediaMelon Player SDK with Bitmovin Player on the Android platform

PreviousApp Analytics SDKNextExoplayer v2.13.2 integration with MediaMelon SDK

Last updated 10 months ago

Was this helpful?

Prerequisites

  1. Bitmovin Android Sample Player

  2. MediaMelon SmartSight SDKsmartstreaming-release.aar

  3. MediaMelon-assigned Customer ID

If you do not know your Customer ID contact MediaMelon at

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 BasicPlayback/smartstreaming-release.aar

  2. Add network permissions to

    app/src/main/AndroidManifest.xml

    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
  3. Add the following library to BasicPlayback/build.gradle :-

    dependencies {
        ...
        implementation("com.github.MediamelonSDK:mediamelon_bitmovin_sdk:1.0.14")
        ...
    }

Step 2: Integrate MediaMelon Player SDK Code to Basic Playback App

The player application must register the MediaMelon Player 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 initialised.

import com.mediamelon.qubit.ep.ContentMetadata;
import com.mediamelon.smartstreaming.MMAVAssetInformation;
import com.mediamelon.smartstreaming.MMPlayerState;
import com.mediamelon.smartstreaming.MMRegistrationInformation;
import com.mediamelon.smartstreaming.MMSmartStreaming;
import com.mediamelon.smartstreaming.bitmovin.MMSmartStreamingBitmovinAdaptor;

Note:

Please provide the hashSubscriberId value in setSubscriberInformation(), hashSubscriberId boolean variable indicates whether the SUBSCRIBER_ID to be hashed or not.

Use the setIsLive API to set true for a live stream and false for a VOD stream. If not set here, SDK will set it internally.

MMSmartStreamingBitmovinAdaptor.setIsLive(true);
protected void initializePlayer() {
    //Player creation
    player = Player.create(this);
    playerView.setPlayer(player);

    // MediaMelon
    MMAVAssetInformation assetInformation = new MMAVAssetInformation("ASSET_ID", "ASSET_NAME", "VIDEO_ID");
    String jsonAssetInfo = assetInformation.toJSON();
    MMSmartStreamingBitmovinAdaptor.JsonFromClient = jsonAssetInfo;
    
    MMSmartStreamingBitmovinAdaptor mmSmartStreamingBitmovinAdaptor  = new MMSmartStreamingBitmovinAdaptor(getApplicationContext()) ;
    
    MMSmartStreamingBitmovinAdaptor.enableLogTrace(false); //set this to false before releasing to production
    MMSmartStreamingBitmovinAdaptor.setIsLive(true);

    MMRegistrationInformation registrationInformation = new MMRegistrationInformation("CUSTOMER_ID", "PLAYER_NAME");
    registrationInformation.setPlayerInformation("PLAYER_BRAND", "PLAYER_MODEL", "PLAYER_VERSION");
    registrationInformation.setDomain("DOMAIN_NAME");
    boolean hashSubscriberId = true; 
    registrationInformation.setSubscriberInformation("SUBSCRIBER_ID", "SUBSCRIBER_TYPE", "SUBSCRIBER_TAG", hashSubscriberId);
   
    String url  = "STREAM_URL";
    mmSmartStreamingBitmovinAdaptor.setContentProviderDetails(url);
    mmSmartStreamingBitmovinAdaptor.setURL(url);  
    
     MMSmartStreamingBitmovinAdaptor.setPlayerRegistrationInformation(registrationInformation, player, this);

    //load the source into the player
    SourceConfig sourceConfiguration = new SourceConfig(url, SourceType.Hls);
    Source playerSource  = Source.create(sourceConfiguration);
    this.player.load(playerSource);
}

Step 3 : Report Content Metadata

To enable Content Metadata , user need to include the following package in BasicPlayback app.

import com.mediamelon.qubit.ep.ContentMetada;
ContentMetadata cm  = new ContentMetadata();

cm.videoId="VIDEO_ID";
cm.seriesTitle="SERIES_TITLE";
cm.season="SEASON";
cm.genre="GENRE";
cm.episodeNumber="EPISODE_NUMBER";
cm.drmProtection="DRM_PROTECTION";
cm.contentType="CONTENT_TYPE";
cm.assetName="ASSET_NAME";
cm.assetId="ASSET_ID";

JSONObject jsonObj = cm.getJSONObject();
MMSmartStreamingBitmovinAdaptor.contentMetadataFromUser = jsonObj;

Step 4: Report custom metadata (Optional)

mmSmartStreamingBitmovinAdaptor.reportCustomMetadata("KEY", "VALUE");

Step 5: Report Ended State to the SDK

@Override
protected void onDestroy() {
    playerView.onDestroy();
    super.onDestroy();
    MMSmartStreaming.getInstance().reportPlayerState(MMPlayerState.STOPPED);
}

Step 6: Update assetInfo dynamically (Optional)

If Asset Information needs to be updated dynamically during the live session without re-initiating the player, then the "updateAssetInfo” API can be used to update the new AssetInfo.

Note:

  1. This API must be called for updating asset info for the live streams only

  2. This API must be called after the Player has started the playback of the live stream.

  3. New Asset Info Object will override the previous values, hence set all the fields that are required every time before calling this API.

MMAVAssetInformation newAssetInformation = new MMAVAssetInformation("ASSET_ID", "ASSET_NAME", "VIDEO_ID");
MMSmartStreamingBitmovinAdaptor.updateAssetInfo(newAssetInformation, player, "SEASON","GENRE","EPISODE_NUMBER","CONTENT_TYPE","VIDEO_TYPE","DRM_PROTECTION","SERIES_TITLE");

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.

https://github.com/bitmovin/bitmovin-player-android-samples
support@mediamelon.com