MediaMelon React Native Video SDK Integration Document
This guide provides detailed instructions on integrating the React Native Video MediaMelon SDK with React Native Video v6.19 player
Last updated
import {MMReactNativeVideoSDK, MMCustomAdapter, MMPlayerState} from 'mediamelon-js-react-native-sdk';import {MMReactNativeVideoSDK, MMCustomAdapter, MMPlayerState} from './mmsmartstreaming_reactnative.min.js';const MMPlayer = MMReactNativeVideoSDK(Video);
<MMPlayer
source={{ uri: 'STREAM_URL' }}
...
mmOptions={{
register: {
customerId: 'CUSTOMER_ID',
subscriberId: 'SUBSCRIBER_ID',
subscriberType: 'SUBSCRIBER_TYPE',
subscriberTag:'SUBSCRIBER_TAG',
hashSubscriberId: false,
playerName: 'PLAYER_NAME',
playerBrand:"PLAYER_BRAND",
playerModel:"PLAYER_MODEL",
playerVersion:'PLAYER_VERSION',
basePlayerName: "BASE_PLAYER_NAME",
basePlayerVersion: "BASE_PLAYER_VERSION",
domainName: 'DOMAIN_NAME',
applicationName: 'APP_NAME',
applicationVersion: 'APP_VERSION',
deviceMarketingName:'DEVICE_MARKETING_NAME'
},
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',
isLive: false,
},
streamInfo:{
mediaType: 'MEDIA_TYPE',
streamFormat: 'STREAM_FORMAT',
sourceType: 'SOURCE_TYPE'
},
customTags:{
"KEY1": "VALUE_STRING1",
"KEY2": "VALUE_STRING2"
},
experimentName: "EXPERIMENT_NAME",
subPropertyId: "SUB_PROPERTY_ID",
viewSessionId: "VIEW_SESSION_ID",
appSessionId: "APP_SESSION_ID",
deviceId: "DEVICE_ID",
cdn: "CDN",
encodingService: "ENCODING_SERVICE",
enableLogTrace: false
}}
/>const mmAdapter = MMCustomAdapter();
mmAdapter.reportPlayerState(MMPlayerState.PLAYING);
Enum: MMPlayerState
- PLAYING
- PAUSED
- STOPPEDmmAdapter.reportCustomMetadata("KEY", "VALUE");// Create a new assetInfo object with the values need to be updated
var newAssetInfo = {
"assetName": "ASSET_NAME",
"assetId": "ASSET_ID",
"videoId": "VIDEO_ID",
"contentType": "CONTENT_TYPE",
"drmProtection": "DRM_PROTECTION",
"episodeNumber": "EPISODE_NUMBER",
"season": "SEASON",
"seriesTitle": "SERIES_TITLE",
"customTags":{
"key1": "VALUE1",
"key2": "VALUE2"
}
}
// Update the new assetInfo
mmAdapter.updateAssetInfo(newAssetInfo);