Bitmovin SDK Integration Document
This page describes the integration of the MediaMelon Player SDK with Bitmovin Player on the Android platform
Step 1: Prerequisites
Step 2: Set up the build environment
Step 3: Integrate MediaMelon Player SDK Code to Basic Playback App
Step 4: Report Content Metadata
Step 5: Report Custom Metadata
Step 6: Report Ended State
Step 7: Update Asset Info Dynamically
Step 8: Set Content Provider URL
Step 1: Prerequisites
Bitmovin Android Sample Player https://github.com/bitmovin/bitmovin-player-android-samples
MediaMelon SmartSight SDK
smartstreaming-release.aarMediaMelon-assigned Customer ID
Step 2: Set up the build environment
The SDK files are added to the build environment and the required network permissions are enabled.
Copy
smartstreaming-release.aarprovided with the release package toBasicPlayback/smartstreaming-release.aarAdd network permissions to
app/src/main/AndroidManifest.xml<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />Add the following library to
BasicPlayback/build.gradle:-dependencies { ... implementation("com.github.MediamelonSDK:mediamelon_bitmovin_sdk:1.0.14") ... }
Step 3: 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;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 4 : 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 5: Report Custom Metadata (Optional)
mmSmartStreamingBitmovinAdaptor.reportCustomMetadata("KEY", "VALUE");Step 6: Report Ended State
@Override
protected void onDestroy() {
playerView.onDestroy();
super.onDestroy();
MMSmartStreaming.getInstance().reportPlayerState(MMPlayerState.STOPPED);
}Step 7: 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:
This API must be called for updating asset info for the live streams only
This API must be called after the Player has started the playback of the live stream.
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");Step 8: Set Content Provider URL(Optional)
String url = "CONTENT_PROVIDER_URL";
mmSmartStreamingBitmovinAdaptor.setContentProviderDetails(url);Last updated