MediaMelon
  • MediaMelon SDK Integration
  • MediaMelon SDK Events
  • MediaMelon Player SDK Integration
    • React Native
      • React Native Video v5.2.0 with Mediamelon SDK
      • React Native Video v6.4.2 with Mediamelon SDK
    • Web SDK
      • VideoJS Web with Mediamelon Analytics
      • VideoJS Web with Google DAI
      • Shaka Player Web v4
      • MediaMelon Web Kaltura Player Plugin Integration Document
      • NexPlayer Web v4
      • THEOPlayer Web
      • JWPlayer Web
      • Radiant Player Web
      • ChromeCast Player
      • HLSJS Player Web
      • HbbTV SDK
      • Comcast PDK 6
      • Bitmovin Web Player
      • HTML5 Player Web
      • Flow Player Web
      • DashJS Player Web
      • Castlabs Player Web
      • Cordova Plugin Toast (Smart TV)
      • Custom Player Web SDK
      • Plyr Player Web with MediaMelon Analytics
      • React Player SDK with IMA
    • Android SDK
      • App Analytics SDK
      • Bitmovin Android v3.73 with Content Provider Metrics
      • Exoplayer v2.13.2 integration with MediaMelon SDK
      • Exoplayer v2.17.1 with Mediamelon SDK
      • Exoplayer v2.12.2 integration with MediaMelon SDK
      • EXOPlayer-Android(V2.14.2) MediaMelon SDK with Google IMA DAI
      • EXOPlayer-Android(V2.17.1) MediaMelon SDK with Google IMA DAI
      • Exoplayer v2.11
      • Exoplayer v2.18.1 with Mediamelon SDK
      • Theoplayer v6.0.0 with Mediamelon SDK
      • Theoplayer v4.12.6 with Mediamelon SDK
      • Theoplayer v7.5.0 with Mediamelon SDK
      • Exoplayer v2.13.3 integration with MediaMelon SDK
      • Kaltura Android Player Integration with Mediamelon SDK
      • Media3 v1.3.0 and ExoPlayer 2.19.1 with MediaMelon SDK
      • Media3 v1.3.1 with MediaMelon SDK
      • MediaMelon Android Media3 v1.1.1 SDK Integration Document
      • Media3Player-Android(V1.3.0) MediaMelon SDK with Google IMA
    • Roku SDK
      • Roku SDK
      • Roku with RAF SDK
      • Roku with IMA SDK
    • iOS SDK
      • AVPlayer (Cocoapods)
      • AVPlayer with Google DAI SDK ( Framework )
      • AVPlayer Quality Of Experience SDK
      • AVPlayer Generic Framework
      • AVPlayer with Google DAI (Cocoapods)
      • Bitmovin iOS v3.44 with Content Provider Metrics
      • THEOPlayer XCFramework
      • THEOplayer (Cocoapods)
      • MediaMelon iOS Kaltura Player Plugin Integration Document
    • tvOS SDK
      • AVPlayer tvOS XCFramework
      • THEOPlayer tvOS XCFramework
    • Toast SDK
    • Custom Player C++ SDK
    • C++ SDK QoE Ads
    • Ad Integrations
      • Google IMA
      • FreeWheel
      • ServerSide.AI
  • SmartSight Analytics
    • Product Features
    • QBR Streaming
  • SmartSight API's
    • API Overview
      • Metric and Dimensions Dictionary
      • General Guidelines
      • Video Experience
      • Ad Experience
      • Smartquery Insights
      • Errors
      • Alerts
    • Use-case dictionary
Powered by GitBook
On this page
  • Integrating the MediaMelonSmartStreaming Framework
  • 1. Import Frameworks
  • 2. Provide Asset information
  • 3. Cleaning up the SDK Session
  • 4. Create a new session and update the asset information
  • 5. Enabling Content Provider Metrics

Was this helpful?

  1. MediaMelon Player SDK Integration
  2. iOS SDK

Bitmovin iOS v3.44 with Content Provider Metrics

Step by step integration of the MediaMelon Player SDK with Bitmovin Player 3.44

Integrating the MediaMelonSmartStreaming Framework

There are five steps involved in integrating the MediaMelon Player SDK using the MediaMelonSmartStreaming Framework:

  1. Importing the framework

  2. Providing asset information for the content before starting the player and after creating its instance

  3. Cleaning up the SDK integration session

  4. Create a new session and update the asset information

  5. Enabling Content Provider Metrics

All Bitmovin Player-related code of the sample application can be found in the Swift classViewController.swift

1. Import Frameworks

import BitmovinPlayer
import MMGenericFramework

2. Provide Asset information

After the instance of the player is created, and SourceConfig is set with it, we should set the asset information and send it before starting its playback. In ViewController.swift, call function self.configureMMSDK(mediaURL: String, vastURL: String)

