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.
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);
protectedvoidinitializePlayer() {//Player creation player =Player.create(this);playerView.setPlayer(player);// MediaMelonMMAVAssetInformation assetInformation =newMMAVAssetInformation("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 productionMMSmartStreamingBitmovinAdaptor.setIsLive(true);MMRegistrationInformation registrationInformation =newMMRegistrationInformation("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 playerSourceConfig sourceConfiguration =newSourceConfig(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 =newContentMetadata();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;
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.
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.