Bitmovin Web Player

This guide is for integrating the MediaMelon Player SDK for the javascript based Bitmovin Web Player v8

Step 1: Add the MediaMelon Player SDK

To integrate the SmartSight Player SDK with the Bitmovin JS Player. Include the following lines in the html page just before the bitmovinplayer.js script is loaded

<script type="text/javascript" src="path-to/mmsmartstreaming-bitmovin.min.js" ></script>
<script type="text/javascript" src="path-to/bitmovinplayer.js"></script>

This MediaMelon SDK has been verified for Bitmovin Web v8

Step 2: Register and Initialize the MediaMelon Player SDK

Note: <customer_id> is your MediaMelon-assigned Customer ID. If you do not know your Customer ID contact MediaMelon at support@mediamelon.com

Create a new plugin object and after the player instance has been created, register it, report player information, and then initialize the Media Melon Player SDK plugin as shown below:

var mmBitmovinPlugin= new BitmovinPlayerMMSSIntgr();
  const config = {
      key: 'Bitmovin_license'
  };

  var container = document.getElementById('my-player');
  var player = new bitmovin.player.Player(container, config);
  
  // Content Meta Data and Custom Tags
  var mmVideoAssetInfo = {
     "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",
         "key3": "VALUE3"
         }
     };
  mmBitmovinPlugin.registerMMSmartStreaming("PLAYER_NAME", "CUSTOMER_ID", "SUBSCRIBER_ID", "DOMAIN_NAME", "SUBSCRIBER_TYPE" , "SUBSCRIBER_TAG");
  mmBitmovinPlugin.reportPlayerInfo("PLAYE_BRAND", "PLAYER_MODEL", "PLAYER_VERSION");
  mmBitmovinAdapter.reportAppInfo("APP_NAME", "APP_VERSION");
  
  var isLive = false;    //Set this to true for a live stream or false for a VOD stream
  // If isLive is not set here, it will be handled internally by the SDK.
  mmBitmovinPlugin.initialize(player, "STREAM_URL", mmVideoAssetInfo, isLive);

Step 3: Report Player load error

Notify Bitmovin load failure using reportPlayerError as shown below:

player.load(source).then(function () {
     // Success
  },function (reason) {
      // Error!
      mmBitmovinPlugin.reportPlayerError(reason, source);
  });

Step 4: Update Asset Info

If Asset Information needs to be updated dynamically during the live session without re-initiating the player, then the updateAssetInfo API can be used to update the new AssetInfo

Note

  • This API must be called for updating asset info for the live streams only

  • This API must be called after the Player has started the playback of the live stream

  • New Asset Info Object will override the previous values, Hence set all the fields that are required every time calling this API

// 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",
         "key3": "VALUE3"
     }          
}
// Update the new assetInfo
mmBitmovinPlugin.updateAssetInfo(newAssetInfo);

Step 5: Set Content Provider Details

Set the required content provider details via an URL. This URL should contain all the details like id's, token information and provider information. This step is required only to generate starz and toolbox events.

mmBitmovinAdapter.setContentProviderDetails(url);

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.

CONTENT_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".

Last updated