AV Player with Nowtilus SSAI (old)
Step by step integration of the Mediamelon Player SDK with Nowtilus SSAI with native Apple AV Player on iOS
Step 0: Creating AV Player 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
Pull the Sample Application from https://sdk.mediamelon.com/$CustomerID/iOS/AVPlayer_SampleApplication.zip
and unzip it
Step 1: Get the MMGenericFramework Static Framework Library
Download the MMGenericFramework static faremwork
Copy the MMGenericFramework static framework to the AVPlayerWithNowtilusSSAi directory
If you are building for the simulator use the MMGenericFramework.framework in the iphonesimulator-x86 and which building for the device use the MMGenericFramework.framework in the iphoneos-arm64 directory
Step 2: Integrating the MMGeneric Framework with the AV Player Sample Application
There are five steps involved for integrating the MediaMelon Player SDK using the MediaMelonSmartStreaming Framework:
Add the appropriate MMGenericFramework to the AV Player Sample Application
Providing asset information for the content before starting the player and after creating its instance
Disable manifest fetching by the SDK
Initializing SSAI
Cleaning up the SDK integration session
All AV Player related code of the sample application can be found in the Swift classViewController.swift
1. Import Frameworks
2. Provide Asset information
After the instance of the player is create, we should set the asset information and send it to before starting its playback. In ViewController.swift, call function self.configureMMSDKwithURL(
mediaURL: String, vastURL: String, player: AVPlayer)
3. Cleaning up the SDK Session
We need to clean up the SDK session once the playback completes. 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. And 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
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()
Note: Disable Manifest Fetch is Optional
5. Add the MMSSAIManagerDelegate
Add the MMSSAIManagerDelegate the ViewController class in ViewController.swift. This delegate will be used for receiving Ad related events and data. At every Ad event the Delegate will fire the notifyMMSSAIAdEventsWith function. This can be used to display Ad related data, enable or disable Ad skipping etc.
6. Initialize the SSAI Ad Manager
Initialize the SSAI Ad Manager to track the Ads and report Ad related metric. For live stream the last parameter isLive is set to true.
7. Stop the SSAI Ad Manager
To stop the SSAI Ad Manager call the following API
Step 3: Adding multiple static frameworks including the MMGeneric (Static) Framework
Last updated