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
Copied to your clipboardstatic var extensionVersion: String
Copied to your clipboard+ (nonnull NSString*) extensionVersion;
Copied to your clipboard+ (nonnull NSString*) extensionVersion;
Copied to your clipboardstatic var extensionVersion: String
Copied to your clipboard+ (nonnull NSString*) extensionVersion;
Copied to your clipboard+ (nonnull NSString*) extensionVersion;
createTracker
Copied to your clipboardstatic func createTracker()
Copied to your clipboard+ (id<AEPMediaTracker> _Nonnull) createTracker;
Copied to your clipboard+(ACPMediaTracker* _Nullable) createTracker;
Copied to your clipboardstatic func createTracker()
Copied to your clipboard+ (id<AEPMediaTracker> _Nonnull) createTracker;
Copied to your clipboard+(ACPMediaTracker* _Nullable) createTracker;
createTrackerWithConfig
Copied to your clipboardstatic func createTrackerWith(config: [String: Any]?)
Copied to your clipboard+ (id<AEPMobileMediaTracker> _Nonnull) createTrackerWithConfig:(NSDictionary<NSString *,id) * _Nullable) config;
Copied to your clipboard+ (ACPMediaTracker* _Nullable) createTrackerWithConfig: (NSDictionary* _Nullable) config;
Copied to your clipboardstatic func createTrackerWith(config: [String: Any]?)
Copied to your clipboard+ (id<AEPMobileMediaTracker> _Nonnull) createTrackerWithConfig:(NSDictionary<NSString *,id) * _Nullable) config;
Copied to your clipboard+ (ACPMediaTracker* _Nullable) createTrackerWithConfig: (NSDictionary* _Nullable) config;
createMediaObject
Copied to your clipboardstatic func createMediaObjectWith(name: String, id: String, length: Double, streamType: String, mediaType: MediaType) -> [String: Any]?
Copied to your clipboard+ (NSDictionary*<NSString *,id> *_Nullable) createMediaObjectWith: (NSString *, _Nonnull) nameid: (NSString * _Nonnull) idlength: (double) lengthstreamType: (NSString * _Nonnull) streamTypemediaType: (enum AEPMediaType) mediaType;
Copied to your clipboard+ (NSDictionary* _Nonnull) createMediaObjectWithName: (NSString* _Nonnull) namemediaId: (NSString* _Nonnull) mediaIdlength: (double) lengthstreamType: (NSString* _Nonnull) streamTypemediaType: (ACPMediaType) mediaType;
Copied to your clipboardstatic func createMediaObjectWith(name: String, id: String, length: Double, streamType: String, mediaType: MediaType) -> [String: Any]?
Copied to your clipboard+ (NSDictionary*<NSString *,id> *_Nullable) createMediaObjectWith: (NSString *, _Nonnull) nameid: (NSString * _Nonnull) idlength: (double) lengthstreamType: (NSString * _Nonnull) streamTypemediaType: (enum AEPMediaType) mediaType;
Copied to your clipboard+ (NSDictionary* _Nonnull) createMediaObjectWithName: (NSString* _Nonnull) namemediaId: (NSString* _Nonnull) mediaIdlength: (double) lengthstreamType: (NSString* _Nonnull) streamTypemediaType: (ACPMediaType) mediaType;
createAdBreakObject
Copied to your clipboardstatic func createAdBreakObjectWith(name: String, position: Int, startTime: Double) -> [String: Any]?
Copied to your clipboard+ (NSDictionary<NSString * ,id> * _Nullable) createAdBreakObjectWith: (NSString * _Nonnull) nameposition: (NSInteger) positionstartTime: (double) startTime,
Copied to your clipboard+ (NSDictionary* _Nonnull) createAdBreakObjectWithName: (NSString* _Nonnull) nameposition: (double) positionstartTime: (double) startTime;
Copied to your clipboardstatic func createAdBreakObjectWith(name: String, position: Int, startTime: Double) -> [String: Any]?
Copied to your clipboard+ (NSDictionary<NSString * ,id> * _Nullable) createAdBreakObjectWith: (NSString * _Nonnull) nameposition: (NSInteger) positionstartTime: (double) startTime,
Copied to your clipboard+ (NSDictionary* _Nonnull) createAdBreakObjectWithName: (NSString* _Nonnull) nameposition: (double) positionstartTime: (double) startTime;
createAdObject
Copied to your clipboardstatic func createAdObjectWith(name: String, id: String, position: Int, length: Double) -> [String: Any]?
Copied to your clipboard+ (NSDictionary<NSString * ,id>) * _Nullable) createAdObjectWith: (NSString * _Nonnull) nameid: (NSString * _Nonnull) idposition: (NSInteger) positionlength: (double) length;
Copied to your clipboard+ (NSDictionary* _Nonnull) createAdObjectWithName: (NSString* _Nonnull) nameadId: (NSString* _Nonnull) adIdposition: (double) positionlength: (double) length;
Copied to your clipboardstatic func createAdObjectWith(name: String, id: String, position: Int, length: Double) -> [String: Any]?
Copied to your clipboard+ (NSDictionary<NSString * ,id>) * _Nullable) createAdObjectWith: (NSString * _Nonnull) nameid: (NSString * _Nonnull) idposition: (NSInteger) positionlength: (double) length;
Copied to your clipboard+ (NSDictionary* _Nonnull) createAdObjectWithName: (NSString* _Nonnull) nameadId: (NSString* _Nonnull) adIdposition: (double) positionlength: (double) length;
createChapterObject
Copied to your clipboardstatic func createChapterObjectWith(name: String, position: Int, length: Double, startTime: Double) -> [String: Any]?
Copied to your clipboard+ (NSDictionary<NSString * ,id>) * _Nullable) createChapterObjectWith: (NSString * _Nonnull) nameposition: (NSInteger) positionlength: (double) lengthstartTime: (double) startTime;
Copied to your clipboard+ (NSDictionary* _Nonnull) createChapterObjectWithName: (NSString* _Nonnull) nameposition: (double) positionlength: (double) lengthstartTime: (double) startTime;
Copied to your clipboardstatic func createChapterObjectWith(name: String, position: Int, length: Double, startTime: Double) -> [String: Any]?
Copied to your clipboard+ (NSDictionary<NSString * ,id>) * _Nullable) createChapterObjectWith: (NSString * _Nonnull) nameposition: (NSInteger) positionlength: (double) lengthstartTime: (double) startTime;
Copied to your clipboard+ (NSDictionary* _Nonnull) createChapterObjectWithName: (NSString* _Nonnull) nameposition: (double) positionlength: (double) lengthstartTime: (double) startTime;
createQoEObject
Copied to your clipboardstatic func createQoEObjectWith(bitrate: Double, startupTime: Double, fps: Double, droppedFrames: Double) -> [String: Any]?
Copied to your clipboard+ (NSDictionary<NSString * ,id>) * _Nullable) createQoEObjectWith: (double) bitratestartTime: (double) startTimefps: (double) fpsdroppedFrames: (double) droppedFrames;
Copied to your clipboard+ (NSDictionary* _Nonnull) createQoEObjectWithBitrate: (double) bitratestartupTime: (double) startupTimefps: (double) fpsdroppedFrames: (double) droppedFrames;
Copied to your clipboardstatic func createQoEObjectWith(bitrate: Double, startupTime: Double, fps: Double, droppedFrames: Double) -> [String: Any]?
Copied to your clipboard+ (NSDictionary<NSString * ,id>) * _Nullable) createQoEObjectWith: (double) bitratestartTime: (double) startTimefps: (double) fpsdroppedFrames: (double) droppedFrames;
Copied to your clipboard+ (NSDictionary* _Nonnull) createQoEObjectWithBitrate: (double) bitratestartupTime: (double) startupTimefps: (double) fpsdroppedFrames: (double) droppedFrames;
createStateObject
Copied to your clipboardstatic func createStateObjectWith(stateName: String) -> [String: Any]
Copied to your clipboard+ (NSDictionary<NSString * ,id>) * _Nullable) createStateObjectWith: (NSString * _Nonnull) stateName;
Copied to your clipboard+ (NSDictionary* _Nonnull) createStateObjectWithName: (NSString* _Nonnull) stateName;
Copied to your clipboardstatic func createStateObjectWith(stateName: String) -> [String: Any]
Copied to your clipboard+ (NSDictionary<NSString * ,id>) * _Nullable) createStateObjectWith: (NSString * _Nonnull) stateName;
Copied to your clipboard+ (NSDictionary* _Nonnull) createStateObjectWithName: (NSString* _Nonnull) stateName;
Media tracker API reference
trackEvent
Copied to your clipboardfunc trackEvent(event: MediaEvent, info: [String: Any]?, metadata: [String: String]?)
Copied to your clipboard- (void) trackEvent: (enum AEPMediaEvent) eventinfo: (NSDictionary* <NSString *,id> * _Nullable) infodata: (NSDictionary* <NSString *,NSString> * _Nullable) data;
Copied to your clipboard- (void) trackEvent: (ACPMediaEvent) eventinfo: (NSDictionary* _Nullable) infodata: (NSDictionary* _Nullable) data;
Copied to your clipboardfunc trackEvent(event: MediaEvent, info: [String: Any]?, metadata: [String: String]?)
Copied to your clipboard- (void) trackEvent: (enum AEPMediaEvent) eventinfo: (NSDictionary* <NSString *,id> * _Nullable) infodata: (NSDictionary* <NSString *,NSString> * _Nullable) data;
Copied to your clipboard- (void) trackEvent: (ACPMediaEvent) eventinfo: (NSDictionary* _Nullable) infodata: (NSDictionary* _Nullable) data;
trackSessionStart
Copied to your clipboardpublic func trackSessionStart(info: [String: Any], metadata: [String: String]? = nil)
Copied to your clipboard- (void) trackSessionStart:(NSDictionary<NSString *,id> * _Nonnull) mediaInfo metadata:(NSDictionary<NSString *,NSString *> * _Nullable) data;
Copied to your clipboard- (void) trackSessionStart: (NSDictionary* _Nonnull) mediaInfo data: (NSDictionary* _Nullable) contextData;
Copied to your clipboardpublic func trackSessionStart(info: [String: Any], metadata: [String: String]? = nil)
Copied to your clipboard- (void) trackSessionStart:(NSDictionary<NSString *,id> * _Nonnull) mediaInfo metadata:(NSDictionary<NSString *,NSString *> * _Nullable) data;
Copied to your clipboard- (void) trackSessionStart: (NSDictionary* _Nonnull) mediaInfo data: (NSDictionary* _Nullable) contextData;
trackPlay
Copied to your clipboardfunc trackPlay()
Copied to your clipboard- (void) trackPlay;
Copied to your clipboard- (void) trackPlay;
Copied to your clipboardfunc trackPlay()
Copied to your clipboard- (void) trackPlay;
Copied to your clipboard- (void) trackPlay;
trackPause
Copied to your clipboardfunc trackPause()
Copied to your clipboard- (void) trackPause;
Copied to your clipboard- (void) trackPause;
Copied to your clipboardfunc trackPause()
Copied to your clipboard- (void) trackPause;
Copied to your clipboard- (void) trackPause;
trackComplete
Copied to your clipboardfunc trackComplete()
Copied to your clipboard- (void) trackComplete;
Copied to your clipboard- (void) trackComplete;
Copied to your clipboardfunc trackComplete()
Copied to your clipboard- (void) trackComplete;
Copied to your clipboard- (void) trackComplete;
trackSessionEnd
Copied to your clipboardfunc trackSessionEnd()
Copied to your clipboard- (void) trackSessionEnd;
Copied to your clipboard- (void) trackSessionEnd;
Copied to your clipboardfunc trackSessionEnd()
Copied to your clipboard- (void) trackSessionEnd;
Copied to your clipboard- (void) trackSessionEnd;
trackError
Copied to your clipboardfunc trackError(errorId: String)
Copied to your clipboard- (void) trackError: (NSString* _Nonnull) errorId;
Copied to your clipboard- (void) trackError: (NSString* _Nonnull) errorId;
Copied to your clipboardfunc trackError(errorId: String)
Copied to your clipboard- (void) trackError: (NSString* _Nonnull) errorId;
Copied to your clipboard- (void) trackError: (NSString* _Nonnull) errorId;
updateCurrentPlayhead
Copied to your clipboardfunc updateCurrentPlayhead(time: Double)
Copied to your clipboard- (void) updateCurrentPlayhead: (double) time;
Copied to your clipboard- (void) updateCurrentPlayhead: (double) time;
Copied to your clipboardfunc updateCurrentPlayhead(time: Double)
Copied to your clipboard- (void) updateCurrentPlayhead: (double) time;
Copied to your clipboard- (void) updateCurrentPlayhead: (double) time;
updateQoEObject
Copied to your clipboardfunc updateQoEObject(qoe: [String: Any])
Copied to your clipboard- (void) updateQoEObject: (NSDictionary*<NSString *,id> _Nonnull) qoeObject;
Copied to your clipboard- (void) updateQoEObject: (NSDictionary* _Nonnull) qoeObject;
Copied to your clipboardfunc updateQoEObject(qoe: [String: Any])
Copied to your clipboard- (void) updateQoEObject: (NSDictionary*<NSString *,id> _Nonnull) qoeObject;
Copied to your clipboard- (void) updateQoEObject: (NSDictionary* _Nonnull) qoeObject;
Media constants
Media type
Copied to your clipboardpublic enum MediaType: Int, RawRepresentable {//Constant defining media type for Video streamscase Audio//Constant defining media type for Audio streamscase Video}
Copied to your clipboard@objc(AEPMediaType)public enum MediaType: Int, RawRepresentable {//Constant defining media type for Video streamscase Audio//Constant defining media type for Audio streamscase Video}
Copied to your clipboardtypedef NS_ENUM(NSInteger, ACPMediaType) {/*** Constant defining media type for Video streams*/ACPMediaTypeVideo,/*** Constant defining media type for Audio streams*/ACPMediaTypeAudio};
Copied to your clipboardpublic enum MediaType: Int, RawRepresentable {//Constant defining media type for Video streamscase Audio//Constant defining media type for Audio streamscase Video}
Copied to your clipboard@objc(AEPMediaType)public enum MediaType: Int, RawRepresentable {//Constant defining media type for Video streamscase Audio//Constant defining media type for Audio streamscase Video}
Copied to your clipboardtypedef NS_ENUM(NSInteger, ACPMediaType) {/*** Constant defining media type for Video streams*/ACPMediaTypeVideo,/*** Constant defining media type for Audio streams*/ACPMediaTypeAudio};
Stream type
For the full list of constant type, please refer to the Media API reference.
Copied to your clipboardpublic class StreamType: NSObject {// Constant defining stream type for VOD streams.public static let VOD = "vod"}
Copied to your clipboardpublic class MediaConstants: NSObject {@objc(AEPMediaStreamType)public class StreamType: NSObject {// Constant defining stream type for VOD streams.public static let VOD = "vod"}}
Copied to your clipboard/*** Constant defining stream type for VOD streams*/FOUNDATION_EXPORT NSString* _Nonnull const ACPMediaStreamTypeVod;
Copied to your clipboardpublic class StreamType: NSObject {// Constant defining stream type for VOD streams.public static let VOD = "vod"}
Copied to your clipboardpublic class MediaConstants: NSObject {@objc(AEPMediaStreamType)public class StreamType: NSObject {// Constant defining stream type for VOD streams.public static let VOD = "vod"}}
Copied to your clipboard/*** Constant defining stream type for VOD streams*/FOUNDATION_EXPORT NSString* _Nonnull const ACPMediaStreamTypeVod;
Standard video constants
For the full list of constant type, please refer to the Media API reference.
Copied to your clipboardpublic class VideoMetadataKeys: NSObject {public static let SHOW = "a.media.show"}
Copied to your clipboardpublic class MediaConstants: NSObject {@objc(AEPVideoMetadataKeys)public class VideoMetadataKeys: NSObject {public static let SHOW = "a.media.show"}}
Copied to your clipboardFOUNDATION_EXPORT NSString* _Nonnull const ACPVideoMetadataKeyShow;
Copied to your clipboardpublic class VideoMetadataKeys: NSObject {public static let SHOW = "a.media.show"}
Copied to your clipboardpublic class MediaConstants: NSObject {@objc(AEPVideoMetadataKeys)public class VideoMetadataKeys: NSObject {public static let SHOW = "a.media.show"}}
Copied to your clipboardFOUNDATION_EXPORT NSString* _Nonnull const ACPVideoMetadataKeyShow;
Standard audio constants
For the full list of constant type, please refer to the Media API reference.
Copied to your clipboardpublic class AudioMetadataKeys: NSObject {public static let ARTIST = "a.media.artist"}
Copied to your clipboardpublic class MediaConstants: NSObject {@objc(AEPAudioMetadataKeys)public class AudioMetadataKeys: NSObject {public static let ARTIST = "a.media.artist"}}
Copied to your clipboardFOUNDATION_EXPORT NSString* _Nonnull const ACPAudioMetadataKeyArtist;
Copied to your clipboardpublic class AudioMetadataKeys: NSObject {public static let ARTIST = "a.media.artist"}
Copied to your clipboardpublic class MediaConstants: NSObject {@objc(AEPAudioMetadataKeys)public class AudioMetadataKeys: NSObject {public static let ARTIST = "a.media.artist"}}
Copied to your clipboardFOUNDATION_EXPORT NSString* _Nonnull const ACPAudioMetadataKeyArtist;
Standard ad constants
For the full list of constant type, please refer to the Media API reference.
Copied to your clipboardpublic class AdMetadataKeys: NSObject {public static let ADVERTISER = "a.media.ad.advertiser"}
Copied to your clipboardpublic class MediaConstants: NSObject {@objc(AEPAdMetadataKeys)public class AdMetadataKeys: NSObject {public static let ADVERTISER = "a.media.ad.advertiser"}}
Copied to your clipboardFOUNDATION_EXPORT NSString* _Nonnull const ACPAdMetadataKeyAdvertiser;
Copied to your clipboardpublic class AdMetadataKeys: NSObject {public static let ADVERTISER = "a.media.ad.advertiser"}
Copied to your clipboardpublic class MediaConstants: NSObject {@objc(AEPAdMetadataKeys)public class AdMetadataKeys: NSObject {public static let ADVERTISER = "a.media.ad.advertiser"}}
Copied to your clipboardFOUNDATION_EXPORT NSString* _Nonnull const ACPAdMetadataKeyAdvertiser;
Player state constants
For the full list of constant type, please refer to the Media API reference.
Copied to your clipboardpublic class PlayerState: NSObject {public static let FULLSCREEN = "fullscreen"}
Copied to your clipboardpublic class MediaConstants: NSObject {@objc(AEPMediaPlayerState)public class PlayerState: NSObject {public static let FULLSCREEN = "fullscreen"}}
Copied to your clipboardFOUNDATION_EXPORT NSString* _Nonnull const ACPMediaPlayerStateFullScreen;
Copied to your clipboardpublic class PlayerState: NSObject {public static let FULLSCREEN = "fullscreen"}
Copied to your clipboardpublic class MediaConstants: NSObject {@objc(AEPMediaPlayerState)public class PlayerState: NSObject {public static let FULLSCREEN = "fullscreen"}}
Copied to your clipboardFOUNDATION_EXPORT NSString* _Nonnull const ACPMediaPlayerStateFullScreen;
Media events
For the full list of constant type, please refer to the Media API reference.
Copied to your clipboardpublic enum MediaEvent: Int, RawRepresentable {// event type for AdBreak startcase AdBreakStart}
Copied to your clipboard@objc(AEPMediaEvent)public enum MediaEvent: Int, RawRepresentable {// event type for AdBreak startcase AdBreakStart}
Copied to your clipboardtypedef NS_ENUM(NSInteger, ACPMediaEvent) {/*** Constant defining event type for AdBreak start*/ACPMediaEventAdBreakStart,}
Copied to your clipboardpublic enum MediaEvent: Int, RawRepresentable {// event type for AdBreak startcase AdBreakStart}
Copied to your clipboard@objc(AEPMediaEvent)public enum MediaEvent: Int, RawRepresentable {// event type for AdBreak startcase AdBreakStart}
Copied to your clipboardtypedef NS_ENUM(NSInteger, ACPMediaEvent) {/*** Constant defining event type for AdBreak start*/ACPMediaEventAdBreakStart,}
Media resume
Copied to your clipboardpublic class MediaObjectKey: NSObject {public static let RESUMED = "media.resumed"}}
Copied to your clipboardpublic class MediaConstants: NSObject {@objc(AEPMediaObjectKey)public class MediaObjectKey: NSObject {public static let RESUMED = "media.resumed"}}
Copied to your clipboardFOUNDATION_EXPORT NSString* _Nonnull const ACPMediaKeyMediaResumed;
Copied to your clipboardpublic class MediaObjectKey: NSObject {public static let RESUMED = "media.resumed"}}
Copied to your clipboardpublic class MediaConstants: NSObject {@objc(AEPMediaObjectKey)public class MediaObjectKey: NSObject {public static let RESUMED = "media.resumed"}}
Copied to your clipboardFOUNDATION_EXPORT NSString* _Nonnull const ACPMediaKeyMediaResumed;