Step 3: Register and Initialize the MediaMelon Player SDK
<customer_id> is your MediaMelon-assigned Customer ID. If you do not know your Customer ID contact MediaMelon at support@mediamelon.com
After the player instance has been created, create a new Plugin object, register, report player Info and then initialize the plugin as shown below:
Note:
Please provide the exact correct details in all fields like CUSTOMER_ID, ASSET_ID, ASSET_TITLE, VIDEO_ID, PLAYER_BRAND, PLAYER_MODEL, PLAYER_VERSION, PLAYER_NAME, DOMAIN_NAME, SUBSCRIBER_ID, SUBSCRIBER_TYPE & SUBSCRIBER_TAG.
This data helps in debugging through MediaMelon SmartSight if anything goes wrong.
Step 4: Listen to Ad Callback Events for Disabling Player Controls
Listen to the Ad callbacks provided by MediaMelon SDK for disabling the player controls during the Ad playback and can be enabled back when the Ad playback ends.
NowtilusAdPlugin.addListener('onCueTimelineAdded',function (adinfo, adTimeline) {// adTimeline is an Array of adinfo objects. This contains details of all the Ads from upcoming Ad break.console.log("onCueTimelineAdded callback"); });NowtilusAdPlugin.addListener('onCueTimelineEnter',function (adinfo) {console.log("onCueTimelineEnter callback");});NowtilusAdPlugin.addListener('impression',function (adinfo) {console.log("AD Impression callback");});NowtilusAdPlugin.addListener('start',function (adinfo) {console.log("AD start callback");});NowtilusAdPlugin.addListener('firstQuartile',function (adinfo) {console.log("AD FirstQuartile callback");});NowtilusAdPlugin.addListener('midpoint',function (adinfo) {console.log("AD Midpoint callback");});NowtilusAdPlugin.addListener('thirdQuartile',function (adinfo) {console.log("AD ThirdQuartile callback");});NowtilusAdPlugin.addListener('complete',function (adinfo) {console.log("AD Complete callback");});NowtilusAdPlugin.addListener('onCueTimelineExit',function (adinfo) {console.log("onCueTimelineExit callback");});
API's Provided by MediaMelon SDK Plugin
// Registering MediaMelon SDKmmCastlabsPlugin.registerMMSmartStreaming("PLAYER_NAME","CUSTOMER_ID","SUBSCRIBER_ID","DOMAIN_NAME","SUBSCRIBER_TYPE","SUBSCRIBER_TAG");// Checking MediaMelon SDK Registration Status. This API returns a boolean value where, // true -> MediaMelon SDK Registration is Completed// false -> MediaMelon SDK Registration is PendingmmCastlabsPlugin.getRegistrationStatus()// Reporting Player InformationmmCastlabsPlugin.reportPlayerInfo("PLAYER_BRAND","PLAYER_MODEL",'PLAYER_VERSION');// Initializing MediaMelon SDKmmCastlabsPlugin.initialize(<PLAYER_OBJECT>, "MEDIA_URL", <MM_VIDEO_ASSET_INFO>, <MM_SSAI_PLUGIN_OBJECT>);// Enable or Disable Log Trace. It takes a boolean value as an input parameter.// true -> Enabling Log Trace// false -> Disabling Log TracemmCastlabsPlugin.enableLogTrace(false);// Reporting Current Player State as StoppedmmCastlabsPlugin.reportPlayerStopped();// Updating Subscriber DetailsmmCastlabsPlugin.updateSubscriber("SUBSCRIBER_ID", "SUBSCRIBER_TYPE", "SUBSCRIBER_TAG");// Reporting Custom Metadata in a KEY & VALUE formatmmCastlabsPlugin.reportCustomMetadata("KEY", "VALUE_STRING");// Shutting Down the MediaMelon SDKmmCastlabsPlugin.closeMediaMelonSDK();
Variable
Description
PLAYER_NAME
String containing the Player Name.
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.
COTENT_TYPE
String containing type of the Content. For example - "Movie", "Special", "Clip", "Scene Epis Lifts".
GENRE
String containing Genre of the content. For example - "Comedy", "Horror".
DRM_PROTECTION
Widevine, Fairplay, Playready etc. Unknown means content is protected, but protection type is unknown. For clear contents, do not set this field
EPISODE_NUMBER
String containing sequence number of the Episode.
SEASON
String containing the Season. For example - "Season1".
SERIES_TITLE
String containing Title of the Series.
VIDEO_TYPE
String containing Video Type. For example - "LIVE", "VOD".
CUSTOM_TAGS
Extra custom metadata can be added here if required. If extra metadata is not required, enter null.
PLAYER_BRAND
String containing Player Brand.
PLAYER_MODEL
String containing 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.