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.
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
publicvoidonCreate(Bundle savedInstanceState) {... @OverridepublicvoidonClick(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.
// after player is initialised and not null anymoreString mediaUrl ="get the mediaURL from your application"String assetId ="assetID"; //enter you assetId hereString assetName ="assetNAME"; // enter your assetname hereString videoId ="videoID"; // enter your videoId hereContentMetadata cm =newContentMetadata();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, assetId, assetName, videoId,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