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)
1
static var extensionVersion: String
Copied!
1
+ (nonnull NSString*) extensionVersion;
Copied!
1
+ (nonnull NSString*) extensionVersion;
Copied!

createTracker

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

createTrackerWithConfig

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

createMediaObject

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

createAdBreakObject

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

createAdObject

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

createChapterObject

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

createQoEObject

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

createStateObject

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

Media tracker API reference

trackEvent

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

trackSessionStart

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

trackPlay

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

trackPause

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

trackComplete

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

trackSessionEnd

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

trackError

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

updateCurrentPlayhead

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

updateQoEObject

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

Media constants

Media type

AEP 3.x (Swift)
AEP 3.x (Objective-C)
ACP 2.x (Objective-C)
1
public enum MediaType: Int, RawRepresentable {
2
//Constant defining media type for Video streams
3
case Audio
4
//Constant defining media type for Audio streams
5
case Video
6
}
Copied!
1
@objc(AEPMediaType)
2
public enum MediaType: Int, RawRepresentable {
3
//Constant defining media type for Video streams
4
case Audio
5
//Constant defining media type for Audio streams
6
case Video
7
}
Copied!
1
typedef NS_ENUM(NSInteger, ACPMediaType) {
2
/**
3
* Constant defining media type for Video streams
4
*/
5
ACPMediaTypeVideo,
6
7
/**
8
* Constant defining media type for Audio streams
9
*/
10
ACPMediaTypeAudio
11
};
Copied!

Stream type

AEP 3.x (Swift)
AEP 3.x (Objective-C)
ACP 2.x (Objective-C)
1
public class StreamType: NSObject {
2
// Constant defining stream type for VOD streams.
3
public static let VOD = "vod"
4
}
Copied!
1
public class MediaConstants: NSObject {
2
@objc(AEPMediaStreamType)
3
public class StreamType: NSObject {
4
// Constant defining stream type for VOD streams.
5
public static let VOD = "vod"
6
}
7
}
Copied!
1
/**
2
* Constant defining stream type for VOD streams
3
*/
4
FOUNDATION_EXPORT NSString* _Nonnull const ACPMediaStreamTypeVod;
Copied!
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)
1
public class VideoMetadataKeys: NSObject {
2
public static let SHOW = "a.media.show"
3
}
Copied!
1
public class MediaConstants: NSObject {
2
@objc(AEPVideoMetadataKeys)
3
public class VideoMetadataKeys: NSObject {
4
public static let SHOW = "a.media.show"
5
}
6
}
Copied!
1
FOUNDATION_EXPORT NSString* _Nonnull const ACPVideoMetadataKeyShow;
Copied!
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)
1
public class AudioMetadataKeys: NSObject {
2
public static let ARTIST = "a.media.artist"
3
}
Copied!
1
public class MediaConstants: NSObject {
2
@objc(AEPAudioMetadataKeys)
3
public class AudioMetadataKeys: NSObject {
4
public static let ARTIST = "a.media.artist"
5
}
6
}
Copied!
1
FOUNDATION_EXPORT NSString* _Nonnull const ACPAudioMetadataKeyArtist;
Copied!
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)
1
public class AdMetadataKeys: NSObject {
2
public static let ADVERTISER = "a.media.ad.advertiser"
3
}
Copied!
1
public class MediaConstants: NSObject {
2
@objc(AEPAdMetadataKeys)
3
public class AdMetadataKeys: NSObject {
4
public static let ADVERTISER = "a.media.ad.advertiser"
5
}
6
}
Copied!
1
FOUNDATION_EXPORT NSString* _Nonnull const ACPAdMetadataKeyAdvertiser;
Copied!
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)
1
public class PlayerState: NSObject {
2
public static let FULLSCREEN = "fullscreen"
3
}
Copied!
1
public class MediaConstants: NSObject {
2
@objc(AEPMediaPlayerState)
3
public class PlayerState: NSObject {
4
public static let FULLSCREEN = "fullscreen"
5
}
6
}
Copied!
1
FOUNDATION_EXPORT NSString* _Nonnull const ACPMediaPlayerStateFullScreen;
Copied!
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)
1
public enum MediaEvent: Int, RawRepresentable {
2
// event type for AdBreak start
3
case AdBreakStart
4
}
Copied!
1
@objc(AEPMediaEvent)
2
public enum MediaEvent: Int, RawRepresentable {
3
// event type for AdBreak start
4
case AdBreakStart
5
}
Copied!
1
typedef NS_ENUM(NSInteger, ACPMediaEvent) {
2
/**
3
* Constant defining event type for AdBreak start
4
*/
5
ACPMediaEventAdBreakStart,
6
}
Copied!
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)
1
public class MediaObjectKey: NSObject {
2
public static let RESUMED = "media.resumed"
3
}
4
}
Copied!
1
public class MediaConstants: NSObject {
2
@objc(AEPMediaObjectKey)
3
public class MediaObjectKey: NSObject {
4
public static let RESUMED = "media.resumed"
5
}
6
}
Copied!
1
FOUNDATION_EXPORT NSString* _Nonnull const ACPMediaKeyMediaResumed;
Copied!
Last modified 1mo ago