Exoplayer SDK with Nowtilus SSAI JIO
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
STEP 2: Add the .jar file as a dependency in the Exoplayer build.gradle file.
STEP 3: Add the below lines to the Exoplayer PlayerActivity.java.
STEP 4 :Add the below lines in onCreate method of PlayerActivity.java.
STEP 5: 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 6: 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.And set isLive parameter to true for live streams and false for VOD.
STEP 7: Add Macro Parameters API
getMacros() API returns the JSONObject which contains all Macros that needs to be substituted in Tracking Urls. You can add any new Macros to added in getMacros() API
STEP 8: Subscribe to AD EVENTS and Pass the Macros to SSAI .
Passing Macros to SSAI with the help of setMacroSubstitution() API. getMacros() API will return the Macros in JSON format.
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 9 : 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 aint
which 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.
Step 10 : Get SDK Version Information
MMSmartStreamingExo2.getVersion() - returns the information about the version of SDK using.
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
Last updated