Edit in GitHubLog an issue

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

TypeAEP 3.x (Swift)AEP 3.x (Objective-C)ACP 2.x (Objective-C)
Primary Class
Media
AEPMobileMedia
ACPMedia

AEPMedia APIs

extensionVersion

Copied to your clipboard
static var extensionVersion: String

createTracker

Copied to your clipboard
static func createTracker()

createTrackerWithConfig

Copied to your clipboard
static func createTrackerWith(config: [String: Any]?)

createMediaObject

Copied to your clipboard
static func createMediaObjectWith(name: String, id: String, length: Double, streamType: String, mediaType: MediaType) -> [String: Any]?

createAdBreakObject

Copied to your clipboard
static func createAdBreakObjectWith(name: String, position: Int, startTime: Double) -> [String: Any]?

createAdObject

Copied to your clipboard
static func createAdObjectWith(name: String, id: String, position: Int, length: Double) -> [String: Any]?

createChapterObject

Copied to your clipboard
static func createChapterObjectWith(name: String, position: Int, length: Double, startTime: Double) -> [String: Any]?

createQoEObject

Copied to your clipboard
static func createQoEObjectWith(bitrate: Double, startupTime: Double, fps: Double, droppedFrames: Double) -> [String: Any]?

createStateObject

Copied to your clipboard
static func createStateObjectWith(stateName: String) -> [String: Any]

Media tracker API reference

trackEvent

Copied to your clipboard
func trackEvent(event: MediaEvent, info: [String: Any]?, metadata: [String: String]?)

trackSessionStart

Copied to your clipboard
public func trackSessionStart(info: [String: Any], metadata: [String: String]? = nil)

trackPlay

Copied to your clipboard
func trackPlay()

trackPause

Copied to your clipboard
func trackPause()

trackComplete

Copied to your clipboard
func trackComplete()

trackSessionEnd

Copied to your clipboard
func trackSessionEnd()

trackError

Copied to your clipboard
func trackError(errorId: String)

updateCurrentPlayhead

Copied to your clipboard
func updateCurrentPlayhead(time: Double)

updateQoEObject

Copied to your clipboard
func updateQoEObject(qoe: [String: Any])

Media constants

Media type

Copied to your clipboard
public enum MediaType: Int, RawRepresentable {
//Constant defining media type for Video streams
case Audio
//Constant defining media type for Audio streams
case Video
}

Stream type

Copied to your clipboard
public class StreamType: NSObject {
// Constant defining stream type for VOD streams.
public static let VOD = "vod"
}

Standard video constants

Copied to your clipboard
public class VideoMetadataKeys: NSObject {
public static let SHOW = "a.media.show"
}

Standard audio constants

Copied to your clipboard
public class AudioMetadataKeys: NSObject {
public static let ARTIST = "a.media.artist"
}

Standard ad constants

Copied to your clipboard
public class AdMetadataKeys: NSObject {
public static let ADVERTISER = "a.media.ad.advertiser"
}

Player state constants

Copied to your clipboard
public class PlayerState: NSObject {
public static let FULLSCREEN = "fullscreen"
}

Media events

Copied to your clipboard
public enum MediaEvent: Int, RawRepresentable {
// event type for AdBreak start
case AdBreakStart
}

Media resume

Copied to your clipboard
public class MediaObjectKey: NSObject {
public static let RESUMED = "media.resumed"
}
}
Was this helpful?
  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2024 Adobe. All rights reserved.