AVPlayer (Cocoapods)
This guide provides detailed instructions on integrating the MediaMelon Player SDK into an iOS Media Player Application.
Step 0: Creating AVPlayer based media player application
Create a directory for integration by doing the following. Open the terminal, change directory to the home directory, and create a folder sampleintegration
cd ~/
mkdir sampleintegration
cd sampleintegration/Pull the Sample Application from https://sdk.mediamelon.com/$CustomerID/SampleAVPlayerWithFreeWheelAds.zip and unzip it
wget https://sdk.mediamelon.com/$CustomerID/SampleAVPlayerWithFreeWheelAds.zip Get the sample app dependencies by changing the directory to the ~/sampleintegration/SampleAVPlayerWithFreeWheelAds and execute the following commands
Step 1: Building the MediaMelonSmartStreaming Framework
Execute the following two commands on the terminal in the folder ~/sampleintegration/SampleAVPlayerWithFreeWheelAds
sudo gem install cocoapods
pod init
touch Podfile
open PodfileEdit the Podfile
target 'SwiftDemo' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
pod 'MediaMelon-AVPlayer-iOS'
# Pods for SwiftDemo
endFinally, install the pod pod install
Step 2: Integrating the MediaMelonSmartStreaming Framework
There are five steps involved for integrating the MediaMelon Player SDK using the MediaMelonSmartStreaming Framework:
Importing the framework
Providing asset information for the content before starting the player and after creating its instance
Cleaning up the SDK integration session
Disable manifest fetching by the SDK
Passing FWContext object
Open the project file ~/sampleintegration/SampleAVPlayerWithFreeWheelAds/SwiftDemo.workspace in XCode and edit the file DemoViewController.swiftas mentioned below
1. Import Frameworks
2. Provide Asset information
3. Cleaning up the SDK Session
5. Disable manifest fetching by the SDK
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 _configureMMSDKwithURL()
Last updated