The Omniture plugin is a static library framework which supports Adobe Marketing Cloud v4.21.2 and Adobe Video Heartbeat v2.3.0. The Marketing Cloud and Video Heartbeat libraries are not included with this SDK and must be manually added to your project. Instructions for downloading the libraries are provided below.
You can use CocoaPods to add the Omniture plugin to your project. You can find the latest Brightcove-Player-Omniture
podspec here. To use this spec, add the following to the top of your Podfile: source 'https://github.com/brightcove/BCOVSpecs.git'
.
source 'https://github.com/CocoaPods/Specs'
source 'https://github.com/brightcove/BrightcoveSpecs.git'
platform :ios, '12.0'
use_frameworks!
target 'MyOmniturePlayer' do
pod 'Brightcove-Player-Omniture'
end
XCFrameworks can be installed by appending the /XCFramework
subspec to the pod name.
source 'https://github.com/CocoaPods/Specs'
source 'https://github.com/brightcove/BrightcoveSpecs.git'
platform :ios, '12.0'
use_frameworks!
target 'MyOmniturePlayer' do
pod 'Brightcove-Player-Omniture/XCFramework'
end
To add the Omniture Plugin for Brightcove Player SDK to your project manually:
BrightcoveAMC.framework
or BrightcoveAMC.xcframework
project. You can do this by right-clicking on the Frameworks folder and choose "Add Files To" option and select the BrightcoveAMC.framework
or BrightcoveAMC.xcframework
from the path where it is stored.BrightcoveAMC.framework
/ BrightcoveAMC.xcframework
-ObjC
has been added to the "Other Linker Flags" build setting.AdobeMobile.xcframework
to your project.MediaSDK.xcframework
to your project.bash ${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}/BrightcoveAMC.framework/strip-frameworks.sh
. Check "Run script only when installing". This will remove unneeded architectures from the build, which is important for App Store submission.arm64
has been added to your "Excluded Architectures" build setting for Any iOS Simulator SDK
.To add the Omniture Plugin for Brightcove Player SDK to your project with Swift Package Manager:
https://github.com/brightcove/brightcove-player-sdk-ios-omniture.git
.-ObjC
has been added to the "Other Linker Flags" build setting.AdobeMobile.xcframework
to your project.MediaSDK.xcframework
to your project.BrightcoveAMC is a bridge between the Brightcove Player SDK for iOS and Adobe video tracking, including Adobe Video Heartbeat v2 and Adobe Media Tracking v4. BrightcoveAMC tracks basic video behaviors: video ready, video completed, video play, and video pause.
To setup Adobe Video Heartbeat, Omniture Plugin clients need to implement instances of BCOVAMCVideoHeartbeatConfigurationPolicy. To setup Adobe Media Tracking, an instance of BCOVAMCMediaSettingPolicy is required. These policies allow for customization of ADBMediaHeartbeatConfig or ADBMediaSettings objects for each playback session.
This example uses video heartbeat tracking.
[1] // Create the VHB configuration policy object.
BCOVAMCVideoHeartbeatConfigurationPolicy videoHeartbeatConfigurationPolicy = ^ADBMediaHeartbeatConfig *(id<BCOVPlaybackSession> session) {
ADBMediaHeartbeatConfig *configData = [[ADBMediaHeartbeatConfig alloc] init];
configData.trackingServer = <adobe-assigned_tracking_server>";
configData.channel = <cutomize_sample_channel>;
configData.appVersion = <app_version>;
configData.ovp = <online_video_platform>;
configData.playerName = <player_name>;
configData.ssl = <YES | NO>;
// Set debugLogging to true to activate debug tracing. Remove it in production.
configData.debugLogging = YES;
return configData;
};
[2] // Create the Brightcove AMC analytics policy object fromw1w the VHB configuration policy object.
BCOVAMCAnalyticsPolicy *heartbeatPolicy = [[BCOVAMCAnalyticsPolicy alloc] initWithHeartbeatConfigurationPolicy:videoHeartbeatConfigPolicy];
BCOVAMCSessionConsumer *sessionConsumer = [BCOVAMCSessionConsumer heartbeatAnalyticsConsumerWithPolicy:heartbeatPolicy delegate:self];
BCOVPlayerSDKManager *manager = [BCOVPlayerSDKManager sharedManager];
id<BCOVPlaybackController> controller = [manager createPlaybackController];
controller.delegate = self;
[self.view addSubview:controller.view];
[3] // Add the Brightcove AMC session consumer to the playback controller.
[controller addSessionConsumer:sessionConsumer];
[4] // Find and play a video.
NSString *policyKey = <your-policy-key>;
NSString *accountId = <your-account-id>;
NSString *videoID = <your-video-id>;
BCOVPlaybackService *service = [[BCOVPlaybackService alloc] initWithAccountId:accountId
policyKey:policyKey];
NSDictionary *configuration = @{
kBCOVPlaybackServiceConfigurationKeyVideoID:videoID
};
[service findVideoWithConfiguration:configuration
queryParameters:nil
completion:^(BCOVVideo *video,
NSDictionary *jsonResponse,
NSError *error) {
[controller setVideos:@[ video ]];
[controller play];
}];
-[initWithHeartbeatConfigurationPolicy:]
. The BCOVAMCAnalyticsPolicy object is used to create the BCOVAMCSessionConsumer.-[addSessionConsumer:]
, to add the AMC session consumer.This example uses media tracking.
[1] BCOVAMCMediaSettingPolicy mediaSettingPolicy = ^ADBMediaSettings *(id<BCOVPlaybackSession> session) {
ADBMediaSettings *settings = [ADBMobile mediaCreateSettingsWithName:<cutomize_setting_name>
[2] length:0
playerName:<cutomize_player_name>
playerID:<cutomize_player_ID>];
[3] settings.milestones = @"25,50,75"; // a customization.
return settings;
};
[4] BBCOVAMCAnalyticsPolicy *mediaPolicy = [[BCOVAMCAnalyticsPolicy alloc] initWithMediaSettingsPolicy:mediaSettingPolicy];
BCOVAMCSessionConsumer *sessionConsumer = [BCOVAMCSessionConsumer mediaAnalyticsConsumerWithPolicy:mediaPolicy
delegate:self];
BCOVPlayerSDKManager *manager = [BCOVPlayerSDKManager sharedManager];
id<BCOVPlaybackController> controller = [manager createPlaybackController];
controller.delegate = self;
[self.view addSubview:controller.view];
[5] [controller addSessionConsumer:sessionConsumer];
NSString *policyKey = <your-policy-key>;
NSString *accountId = <your-account-id>;
NSString *videoID = <your-video-id>;
BCOVPlaybackService *service = [[BCOVPlaybackService alloc] initWithAccountId:accountId
policyKey:policyKey];
NSDictionary *configuration = @{
kBCOVPlaybackServiceConfigurationKeyAssetID:videoID
};
[service findVideoWithConfiguration:configuration
queryParameters:nil
completion:^(BCOVVideo *video,
NSDictionary *jsonResponse,
NSError *error) {
[controller setVideos:@[ video ]];
[controller play];
}];
+[mediaCreateSettingsWithName:length:playerName:playerID:]
, you can set video length to 0. The Omniture plugin will update it later.-[initWithMediaSettingsPolicy:]
. The policy object is used to create an AMC session consumer for Adobe media tracking as +[mediaAnalyticsConsumerWithPolicy:delegate:]
.-[addSessionConsumer:]
, to add the AMC session consumer.To fetch the Adobe Marketing Cloud libraries, download the following:
https://github.com/Adobe-Marketing-Cloud/media-sdks/archive/refs/tags/ios-v2.3.0.zip
https://github.com/Adobe-Marketing-Cloud/mobile-services/archive/refs/tags/v4.21.2-iOS.zip
If you have questions, need help or want to provide feedback, please use the Support Portal or contact your Account Manager. To receive notification of new SDK software releases, subscribe to the Brightcove Native Player SDKs Google Group.
link |
Stars: 0 |
Last commit: 1 week ago |
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics