Skip to content
This repository has been archived by the owner on Jul 8, 2024. It is now read-only.

Commit

Permalink
Merge pull request #501 from Adobe-Marketing-Cloud/media-2.3.0-fastla…
Browse files Browse the repository at this point in the history
…ne-ios-pod

ACPMedia v2.3.0 Cocoapods Release 🚀
  • Loading branch information
praveek authored Dec 18, 2020
2 parents c77acf9 + e8fd18b commit 16a41eb
Show file tree
Hide file tree
Showing 15 changed files with 1,117 additions and 10 deletions.
18 changes: 10 additions & 8 deletions ACPMedia.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "ACPMedia"
s.version = "2.2.0"
s.version = "2.3.0"
s.summary = "Media library for Adobe Experience Platform SDK. Written and maintained by Adobe."
s.description = <<-DESC
The Media library provides APIs that allow analytics tracking for audio and video in the Adobe Experience Platform SDK.
Expand All @@ -18,17 +18,19 @@ Pod::Spec.new do |s|
s.tvos.deployment_target = "10.0"
s.requires_arc = true
s.static_framework = true
s.default_subspec = "main"
s.cocoapods_version = ">= 1.10"

# dependency on the core framework
s.dependency "ACPCore", ">= 2.7.0"
s.dependency "ACPCore", ">= 2.9.0"

s.subspec "main" do |th|
th.ios.vendored_libraries = "libACPMedia_iOS.a"
th.ios.source_files = "include/*.h", "include/*.m"
s.subspec "xcframeworks" do |f|
f.ios.vendored_frameworks = "#{s.name}.xcframework"
f.ios.source_files = "#{s.name}.xcframework/ios-arm64_armv7_armv7s/Headers/*.h", "include/*.m"
f.ios.libraries = "sqlite3.0", "z", "c++"

th.tvos.vendored_libraries = "libACPMedia_tvOS.a"
th.tvos.source_files = "include/*.h", "include/*.m"
f.tvos.vendored_frameworks = "#{s.name}TV.xcframework"
f.tvos.source_files = "#{s.name}TV.xcframework/tvos-arm64/Headers/*.h", "include/*.m"
f.tvos.libraries = "sqlite3.0", "z", "c++"
end

end
47 changes: 47 additions & 0 deletions ACPMedia.xcframework/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AvailableLibraries</key>
<array>
<dict>
<key>HeadersPath</key>
<string>Headers</string>
<key>LibraryIdentifier</key>
<string>ios-arm64_i386_x86_64-simulator</string>
<key>LibraryPath</key>
<string>libACPMedia_iOS.a</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>i386</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>HeadersPath</key>
<string>Headers</string>
<key>LibraryIdentifier</key>
<string>ios-arm64_armv7_armv7s</string>
<key>LibraryPath</key>
<string>libACPMedia_iOS.a</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>armv7</string>
<string>armv7s</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
</dict>
</array>
<key>CFBundlePackageType</key>
<string>XFWK</string>
<key>XCFrameworkFormatVersion</key>
<string>1.0</string>
</dict>
</plist>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//
// Copyright 1996-2020. Adobe, Inc. All Rights Reserved
//
// Media Version: 2.2.0
// Media Version: 2.3.0

#import <Foundation/Foundation.h>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//
// Copyright 1996-2020. Adobe, Inc. All Rights Reserved
//
// Media Version: 2.1.1
// Media Version: 2.3.0

#import <Foundation/Foundation.h>

Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,230 @@
//
// ACPMedia.h
// Adobe Digital Marketing Suite -- iOS Application Measurement Library
//
// Copyright 1996-2020. Adobe, Inc. All Rights Reserved
//
// Media Version: 2.3.0

#import <Foundation/Foundation.h>

/**
* @brief These enumeration values define the type of a tracking event
*
* @see ACPMediaTracker::trackEvent:info:data:
*/
typedef NS_ENUM(NSInteger, ACPMediaEvent) {
ACPMediaEventAdBreakStart,
ACPMediaEventAdBreakComplete,
ACPMediaEventAdStart,
ACPMediaEventAdComplete,
ACPMediaEventAdSkip,
ACPMediaEventChapterStart,
ACPMediaEventChapterComplete,
ACPMediaEventChapterSkip,
ACPMediaEventSeekStart,
ACPMediaEventSeekComplete,
ACPMediaEventBufferStart,
ACPMediaEventBufferComplete,
ACPMediaEventBitrateChange,
ACPMediaEventStateStart,
ACPMediaEventStateEnd
};

/**
* @brief These enumeration values define the type of a media
*
* @see ACPMedia::createMediaObjectWithName:mediaId:length:streamType:mediaType:
*/
typedef NS_ENUM(NSInteger, ACPMediaType) {
ACPMediaTypeVideo,
ACPMediaTypeAudio
};

@interface ACPMediaTracker : NSObject

+ (instancetype _Nonnull) new NS_UNAVAILABLE;
- (instancetype _Nonnull) init NS_UNAVAILABLE;

/**
* @brief Method to track the start of a viewing session.
*
* @param mediaInfo NSDictionary instance created using createMediaObjectWithName method
* @param contextData NSDictionary instance containing the context data associated with the media
*/
- (void) trackSessionStart: (NSDictionary* _Nonnull) mediaInfo data: (NSDictionary* _Nullable) contextData;

