VO Player iOS Integration Guide with SSAI
This guide provides detailed instructions on integrating the MediaMelon SDK into the iOS VO Player.
Prerequisites:
VoPlayer iOS Sample Player.
MediaMelon SmartSight SDK Framework.
MediaMelon VOPlayer Swift adapter.
MediaMelon-assigned Customer ID
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 PodfileAdd 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>
endThen 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.
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
onCueTimelineAdded
onCueTimelineStart
onAdImpression
onAdStarted
onAdFirstQuartile
onAdMidpoint
onAdThirdQuartile
onAdProgress
onAdComplete
onCueTimelineEnd
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?