private func configureMMSDK(mediaURL: String, vastURL: String) {
        let assetInfo = MMAssetInformation(assetURL: mediaURL, assetID: "ASSET_ID", assetName: "ASSET_NAME", videoId: "VIDEO_ID")
        
        assetInfo.setContentType("CONTENT_TYPE")
        assetInfo.setDrmProtection("DRM_PROTECTION")
        assetInfo.setEpisodeNumber("EPISODE_NUMBER")
        assetInfo.setSeriesTitle("SERIES_TITLE")
        assetInfo.setSeason("SEASON")
        assetInfo.setGenre("GENRE")

        // Optional custom metadata
        assetInfo.addCustomKVP("KEY1", "VALUE2")
        assetInfo.addCustomKVP("KEY2", "VALUE2")
        assetInfo.setQBRMode(.QBRModeDisabled, withMetaURL: nil)
        
        let registrationInfo = MMRegistrationInformation(customerID: "CUSTOMER_ID", playerName: "PLAYER_NAME")
        registrationInfo.setSubscriberInformation(subscriberID: "SUBSCRIBER_ID", subscriberType: "SUBSCRIBER_TYPE", subscriberTag: "SUBSCRIBER_TAG", hashSubscriberID: true)
        BitmovinPlayerIntegrationWrapper.setPlayerRegistrationInformation(registrationInformation: registrationInfo, player: player)
        
        BitmovinPlayerIntegrationWrapper.shared.reportAppData(appName: "APP_NAME", appVersion: "APP_VERSION")
        BitmovinPlayerIntegrationWrapper.shared.reportDeviceMarketingName(deviceMarketingName: "DEVICE_MARKETING_NAME")
        
        let 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.
        BitmovinPlayerIntegrationWrapper.initializeAssetForPlayer(assetInfo: assetInfo, registrationInformation: registrationInfo, player: player, isLive: isLive)
     }
    

3. Cleaning up the SDK Session

We need to clean up the SDK session once the playback is completed. The SDK internally manages the cleanup for most of the cases. For example - when playback finishes or some error is notified.

However, in some error cases, like network reachability issues, the error notification is delayed. Before this error notification is available, the user may trigger another session. Therefore, it is advised to clean up the session once the playback finishes.

We recommend cleanup at the following two places.

  • When the view controller hosting the post-roll ad terminates

  • When the player is restarted

BitmovinPlayerIntegrationWrapper.cleanUp()

4. Create a new session and update the asset information

During playback updateAssetInfo can be used to create a new session and update the asset information. The usage can be seen in the updateAsset function in the ViewController

func updateAsset() {
        let assetInfo = MMAssetInformation(assetURL: mediaURL, assetID: "RandomID", assetName: "Test Asset", videoId: "123456789")
        
        assetInfo.setContentType("Movie") //Type of content (Movie / Special / Clip / Scene)
        assetInfo.setDrmProtection("Fairplay") //Widevine, Fairplay, Playready etc. Unknown means content is protected, but protection type is unknown. For clear contents, do not set this field
        assetInfo.setEpisodeNumber("testEpisode") //Sequence Number of the Episode (string).
        assetInfo.setSeriesTitle("testSeries") //Title of the series
        assetInfo.setSeason("testSeason") //Season For example - Season1,2,3 etc
        assetInfo.setGenre("testGenre") //Genre of the content
        assetInfo.addCustomKVP("CustomKVP1Key", "CustomKVPalue")
        assetInfo.addCustomKVP("CustomKVP2Key", "CustomKVPValue")
        assetInfo.setQBRMode(.QBRModeDisabled, withMetaURL: nil)
          
         // Create a new session and update the Asset info
        BitmovinPlayerIntegrationWrapper.updateAssetInfo(assetInfo: assetInfo, player: player)        
  }

5. Enabling Content Provider Metrics

Content Provider Metric Reporting is enabled by calling the setContentProviderDetails function defined in the BitmovinPlayerIntegrationWrapper.swift. This needs to be done immediately after the call to configure the Media Melon SDK

self.configureMMSDK(mediaURL: sessionUrl, vastURL: "")
if ( contentProviderDetails == true)
{
    BitmovinPlayerIntegrationWrapper.setContentProviderDetails(url:sessionUrl)
}

The setContentProviderDetails expects the URL with the Content Provider information as shown in the table below. In case the information is correctly provided it enables content provider metrics reporting.

The above code is tested with URLs with the structure:

Parameter
Value

provider

stzp : Starz tbox: Toolbox

tbtoken

JWT Token for Toolbox endpoint

cid

Content ID

sid

Starz session ID

For enabling Toolbox metrics please pass - provider, tbtoken and cid values as shown below

For enabling Starz content provider metrics please pass: provider, cid, and sid values as shown below

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

CUSTOM_TAGS

Extra custom metadata can be added here if required. If extra metadata is not required, enter null.

PLAYER_BRAND

String containing Player Brand.

PLAYER_MODEL

String containing Player Model. For example - This could be a variant of player. Say name of third party player used by organisation. Or any human readable name of the player.

PLAYER_VERSION

String containing Player Version.

PreviousAVPlayer with Google DAI (Cocoapods)NextTHEOPlayer XCFramework

Last updated 10 months ago

Was this helpful?

https://bitdash-a.akamaihd.net/content/MI201109210084_1/m3u8s/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.m3u8?tbtoken=JWTtoken&provider=tbox&cid=ContentId
https://bitdash-a.akamaihd.net/content/MI201109210084_1/m3u8s/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.m3u8?tbtoken=JWTtoken&provider=tbox&cid=ContentId
https://bitdash-a.akamaihd.net/content/MI201109210084_1/m3u8s/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.m3u8?provider=stzp&cid=ContentId&sid=SessionId