Note: CUSTOMER_ID is your MediaMelon assigned Customer ID. If you do not know your Customer ID, contact MediaMelon at customer-support@mediamelon.com.
var mmJSPlugin = new mmJSCustomAdapter();
mmJSPlugin.registerMMSmartStreaming(
"PLAYER_NAME",
"CUSTOMER_ID",
"SUBSCRIBER_ID",
"DOMAIN_NAME",
"SUBSCRIBER_TYPE",
"SUBSCRIBER_TAG",
hash_subscriber_id // Boolean Value
);
Note:
hash_subscriber_id
: Set it to true to hash the subscriber ID, and to false to process the subscriber ID without hashing.
mmJSPlugin.reportPlayerInfo("PLAYER_BRAND", "PLAYER_MODEL", "PLAYER_VERSION");
mmJSPlugin.reportBasePlayerInfo("BASE_PLAYER_NAME", "BASE_PLAYER_VERSION");
mmJSPlugin.reportAppInfo("APPLICATION_NAME", "APPLICATION_VERSION");
var deviceInfo = {
"deviceName": "DEVICE_NAME",
"deviceBrand": "DEVICE_BRAND",
"deviceModel": "DEVICE_MODEL",
"deviceId": "DEVICE_ID",
"deviceOS": "DEVICE_OS",
"deviceOSVersion": "DEVICE_OS_VERSION",
"screenWidth": screen_width, // Integer Value
"screenHeight": screen_height // Integer Value
};
mmJSPlugin.reportDeviceInfo(deviceInfo);
mmJSPlugin.reportExperimentName("EXPERIMENT_NAME");
mmJSPlugin.reportSubPropertyId("SUB_PROPERTY_ID");
var contentMetaData = {
"assetName": "ASSET_NAME",
"assetId": "ASSET_ID",
"videoId": "VIDEO_ID",
"contentType": "CONTENT_TYPE",
"genre": "GENRE",
"drmProtection": "DRM_PROTECTION",
"episodeNumber": "EPISODE_NUMBER",
"season": "SEASON",
"seriesTitle": "SERIES_TITLE",
"videoType": "VIDEO_TYPE"
};
mmJSPlugin.initializeSession(contentMetaData, "STREAM_URL");
mmJSPlugin.reportUserInitiatedPlayback();
mmJSPlugin.reportViewSessionId("VIEW_SESSION_ID");
Note: Check the custom tags configuration in your dashboard and report accordingly. If the custom tags are not configured, please configure and use them accordingly.
mmJSPlugin.reportCustomMetadata("custom_1", "value1");
mmJSPlugin.reportCustomMetadata("custom_2", "value2");
var streamInfo = {
"streamURL": "NEW_STREAM_URL",
"streamFormat": "STREAM_FORMAT",
"mediaType": "MEDIA_TYPE",
"sourceType": "SOURCE_TYPE",
"duration": video_duration, // Integer Value in Milli Seconds
"isLive": is_live // Boolean Value
}
mmJSPlugin.reportStreamInfo(streamInfo);
Note:
is_live
: Set isVideoLive to true for live video stream and to false for the VOD stream
mmJSPlugin.updateDRMType("NEW_DRM_TYPE");
var networkInfo = {
"cdn": "CDN",
"asn": asn, // Integer Value
"hostName": "SOURCE_HOST_NAME",
"networkType": "NETWORK_TYPE",
"networkOperator": "NETWORK_OPERATOR"
}
mmJSPlugin.reportNetworkInfo(networkInfo);
mmJSPlugin.reportPlayerState(MMPlayerState.PLAYING);
Enum: MMPlayerState
- PLAYING
- PAUSED
- STOPPED
mmJSPlugin.reportBufferingStarted();
mmJSPlugin.reportBufferingCompleted();
mmJSPlugin.reportPlayerSeekStarted();
mmJSPlugin.reportPlayerSeekCompleted();
mmJSPlugin.reportError("ERROR_CODE", "ERROR_MESSAGE", "ERROR_DETAILS");
Note: Call this every 0.5 sec or 1 sec to report the playback position from the player
mmJSPlugin.reportPlaybackPosition(playback_position); // Integer Value in Milli Seconds
mmJSPlugin.reportFallbackEvent("FALLBACK_MANIFEST_URL", "DESCRIPTION");
mmJSPlugin.reportManifestRequestStatus(ManifestRequestStatus.FAILED, "DESCRIPTION");
Enum: ManifestRequestStatus
- FAILED
- CANCELLED
mmJSPlugin.reportChunkRequestStatus(ChunkRequestStatus.FAILED, ChunkType.VIDEO, {"KEY": "VALUE"});
Enum: ChunkRequestStatus
- FAILED
- CANCELLED
Enum: ChunkType
- VIDEO
- AUDIO
mmJSPlugin.reportAdBreakStart();
mmJSPlugin.reportAdBreakEnd();
var adInfo = {
"adTitle": "AD_TITLE",
"adId": "AD_ID",
"adCreativeId": "AD_CREATIVE_ID",
"adCreativeType": "AD_CREATIVE_TYPE",
"adClient": "AD_CLIENT",
"adPosition": "AD_POSITION", // pre, mid, post
"adServer": "AD_SERVER",
"adResolution": "AD_RESOLUTION",
"adUrl": "AD_URL",
"adDuration": ad_duration, // Double Value
"adPodIndex": pod_index, // Integer Value
"adPositionInPod": ad_position_in_pod, // Integer Value
"isBumper": is_bumper // Boolean Value
}
mmJSPlugin.reportAdStart(adInfo);
mmJSPlugin.reportAdEnd();