VO Player iOS Integration Guide with SSAI

This guide provides detailed instructions on integrating the MediaMelon SDK into the iOS VO Player.

Prerequisites:

  1. VoPlayer iOS Sample Player.

  2. MediaMelon SmartSight SDK Framework.

  3. MediaMelon VOPlayer Swift adapter.

  4. MediaMelon-assigned Customer ID

<CUSTOMER_ID> is your MediaMelon-assigned Customer ID. If you do not know your Customer ID contact MediaMelon at [email protected]

Step 1: MMSmartStreaming SDK Framework and VOPlayer wrapper

  • Download the Mediamelon VO Player adapter from the below path and add it to the Swift application project.

  • Add the MMSmartStreaming SDK Framework using Cocoapods as shown below. Navigate to your project folder using the terminal, if you don't have CocoaPods installed, Please install it using the below commands in the terminal.

sudo gem install cocoapods
pod init
touch Podfile
open Podfile

Add the MediaMelon-VOPlayer-SSAI-iOS pod using the below lines in your Podfile.

target '<SampleProject_name>' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!
  
  pod 'MediaMelon-VOPlayer-SSAI-iOS'
  
  # Pods for <SampleProject_name>
end

Then install the pod by giving pod install

  • Add the VOPlayer framework and its dependencies to the Xcode project

Step 2: Integrate MediaMelon Code to iOS Sample Player App

The player application must register the SDK and provide player information once when the application launches. Please note that the values provided in this integration step persist across video sessions. This is typically done when the player itself is initialized.

Import the following in the PlayBackViewController.swift.

Create a new function setMMSmartStreaming as below and add it into PlayBackViewController.swift.

Note:

Please provide the exact correct details in all fields like CUSTOMER_ID, ASSET_ID, ASSET_TITLE, VIDEO_ID, PLAYER_BRAND, PLAYER_MODEL, PLAYER_VERSION, PLAYER_NAME, DOMAIN_NAME, SUBSCRIBER_ID, SUBSCRIBER_TYPE & SUBSCRIBER_TAG. This data helps in debugging through MediaMelon SmartSight if anything goes wrong.

Call “setMMSmartStreaming“ in function preparePlayer() as shown below. Refer getURLDetails function in the sample application to get the mediaURL and AD Data from the curl request for both live and VoD streams. If the stream is VoD, set the isLive variable to false. If the stream is Live, set the isLive variable to true.

Step 3: To Add delegates to get the Ad events from SSAIAdManager

Accessing the adTimeline array object

adTimeline array object (MMSSAIAdDetails) contains the following multiple MMSSAIAdDetails objects.

Step 4: To stop the SSAI Ad Manager

To stop the SSAI Ad Manager, use the below code snippet in PlayBackViewController.swift file.

List of Ad events

  1. onCueTimelineAdded

  2. onCueTimelineStart

  3. onAdImpression

  4. onAdStarted

  5. onAdFirstQuartile

  6. onAdMidpoint

  7. onAdThirdQuartile

  8. onAdProgress

  9. onAdComplete

  10. onCueTimelineEnd

Variable
Description

PLAYER_NAME

String containing the player name (e.g. “VOPlayeriOS”).

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

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

SUBSCRIBER_TAG

String containing 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.

PLAYER_BRAND

String containing the player brand.

PLAYER_MODEL

String containing the 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 the player version.

Last updated

Was this helpful?