THEOPlayer Web
This guide is for integrating the MediaMelon Player SDK for the javascript based THEOPlayer Web Version 8.x
Step 1: Add the MediaMelonPlayer SDK
Add the following lines to the web page before THEOPlayer.js files are loaded.
<script type="text/javascript" src="https://PATH_TO_SMARTSIGHT_SDK/mmsmartstreaming_theoplayer.min.js"></script>
<script type='text/javascript' src='THEOplayer.js'></script>
Step 2: Register and Initialize the MediaMelon Player SDK
After the player instance has been created, create a new Plugin object, register, report player Info, and then initialize the plugin as shown below:
var theoPlayer = new THEOplayer.Player(element, {
libraryLocation: <location of the library>,
license: <player license>
})
var mmVideoAssetInfo = {
"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",
"customTags": {
"key1": "VALUE_STRING1",
"key2": "VALUE_STRING2"
}
};
var theoPlugin = new mmTheoJSAdapter();
var hashSubscriberId = false;
if(theoPlugin.getRegistrationStatus() === false){
theoPlugin.registerMMSmartStreaming("PLAYER_NAME", "CUSTOMER_ID", "SUBSCRIBER_ID", "DOMAIN_NAME", "SUBSCRIBER_TYPE" , "SUBSCRIBER_TAG", hashSubscriberId);
theoPlugin.reportPlayerInfo("PLAYER_BRAND", "PLAYER_MODEL", "PLAYER_VERSION");
}
theoPlugin.reportAppInfo("APP_NAME", "APP_VERSION");
theoPlugin.setDeviceInfo("DEVICE_MARKETING_NAME");
theoPlugin.reportViewSessionId("VIEW_SESSION_ID");
theoPlugin.reportSubPropertyId("SUB_PROPERTY_ID");
theoPlugin.reportBasePlayerInfo("BASE_PLAYER_NAME", "BASE_PLAYER_VERSION");
var isLive = false;
theoPlugin.initialize(theoPlayer, "STREAM_URL", mmVideoAssetInfo, isLive);
// Call this Error API to report an App Error.
theoPlugin.reportAppError("ERROR_MESSAGE", "ERROR_CODE");
Last updated