Exoplayer SDK with Nowtilus SSAI
This document explains the process to integrate MM SDK with Google Exoplayer version v2.12.2 and v2.11.8
STEP 1 :
Each SDK release directory contain the class files required for building a jar which is used in the application . The jar can be created as follows
jar cvf <name_of_the_jar>.jar .STEP 2: Add the .jar file as a dependency in the Exoplayer build.gradle file.
api files ('name_of_the_jar.jar')STEP 3: Add the below lines to the Exoplayer PlayerActivity.java.
import com.mediamelon.smartstreaming.MMQBRMode;
import com.mediamelon.smartstreaming.MMSmartStreaming;
import com.mediamelon.smartstreaming.MMSmartStreamingExo2;
import com.mediamelon.smartstreaming.MMSmartStreamingInitializationStatus;
import com.mediamelon.smartstreaming.MMSmartStreamingObserver;
import com.mediamelon.qubit.PropertyReader;STEP 4 :Register Mediamelon SDK using your assigned customerID.
Add the below lines in the onCreate method of PlayerActivity.java
$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.
$ASSETID
String containing Asset Id.
$ASSETNAME
String containing Asset Name.
$VIDEOID
String containing your video’s ID. If you do not use videos IDs, leave it as it is.
$PLAYER_BRAND
String containing the player brand (e.g. “Exo”).
$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.
STEP 5 : Disable manifest fetching by the SDK.
If your workflow restricts the manifest to be accessible from both player and the MediaMelon Player SDK simultaneously, then, you can disable the fetch of manifest via :
STEP 6: Create the Content Metadata object inside the initializePlayer() method of PlayerActivity.java .
STEP 7: Get the mediaURL and vastURL from the Nowtilus SSAI stream url.
NOTE - The player needs to be given the extracted mediaURL as the playback URL.
STEP 8: Add the below lines to the initializePlayer() method. Add the lines after the player is initialized and not null.
NOTE - boolean enablePollingforSSAI variable indicates whether the Mediamelon SDK needs to poll for the VAST URL or not. Please set it to true if you want to opt for polling else set it to false.
STEP 9: Subscribe to AD EVENTS .
List of AD EVENTS
onAdImpression
Fired when an Ad Impression occurs
onAdStarted
Fired when Ad starts playing
onAdFirstQuartile
Fired when Ad playback reaches the First Quartile point
onAdMidpoint
Fired when Ad playback reaches the Midpoint
onAdThirdQuartile
Fired when Ad playback reaches the Third Quartile point
onAdProgress
Fired every second during Ad Playback, used to track Ad Playback progress
onAdComplete
Fired when Ad Playback completes
onCueTimelineAdded
Fired when an Ad break information gets added
onCueTimelineEnter
Fired when an Ad break ( which can contain multiple Ads) starts
onCueTimeLineExit
Fired when an Ad break ( which can contain multiple Ads) ends
STEP 10: Add the below lines to the releasePlayer() method.
Step 11 : Get Ad Related Information.
You can use the below commands from inside any of the AD Events(listed above) that you subscribe to.
ssaiAdInfo.getTotalAds()- returns aintwhich signifies the number of Ads in the current Ad break.ssaiAdInfo.getClickTrackingURLs()-returns the click tracking URLs as a List<String>.ssaiAdInfo.getClickThroughURLs()-returns the clickthrough URLs as a List<String>.ssaiAdInfo.getAdSkipOffset()- returns the AD offset inseconds.ssaiAdInfo.getCompleteTrackers()-returns the AD Complete Tracking URLs as a List<String>.ssaiAdInfo.getMidpointTrackers()-returns the AD Midpoint Tracking URLs as a List<String>.ssaiAdInfo.getThirdQuartileTrackers()-returns the AD ThirdQuartile Tracking URLs as a List<String>.ssaiAdInfo.getFirstQuartileTrackers()-returns the AD FirstQuartile Tracking URLs as a List<String>.ssaiAdInfo.getImpressionTrackers()-returns the AD Impression URLs as a List<String>.ssaiAdInfo.getAdIndex()-returns the index of the current AD in the AD break.
Sample Application
The Sample Application for Exoplayer with Nowtilus SSAI can be donwloaded from
sdk.mediamelon.com/<Customer ID>/Android/ExoPlayer_2.11.8.zip
sdk.mediamelon.com/<Customer ID>/Android/ExoPlayer_2.12.2.zip
Complete Integration
Inside onCreate method
Inside the initializePlayer() method
Inside the releasePlayer() method
Last updated