Migrating to AEPMedia reference

This document is a reference comparison of AEPMedia (3.x) APIs against their equivalent ACPMedia (2.x) APIs.

The AEPMedia extension is implemented purely in Swift and is compatible with the AEPCore Swift SDK. To ensure a smooth transition from the ACPMedia SDK, there are no major changes on the API names or definition. For more details, follow the migration guide below for your Swift or Objective-C mobile application. If explanation beyond showing API differences is necessary, it will be captured as an info hint within that API's section.

AEPMedia classes

Type

AEP 3.x (Swift)

AEP 3.x (Objective-C)

ACP 2.x (Objective-C)

Primary Class

Media

AEPMobileMedia

ACPMedia

AEPMedia APIs

extensionVersion

AEP 3.x (Swift)
AEP 3.x (Objective-C)
ACP 2.x (Objective-C)
AEP 3.x (Swift)
static var extensionVersion: String
AEP 3.x (Objective-C)
+ (nonnull NSString*) extensionVersion;
ACP 2.x (Objective-C)
+ (nonnull NSString*) extensionVersion;

createTracker

AEP 3.x (Swift)
AEP 3.x (Objective-C)
ACP 2.x (Objective-C)
AEP 3.x (Swift)
static func createTracker()
AEP 3.x (Objective-C)
+ (id<AEPMediaTracker> _Nonnull) createTracker;
ACP 2.x (Objective-C)
+(ACPMediaTracker* _Nullable) createTracker;

createTrackerWithConfig

AEP 3.x (Swift)
AEP 3.x (Objective-C)
ACP 2.x (Objective-C)
AEP 3.x (Swift)
static func createTrackerWith(config: [String: Any]?)
AEP 3.x (Objective-C)
+ (id<AEPMobileMediaTracker> _Nonnull) createTrackerWithConfig:(NSDictionary<NSString *,id) * _Nullable) config;
ACP 2.x (Objective-C)
+ (ACPMediaTracker* _Nullable) createTrackerWithConfig: (NSDictionary* _Nullable) config;

createMediaObject

AEP 3.x (Swift)
AEP 3.x (Objective-C)
ACP 2.x (Objective-C)
AEP 3.x (Swift)
static func createMediaObjectWith(name: String, id: String, length: Double, streamType: String, mediaType: MediaType) -> [String: Any]?
AEP 3.x (Objective-C)
+ (NSDictionary*<NSString *,id> *_Nullable) createMediaObjectWith: (NSString *, _Nonnull) name
id: (NSString * _Nonnull) id
length: (double) length
streamType: (NSString * _Nonnull) streamType
mediaType: (enum AEPMediaType) mediaType;
ACP 2.x (Objective-C)
+ (NSDictionary* _Nonnull) createMediaObjectWithName: (NSString* _Nonnull) name
mediaId: (NSString* _Nonnull) mediaId
length: (double) length
streamType: (NSString* _Nonnull) streamType
mediaType: (ACPMediaType) mediaType;

createAdBreakObject

AEP 3.x (Swift)
AEP 3.x (Objective-C)
ACP 2.x (Objective-C)
AEP 3.x (Swift)
static func createAdBreakObjectWith(name: String, position: Int, startTime: Double) -> [String: Any]?
AEP 3.x (Objective-C)
+ (NSDictionary<NSString * ,id> * _Nullable) createAdBreakObjectWith: (NSString * _Nonnull) name
position: (NSInteger) position
startTime: (double) startTime,
ACP 2.x (Objective-C)
+ (NSDictionary* _Nonnull) createAdBreakObjectWithName: (NSString* _Nonnull) name
position: (double) position
startTime: (double) startTime;

createAdObject

