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
  • Step 1: Add the MediaMelon Player SDK using the MMSmartStreaming Framework
  • Step 2: Integrating the MMSmartStreaming Framework

Was this helpful?

  1. MediaMelon Player SDK Integration
  2. iOS SDK

THEOplayer (Cocoapods)

This guide provides detailed instructions on integrating the MediaMelon Player SDK into a Theoplayer (2.76.1) based iOS Media Player Application

Step 1: Add the MediaMelon Player SDK using the MMSmartStreaming Framework

Navigate to your project folder using the terminal, if you don't have CocoaPods installed, Please install it using the below commands in terminal

sudo gem install cocoapods
pod init
touch Podfile
open Podfile

Add the MediaMelonSmartStreaming pod using the below lines

target '<SamplePorject_name>' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!
  pod 'MediaMelonSmartStreaming-THEO', '~> 1.0.0'
  # Pods for <SamplePorject_name>
end

Finally, install the pod pod install

Step 2: Integrating the MMSmartStreaming Framework

There are four steps involved for integrating the SmartSight Player SDK

  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. Disable manifest-fetching by the SDK

1. Import Frameworks

import THEOplayerSDK
// MediaMelon Integration #1
import MediaMelonSmartStreaming_THEO

2. Provide asset information

2a) Add the following method to integrate the MediaMelon Player SDK to the class ViewController

 class ViewController: UIViewController {
 var theoplayer: THEOplayer!
 // MediaMelon Integration #2a
 func integrateMMSDK(){
     //TheoMMIntegration.shared.enableLogTrace(logStTrace: true)
     let regInfo = MMRegistrationInformation(customerID: $CUSTOMERID, playerName:$PLAYERNAME)
     regInfo.setPlayerInformation(brand: $PLAYERBRAND, model:$PLAYERMODEL, version: $PLAYERVERSION)
     regInfo.setSubscriberInformation(subscriberID: $SUBSID, subscriberType: $SUBSTYPE, subscriberTag: $SUBSTAG)
     TheoMMIntegration.setPlayerRegistrationInformation(registrationInformation: regInfo, player: theoplayer)
 }

Call to setPlayerRegistrationInformation is mandatory.Call to setPlayerInformation and setSubscriberInformation is optional.

2b) Call the method integrateMMSDK after setting up the player

override func viewDidLoad() {
      super.viewDidLoad()
      setupTheoPlayer()
      //Integration Step 2b
      integrateMMSDK()
      self.theoplayer.source = sampleSource
}

2c) Create and Set the Asset Information

The application may like to set the auxiliary information of the asset so that it can be recorded in the Smartsight. This information could be assetId, assetName, videoId (describing the title to which assets belong), custom metadata etc. The app can produce this information to the SmartSight Player SDK by utilizing the metadata field of the SourceDescription used by the Theo player.

let assetInfo = MMAssetInformation(assetURL: $ASSETURL, assetID: $ASSETID, assetName: $ASSETNAME, videoId: $VIDEOID)
     assetInfo.addCustomKVP($CUSTOMKEY, $CUSTOMVALUE)
     let encodedAssetInfo = try? JSONEncoder().encode(assetInfo)
     var jsonAssetInfo = ""
     if let encodedAssetInfo = encodedAssetInfo{
         jsonAssetInfo = String(data: encodedAssetInfo, encoding: .utf8) ?? ""
}

2d) Adding Custom parameters.

Call to addCustomKVP is optional. However, when a call is made, setting both custom key and the value is mandatory

return SourceDescription(
         source: TypedSource(
             src: "https://cdn.theoplayer.com/video/elephants-dream/playlist.m3u8",
             type: "application/x-mpegurl"
         ),
         //Integration Step 2d
         metadata : MetadataDescription(metadataKeys: [TheoMMIntegration.KAssetInformationKey:jsonAssetInfo])
 )

3) Cleanup of session

When the view controller used for playback is removed, call the cleanUp method of the SmartSight Player SDK and add the following method in class ViewController

 deinit{
     TheoMMIntegration.cleanUp()
 }

4) Disable Manifest

Disable Manifest Fetch is optional

If your workflow restricts the manifest to be accessible from both player and the MediaMelon Player SDK simultaneously, then, you can disable the fetch of manifest via disableManifestsFetch in method integrateMMSDK()

 func integrateMMSDK(){
     .
     .
     .
     .
     TheoMMIntegration.setPlayerRegistrationInformation(registrationInformation: regInfo, player: theoplayer)
     TheoMMIntegration.disableManifestsFetch(disable: true)
 }
PreviousTHEOPlayer XCFrameworkNextMediaMelon iOS Kaltura Player Plugin Integration Document

Last updated 3 years ago

Was this helpful?