React Native Video v5.2.1 with Mediamelon SDK
This guide provides detailed instructions on integrating the React Native Video MediaMelon SDK with React Native Video v5.2.1 player
Step 1: Install MediaMelon React Native SDK
Step 2: Import SDK Package
Step 3: Register and Initialise SDK
Step 4: Limitations
Step 5: Variables and Description
Step 1: Install MediaMelon React Native SDK
$REACT_NATIVE_PROJECT = {ReactNativeVideo - v5.2.1}
The SDK files should be added to the build environment
Using NPM:
Use this command in your terminal:-
npm i [email protected]
Using JS file:
Copy
mmsmartstreaming_reactnative.min.js
provided in the release package to the React native project. Example$REACT_NATIVE_PROJECT/mmsmartstreaming_reactnative.min.js
Step 2: Import SDK Package
$REACT_NATIVE_PROJECT/App.js
Using NPM:
import MMReactNativeVideoSDK from 'mediamelon-js-react-native-sdk';
Using JS File:
import MMReactNativeVideoSDK from './mmsmartstreaming_reactnative.min.js';
Step 3: Register and Initialise SDK
Wrap your Video
component with the MMReactNativeVideoSDK
.
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,
},
customTags:{
"KEY1": "VALUE_STRING1",
"KEY2": "VALUE_STRING2"
},
experimentName: "EXPERIMENT_NAME",
subPropertyId: "SUB_PROPERTY_ID",
viewSessionId: "VIEW_SESSION_ID"
}}
/>
Step 4: Limitations
Buffering events are not tracked in Android as the
onBuffer()
is not being triggered.Seek start/complete events are being tracked internally, as the
onSeek()
listener is not consistent.
Step 5: Variables and Description
Variable
Description
Optional/Mandatory
PLAYER_NAME
String containing the Player Name.
Mandatory
CUSTOMER_ID
String containing your MediaMelon-assigned Customer ID.
Mandatory
SUBSCRIBER_ID
String containing your Subscriber’s ID.
Mandatory
DOMAIN_NAME
String containing your section of your subscriber or assets.
Mandatory
SUBSCRIBER_TYPE
String containing the Subscriber Type (e.g. “Free”, “Paid”).
Mandatory
SUBSCRIBER_TAG
String containing additional subscriber-specific information. This is sent in clear (not hashed) to SmartSight and it is advised not to send sensitive information in this field.
Optional
ASSET_ID
String containing Asset Id.
Mandatory
ASSET_NAME
String containing Asset Name.
Mandatory
VIDEO_ID
String containing your video’s ID.
Mandatory
CONTENT_TYPE
String containing the type of the Content. For example - "Movie", "Special", "Clip", "Scene" or "Episode".
Mandatory
GENRE
String containing the Genre of the content. For example - "Comedy", "Horror".
Mandatory
DRM_PROTECTION
Widevine, Fairplay, Playready, etc. Unknown means content is protected, but the protection type is unknown. For clear contents, do not set this field
Mandatory
EPISODE_NUMBER
String containing sequence number of the Episode.
Mandatory
SEASON
String containing the Season. For example - "Season 1".
Mandatory
SERIES_TITLE
String containing Title of the Series.
Mandatory
VIDEO_TYPE
String containing Video Type. For example - "LIVE", and "VOD".
Optional
PLAYER_BRAND
String containing Player Brand (e.g. “Exo Player”).
Mandatory
PLAYER_MODEL
String containing Player Model. For example - This could be a variant of a player. Say the name of third third-party player used by the organisation. Or any human-readable name of the player.
Mandatory
PLAYER_VERSION
String containing Player Version.
Mandatory
BASE_PLAYER_NAME
String containing base player name
Mandatory
BASE_PLAYER_VERSION
String containing base player version
Mandatory
EXPERIMENT_NAME
You can use this field to categorise views into different experiments, allowing you to filter by this dimension later.
Mandatory
SUB_PROPERTY_ID
A sub-property is an optional feature that allows you to organize data within a property. For instance, a video platform could use sub-properties to group data by customer, or a media company might use them to differentiate between its various websites.
Mandatory
VIEW_SESSION_ID
An ID that can be used to link the view with upstream platform services, such as CDN or origin logs, for correlation purposes.
Mandatory
Last updated
Was this helpful?