AEP 3.x (Swift)
AEP 3.x (Objective-C)
ACP 2.x (Objective-C)
AEP 3.x (Swift)
static func createAdObjectWith(name: String, id: String, position: Int, length: Double) -> [String: Any]?
AEP 3.x (Objective-C)
+ (NSDictionary<NSString * ,id>) * _Nullable) createAdObjectWith: (NSString * _Nonnull) name
id: (NSString * _Nonnull) id
position: (NSInteger) position
length: (double) length;
ACP 2.x (Objective-C)
+ (NSDictionary* _Nonnull) createAdObjectWithName: (NSString* _Nonnull) name
adId: (NSString* _Nonnull) adId
position: (double) position
length: (double) length;

createChapterObject

AEP 3.x (Swift)
AEP 3.x (Objective-C)
ACP 2.x (Objective-C)
AEP 3.x (Swift)
static func createChapterObjectWith(name: String, position: Int, length: Double, startTime: Double) -> [String: Any]?
AEP 3.x (Objective-C)
+ (NSDictionary<NSString * ,id>) * _Nullable) createChapterObjectWith: (NSString * _Nonnull) name
position: (NSInteger) position
length: (double) length
startTime: (double) startTime;
ACP 2.x (Objective-C)
+ (NSDictionary* _Nonnull) createChapterObjectWithName: (NSString* _Nonnull) name
position: (double) position
length: (double) length
startTime: (double) startTime;

createQoEObject

AEP 3.x (Swift)
AEP 3.x (Objective-C)
ACP 2.x (Objective-C)
AEP 3.x (Swift)
static func createQoEObjectWith(bitrate: Double, startupTime: Double, fps: Double, droppedFrames: Double) -> [String: Any]?
AEP 3.x (Objective-C)
+ (NSDictionary<NSString * ,id>) * _Nullable) createQoEObjectWith: (double) bitrate
startTime: (double) startTime
fps: (double) fps
droppedFrames: (double) droppedFrames;
ACP 2.x (Objective-C)
+ (NSDictionary* _Nonnull) createQoEObjectWithBitrate: (double) bitrate
startupTime: (double) startupTime
fps: (double) fps
droppedFrames: (double) droppedFrames;

createStateObject

AEP 3.x (Swift)
AEP 3.x (Objective-C)
ACP 2.x (Objective-C)
AEP 3.x (Swift)
static func createStateObjectWith(stateName: String) -> [String: Any]
AEP 3.x (Objective-C)
+ (NSDictionary<NSString * ,id>) * _Nullable) createStateObjectWith: (NSString * _Nonnull) stateName;
ACP 2.x (Objective-C)
+ (NSDictionary* _Nonnull) createStateObjectWithName: (NSString* _Nonnull) stateName;

Media tracker API reference

trackEvent

AEP 3.x (Swift)
AEP 3.x (Objective-C)
ACP 2.x (Objective-C)
AEP 3.x (Swift)
func trackEvent(event: MediaEvent, info: [String: Any]?, metadata: [String: String]?)
AEP 3.x (Objective-C)
- (void) trackEvent: (enum AEPMediaEvent) event
info: (NSDictionary* <NSString *,id> * _Nullable) info
data: (NSDictionary* <NSString *,NSString> * _Nullable) data;
ACP 2.x (Objective-C)
- (void) trackEvent: (ACPMediaEvent) event
info: (NSDictionary* _Nullable) info
data: (NSDictionary* _Nullable) data;

trackSessionStart

AEP 3.x (Swift)
AEP 3.x (Objective-C)
ACP 2.x (Objective-C)
AEP 3.x (Swift)
public func trackSessionStart(info: [String: Any], metadata: [String: String]? = nil)
AEP 3.x (Objective-C)
- (void) trackSessionStart:(NSDictionary<NSString *,id> * _Nonnull) mediaInfo metadata:(NSDictionary<NSString *,NSString *> * _Nullable) data;
ACP 2.x (Objective-C)
- (void) trackSessionStart: (NSDictionary* _Nonnull) mediaInfo data: (NSDictionary* _Nullable) contextData;

trackPlay

AEP 3.x (Swift)
AEP 3.x (Objective-C)
ACP 2.x (Objective-C)
AEP 3.x (Swift)
func trackPlay()
AEP 3.x (Objective-C)
- (void) trackPlay;
ACP 2.x (Objective-C)
- (void) trackPlay;

