Datazoom is a high-availability real-time data collection solution. This document summarizes how to integrate the Akamai Adaptive Media Player for tvOS with the Datazoom platform.
- Login to Datazoom here: https://app.datazoom.io
- Add a Collector as indicated here: How to add a Collector
- Copy the
config key
that was created at the end of the process
Click the icon indicated below to copy the Configuration Key
You will see this message:
4. Replace the <configuration id from Datazoom>
in Datazoom's DZAkamai.framework
file with the Key you copied above.
5. Replace the <url given by Datazoom>
with <
https://platform.datazoom.io/beacon/v1/
>
6. Replace the <AMPPlayer object>
with your playerInstance
identifier
Prerequisites
- macOS Catalina version 10.15.2 or later
- Xcode 12.2
- CocoaPods (https://guides.cocoapods.org/using/getting-started.html)
- AmpCore 9.1.1
Installation
Open the terminal and check if Cocoapods is installed in your machine.
pod --version
If the above command returns no version number, then you'll need to install CocoaPods.
sudo gem install cocoapods
After installation, navigate to the Xcode project directory and create a
Podfile
configuration file if not present.pod init
Run the command:
open Podfile
Add the DZAkamaiTvOS framework after
use_frameworks!
in thePodfile
pod 'DZAkamaiTvOS', '1.12.0', :source => 'https://gitlab.com/datazoom/pod-specs.git'
Add the
AmpCore
framework in thePodfile
pod 'AmpCore'
Pull and update the latest Cocoapods pod specs
pod repo update
Install the pods
pod install
- Be sure to close any current Xcode sessions and use `your_project_name.xcworkspace` for this project from now on.
Implementation Steps for Swift Language-based Applications
- Open the ViewController/View file, where the AMPPlayer(Akamai Player) is included.
Import the framework using the following command:
import DZAkamaiTVOSCollector
Initialize the framework by passing along the env (any one of DEV, STAGING, PROD) "Configuration ID", and player instance:
DZAkamaiTvOsCollectorInstance.shared.initialize(dzEnv.PROD, <configuration id from Datazoom>, <AMPPlayer object>, onCompletion: {})
Custom Metadata
Datazoom allows customers to collect custom events and metadata that aren't emitted from the video player.
Custom Metadata
The customer should add the following snippet just after calling the
DZAkamaiTvOsCollectorInstance.shared.initialize
DZAkamaiTvOsCollectorInstance.shared.setCustomMetaData(["customMetadataName": "customMetadataValue"])
Example:func setupCustomMetadata(){ DZAkamaiTvOsCollectorInstance.shared.setCustomMetaData([ "customPlayerName" : "Akamai tvOS Player", "customDomain": "https://datazoom.io" ]) }
Custom Events
Send Events like below:
DZAkamaiTvOsCollectorInstance.shared.sendCustomEvent("Custom_Event_Name", ["customMetadataName": "customMetadataValue"])
Example:func buttonTouched() { DZAkamaiTvOsCollectorInstance.shared.sendCustomEvent("buttonClick", ["buttonLabel": "ViewCredits"]) }
Demo Application
- A demo application that shows the usage of this framework is available here:
https://gitlab.com/datazoom/apple-tvos/tvos-akamai-demo/-/tree/develop - This application can be used to test the DZAkamaiTvOS framework implementation.
Comments
0 comments
Article is closed for comments.