/**
* @brief Method to track media play or resume after a previous pause.
*/
- (void) trackPlay;

/**
* @brief Method to track media pause.
*/
- (void) trackPause;

/**
* @brief Method to track media complete.
*
*/
- (void) trackComplete;

/**
* @brief Method to track the end of a viewing session.
*
* This method must be called even if the user does not view the media to completion.
*/
- (void) trackSessionEnd;

/**
* @brief Method to track an error in media playback.
*
* @param errorId Error Id
*/
- (void) trackError: (NSString* _Nonnull) errorId;

/**
* @brief Method to track media event.
*
* @param event Media event
* @param info Info object for AdBreakStart, AdStart and ChapterStart events. Pass nil for other events.
* @param data NSDictionary instance containing context data for AdStart and ChapterStart events. Pass nil for other events.
*/
- (void) trackEvent: (ACPMediaEvent) event info: (NSDictionary* _Nullable) info data:
(NSDictionary* _Nullable) data;

/**
* @brief This method should be called when media playhead changes for accurate tracking.
*
* @param time Current position of the playhead. For VOD, value is specified in seconds from the beginning of the media item.
* For live streaming, return playhead position if available or the current UTC time in seconds otherwise.
*/

- (void) updateCurrentPlayhead: (double) time;

/**
* @brief This method should be called during a playback session with recently available QoE data.
*
* @param qoeObject NSDictionary instance containing current QoE information
*/

- (void) updateQoEObject: (NSDictionary* _Nonnull) qoeObject;

@end

@interface ACPMedia : NSObject {}
/**
* @brief Registers the ACPMedia extension with the Core Event Hub.
*/
+ (void) registerExtension;

/**
* @brief Returns the current version of the ACPMedia Extension.
*/
+ (NSString* _Nonnull) extensionVersion;

/**
* @brief Creates an instance of ACPMediaTracker.
*/
+ (ACPMediaTracker* _Nullable) createTracker;

/**
* @brief Creates an instance of ACPMediaTracker.
*
* @param config Config to override default config passed through V5 config.
*/
+ (ACPMediaTracker* _Nullable) createTrackerWithConfig: (NSDictionary* _Nullable) config;

/**
* @deprecated
* @brief Creates an instance of ACPMediaTracker.
*
* @param callback Callback which returns the created ACPMediaTracker instance.
*/
+ (void) createTracker: (void (^ _Nonnull) (
ACPMediaTracker* _Nullable)) callback __attribute__ ( (deprecated)) ;

/**
* @deprecated
* @brief Creates an instance of ACPMediaTracker.
*
* @param config Config to override default config passed through V5 config.
* @param callback Callback which returns the created ACPMediaTracker instance.
*/
+ (void) createTrackerWithConfig: (NSDictionary* _Nullable) config
callback: (void (^ _Nonnull) (ACPMediaTracker* _Nullable)) callback __attribute__ ( (deprecated)) ;

/**
* @brief Creates an instance of the Media info object.
*
* @param name The name of the media
* @param mediaId The unqiue identifier for the media
* @param length The length of the media in seconds
* @param streamType The stream type as a string. Use the pre-defined constants for vod, live, and linear content
* @param mediaType The media type of the stream
*/
+ (NSDictionary* _Nonnull) createMediaObjectWithName: (NSString* _Nonnull) name
mediaId: (NSString* _Nonnull) mediaId
length: (double) length
streamType: (NSString* _Nonnull) streamType
mediaType: (ACPMediaType) mediaType;

/**
* @brief Creates an instance of the AdBreak info object.
*
* @param name The name of the ad break
* @param position The position of the ad break in the content starting with 1
* @param startTime The start time of the ad break relative to the main media
*/
+ (NSDictionary* _Nonnull) createAdBreakObjectWithName: (NSString* _Nonnull) name
position: (double) position
startTime: (double) startTime;

/**
* @brief Creates an instance of the Ad info object.
*
* @param name The name of the ad
* @param adId The unique id for the ad
* @param position The start position of the ad
* @param length The length of the ad in seconds
*/
+ (NSDictionary* _Nonnull) createAdObjectWithName: (NSString* _Nonnull) name
adId: (NSString* _Nonnull) adId
position: (double) position
length: (double) length;

/**
* @brief Creates an instance of the Chapter info object.
*
* @param name The name of the chapter
* @param position The position of the chapter
* @param length The length of the chapter in seconds
* @param startTime The start time of the chapter relative to the main media
*/
+ (NSDictionary* _Nonnull) createChapterObjectWithName: (NSString* _Nonnull) name
position: (double) position
length: (double) length
startTime: (double) startTime;

/**
* @brief Creates an instance of the QoE info object.
*
* @param bitrate The bitrate of media in bits per second
* @param startupTime The start up time of media in seconds
* @param fps The current frames per second information
* @param droppedFrames The number of dropped frames so far
*/
+ (NSDictionary* _Nonnull) createQoEObjectWithBitrate: (double) bitrate
startupTime: (double) startupTime
fps: (double) fps
droppedFrames: (double) droppedFrames;

/**
* @brief Creates an instance of the state info object.
*
* @param stateName The media state with a state name
*/
+ (NSDictionary* _Nonnull) createStateObjectWithName: (NSString* _Nonnull) stateName;

@end
Loading

0 comments on commit 16a41eb

Please sign in to comment.