trackPause

AEP 3.x (Swift)
AEP 3.x (Objective-C)
ACP 2.x (Objective-C)
AEP 3.x (Swift)
func trackPause()
AEP 3.x (Objective-C)
- (void) trackPause;
ACP 2.x (Objective-C)
- (void) trackPause;

trackComplete

AEP 3.x (Swift)
AEP 3.x (Objective-C)
ACP 2.x (Objective-C)
AEP 3.x (Swift)
func trackComplete()
AEP 3.x (Objective-C)
- (void) trackComplete;
ACP 2.x (Objective-C)
- (void) trackComplete;

trackSessionEnd

AEP 3.x (Swift)
AEP 3.x (Objective-C)
ACP 2.x (Objective-C)
AEP 3.x (Swift)
func trackSessionEnd()
AEP 3.x (Objective-C)
- (void) trackSessionEnd;
ACP 2.x (Objective-C)
- (void) trackSessionEnd;

trackError

AEP 3.x (Swift)
AEP 3.x (Objective-C)
ACP 2.x (Objective-C)
AEP 3.x (Swift)
func trackError(errorId: String)
AEP 3.x (Objective-C)
- (void) trackError: (NSString* _Nonnull) errorId;
ACP 2.x (Objective-C)
- (void) trackError: (NSString* _Nonnull) errorId;

updateCurrentPlayhead

AEP 3.x (Swift)
AEP 3.x (Objective-C)
ACP 2.x (Objective-C)
AEP 3.x (Swift)
func updateCurrentPlayhead(time: Double)
AEP 3.x (Objective-C)
- (void) updateCurrentPlayhead: (double) time;
ACP 2.x (Objective-C)
- (void) updateCurrentPlayhead: (double) time;

updateQoEObject

AEP 3.x (Swift)
AEP 3.x (Objective-C)
ACP 2.x (Objective-C)
AEP 3.x (Swift)
func updateQoEObject(qoe: [String: Any])
AEP 3.x (Objective-C)
- (void) updateQoEObject: (NSDictionary*<NSString *,id> _Nonnull) qoeObject;
ACP 2.x (Objective-C)
- (void) updateQoEObject: (NSDictionary* _Nonnull) qoeObject;

Media constants

Media type

AEP 3.x (Swift)
AEP 3.x (Objective-C)
ACP 2.x (Objective-C)
AEP 3.x (Swift)
public enum MediaType: Int, RawRepresentable {
//Constant defining media type for Video streams
case Audio
//Constant defining media type for Audio streams
case Video
}
AEP 3.x (Objective-C)
@objc(AEPMediaType)
public enum MediaType: Int, RawRepresentable {
//Constant defining media type for Video streams
case Audio
//Constant defining media type for Audio streams
case Video
}
ACP 2.x (Objective-C)
typedef NS_ENUM(NSInteger, ACPMediaType) {
/**
* Constant defining media type for Video streams
*/
ACPMediaTypeVideo,
/**
* Constant defining media type for Audio streams
*/
ACPMediaTypeAudio
};

Stream type

AEP 3.x (Swift)
AEP 3.x (Objective-C)
ACP 2.x (Objective-C)
AEP 3.x (Swift)
public class StreamType: NSObject {
// Constant defining stream type for VOD streams.
public static let VOD = "vod"
}
AEP 3.x (Objective-C)
public class MediaConstants: NSObject {
@objc(AEPMediaStreamType)
public class StreamType: NSObject {
// Constant defining stream type for VOD streams.
public static let VOD = "vod"
}
}
ACP 2.x (Objective-C)
/**
* Constant defining stream type for VOD streams
*/
FOUNDATION_EXPORT NSString* _Nonnull const ACPMediaStreamTypeVod;

For the full list of constant type, refer to [Media API reference]((media-api-reference#stream-type)).

Standard video constants

AEP 3.x (Swift)
AEP 3.x (Objective-C)
ACP 2.x (Objective-C)
AEP 3.x (Swift)
public class VideoMetadataKeys: NSObject {
public static let SHOW = "a.media.show"
}
AEP 3.x (Objective-C)
public class MediaConstants: NSObject {
@objc(AEPVideoMetadataKeys)
public class VideoMetadataKeys: NSObject {
public static let SHOW = "a.media.show"
}
}
ACP 2.x (Objective-C)
FOUNDATION_EXPORT NSString* _Nonnull const ACPVideoMetadataKeyShow;

For the full list of constant type, refer to Media API reference.

Standard audio constants

AEP 3.x (Swift)
AEP 3.x (Objective-C)
ACP 2.x (Objective-C)
AEP 3.x (Swift)
public class AudioMetadataKeys: NSObject {
public static let ARTIST = "a.media.artist"
}
AEP 3.x (Objective-C)
public class MediaConstants: NSObject {
@objc(AEPAudioMetadataKeys)
public class AudioMetadataKeys: NSObject {
public static let ARTIST = "a.media.artist"
}
}
ACP 2.x (Objective-C)
FOUNDATION_EXPORT NSString* _Nonnull const ACPAudioMetadataKeyArtist;

For the full list of constant type, refer to Media API reference.

Standard ad constants

AEP 3.x (Swift)
AEP 3.x (Objective-C)
ACP 2.x (Objective-C)
AEP 3.x (Swift)
public class AdMetadataKeys: NSObject {
public static let ADVERTISER = "a.media.ad.advertiser"
}
AEP 3.x (Objective-C)
public class MediaConstants: NSObject {
@objc(AEPAdMetadataKeys)
public class AdMetadataKeys: NSObject {
public static let ADVERTISER = "a.media.ad.advertiser"
}
}
ACP 2.x (Objective-C)
FOUNDATION_EXPORT NSString* _Nonnull const ACPAdMetadataKeyAdvertiser;

For the full list of constant type, refer to Media API reference.

Player State constants

AEP 3.x (Swift)
AEP 3.x (Objective-C)
ACP 2.x (Objective-C)
AEP 3.x (Swift)
public class PlayerState: NSObject {
public static let FULLSCREEN = "fullscreen"
}
AEP 3.x (Objective-C)
public class MediaConstants: NSObject {
@objc(AEPMediaPlayerState)
public class PlayerState: NSObject {
public static let FULLSCREEN = "fullscreen"
}
}
ACP 2.x (Objective-C)
FOUNDATION_EXPORT NSString* _Nonnull const ACPMediaPlayerStateFullScreen;

For the full list of constant type, refer to Media API reference.

Media events

AEP 3.x (Swift)
AEP 3.x (Objective-C)
ACP 2.x (Objective-C)
AEP 3.x (Swift)
public enum MediaEvent: Int, RawRepresentable {
// event type for AdBreak start
case AdBreakStart
}
AEP 3.x (Objective-C)
@objc(AEPMediaEvent)
public enum MediaEvent: Int, RawRepresentable {
// event type for AdBreak start
case AdBreakStart
}
ACP 2.x (Objective-C)
typedef NS_ENUM(NSInteger, ACPMediaEvent) {
/**
* Constant defining event type for AdBreak start
*/
ACPMediaEventAdBreakStart,
}

For the full list of constant type, refer to Media API reference.

Media resume

AEP 3.x (Swift)
AEP 3.x (Objective-C)
ACP 2.x (Objective-C)
AEP 3.x (Swift)
public class MediaObjectKey: NSObject {
public static let RESUMED = "media.resumed"
}
}
AEP 3.x (Objective-C)
public class MediaConstants: NSObject {
@objc(AEPMediaObjectKey)
public class MediaObjectKey: NSObject {
public static let RESUMED = "media.resumed"
}
}
ACP 2.x (Objective-C)
FOUNDATION_EXPORT NSString* _Nonnull const ACPMediaKeyMediaResumed;