API reference
This document lists information about the previous versions of the Adobe Experience Platform Mobile SDKs. Check out this page for latest versions and solution support of the Mobile SDKs.
Media API reference
extensionVersion
The extensionVersion()
API returns the version of the Media extension that is registered with the Mobile Core extension.
To get the version of the Media extension, use the following code sample:
Swift
Syntax
Copied to your clipboard+ (nonnull NSString*) extensionVersion;
Example
Copied to your clipboardlet mediaExtensionVersion = ACPMedia.extensionVersion()
Objective-C
Syntax
Copied to your clipboard+ (NSString * _Nonnull)extensionVersion
Example
Copied to your clipboardNSString *mediaExtensionVersion = [ACPMedia extensionVersion];
Swift
Syntax
Copied to your clipboard+ (nonnull NSString*) extensionVersion;
Example
Copied to your clipboardlet mediaExtensionVersion = ACPMedia.extensionVersion()
Objective-C
Syntax
Copied to your clipboard+ (NSString * _Nonnull)extensionVersion
Example
Copied to your clipboardNSString *mediaExtensionVersion = [ACPMedia extensionVersion];
createTracker
Creates a media tracker instance that tracks the playback session. The tracker created should be used to track the streaming content and it sends periodic pings to the media analytics backend.
The createTracker function with a callback has been deprecated. Please use the synchronous version of this API instead.
The createTracker function returns the instance of MediaTracker for tracking a media session. The createTracker function with callback as a parameter has been deprecated.
If MobileCore.resetIdentities() is called in the implementation, the existing tracker will stop sending pings. You will need to create a new tracker to generate a new media session.
Java
Syntax
Copied to your clipboardpublic static MediaTracker createTracker()// Deprecatedpublic static void createTracker(AdobeCallback<MediaTracker> callback)
Example
Copied to your clipboardMediaTracker mediaTracker = Media.createTracker(); // Use the instance for tracking media.// DeprecatedMedia.createTracker(new AdobeCallback<MediaTracker>() {@Overridepublic void call(MediaTracker mediaTracker) {// Use the instance for tracking media.}});
The createTracker function returns the instance of ACPMediaTracker for tracking a media session. The createTracker function with callback as a parameter has been deprecated.
Swift
Syntax
Copied to your clipboardstatic func createTracker()
Example
Copied to your clipboardlet mediaTracker = ACPMedia.createTracker() // Use the instance for tracking media.// DeprecatedACPMedia.createTracker({mediaTracker in// Use the instance for tracking media.})
Objective-C
Syntax
Copied to your clipboard+(ACPMediaTracker* _Nullable) createTracker;// Deprecated+(void) createTracker: (void (^ _Nonnull) (ACPMediaTracker* _Nullable)) callback;
Example
Copied to your clipboardACPMediaTracker *mediaTracker = [ACPMedia createTracker]; // Use the instance for tracking media.// Deprecated[ACPMedia createTracker:^(ACPMediaTracker * _Nullable mediaTracker) {// Use the instance for tracking media.}];
The createTracker function returns the instance of MediaTracker for tracking a media session. The createTracker function with callback as a parameter has been deprecated.
If MobileCore.resetIdentities() is called in the implementation, the existing tracker will stop sending pings. You will need to create a new tracker to generate a new media session.
Java
Syntax
Copied to your clipboardpublic static MediaTracker createTracker()// Deprecatedpublic static void createTracker(AdobeCallback<MediaTracker> callback)
Example
Copied to your clipboardMediaTracker mediaTracker = Media.createTracker(); // Use the instance for tracking media.// DeprecatedMedia.createTracker(new AdobeCallback<MediaTracker>() {@Overridepublic void call(MediaTracker mediaTracker) {// Use the instance for tracking media.}});
The createTracker function returns the instance of ACPMediaTracker for tracking a media session. The createTracker function with callback as a parameter has been deprecated.
Swift
Syntax
Copied to your clipboardstatic func createTracker()
Example
Copied to your clipboardlet mediaTracker = ACPMedia.createTracker() // Use the instance for tracking media.// DeprecatedACPMedia.createTracker({mediaTracker in// Use the instance for tracking media.})
Objective-C
Syntax
Copied to your clipboard+(ACPMediaTracker* _Nullable) createTracker;// Deprecated+(void) createTracker: (void (^ _Nonnull) (ACPMediaTracker* _Nullable)) callback;
Example
Copied to your clipboardACPMediaTracker *mediaTracker = [ACPMedia createTracker]; // Use the instance for tracking media.// Deprecated[ACPMedia createTracker:^(ACPMediaTracker * _Nullable mediaTracker) {// Use the instance for tracking media.}];
createTrackerWithConfig
Creates a media tracker instance based on the configuration to track the playback session.
Key | Description | Value | Required |
---|---|---|---|
config.channel | Channel name for media. Set this to overwrite the channel name configured from launch for media tracked with this tracker instance. | String | No |
config.downloadedcontent | Creates a tracker instance to track downloaded media. Instead of sending periodic pings, the tracker only sends one ping for the entire content. | Boolean | No |
The createTracker function with a callback has been deprecated. Please use the synchronous version of this API instead.
Java
Optional configuration about the tracker can be passed to this function. The createTracker function returns the instance of MediaTracker with the configuration for tracking a media session. The createTracker function with callback as a parameter has been deprecated.
Syntax
Copied to your clipboardpublic class MediaConstants {public static final class Config {public static final String CHANNEL = "config.channel";public static final String DOWNLOADED_CONTENT = "config.downloadedcontent";}}public static MediaTracker createTracker(Map<String, Object> config)// Deprecatedpublic static void createTracker(Map<String, Object> config, final AdobeCallback<MediaTracker> callback)
Example
Copied to your clipboardHashMap<String, Object> config = new HashMap<String, Object>();config.put(MediaConstants.Config.CHANNEL, "custom-channel"); // Override channel configured in the Data Collection UIconfig.put(MediaConstants.Config.DOWNLOADED_CONTENT, true); // Creates downloaded content trackerMediaTracker mediaTracker = Media.createTracker(config); // Use the instance for tracking media.// DeprecatedMedia.createTracker(config, new AdobeCallback<MediaTracker>() {@Overridepublic void call(MediaTracker mediaTracker) {// Use the instance for tracking media.}});
Optional configuration about the tracker can be passed to this function. The createTracker function returns the instance of ACPMediaTracker with the configuration for tracking a media session. The createTracker function with callback as a parameter has been deprecated.
Swift
Syntax
Copied to your clipboardstatic func createTracker(withConfig config: [AnyHashable : Any]?)
Example
Copied to your clipboardvar config: [String: Any] = [:]config[ACPMediaKeyConfigChannel] = "custom-channel" // Override channel configured in the Data Collection UIconfig[ACPMediaKeyConfigDownloadedContent] = true // Creates downloaded content trackerlet mediaTracker = ACPMedia.createTrackerWithConfig(config); // Use the instance for tracking media.// DeprecatedACPMedia.createTrackerWithConfig(config, {mediaTracker in// Use the instance for tracking media.}
Objective-C
Syntax
Copied to your clipboardFOUNDATION_EXPORT NSString* _Nonnull const ACPMediaKeyConfigChannel;FOUNDATION_EXPORT NSString* _Nonnull const ACPMediaKeyConfigDownloadedContent;+ (ACPMediaTracker* _Nullable) createTrackerWithConfig: (NSDictionary* _Nullable) config;// Deprecated+ (void) createTrackerWithConfig: (NSDictionary* _Nullable) configcallback: (void (^ _Nonnull) (ACPMediaTracker* _Nullable)) callback;
Example
Copied to your clipboardNSMutableDictionary* config = [NSMutableDictionary dictionary];config[ACPMediaKeyConfigChannel] = @"custom-channel"; // Override channel configured in the Data Collection UIconfig[ACPMediaKeyConfigDownloadedContent] = @YES; // Creates downloaded content trackerACPMediaTracker *mediaTracker = [ACPMedia createTrackerWithConfig:config]; // Use the instance for tracking media.// Deprecated[ACPMedia createTrackerWithConfig: configcallback:^(ACPMediaTracker * _Nullable mediaTracker) {// Use the instance for tracking media.}];
JavaScript
Copied to your clipboardvar config = new Object();config[ACPMediaConstants.ACPMediaKeyConfigChannel] = "customer-channel"; // Override channel configured in the Data Collection UIconfig[ACPMediaConstants.ACPMediaKeyConfigDownloadedContent] = true; // Creates downloaded content trackerACPMedia.createTrackerWithConfig(config).then(tracker =>this.setState({currentTracker: tracker}));
Java
Optional configuration about the tracker can be passed to this function. The createTracker function returns the instance of MediaTracker with the configuration for tracking a media session. The createTracker function with callback as a parameter has been deprecated.
Syntax
Copied to your clipboardpublic class MediaConstants {public static final class Config {public static final String CHANNEL = "config.channel";public static final String DOWNLOADED_CONTENT = "config.downloadedcontent";}}public static MediaTracker createTracker(Map<String, Object> config)// Deprecatedpublic static void createTracker(Map<String, Object> config, final AdobeCallback<MediaTracker> callback)
Example
Copied to your clipboardHashMap<String, Object> config = new HashMap<String, Object>();config.put(MediaConstants.Config.CHANNEL, "custom-channel"); // Override channel configured in the Data Collection UIconfig.put(MediaConstants.Config.DOWNLOADED_CONTENT, true); // Creates downloaded content trackerMediaTracker mediaTracker = Media.createTracker(config); // Use the instance for tracking media.// DeprecatedMedia.createTracker(config, new AdobeCallback<MediaTracker>() {@Overridepublic void call(MediaTracker mediaTracker) {// Use the instance for tracking media.}});
Optional configuration about the tracker can be passed to this function. The createTracker function returns the instance of ACPMediaTracker with the configuration for tracking a media session. The createTracker function with callback as a parameter has been deprecated.
Swift
Syntax
Copied to your clipboardstatic func createTracker(withConfig config: [AnyHashable : Any]?)
Example
Copied to your clipboardvar config: [String: Any] = [:]config[ACPMediaKeyConfigChannel] = "custom-channel" // Override channel configured in the Data Collection UIconfig[ACPMediaKeyConfigDownloadedContent] = true // Creates downloaded content trackerlet mediaTracker = ACPMedia.createTrackerWithConfig(config); // Use the instance for tracking media.// DeprecatedACPMedia.createTrackerWithConfig(config, {mediaTracker in// Use the instance for tracking media.}
Objective-C
Syntax
Copied to your clipboardFOUNDATION_EXPORT NSString* _Nonnull const ACPMediaKeyConfigChannel;FOUNDATION_EXPORT NSString* _Nonnull const ACPMediaKeyConfigDownloadedContent;+ (ACPMediaTracker* _Nullable) createTrackerWithConfig: (NSDictionary* _Nullable) config;// Deprecated+ (void) createTrackerWithConfig: (NSDictionary* _Nullable) configcallback: (void (^ _Nonnull) (ACPMediaTracker* _Nullable)) callback;
Example
Copied to your clipboardNSMutableDictionary* config = [NSMutableDictionary dictionary];config[ACPMediaKeyConfigChannel] = @"custom-channel"; // Override channel configured in the Data Collection UIconfig[ACPMediaKeyConfigDownloadedContent] = @YES; // Creates downloaded content trackerACPMediaTracker *mediaTracker = [ACPMedia createTrackerWithConfig:config]; // Use the instance for tracking media.// Deprecated[ACPMedia createTrackerWithConfig: configcallback:^(ACPMediaTracker * _Nullable mediaTracker) {// Use the instance for tracking media.}];
JavaScript
Copied to your clipboardvar config = new Object();config[ACPMediaConstants.ACPMediaKeyConfigChannel] = "customer-channel"; // Override channel configured in the Data Collection UIconfig[ACPMediaConstants.ACPMediaKeyConfigDownloadedContent] = true; // Creates downloaded content trackerACPMedia.createTrackerWithConfig(config).then(tracker =>this.setState({currentTracker: tracker}));
createMediaObject
Creates an instance of the Media object.
Variable Name | Description | Required |
---|---|---|
name | Media name | Yes |
mediaId | Media unique identifier | Yes |
length | Media length | Yes |
streamType | Yes | |
mediaType | Yes |
Java
Returns a HashMap instance that contains information about the media.
Syntax
Copied to your clipboardpublic static HashMap<String, Object> createMediaObject(String name,String mediaId,Double length,String streamType,MediaType mediaType);
Example
Copied to your clipboardHashMap<String, Object> mediaInfo = Media.createMediaObject("video-name","video-id",60D,MediaConstants.StreamType.VOD,Media.MediaType.Video);
Returns an NSDictionary instance that contains information about the media.
Swift
Syntax
Copied to your clipboardstatic func createMediaObject(withName name: String, mediaId: String, length: Double, streamType: String, mediaType: ACPMediaType)
Example
Copied to your clipboardlet mediaObject = ACPMedia.createMediaObject(withName: "video-name", mediaId: "video-id",length: Double(60),streamType: ACPMediaStreamTypeVod,mediaType:ACPMediaType.video)
Objective-C
Syntax
Copied to your clipboard+ (NSDictionary* _Nonnull) createMediaObjectWithName: (NSString* _Nonnull) namemediaId: (NSString* _Nonnull) mediaIdlength: (double) lengthstreamType: (NSString* _Nonnull) streamTypemediaType: (ACPMediaType) mediaType;
Example
Copied to your clipboardNSDictionary *mediaObject = [ACPMedia createMediaObjectWithName: @"video-name"mediaId: @"video-id"length: 60streamType: ACPMediaStreamTypeVodmediaType: ACPMediaTypeVideo];
Java
Returns a HashMap instance that contains information about the media.
Syntax
Copied to your clipboardpublic static HashMap<String, Object> createMediaObject(String name,String mediaId,Double length,String streamType,MediaType mediaType);
Example
Copied to your clipboardHashMap<String, Object> mediaInfo = Media.createMediaObject("video-name","video-id",60D,MediaConstants.StreamType.VOD,Media.MediaType.Video);
Returns an NSDictionary instance that contains information about the media.
Swift
Syntax
Copied to your clipboardstatic func createMediaObject(withName name: String, mediaId: String, length: Double, streamType: String, mediaType: ACPMediaType)
Example
Copied to your clipboardlet mediaObject = ACPMedia.createMediaObject(withName: "video-name", mediaId: "video-id",length: Double(60),streamType: ACPMediaStreamTypeVod,mediaType:ACPMediaType.video)
Objective-C
Syntax
Copied to your clipboard+ (NSDictionary* _Nonnull) createMediaObjectWithName: (NSString* _Nonnull) namemediaId: (NSString* _Nonnull) mediaIdlength: (double) lengthstreamType: (NSString* _Nonnull) streamTypemediaType: (ACPMediaType) mediaType;
Example
Copied to your clipboardNSDictionary *mediaObject = [ACPMedia createMediaObjectWithName: @"video-name"mediaId: @"video-id"length: 60streamType: ACPMediaStreamTypeVodmediaType: ACPMediaTypeVideo];
createAdBreakObject
Creates an instance of the AdBreak object.
Variable Name | Description | Required |
---|---|---|
name | Ad break name such as pre-roll, mid-roll, and post-roll. | Yes |
position | The number position of the ad break within the content, starting with 1. | Yes |
startTime | Playhead value at the start of the ad break. | Yes |
Java
Returns a HashMap instance that contains information about the ad break.
Syntax
Copied to your clipboardpublic static HashMap<String, Object> createAdBreakObject(String name, Long position, Double startTime);
Example
Copied to your clipboardHashMap<String, Object> adBreakObject = Media.createAdBreakObject("adbreak-name", 1L, 0D);
Returns an NSDictionary instance that contains information about the ad break.
Swift
Syntax
Copied to your clipboardstatic func createAdBreakObject(withName name: String,position: Double, tartTime: Double)
Example
Copied to your clipboardlet adBreakObject = ACPMedia.createAdBreakObject(withName: "adbreak-name",position: 1,startTime: 0)
Objective-C
Syntax
Copied to your clipboard+ (NSDictionary* _Nonnull) createAdBreakObjectWithName: (NSString* _Nonnull) nameposition: (double) positionstartTime: (double) startTime;
Example
Copied to your clipboardNSDictionary *adBreakObject = [ACPMedia createAdBreakObjectWithName: @"adbreak-name"position: 1startTime: 0];
Java
Returns a HashMap instance that contains information about the ad break.
Syntax
Copied to your clipboardpublic static HashMap<String, Object> createAdBreakObject(String name, Long position, Double startTime);
Example
Copied to your clipboardHashMap<String, Object> adBreakObject = Media.createAdBreakObject("adbreak-name", 1L, 0D);
Returns an NSDictionary instance that contains information about the ad break.
Swift
Syntax
Copied to your clipboardstatic func createAdBreakObject(withName name: String,position: Double, tartTime: Double)
Example
Copied to your clipboardlet adBreakObject = ACPMedia.createAdBreakObject(withName: "adbreak-name",position: 1,startTime: 0)
Objective-C
Syntax
Copied to your clipboard+ (NSDictionary* _Nonnull) createAdBreakObjectWithName: (NSString* _Nonnull) nameposition: (double) positionstartTime: (double) startTime;
Example
Copied to your clipboardNSDictionary *adBreakObject = [ACPMedia createAdBreakObjectWithName: @"adbreak-name"position: 1startTime: 0];
createAdObject
Creates an instance of the Ad object.
Variable Name | Description | Required |
---|---|---|
name | Friendly name of the ad. | Yes |
adId | Unique identifier for the ad. | Yes |
position | The number position of the ad within the ad break, starting with 1. | Yes |
length | Ad length | Yes |
Java
Returns a HashMap instance that contains information about the ad.
Syntax
Copied to your clipboardpublic static HashMap<String, Object> createAdObject(String name, String adId, Long position, Double length);
Example
Copied to your clipboardHashMap<String, Object> adInfo = Media.createAdObject("ad-name", "ad-id", 1L, 15D);
Returns an NSDictionary instance that contains information about the ad.
Swift
Syntax
Copied to your clipboardstatic func createAdObject(withName name: String,adId: String,position: Double,length: Double)
Example
Copied to your clipboardlet adObject = ACPMedia.createAdObject(withName: "ad-name",adId: "ad-id",position: 1,length: 15)
Objective-C
Syntax
Copied to your clipboard+ (NSDictionary* _Nonnull) createAdObjectWithName: (NSString* _Nonnull) nameadId: (NSString* _Nonnull) adIdposition: (double) positionlength: (double) length;
Example
Copied to your clipboardNSDictionary *adObject = [ACPMedia createAdObjectWithName: @"ad-name"adId: @"ad-id"position: 1length: 15];
Java
Returns a HashMap instance that contains information about the ad.
Syntax
Copied to your clipboardpublic static HashMap<String, Object> createAdObject(String name, String adId, Long position, Double length);
Example
Copied to your clipboardHashMap<String, Object> adInfo = Media.createAdObject("ad-name", "ad-id", 1L, 15D);
Returns an NSDictionary instance that contains information about the ad.
Swift
Syntax
Copied to your clipboardstatic func createAdObject(withName name: String,adId: String,position: Double,length: Double)
Example
Copied to your clipboardlet adObject = ACPMedia.createAdObject(withName: "ad-name",adId: "ad-id",position: 1,length: 15)
Objective-C
Syntax
Copied to your clipboard+ (NSDictionary* _Nonnull) createAdObjectWithName: (NSString* _Nonnull) nameadId: (NSString* _Nonnull) adIdposition: (double) positionlength: (double) length;
Example
Copied to your clipboardNSDictionary *adObject = [ACPMedia createAdObjectWithName: @"ad-name"adId: @"ad-id"position: 1length: 15];
createChapterObject
Creates an instance of the Chapter object.
Variable Name | Description | Required |
---|---|---|
name | Chapter name | Yes |
position | The number position of the chapter within the content, starting with 1. | Yes |
length | Chapter length | Yes |
startTime | Playhead value at the start of the chapter | Yes |
Java
Returns a HashMap instance that contains information about the chapter.
Syntax
Copied to your clipboardpublic static HashMap<String, Object> createChapterObject(String name,Long position,Double length,Double startTime);
Example
Copied to your clipboardHashMap<String, Object> chapterInfo = Media.createChapterObject("chapter-name", 1L, 60D, 0D);
Returns an NSDictionary instance that contains information about the chapter.
Swift
Syntax
Copied to your clipboardstatic func createChapterObject(withName name: String,position: Double,length: Double,startTime: Double)
Example
Copied to your clipboardlet chapterObject = ACPMedia.createChapterObject(withName: "chapter-name", position: 1, length: 60, startTime: 0)
Objective-C
Syntax
Copied to your clipboard+ (NSDictionary* _Nonnull) createChapterObjectWithName: (NSString* _Nonnull) nameposition: (double) positionlength: (double) lengthstartTime: (double) startTime;
Example
Copied to your clipboardNSDictionary *chapterObject = [ACPMedia createChapterObjectWithName: @"chapter-name"position: 1length: 60startTime: 0];
Java
Returns a HashMap instance that contains information about the chapter.
Syntax
Copied to your clipboardpublic static HashMap<String, Object> createChapterObject(String name,Long position,Double length,Double startTime);
Example
Copied to your clipboardHashMap<String, Object> chapterInfo = Media.createChapterObject("chapter-name", 1L, 60D, 0D);
Returns an NSDictionary instance that contains information about the chapter.
Swift
Syntax
Copied to your clipboardstatic func createChapterObject(withName name: String,position: Double,length: Double,startTime: Double)
Example
Copied to your clipboardlet chapterObject = ACPMedia.createChapterObject(withName: "chapter-name", position: 1, length: 60, startTime: 0)
Objective-C
Syntax
Copied to your clipboard+ (NSDictionary* _Nonnull) createChapterObjectWithName: (NSString* _Nonnull) nameposition: (double) positionlength: (double) lengthstartTime: (double) startTime;
Example
Copied to your clipboardNSDictionary *chapterObject = [ACPMedia createChapterObjectWithName: @"chapter-name"position: 1length: 60startTime: 0];
createQoEObject
Creates an instance of the QoE object.
Variable Name | Description | Required |
---|---|---|
bitrate | Current bitrate | Yes |
startupTime | Startup time | Yes |
fps | FPS value | Yes |
droppedFrames | Number of dropped frames | Yes |
All the QoE values bitrate
, startupTime
, fps
, droppedFrames
would be converted to long
for reporting purposes.
Java
Returns a HashMap instance that contains information about the quality of experience.
Syntax
Copied to your clipboardpublic static HashMap<String, Object> createQoEObject(Long bitrate,Double startupTime,Double fps,Long droppedFrames);
Example
Copied to your clipboardHashMap<String, Object> qoeInfo = Media.createQoEObject(10000000L, 2D, 23D, 10D);
Returns an NSDictionary instance that contains information about the quality of experience.
Swift
Syntax
Copied to your clipboardstatic func createQoEObject(withBitrate bitrate: Double,startupTime: Double,fps: Double,droppedFrames: Double)
Example
Copied to your clipboardlet qoeObject = ACPMedia.createQoEObject(withBitrate: 10000000, startupTime: 2, fps: 23, droppedFrames: 10)
Objective-C
Syntax
Copied to your clipboard+ (NSDictionary* _Nonnull) createQoEObjectWithBitrate: (double) bitratestartupTime: (double) startupTimefps: (double) fpsdroppedFrames: (double) droppedFrames;
Example
Copied to your clipboardNSDictionary *qoeObject = [ACPMedia createQoEObjectWithBitrate: 10000000startupTime: 2fps: 23droppedFrames: 10];
Java
Returns a HashMap instance that contains information about the quality of experience.
Syntax
Copied to your clipboardpublic static HashMap<String, Object> createQoEObject(Long bitrate,Double startupTime,Double fps,Long droppedFrames);
Example
Copied to your clipboardHashMap<String, Object> qoeInfo = Media.createQoEObject(10000000L, 2D, 23D, 10D);
Returns an NSDictionary instance that contains information about the quality of experience.
Swift
Syntax
Copied to your clipboardstatic func createQoEObject(withBitrate bitrate: Double,startupTime: Double,fps: Double,droppedFrames: Double)
Example
Copied to your clipboardlet qoeObject = ACPMedia.createQoEObject(withBitrate: 10000000, startupTime: 2, fps: 23, droppedFrames: 10)
Objective-C
Syntax
Copied to your clipboard+ (NSDictionary* _Nonnull) createQoEObjectWithBitrate: (double) bitratestartupTime: (double) startupTimefps: (double) fpsdroppedFrames: (double) droppedFrames;
Example
Copied to your clipboardNSDictionary *qoeObject = [ACPMedia createQoEObjectWithBitrate: 10000000startupTime: 2fps: 23droppedFrames: 10];
createStateObject
Creates an instance of the Player State object.
Variable Name | Description | Required |
---|---|---|
name | State name(Use Player State constants to track standard player states) | Yes |
Returns an NSDictionary instance that contains information about the player state.
Swift
Syntax
Copied to your clipboardstatic func createStateObject(withName stateName: String)
Example
Copied to your clipboardlet playerStateObject = ACPMedia.createStateObject(withName: "fullscreen")
Objective-C
Syntax
Copied to your clipboard+ (NSDictionary* _Nonnull) createStateObjectWithName: (NSString* _Nonnull) stateName;
Example
Copied to your clipboardNSDictionary *playerStateObject = [ACPMedia createStateObjectWithName: @"fullscreen"];
Java
Returns a HashMap instance that contains information about the State.
Syntax
Copied to your clipboardpublic static HashMap<String, Object> createStateObject(String stateName);
Example
Copied to your clipboardHashMap<String, Object> playerStateInfo = Media.createStateObject("fullscreen");
Returns an NSDictionary instance that contains information about the player state.
Swift
Syntax
Copied to your clipboardstatic func createStateObject(withName stateName: String)
Example
Copied to your clipboardlet playerStateObject = ACPMedia.createStateObject(withName: "fullscreen")
Objective-C
Syntax
Copied to your clipboard+ (NSDictionary* _Nonnull) createStateObjectWithName: (NSString* _Nonnull) stateName;
Example
Copied to your clipboardNSDictionary *playerStateObject = [ACPMedia createStateObjectWithName: @"fullscreen"];
Media tracker API reference
trackSessionStart
Tracks the intention to start playback. This starts a tracking session on the media tracker instance. To learn how to resume a previously closed session, please read the media resume guide
Variable Name | Description | Required |
---|---|---|
mediaInfo | Media information created using the createMediaObject method. | Yes |
contextData | Optional Media context data. For standard metadata keys, use standard video constants or standard audio constants. | No |
Java
Syntax
Copied to your clipboardpublic void trackSessionStart(Map<String, Object> mediaInfo, Map<String, String> contextData);
Example
Copied to your clipboardHashMap<String, Object> mediaObject = Media.createMediaObject("media-name", "media-id", 60D, MediaConstants.StreamType.VOD, Media.MediaType.Video);HashMap<String, String> mediaMetadata = new HashMap<String, String>();// Standard metadata keys provided by adobe.mediaMetadata.put(MediaConstants.VideoMetadataKeys.EPISODE, "Sample Episode");mediaMetadata.put(MediaConstants.VideoMetadataKeys.SHOW, "Sample Show");// Custom metadata keysmediaMetadata.put("isUserLoggedIn", "false");mediaMetadata.put("tvStation", "Sample TV Station");_tracker.trackSessionStart(mediaInfo, mediaMetadata);
Swift
Syntax
Copied to your clipboardfunc trackSessionStart(_ mediaInfo: [AnyHashable : Any], data contextData: [AnyHashable : Any]?)
Example
Copied to your clipboardlet mediaObject = ACPMedia.createMediaObject(withName: "media-name", mediaId: "media-id", length: 60, streamType: ACPMediaStreamTypeVod, mediaType:ACPMediaType.video)// Standard metadata keys provided by adobe.var mediaMetadata = [ACPVideoMetadataKeyShow: "Sample show", ACPVideoMetadataKeySeason: "Sample season"]// Custom metadata keysmediaMetadata["isUserLoggedIn"] = "false"mediaMetadata["tvStation"] = "Sample TV station"_tracker.trackSessionStart(mediaObject, data: mediaMetadata)
Objective-C
Syntax
Copied to your clipboard- (void) trackSessionStart: (NSDictionary* _Nonnull) mediaInfo data: (NSDictionary* _Nullable) contextData;
Example
Copied to your clipboardNSDictionary *mediaObject = [ACPMedia createMediaObjectWithName:@"media-name" mediaId:@"media-id" length:60 streamType:ACPMediaStreamTypeVod mediaType:ACPMediaTypeVideo];NSMutableDictionary *mediaMetadata = [[NSMutableDictionary alloc] init];// Standard metadata keys provided by adobe.[mediaMetadata setObject:@"Sample show" forKey:ACPVideoMetadataKeyShow];[mediaMetadata setObject:@"Sample season" forKey:ACPVideoMetadataKeySeason];// Custom metadata keys[mediaMetadata setObject:@"false" forKey:@"isUserLoggedIn"];[mediaMetadata setObject:@"Sample TV station" forKey:@"tvStation"];[_tracker trackSessionStart:mediaObject data:mediaMetadata];
JavaScript
Copied to your clipboardlet mediaObject = ACPMedia.createMediaObject("media-name", "media-id", 60, ACPMediaConstants.ACPMediaStreamTypeVod, ACPMediaType.Video);var mediaMetadata = new Object();mediaMetadata[ACPMediaConstants.ACPVideoMetadataKeyShow] = "Sample Show";mediaMetadata[ACPMediaConstants.ACPVideoMetadataKeySeason] = "Sample Season";// Custom metadata keysmediaMetadata["isUserLoggedIn"] = "false";mediaMetadata["tvStation"] = "Sample TV station";tracker.trackSessionStart(mediaObject, mediaMetadata);
Java
Syntax
Copied to your clipboardpublic void trackSessionStart(Map<String, Object> mediaInfo, Map<String, String> contextData);
Example
Copied to your clipboardHashMap<String, Object> mediaObject = Media.createMediaObject("media-name", "media-id", 60D, MediaConstants.StreamType.VOD, Media.MediaType.Video);HashMap<String, String> mediaMetadata = new HashMap<String, String>();// Standard metadata keys provided by adobe.mediaMetadata.put(MediaConstants.VideoMetadataKeys.EPISODE, "Sample Episode");mediaMetadata.put(MediaConstants.VideoMetadataKeys.SHOW, "Sample Show");// Custom metadata keysmediaMetadata.put("isUserLoggedIn", "false");mediaMetadata.put("tvStation", "Sample TV Station");_tracker.trackSessionStart(mediaInfo, mediaMetadata);
Swift
Syntax
Copied to your clipboardfunc trackSessionStart(_ mediaInfo: [AnyHashable : Any], data contextData: [AnyHashable : Any]?)
Example
Copied to your clipboardlet mediaObject = ACPMedia.createMediaObject(withName: "media-name", mediaId: "media-id", length: 60, streamType: ACPMediaStreamTypeVod, mediaType:ACPMediaType.video)// Standard metadata keys provided by adobe.var mediaMetadata = [ACPVideoMetadataKeyShow: "Sample show", ACPVideoMetadataKeySeason: "Sample season"]// Custom metadata keysmediaMetadata["isUserLoggedIn"] = "false"mediaMetadata["tvStation"] = "Sample TV station"_tracker.trackSessionStart(mediaObject, data: mediaMetadata)
Objective-C
Syntax
Copied to your clipboard- (void) trackSessionStart: (NSDictionary* _Nonnull) mediaInfo data: (NSDictionary* _Nullable) contextData;
Example
Copied to your clipboardNSDictionary *mediaObject = [ACPMedia createMediaObjectWithName:@"media-name" mediaId:@"media-id" length:60 streamType:ACPMediaStreamTypeVod mediaType:ACPMediaTypeVideo];NSMutableDictionary *mediaMetadata = [[NSMutableDictionary alloc] init];// Standard metadata keys provided by adobe.[mediaMetadata setObject:@"Sample show" forKey:ACPVideoMetadataKeyShow];[mediaMetadata setObject:@"Sample season" forKey:ACPVideoMetadataKeySeason];// Custom metadata keys[mediaMetadata setObject:@"false" forKey:@"isUserLoggedIn"];[mediaMetadata setObject:@"Sample TV station" forKey:@"tvStation"];[_tracker trackSessionStart:mediaObject data:mediaMetadata];
JavaScript
Copied to your clipboardlet mediaObject = ACPMedia.createMediaObject("media-name", "media-id", 60, ACPMediaConstants.ACPMediaStreamTypeVod, ACPMediaType.Video);var mediaMetadata = new Object();mediaMetadata[ACPMediaConstants.ACPVideoMetadataKeyShow] = "Sample Show";mediaMetadata[ACPMediaConstants.ACPVideoMetadataKeySeason] = "Sample Season";// Custom metadata keysmediaMetadata["isUserLoggedIn"] = "false";mediaMetadata["tvStation"] = "Sample TV station";tracker.trackSessionStart(mediaObject, mediaMetadata);
trackPlay
Tracks the media play, or resume, after a previous pause.
Java
Syntax
Copied to your clipboardpublic void trackPlay();
Example
Copied to your clipboard_tracker.trackPlay();
trackPause
Tracks the media pause.
Java
Syntax
Copied to your clipboardpublic void trackPause();
Example
Copied to your clipboard_tracker.trackPause();
trackComplete
Tracks media complete. Call this method only when the media has been completely viewed.
Java
Syntax
Copied to your clipboardpublic void trackComplete();
Example
Copied to your clipboard_tracker.trackComplete();
trackSessionEnd
Tracks the end of a viewing session. Call this method even if the user does not view the media to completion.
Java
Syntax
Copied to your clipboardpublic void trackSessionEnd();
Example
Copied to your clipboard_tracker.trackSessionEnd();
trackError
Tracks an error in media playback.
Variable Name | Description | Required |
---|---|---|
errorId | Error Information | Yes |
Java
Syntax
Copied to your clipboardpublic void trackError(String errorId);
Example
Copied to your clipboard_tracker.trackError("errorId");
trackEvent
Tracks media events.
Variable Name | Description |
---|---|
event | |
info | For an AdBreakStart event, the adBreak information is created by using the createAdBreakObject method. For an AdStart event, the Ad information is created by using the createAdObject method. For ChapterStart event, the Chapter information is created by using the createChapterObject method. For StateStart and StateEnd event, the State information is created by using the createStateObject method. |
data | Optional context data can be provided for AdStart and ChapterStart events. This is not required for other events. |
Java
Syntax
Copied to your clipboardpublic void trackEvent(Media.Event event,Map<String, Object> info,Map<String, String> data);
Examples
Tracking player states
Copied to your clipboard// StateStartHashMap<String, Object> stateObject = Media.createStateObject("fullscreen");_tracker.trackEvent(Media.Event.StateStart, stateObject, null);// StateEndHashMap<String, Object> stateObject = Media.createStateObject("fullscreen");_tracker.trackEvent(Media.Event.StateEnd, stateObject, null);
Tracking ad breaks
Copied to your clipboard// AdBreakStartHashMap<String, Object> adBreakObject = Media.createAdBreakObject("adbreak-name", 1L, 0D);_tracker.trackEvent(Media.Event.AdBreakStart, adBreakObject, null);// AdBreakComplete_tracker.trackEvent(Media.Event.AdBreakComplete, null, null);
Tracking ads
Copied to your clipboard// AdStartHashMap<String, Object> adObject = Media.createAdObject("ad-name", "ad-id", 1L, 15D);HashMap<String, String> adMetadata = new HashMap<String, String>();// Standard metadata keys provided by adobe.adMetadata.put(MediaConstants.AdMetadataKeys.ADVERTISER, "Sample Advertiser");adMetadata.put(MediaConstants.AdMetadataKeys.CAMPAIGN_ID, "Sample Campaign");// Custom metadata keysadMetadata.put("affiliate", "Sample affiliate");_tracker.trackEvent(Media.Event.AdStart, adObject, adMetadata);// AdComplete_tracker.trackEvent(Media.Event.AdComplete, null, null);// AdSkip_tracker.trackEvent(Media.Event.AdSkip, null, null);
Tracking chapters
Copied to your clipboard// ChapterStartHashMap<String, Object> chapterObject = Media.createChapterObject("chapter-name", 1L, 60D, 0D);HashMap<String, String> chapterMetadata = new HashMap<String, String>();chapterMetadata.put("segmentType", "Sample segment type");_tracker.trackEvent(Media.Event.ChapterStart, chapterDataInfo, chapterMetadata);// ChapterComplete_tracker.trackEvent(Media.Event.ChapterComplete, null, null);// ChapterSkip_tracker.trackEvent(Media.Event.ChapterSkip, null, null);
Tracking playback events
Copied to your clipboard// BufferStart_tracker.trackEvent(Media.Event.BufferStart, null, null);// BufferComplete_tracker.trackEvent(Media.Event.BufferComplete, null, null);// SeekStart_tracker.trackEvent(Media.Event.SeekStart, null, null);// SeekComplete_tracker.trackEvent(Media.Event.SeekComplete, null, null);
Tracking bitrate changes
Copied to your clipboard// If the new bitrate value is available provide it to the tracker.HashMap<String, Object> qoeObject = Media.createQoEObject(2000000L, 2D, 25D, 10D);_tracker.updateQoEObject(qoeObject);// Bitrate change_tracker.trackEvent(Media.Event.BitrateChange, null, null);
Swift
Syntax
Copied to your clipboardfunc trackEvent(_ event: ACPMediaEvent, info: [AnyHashable : Any]?, data: [AnyHashable : Any]?)
Examples
Tracking player states
Copied to your clipboard// StateStartlet stateObject = ACPMedia.createStateObject(withName: "fullscreen")_tracker.trackEvent(ACPMediaEvent.stateStart, info: stateObject, data: nil)// StateEndlet stateObject = ACPMedia.createStateObject(withName: "fullscreen")_tracker.trackEvent(ACPMediaEvent.stateEnd, info: stateObject, data: nil)
Tracking ad breaks
Copied to your clipboard// AdBreakStartlet adBreakObject = ACPMedia.createAdBreakObject(withName: "adbreak-name", position: 1, startTime: 0)_tracker.trackEvent(ACPMediaEvent.adBreakStart, mediaObject: adBreakObject, data: nil)// AdBreakComplete_tracker.trackEvent(ACPMediaEvent.adBreakComplete, mediaObject: nil, data: nil)
Tracking ads
Copied to your clipboard// AdStartlet adObject = ACPMedia.createAdObject(withName: "ad-name", adId: "ad-id", position: 1, length: 15)// Standard metadata keys provided by adobe.var adMetadata = [ACPAdMetadataKeyAdvertiser: "Sample Advertiser", ACPAdMetadataKeyCampaignId: "Sample Campaign"]// Custom metadata keysadMetadata["affiliate"] = "Sample affiliate"_tracker.trackEvent(ACPMediaEvent.adStart, mediaObject: adObject, data: adMetadata)// AdComplete_tracker.trackEvent(ACPMediaEvent.adComplete, mediaObject: nil, data: nil)// AdSkip_tracker.trackEvent(ACPMediaEvent.adSkip, mediaObject: nil, data: nil)
Tracking chapters
Copied to your clipboard// ChapterStartlet chapterObject = ACPMedia.createChapterObject(withName: "chapter-name", position: 1, length: 60, startTime: 0)let chapterMetadata = ["Sample segment type": "segmentType"];_tracker.trackEvent(ACPMediaEvent.chapterStart, mediaObject: chapterObject, data: chapterMetadata)// ChapterComplete_tracker.trackEvent(ACPMediaEvent.chapterComplete, mediaObject: nil, data: nil)// ChapterSkip_tracker.trackEvent(ACPMediaEvent.chapterSkip, mediaObject: nil, data: nil)
Tracking playback events
Copied to your clipboard// BufferStart_tracker.trackEvent(ACPMediaEvent.bufferStart, mediaObject: nil, data: nil)// BufferComplete_tracker.trackEvent(ACPMediaEvent.bufferComplete, mediaObject: nil, data: nil)// SeekStart_tracker.trackEvent(ACPMediaEvent.seekStart, mediaObject: nil, data: nil)// SeekComplete_tracker.trackEvent(ACPMediaEvent.seekComplete, mediaObject: nil, data: nil)
Tracking bitrate change
Copied to your clipboard// If the new bitrate value is available provide it to the tracker.let qoeObject = ACPMedia.createQoEObject(withBitrate: 2000000, startupTime: 2, fps: 25, droppedFrames: 10)_tracker.updateQoEObject(qoeObject)// Bitrate change_tracker.trackEvent(ACPMediaEvent.bitrateChange, mediaObject: nil, data: nil)
Objective-C
Syntax
Copied to your clipboard- (void) trackEvent: (ACPMediaEvent) eventinfo: (NSDictionary* _Nullable) infodata: (NSDictionary* _Nullable) data;
Examples
Tracking player states
Copied to your clipboard// StateStartNSDictionary* stateObject = [ACPMedia createStateObjectWithName:@"fullscreen"];[_tracker trackEvent:ACPMediaEventStateStart mediaObject:stateObject data:nil];// StateEndNSDictionary* stateObject = [ACPMedia createStateObjectWithName:@"fullscreen"];[_tracker trackEvent:ACPMediaEventStateEnd mediaObject:stateObject data:nil];
Tracking ad breaks
Copied to your clipboard// AdBreakStartNSDictionary* adBreakObject = [ACPMedia createAdBreakObjectWithName:@"adbreak-name" position:1 startTime:0];[_tracker trackEvent:ACPMediaEventAdBreakStart mediaObject:adBreakObject data:nil];// AdBreakComplete[_tracker trackEvent:ACPMediaEventAdBreakComplete mediaObject:nil data:nil];
Tracking ads
Copied to your clipboard// AdStartNSDictionary* adObject = [ACPMedia createAdObjectWithName:@"ad-name" adId:@"ad-id" position:1 length:15];NSMutableDictionary* adMetadata = [[NSMutableDictionary alloc] init];// Standard metadata keys provided by adobe.[adMetadata setObject:@"Sample Advertiser" forKey:ACPAdMetadataKeyAdvertiser];[adMetadata setObject:@"Sample Campaign" forKey:ACPAdMetadataKeyCampaignId];// Custom metadata keys[adMetadata setObject:@"Sample affiliate" forKey:@"affiliate"];[_tracker trackEvent:ACPMediaEventAdStart mediaObject:adObject data:adMetadata];// AdComplete[_tracker trackEvent:ACPMediaEventAdComplete mediaObject:nil data:nil];// AdSkip[_tracker trackEvent:ACPMediaEventAdSkip mediaObject:nil data:nil];
Tracking chapters
Copied to your clipboard// ChapterStartNSDictionary* chapterObject = [ACPMedia createChapterObjectWithName:@"chapter-name" position:1 length:30 startTime:0];NSMutableDictionary *chapterMetadata = [[NSMutableDictionary alloc] init];[chapterMetadata setObject:@"Sample segment type" forKey:@"segmentType"];[_tracker trackEvent:ACPMediaEventChapterStart mediaObject:chapterObject data:chapterMetadata];// ChapterComplete[_tracker trackEvent:ACPMediaEventChapterComplete mediaObject:nil data:nil];// ChapterSkip[_tracker trackEvent:ACPMediaEventChapterSkip mediaObject:nil data:nil];
Tracking playback events
Copied to your clipboard// BufferStart[_tracker trackEvent:ACPMediaEventBufferStart info:nil data:nil];// BufferComplete[_tracker trackEvent:ACPMediaEventBufferComplete info:nil data:nil];// SeekStart[_tracker trackEvent:ACPMediaEventSeekStart info:nil data:nil];// SeekComplete[_tracker trackEvent:ACPMediaEventSeekComplete info:nil data:nil];
Tracking bitrate change
Copied to your clipboard// If the new bitrate value is available provide it to the tracker.NSDictionary* qoeObject = [ACPMedia createQoEObjectWithBitrate:2000000 startupTime:2 fps:25 droppedFrames:10];[_tracker updateQoEObject:qoeObject];// Bitrate change[_tracker trackEvent:ACPMediaEventBitrateChange info:nil data:nil];
JavaScript
Examples
Tracking player states
Copied to your clipboard// StateStartlet stateObject = ACPMedia.createStateObject("fullscreen");tracker.trackEvent(ACPMediaEvent.EventStateStart, stateObject, null);// StateEndlet stateObject = ACPMedia.createStateObject("fullscreen");tracker.trackEvent(ACPMediaEvent.EventStateEnd, stateObject, null);
Tracking ad breaks
Copied to your clipboard// AdBreakStartlet adBreakObject = ACPMedia.createAdBreakObject("adbreak-name", 1, 0);tracker.trackEvent(ACPMediaEvent.EventAdBreakStart, adBreakObject, null);// AdBreakCompletetracker.trackEvent(ACPMediaEvent.EventAdBreakComplete, null, null);
Tracking ads
Copied to your clipboard// AdStartlet adObject = ACPMedia.createAdObject("ad-name", "ad-id", 1, 15);var adMetadata = new Object();adMetadata[ACPMediaConstants.ACPAdMetadataKeyAdvertiser] = "Sample Advertiser";adMetadata[ACPMediaConstants.ACPAdMetadataKeyCampaignId] = "Sample Campaign";// Custom metadata keysadMetadata["affiliate"] = "Sample affiliate";tracker.trackEvent(ACPMediaEvent.EventAdStart, adObject, adMetadata);// AdCompletetracker.trackEvent(ACPMediaEvent.EventAdComplete, null, null);// AdSkiptracker.trackEvent(ACPMediaEvent.EventAdSkip, null, null);
Tracking chapters
Copied to your clipboard// ChapterStartlet chapterObject = ACPMedia.createChapterObject("chapter-name", 1, 60, 0);var chapterMetadata = new Object();chapterMetadata["segmentType"] = "Sample segment type";tracker.trackEvent(ACPMediaEvent.EventChapterStart, chapterObject, chapterMetadata);// ChapterCompletetracker.trackEvent(ACPMediaEvent.EventChapterComplete, null, null);// ChapterSkiptracker.trackEvent(ACPMediaEvent.EventChapterSkip, null, null);
Tracking playback events
Copied to your clipboard// BufferStarttracker.trackEvent(ACPMediaEvent.EventBufferStart, null, null);// BufferCompletetracker.trackEvent(ACPMediaEvent.EventBufferComplete, null, null);// SeekStarttracker.trackEvent(ACPMediaEvent.EventSeekStart, null, null);// SeekCompletetracker.trackEvent(ACPMediaEvent.EventSeekComplete, null, null);
Tracking bitrate changes
Copied to your clipboard// If the new bitrate value is available provide it to the tracker.let qoeObject = ACPMedia.createQoEObject(2000000, 2, 25, 10);tracker.updateQoEObject(qoeObject);// Bitrate changetracker.trackEvent(ACPMediaEvent.EventBitrateChange, null, null);
Java
Syntax
Copied to your clipboardpublic void trackEvent(Media.Event event,Map<String, Object> info,Map<String, String> data);
Examples
Tracking player states
Copied to your clipboard// StateStartHashMap<String, Object> stateObject = Media.createStateObject("fullscreen");_tracker.trackEvent(Media.Event.StateStart, stateObject, null);// StateEndHashMap<String, Object> stateObject = Media.createStateObject("fullscreen");_tracker.trackEvent(Media.Event.StateEnd, stateObject, null);
Tracking ad breaks
Copied to your clipboard// AdBreakStartHashMap<String, Object> adBreakObject = Media.createAdBreakObject("adbreak-name", 1L, 0D);_tracker.trackEvent(Media.Event.AdBreakStart, adBreakObject, null);// AdBreakComplete_tracker.trackEvent(Media.Event.AdBreakComplete, null, null);
Tracking ads
Copied to your clipboard// AdStartHashMap<String, Object> adObject = Media.createAdObject("ad-name", "ad-id", 1L, 15D);HashMap<String, String> adMetadata = new HashMap<String, String>();// Standard metadata keys provided by adobe.adMetadata.put(MediaConstants.AdMetadataKeys.ADVERTISER, "Sample Advertiser");adMetadata.put(MediaConstants.AdMetadataKeys.CAMPAIGN_ID, "Sample Campaign");// Custom metadata keysadMetadata.put("affiliate", "Sample affiliate");_tracker.trackEvent(Media.Event.AdStart, adObject, adMetadata);// AdComplete_tracker.trackEvent(Media.Event.AdComplete, null, null);// AdSkip_tracker.trackEvent(Media.Event.AdSkip, null, null);
Tracking chapters
Copied to your clipboard// ChapterStartHashMap<String, Object> chapterObject = Media.createChapterObject("chapter-name", 1L, 60D, 0D);HashMap<String, String> chapterMetadata = new HashMap<String, String>();chapterMetadata.put("segmentType", "Sample segment type");_tracker.trackEvent(Media.Event.ChapterStart, chapterDataInfo, chapterMetadata);// ChapterComplete_tracker.trackEvent(Media.Event.ChapterComplete, null, null);// ChapterSkip_tracker.trackEvent(Media.Event.ChapterSkip, null, null);
Tracking playback events
Copied to your clipboard// BufferStart_tracker.trackEvent(Media.Event.BufferStart, null, null);// BufferComplete_tracker.trackEvent(Media.Event.BufferComplete, null, null);// SeekStart_tracker.trackEvent(Media.Event.SeekStart, null, null);// SeekComplete_tracker.trackEvent(Media.Event.SeekComplete, null, null);
Tracking bitrate changes
Copied to your clipboard// If the new bitrate value is available provide it to the tracker.HashMap<String, Object> qoeObject = Media.createQoEObject(2000000L, 2D, 25D, 10D);_tracker.updateQoEObject(qoeObject);// Bitrate change_tracker.trackEvent(Media.Event.BitrateChange, null, null);
Swift
Syntax
Copied to your clipboardfunc trackEvent(_ event: ACPMediaEvent, info: [AnyHashable : Any]?, data: [AnyHashable : Any]?)
Examples
Tracking player states
Copied to your clipboard// StateStartlet stateObject = ACPMedia.createStateObject(withName: "fullscreen")_tracker.trackEvent(ACPMediaEvent.stateStart, info: stateObject, data: nil)// StateEndlet stateObject = ACPMedia.createStateObject(withName: "fullscreen")_tracker.trackEvent(ACPMediaEvent.stateEnd, info: stateObject, data: nil)
Tracking ad breaks
Copied to your clipboard// AdBreakStartlet adBreakObject = ACPMedia.createAdBreakObject(withName: "adbreak-name", position: 1, startTime: 0)_tracker.trackEvent(ACPMediaEvent.adBreakStart, mediaObject: adBreakObject, data: nil)// AdBreakComplete_tracker.trackEvent(ACPMediaEvent.adBreakComplete, mediaObject: nil, data: nil)
Tracking ads
Copied to your clipboard// AdStartlet adObject = ACPMedia.createAdObject(withName: "ad-name", adId: "ad-id", position: 1, length: 15)// Standard metadata keys provided by adobe.var adMetadata = [ACPAdMetadataKeyAdvertiser: "Sample Advertiser", ACPAdMetadataKeyCampaignId: "Sample Campaign"]// Custom metadata keysadMetadata["affiliate"] = "Sample affiliate"_tracker.trackEvent(ACPMediaEvent.adStart, mediaObject: adObject, data: adMetadata)// AdComplete_tracker.trackEvent(ACPMediaEvent.adComplete, mediaObject: nil, data: nil)// AdSkip_tracker.trackEvent(ACPMediaEvent.adSkip, mediaObject: nil, data: nil)
Tracking chapters
Copied to your clipboard// ChapterStartlet chapterObject = ACPMedia.createChapterObject(withName: "chapter-name", position: 1, length: 60, startTime: 0)let chapterMetadata = ["Sample segment type": "segmentType"];_tracker.trackEvent(ACPMediaEvent.chapterStart, mediaObject: chapterObject, data: chapterMetadata)// ChapterComplete_tracker.trackEvent(ACPMediaEvent.chapterComplete, mediaObject: nil, data: nil)// ChapterSkip_tracker.trackEvent(ACPMediaEvent.chapterSkip, mediaObject: nil, data: nil)
Tracking playback events
Copied to your clipboard// BufferStart_tracker.trackEvent(ACPMediaEvent.bufferStart, mediaObject: nil, data: nil)// BufferComplete_tracker.trackEvent(ACPMediaEvent.bufferComplete, mediaObject: nil, data: nil)// SeekStart_tracker.trackEvent(ACPMediaEvent.seekStart, mediaObject: nil, data: nil)// SeekComplete_tracker.trackEvent(ACPMediaEvent.seekComplete, mediaObject: nil, data: nil)
Tracking bitrate change
Copied to your clipboard// If the new bitrate value is available provide it to the tracker.let qoeObject = ACPMedia.createQoEObject(withBitrate: 2000000, startupTime: 2, fps: 25, droppedFrames: 10)_tracker.updateQoEObject(qoeObject)// Bitrate change_tracker.trackEvent(ACPMediaEvent.bitrateChange, mediaObject: nil, data: nil)
Objective-C
Syntax
Copied to your clipboard- (void) trackEvent: (ACPMediaEvent) eventinfo: (NSDictionary* _Nullable) infodata: (NSDictionary* _Nullable) data;
Examples
Tracking player states
Copied to your clipboard// StateStartNSDictionary* stateObject = [ACPMedia createStateObjectWithName:@"fullscreen"];[_tracker trackEvent:ACPMediaEventStateStart mediaObject:stateObject data:nil];// StateEndNSDictionary* stateObject = [ACPMedia createStateObjectWithName:@"fullscreen"];[_tracker trackEvent:ACPMediaEventStateEnd mediaObject:stateObject data:nil];
Tracking ad breaks
Copied to your clipboard// AdBreakStartNSDictionary* adBreakObject = [ACPMedia createAdBreakObjectWithName:@"adbreak-name" position:1 startTime:0];[_tracker trackEvent:ACPMediaEventAdBreakStart mediaObject:adBreakObject data:nil];// AdBreakComplete[_tracker trackEvent:ACPMediaEventAdBreakComplete mediaObject:nil data:nil];
Tracking ads
Copied to your clipboard// AdStartNSDictionary* adObject = [ACPMedia createAdObjectWithName:@"ad-name" adId:@"ad-id" position:1 length:15];NSMutableDictionary* adMetadata = [[NSMutableDictionary alloc] init];// Standard metadata keys provided by adobe.[adMetadata setObject:@"Sample Advertiser" forKey:ACPAdMetadataKeyAdvertiser];[adMetadata setObject:@"Sample Campaign" forKey:ACPAdMetadataKeyCampaignId];// Custom metadata keys[adMetadata setObject:@"Sample affiliate" forKey:@"affiliate"];[_tracker trackEvent:ACPMediaEventAdStart mediaObject:adObject data:adMetadata];// AdComplete[_tracker trackEvent:ACPMediaEventAdComplete mediaObject:nil data:nil];// AdSkip[_tracker trackEvent:ACPMediaEventAdSkip mediaObject:nil data:nil];
Tracking chapters
Copied to your clipboard// ChapterStartNSDictionary* chapterObject = [ACPMedia createChapterObjectWithName:@"chapter-name" position:1 length:30 startTime:0];NSMutableDictionary *chapterMetadata = [[NSMutableDictionary alloc] init];[chapterMetadata setObject:@"Sample segment type" forKey:@"segmentType"];[_tracker trackEvent:ACPMediaEventChapterStart mediaObject:chapterObject data:chapterMetadata];// ChapterComplete[_tracker trackEvent:ACPMediaEventChapterComplete mediaObject:nil data:nil];// ChapterSkip[_tracker trackEvent:ACPMediaEventChapterSkip mediaObject:nil data:nil];
Tracking playback events
Copied to your clipboard// BufferStart[_tracker trackEvent:ACPMediaEventBufferStart info:nil data:nil];// BufferComplete[_tracker trackEvent:ACPMediaEventBufferComplete info:nil data:nil];// SeekStart[_tracker trackEvent:ACPMediaEventSeekStart info:nil data:nil];// SeekComplete[_tracker trackEvent:ACPMediaEventSeekComplete info:nil data:nil];
Tracking bitrate change
Copied to your clipboard// If the new bitrate value is available provide it to the tracker.NSDictionary* qoeObject = [ACPMedia createQoEObjectWithBitrate:2000000 startupTime:2 fps:25 droppedFrames:10];[_tracker updateQoEObject:qoeObject];// Bitrate change[_tracker trackEvent:ACPMediaEventBitrateChange info:nil data:nil];
JavaScript
Examples
Tracking player states
Copied to your clipboard// StateStartlet stateObject = ACPMedia.createStateObject("fullscreen");tracker.trackEvent(ACPMediaEvent.EventStateStart, stateObject, null);// StateEndlet stateObject = ACPMedia.createStateObject("fullscreen");tracker.trackEvent(ACPMediaEvent.EventStateEnd, stateObject, null);
Tracking ad breaks
Copied to your clipboard// AdBreakStartlet adBreakObject = ACPMedia.createAdBreakObject("adbreak-name", 1, 0);tracker.trackEvent(ACPMediaEvent.EventAdBreakStart, adBreakObject, null);// AdBreakCompletetracker.trackEvent(ACPMediaEvent.EventAdBreakComplete, null, null);
Tracking ads
Copied to your clipboard// AdStartlet adObject = ACPMedia.createAdObject("ad-name", "ad-id", 1, 15);var adMetadata = new Object();adMetadata[ACPMediaConstants.ACPAdMetadataKeyAdvertiser] = "Sample Advertiser";adMetadata[ACPMediaConstants.ACPAdMetadataKeyCampaignId] = "Sample Campaign";// Custom metadata keysadMetadata["affiliate"] = "Sample affiliate";tracker.trackEvent(ACPMediaEvent.EventAdStart, adObject, adMetadata);// AdCompletetracker.trackEvent(ACPMediaEvent.EventAdComplete, null, null);// AdSkiptracker.trackEvent(ACPMediaEvent.EventAdSkip, null, null);
Tracking chapters
Copied to your clipboard// ChapterStartlet chapterObject = ACPMedia.createChapterObject("chapter-name", 1, 60, 0);var chapterMetadata = new Object();chapterMetadata["segmentType"] = "Sample segment type";tracker.trackEvent(ACPMediaEvent.EventChapterStart, chapterObject, chapterMetadata);// ChapterCompletetracker.trackEvent(ACPMediaEvent.EventChapterComplete, null, null);// ChapterSkiptracker.trackEvent(ACPMediaEvent.EventChapterSkip, null, null);
Tracking playback events
Copied to your clipboard// BufferStarttracker.trackEvent(ACPMediaEvent.EventBufferStart, null, null);// BufferCompletetracker.trackEvent(ACPMediaEvent.EventBufferComplete, null, null);// SeekStarttracker.trackEvent(ACPMediaEvent.EventSeekStart, null, null);// SeekCompletetracker.trackEvent(ACPMediaEvent.EventSeekComplete, null, null);
Tracking bitrate changes
Copied to your clipboard// If the new bitrate value is available provide it to the tracker.let qoeObject = ACPMedia.createQoEObject(2000000, 2, 25, 10);tracker.updateQoEObject(qoeObject);// Bitrate changetracker.trackEvent(ACPMediaEvent.EventBitrateChange, null, null);
updateCurrentPlayhead
Provides a media tracker with the current media playhead. For accurate tracking, call this method multiple times when the playhead changes.
Variable Name | Description |
---|---|
time | Current playhead in seconds. For video-on-demand (VOD), the value is specified in seconds from the beginning of the media item. For live streaming, the value is specified as the number of seconds since midnight UTC on that day. |
Java
Syntax
Copied to your clipboardpublic void updateCurrentPlayhead(double time);
Example
Copied to your clipboard_tracker.updateCurrentPlayhead(1);
Live streaming example
Copied to your clipboard//Calculation for number of seconds since midnight UTC of the daydouble timeFromMidnightInSecond = (System.currentTimeMillis()/1000) % 86400;_tracker.updateCurrentPlayhead(timeFromMidnightInSecond);
Swift
Syntax
Copied to your clipboardfunc updateCurrentPlayhead(_ time: Double)
Example
Copied to your clipboard_tracker.updateCurrentPlayhead(1)
Objective-C
Syntax
Copied to your clipboard- (void) updateCurrentPlayhead: (double) time;
Example
Copied to your clipboard[_tracker updateCurrentPlayhead:1];
Live streaming example
Copied to your clipboard//Calculation for number of seconds since midnight UTC of the daydouble secondsSince1970 = [[NSDate date] timeIntervalSince1970];double timeFromMidnightInSecond = fmod(secondsSince1970 , 86400);[_tracker updateCurrentPlayhead: timeFromMidnightInSecond];
Java
Syntax
Copied to your clipboardpublic void updateCurrentPlayhead(double time);
Example
Copied to your clipboard_tracker.updateCurrentPlayhead(1);
Live streaming example
Copied to your clipboard//Calculation for number of seconds since midnight UTC of the daydouble timeFromMidnightInSecond = (System.currentTimeMillis()/1000) % 86400;_tracker.updateCurrentPlayhead(timeFromMidnightInSecond);
Swift
Syntax
Copied to your clipboardfunc updateCurrentPlayhead(_ time: Double)
Example
Copied to your clipboard_tracker.updateCurrentPlayhead(1)
Objective-C
Syntax
Copied to your clipboard- (void) updateCurrentPlayhead: (double) time;
Example
Copied to your clipboard[_tracker updateCurrentPlayhead:1];
Live streaming example
Copied to your clipboard//Calculation for number of seconds since midnight UTC of the daydouble secondsSince1970 = [[NSDate date] timeIntervalSince1970];double timeFromMidnightInSecond = fmod(secondsSince1970 , 86400);[_tracker updateCurrentPlayhead: timeFromMidnightInSecond];
updateQoEObject
Provides the media tracker with the current QoE information. For accurate tracking, call this method multiple times when the media player provides the updated QoE information.
Variable name | Description |
---|---|
qoeObject | Current QoE information that was created by using the createQoEObject method. |
Swift
Syntax
Copied to your clipboardfunc updateQoEObject(_ qoeObject: [AnyHashable : Any])
Example
Copied to your clipboardlet qoeObject = ACPMedia.createQoEObject(withBitrate: 1000000, startupTime: 2, fps: 25, droppedFrames: 10)_tracker.updateQoEObject(qoeObject)
Objective-C
Syntax
Copied to your clipboard- (void) updateQoEObject: (NSDictionary* _Nonnull) qoeObject;
Example
Copied to your clipboardNSDictionary* qoeObject = [ACPMedia createQoEObjectWithBitrate:1000000 startupTime:2 fps:25 droppedFrames:10];[_tracker updateQoEObject:qoeObject];
Java
Syntax
Copied to your clipboardpublic void updateQoEObject(Map<String, Object> qoeObject);
Example
Copied to your clipboardHashMap<String, Object> qoeObject = Media.createQoEObject(1000000L, 2D, 25D, 10D);_tracker.updateQoEObject(qoeObject);
Swift
Syntax
Copied to your clipboardfunc updateQoEObject(_ qoeObject: [AnyHashable : Any])
Example
Copied to your clipboardlet qoeObject = ACPMedia.createQoEObject(withBitrate: 1000000, startupTime: 2, fps: 25, droppedFrames: 10)_tracker.updateQoEObject(qoeObject)
Objective-C
Syntax
Copied to your clipboard- (void) updateQoEObject: (NSDictionary* _Nonnull) qoeObject;
Example
Copied to your clipboardNSDictionary* qoeObject = [ACPMedia createQoEObjectWithBitrate:1000000 startupTime:2 fps:25 droppedFrames:10];[_tracker updateQoEObject:qoeObject];
Media constants
Media type
Defines the type of a media that is currently tracked.
Copied to your clipboardpublic class Media {public enum MediaType {/*** Constant defining media type for Video streams*/Video,/*** Constant defining media type for Audio streams*/Audio}}
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 class Media {public enum MediaType {/*** Constant defining media type for Video streams*/Video,/*** Constant defining media type for Audio streams*/Audio}}
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
Defines the stream type of the content that is currently tracked.
Copied to your clipboardpublic class MediaConstants {public static final class StreamType {/*** Constant defining stream type for VOD streams*/public static final String VOD = "vod";/*** Constant defining stream type for Live streams*/public static final String LIVE = "live";/*** Constant defining stream type for Linear streams*/public static final String LINEAR = "linear";/*** Constant defining stream type for Podcast streams*/public static final String PODCAST = "podcast";/*** Constant defining stream type for Audiobook streams*/public static final String AUDIOBOOK = "audiobook";/*** Constant defining stream type for AOD streams*/public static final String AOD = "aod";}}
Copied to your clipboard/*** Constant defining stream type for VOD streams*/FOUNDATION_EXPORT NSString* _Nonnull const ACPMediaStreamTypeVod;/*** Constant defining stream type for Live streams*/FOUNDATION_EXPORT NSString* _Nonnull const ACPMediaStreamTypeLive;/*** Constant defining stream type for Linear streams*/FOUNDATION_EXPORT NSString* _Nonnull const ACPMediaStreamTypeLinear;/*** Constant defining stream type for Podcast streams*/FOUNDATION_EXPORT NSString* _Nonnull const ACPMediaStreamTypePodcast;/*** Constant defining stream type for Audiobook streams*/FOUNDATION_EXPORT NSString* _Nonnull const ACPMediaStreamTypeAudiobook;/*** Constant defining stream type for AOD streams*/FOUNDATION_EXPORT NSString* _Nonnull const ACPMediaStreamTypeAod;
JavaScript
Copied to your clipboardimport {ACPMediaConstants} from '@adobe/react-native-acpmedia';ACPMediaConstants.ACPMediaStreamTypeVodACPMediaConstants.ACPMediaStreamTypeLiveACPMediaConstants.ACPMediaConstantsACPMediaStreamTypeLinearACPMediaConstants.ACPMediaStreamTypePodcastACPMediaConstants.ACPMediaStreamTypeAudiobookACPMediaConstants.ACPMediaStreamTypeAod
Copied to your clipboardpublic class MediaConstants {public static final class StreamType {/*** Constant defining stream type for VOD streams*/public static final String VOD = "vod";/*** Constant defining stream type for Live streams*/public static final String LIVE = "live";/*** Constant defining stream type for Linear streams*/public static final String LINEAR = "linear";/*** Constant defining stream type for Podcast streams*/public static final String PODCAST = "podcast";/*** Constant defining stream type for Audiobook streams*/public static final String AUDIOBOOK = "audiobook";/*** Constant defining stream type for AOD streams*/public static final String AOD = "aod";}}
Copied to your clipboard/*** Constant defining stream type for VOD streams*/FOUNDATION_EXPORT NSString* _Nonnull const ACPMediaStreamTypeVod;/*** Constant defining stream type for Live streams*/FOUNDATION_EXPORT NSString* _Nonnull const ACPMediaStreamTypeLive;/*** Constant defining stream type for Linear streams*/FOUNDATION_EXPORT NSString* _Nonnull const ACPMediaStreamTypeLinear;/*** Constant defining stream type for Podcast streams*/FOUNDATION_EXPORT NSString* _Nonnull const ACPMediaStreamTypePodcast;/*** Constant defining stream type for Audiobook streams*/FOUNDATION_EXPORT NSString* _Nonnull const ACPMediaStreamTypeAudiobook;/*** Constant defining stream type for AOD streams*/FOUNDATION_EXPORT NSString* _Nonnull const ACPMediaStreamTypeAod;
JavaScript
Copied to your clipboardimport {ACPMediaConstants} from '@adobe/react-native-acpmedia';ACPMediaConstants.ACPMediaStreamTypeVodACPMediaConstants.ACPMediaStreamTypeLiveACPMediaConstants.ACPMediaConstantsACPMediaStreamTypeLinearACPMediaConstants.ACPMediaStreamTypePodcastACPMediaConstants.ACPMediaStreamTypeAudiobookACPMediaConstants.ACPMediaStreamTypeAod
Standard video constants
Defines the standard metadata keys for video streams.
Copied to your clipboardpublic class MediaConstants {public static final class VideoMetadataKeys {public static final String SHOW = "a.media.show";public static final String SEASON = "a.media.season";public static final String EPISODE = "a.media.episode";public static final String ASSET_ID = "a.media.asset";public static final String GENRE = "a.media.genre";public static final String FIRST_AIR_DATE = "a.media.airDate";public static final String FIRST_DIGITAL_DATE = "a.media.digitalDate";public static final String RATING = "a.media.rating";public static final String ORIGINATOR = "a.media.originator";public static final String NETWORK = "a.media.network";public static final String SHOW_TYPE = "a.media.type";public static final String AD_LOAD = "a.media.adLoad";public static final String MVPD = "a.media.pass.mvpd";public static final String AUTHORIZED = "a.media.pass.auth";public static final String DAY_PART = "a.media.dayPart";public static final String FEED = "a.media.feed";public static final String STREAM_FORMAT = "a.media.format";}}
Copied to your clipboardFOUNDATION_EXPORT NSString* _Nonnull const ACPVideoMetadataKeyShow;FOUNDATION_EXPORT NSString* _Nonnull const ACPVideoMetadataKeySeason;FOUNDATION_EXPORT NSString* _Nonnull const ACPVideoMetadataKeyEpisode;FOUNDATION_EXPORT NSString* _Nonnull const ACPVideoMetadataKeyAssetId;FOUNDATION_EXPORT NSString* _Nonnull const ACPVideoMetadataKeyGenre;FOUNDATION_EXPORT NSString* _Nonnull const ACPVideoMetadataKeyFirstAirDate;FOUNDATION_EXPORT NSString* _Nonnull const ACPVideoMetadataKeyFirstDigitalDate;FOUNDATION_EXPORT NSString* _Nonnull const ACPVideoMetadataKeyRating;FOUNDATION_EXPORT NSString* _Nonnull const ACPVideoMetadataKeyOriginator;FOUNDATION_EXPORT NSString* _Nonnull const ACPVideoMetadataKeyNetwork;FOUNDATION_EXPORT NSString* _Nonnull const ACPVideoMetadataKeyShowType;FOUNDATION_EXPORT NSString* _Nonnull const ACPVideoMetadataKeyAdLoad;FOUNDATION_EXPORT NSString* _Nonnull const ACPVideoMetadataKeyMvpd;FOUNDATION_EXPORT NSString* _Nonnull const ACPVideoMetadataKeyAuthorized;FOUNDATION_EXPORT NSString* _Nonnull const ACPVideoMetadataKeyDayPart;FOUNDATION_EXPORT NSString* _Nonnull const ACPVideoMetadataKeyFeed;FOUNDATION_EXPORT NSString* _Nonnull const ACPVideoMetadataKeyStreamFormat;
JavaScript
Copied to your clipboardimport {ACPMediaConstants} from '@adobe/react-native-acpmedia';ACPMediaConstants.ACPVideoMetadataKeyShowACPMediaConstants.ACPVideoMetadataKeySeasonACPMediaConstants.ACPVideoMetadataKeyEpisodeACPMediaConstants.ACPVideoMetadataKeyAssetIdACPMediaConstants.ACPVideoMetadataKeyGenreACPMediaConstants.ACPVideoMetadataKeyFirstAirDateACPMediaConstants.ACPVideoMetadataKeyFirstDigitalDateACPMediaConstants.ACPVideoMetadataKeyRatingACPMediaConstants.ACPVideoMetadataKeyOriginatorACPMediaConstants.ACPVideoMetadataKeyNetworkACPMediaConstants.ACPVideoMetadataKeyShowTypeACPMediaConstants.ACPVideoMetadataKeyAdLoadACPMediaConstants.ACPVideoMetadataKeyMvpdACPMediaConstants.ACPVideoMetadataKeyAuthorizedACPMediaConstants.ACPVideoMetadataKeyDayPartACPMediaConstants.ACPVideoMetadataKeyFeedACPMediaConstants.ACPVideoMetadataKeyStreamFormat
Copied to your clipboardpublic class MediaConstants {public static final class VideoMetadataKeys {public static final String SHOW = "a.media.show";public static final String SEASON = "a.media.season";public static final String EPISODE = "a.media.episode";public static final String ASSET_ID = "a.media.asset";public static final String GENRE = "a.media.genre";public static final String FIRST_AIR_DATE = "a.media.airDate";public static final String FIRST_DIGITAL_DATE = "a.media.digitalDate";public static final String RATING = "a.media.rating";public static final String ORIGINATOR = "a.media.originator";public static final String NETWORK = "a.media.network";public static final String SHOW_TYPE = "a.media.type";public static final String AD_LOAD = "a.media.adLoad";public static final String MVPD = "a.media.pass.mvpd";public static final String AUTHORIZED = "a.media.pass.auth";public static final String DAY_PART = "a.media.dayPart";public static final String FEED = "a.media.feed";public static final String STREAM_FORMAT = "a.media.format";}}
Copied to your clipboardFOUNDATION_EXPORT NSString* _Nonnull const ACPVideoMetadataKeyShow;FOUNDATION_EXPORT NSString* _Nonnull const ACPVideoMetadataKeySeason;FOUNDATION_EXPORT NSString* _Nonnull const ACPVideoMetadataKeyEpisode;FOUNDATION_EXPORT NSString* _Nonnull const ACPVideoMetadataKeyAssetId;FOUNDATION_EXPORT NSString* _Nonnull const ACPVideoMetadataKeyGenre;FOUNDATION_EXPORT NSString* _Nonnull const ACPVideoMetadataKeyFirstAirDate;FOUNDATION_EXPORT NSString* _Nonnull const ACPVideoMetadataKeyFirstDigitalDate;FOUNDATION_EXPORT NSString* _Nonnull const ACPVideoMetadataKeyRating;FOUNDATION_EXPORT NSString* _Nonnull const ACPVideoMetadataKeyOriginator;FOUNDATION_EXPORT NSString* _Nonnull const ACPVideoMetadataKeyNetwork;FOUNDATION_EXPORT NSString* _Nonnull const ACPVideoMetadataKeyShowType;FOUNDATION_EXPORT NSString* _Nonnull const ACPVideoMetadataKeyAdLoad;FOUNDATION_EXPORT NSString* _Nonnull const ACPVideoMetadataKeyMvpd;FOUNDATION_EXPORT NSString* _Nonnull const ACPVideoMetadataKeyAuthorized;FOUNDATION_EXPORT NSString* _Nonnull const ACPVideoMetadataKeyDayPart;FOUNDATION_EXPORT NSString* _Nonnull const ACPVideoMetadataKeyFeed;FOUNDATION_EXPORT NSString* _Nonnull const ACPVideoMetadataKeyStreamFormat;
JavaScript
Copied to your clipboardimport {ACPMediaConstants} from '@adobe/react-native-acpmedia';ACPMediaConstants.ACPVideoMetadataKeyShowACPMediaConstants.ACPVideoMetadataKeySeasonACPMediaConstants.ACPVideoMetadataKeyEpisodeACPMediaConstants.ACPVideoMetadataKeyAssetIdACPMediaConstants.ACPVideoMetadataKeyGenreACPMediaConstants.ACPVideoMetadataKeyFirstAirDateACPMediaConstants.ACPVideoMetadataKeyFirstDigitalDateACPMediaConstants.ACPVideoMetadataKeyRatingACPMediaConstants.ACPVideoMetadataKeyOriginatorACPMediaConstants.ACPVideoMetadataKeyNetworkACPMediaConstants.ACPVideoMetadataKeyShowTypeACPMediaConstants.ACPVideoMetadataKeyAdLoadACPMediaConstants.ACPVideoMetadataKeyMvpdACPMediaConstants.ACPVideoMetadataKeyAuthorizedACPMediaConstants.ACPVideoMetadataKeyDayPartACPMediaConstants.ACPVideoMetadataKeyFeedACPMediaConstants.ACPVideoMetadataKeyStreamFormat
Standard audio constants
Defines the standard metadata keys for audio streams.
Copied to your clipboardpublic class MediaConstants {public static final class AudioMetadataKeys {public static final String ARTIST = "a.media.artist";public static final String ALBUM = "a.media.album";public static final String LABEL = "a.media.label";public static final String AUTHOR = "a.media.author";public static final String STATION = "a.media.station";public static final String PUBLISHER = "a.media.publisher";}}
Copied to your clipboardFOUNDATION_EXPORT NSString* _Nonnull const ACPAudioMetadataKeyArtist;FOUNDATION_EXPORT NSString* _Nonnull const ACPAudioMetadataKeyAlbum;FOUNDATION_EXPORT NSString* _Nonnull const ACPAudioMetadataKeyLabel;FOUNDATION_EXPORT NSString* _Nonnull const ACPAudioMetadataKeyAuthor;FOUNDATION_EXPORT NSString* _Nonnull const ACPAudioMetadataKeyStation;FOUNDATION_EXPORT NSString* _Nonnull const ACPAudioMetadataKeyPublisher;
JavaScript
Copied to your clipboardimport {ACPMediaConstants} from '@adobe/react-native-acpmedia';ACPMediaConstants.ACPAudioMetadataKeyArtistACPMediaConstants.ACPAudioMetadataKeyAlbumACPMediaConstants.ACPAudioMetadataKeyLabelACPMediaConstants.ACPAudioMetadataKeyAuthorACPMediaConstants.ACPAudioMetadataKeyStationACPMediaConstants.ACPAudioMetadataKeyPublisher
Copied to your clipboardpublic class MediaConstants {public static final class AudioMetadataKeys {public static final String ARTIST = "a.media.artist";public static final String ALBUM = "a.media.album";public static final String LABEL = "a.media.label";public static final String AUTHOR = "a.media.author";public static final String STATION = "a.media.station";public static final String PUBLISHER = "a.media.publisher";}}
Copied to your clipboardFOUNDATION_EXPORT NSString* _Nonnull const ACPAudioMetadataKeyArtist;FOUNDATION_EXPORT NSString* _Nonnull const ACPAudioMetadataKeyAlbum;FOUNDATION_EXPORT NSString* _Nonnull const ACPAudioMetadataKeyLabel;FOUNDATION_EXPORT NSString* _Nonnull const ACPAudioMetadataKeyAuthor;FOUNDATION_EXPORT NSString* _Nonnull const ACPAudioMetadataKeyStation;FOUNDATION_EXPORT NSString* _Nonnull const ACPAudioMetadataKeyPublisher;
JavaScript
Copied to your clipboardimport {ACPMediaConstants} from '@adobe/react-native-acpmedia';ACPMediaConstants.ACPAudioMetadataKeyArtistACPMediaConstants.ACPAudioMetadataKeyAlbumACPMediaConstants.ACPAudioMetadataKeyLabelACPMediaConstants.ACPAudioMetadataKeyAuthorACPMediaConstants.ACPAudioMetadataKeyStationACPMediaConstants.ACPAudioMetadataKeyPublisher
Standard ad constants
Defines the standard metadata keys for ads.
Copied to your clipboardpublic class MediaConstants {public static final class AdMetadataKeys {public static final String ADVERTISER = "a.media.ad.advertiser";public static final String CAMPAIGN_ID = "a.media.ad.campaign";public static final String CREATIVE_ID = "a.media.ad.creative";public static final String PLACEMENT_ID = "a.media.ad.placement";public static final String SITE_ID = "a.media.ad.site";public static final String CREATIVE_URL = "a.media.ad.creativeURL";}}
Copied to your clipboardFOUNDATION_EXPORT NSString* _Nonnull const ACPAdMetadataKeyAdvertiser;FOUNDATION_EXPORT NSString* _Nonnull const ACPAdMetadataKeyCampaignId;FOUNDATION_EXPORT NSString* _Nonnull const ACPAdMetadataKeyCreativeId;FOUNDATION_EXPORT NSString* _Nonnull const ACPAdMetadataKeyPlacementId;FOUNDATION_EXPORT NSString* _Nonnull const ACPAdMetadataKeySiteId;FOUNDATION_EXPORT NSString* _Nonnull const ACPAdMetadataKeyCreativeUrl;
JavaScript
Copied to your clipboardimport {ACPMediaConstants} from '@adobe/react-native-acpmedia';ACPMediaConstants.ACPAdMetadataKeyAdvertiserACPMediaConstants.ACPAdMetadataKeyCampaignIdACPMediaConstants.ACPAdMetadataKeyCreativeIdACPMediaConstants.ACPAdMetadataKeyPlacementIdACPMediaConstants.ACPAdMetadataKeySiteIdACPMediaConstants.ACPAdMetadataKeyCreativeUrl
Copied to your clipboardpublic class MediaConstants {public static final class AdMetadataKeys {public static final String ADVERTISER = "a.media.ad.advertiser";public static final String CAMPAIGN_ID = "a.media.ad.campaign";public static final String CREATIVE_ID = "a.media.ad.creative";public static final String PLACEMENT_ID = "a.media.ad.placement";public static final String SITE_ID = "a.media.ad.site";public static final String CREATIVE_URL = "a.media.ad.creativeURL";}}
Copied to your clipboardFOUNDATION_EXPORT NSString* _Nonnull const ACPAdMetadataKeyAdvertiser;FOUNDATION_EXPORT NSString* _Nonnull const ACPAdMetadataKeyCampaignId;FOUNDATION_EXPORT NSString* _Nonnull const ACPAdMetadataKeyCreativeId;FOUNDATION_EXPORT NSString* _Nonnull const ACPAdMetadataKeyPlacementId;FOUNDATION_EXPORT NSString* _Nonnull const ACPAdMetadataKeySiteId;FOUNDATION_EXPORT NSString* _Nonnull const ACPAdMetadataKeyCreativeUrl;
JavaScript
Copied to your clipboardimport {ACPMediaConstants} from '@adobe/react-native-acpmedia';ACPMediaConstants.ACPAdMetadataKeyAdvertiserACPMediaConstants.ACPAdMetadataKeyCampaignIdACPMediaConstants.ACPAdMetadataKeyCreativeIdACPMediaConstants.ACPAdMetadataKeyPlacementIdACPMediaConstants.ACPAdMetadataKeySiteIdACPMediaConstants.ACPAdMetadataKeyCreativeUrl
Player state constants
Defines some common Player State constants.
Copied to your clipboardpublic class MediaConstants {public static final class PlayerState {public static final String FULLSCREEN = "fullscreen";public static final String PICTURE_IN_PICTURE = "pictureInPicture";public static final String CLOSED_CAPTION = "closedCaptioning";public static final String IN_FOCUS = "inFocus";public static final String MUTE = "mute";}}
Copied to your clipboardFOUNDATION_EXPORT NSString* _Nonnull const ACPMediaPlayerStateFullScreen;FOUNDATION_EXPORT NSString* _Nonnull const ACPMediaPlayerStatePictureInPicture;FOUNDATION_EXPORT NSString* _Nonnull const ACPMediaPlayerStateClosedCaption;FOUNDATION_EXPORT NSString* _Nonnull const ACPMediaPlayerStateInFocus;FOUNDATION_EXPORT NSString* _Nonnull const ACPMediaPlayerStateMute;
JavaScript
Copied to your clipboardimport {ACPMediaConstants} from '@adobe/react-native-acpmedia';ACPMediaConstants.ACPMediaPlayerStateFullScreenACPMediaConstants.ACPMediaPlayerStatePictureInPictureACPMediaConstants.ACPMediaPlayerStateClosedCaptionACPMediaConstants.ACPMediaPlayerStateInFocusACPMediaConstants.ACPMediaPlayerStateMute
Copied to your clipboardpublic class MediaConstants {public static final class PlayerState {public static final String FULLSCREEN = "fullscreen";public static final String PICTURE_IN_PICTURE = "pictureInPicture";public static final String CLOSED_CAPTION = "closedCaptioning";public static final String IN_FOCUS = "inFocus";public static final String MUTE = "mute";}}
Copied to your clipboardFOUNDATION_EXPORT NSString* _Nonnull const ACPMediaPlayerStateFullScreen;FOUNDATION_EXPORT NSString* _Nonnull const ACPMediaPlayerStatePictureInPicture;FOUNDATION_EXPORT NSString* _Nonnull const ACPMediaPlayerStateClosedCaption;FOUNDATION_EXPORT NSString* _Nonnull const ACPMediaPlayerStateInFocus;FOUNDATION_EXPORT NSString* _Nonnull const ACPMediaPlayerStateMute;
JavaScript
Copied to your clipboardimport {ACPMediaConstants} from '@adobe/react-native-acpmedia';ACPMediaConstants.ACPMediaPlayerStateFullScreenACPMediaConstants.ACPMediaPlayerStatePictureInPictureACPMediaConstants.ACPMediaPlayerStateClosedCaptionACPMediaConstants.ACPMediaPlayerStateInFocusACPMediaConstants.ACPMediaPlayerStateMute
Media events
Defines the type of a tracking event.
Copied to your clipboardpublic class Media {/*** These enumeration values define the type of a tracking event*/public enum Event {/*** Constant defining event type for AdBreak start*/AdBreakStart,/*** Constant defining event type for AdBreak complete*/AdBreakComplete,/*** Constant defining event type for Ad start*/AdStart,/*** Constant defining event type for Ad complete*/AdComplete,/*** Constant defining event type for Ad skip*/AdSkip,/*** Constant defining event type for Chapter start*/ChapterStart,/*** Constant defining event type for Chapter complete*/ChapterComplete,/*** Constant defining event type for Chapter skip*/ChapterSkip,/*** Constant defining event type for Seek start*/SeekStart,/*** Constant defining event type for Seek complete*/SeekComplete,/*** Constant defining event type for Buffer start*/BufferStart,/*** Constant defining event type for Buffer complete*/BufferComplete,/*** Constant defining event type for change in Bitrate*/BitrateChange,/*** Constant defining event type for State start*/StateStart,/*** Constant defining event type for State end*/StateEnd}}
Copied to your clipboard/*** These enumeration values define the type of a tracking event*/typedef NS_ENUM(NSInteger, ACPMediaEvent) {/*** Constant defining event type for AdBreak start*/ACPMediaEventAdBreakStart,/*** Constant defining event type for AdBreak complete*/ACPMediaEventAdBreakComplete,/*** Constant defining event type for Ad start*/ACPMediaEventAdStart,/*** Constant defining event type for Ad complete*/ACPMediaEventAdComplete,/*** Constant defining event type for Ad skip*/ACPMediaEventAdSkip,/*** Constant defining event type for Chapter start*/ACPMediaEventChapterStart,/*** Constant defining event type for Chapter complete*/ACPMediaEventChapterComplete,/*** Constant defining event type for Chapter skip*/ACPMediaEventChapterSkip,/*** Constant defining event type for Seek start*/ACPMediaEventSeekStart,/*** Constant defining event type for Seek complete*/ACPMediaEventSeekComplete,/*** Constant defining event type for Buffer start*/ACPMediaEventBufferStart,/*** Constant defining event type for Buffer complete*/ACPMediaEventBufferComplete,/*** Constant defining event type for change in Bitrate*/ACPMediaEventBitrateChange,/*** Constant defining event type for State start*/ACPMediaEventStateStart/*** Constant defining event type for State end*/ACPMediaEventStateEnd};
JavaScript
Copied to your clipboardimport {ACPMediaEvent} from '@adobe/react-native-acpmedia';ACPMediaEvent.EventAdBreakStartACPMediaEvent.EventAdBreakCompleteACPMediaEvent.EventAdStartACPMediaEvent.EventAdCompleteACPMediaEvent.EventAdSkipACPMediaEvent.EventChapterStartACPMediaEvent.EventChapterCompleteACPMediaEvent.EventChapterSkipACPMediaEvent.EventSeekStartACPMediaEvent.EventSeekCompleteACPMediaEvent.EventBufferStartACPMediaEvent.EventBufferCompleteACPMediaEvent.EventBitrateChangeACPMediaEvent.EventStateStartACPMediaEvent.EventStateEnd
Copied to your clipboardpublic class Media {/*** These enumeration values define the type of a tracking event*/public enum Event {/*** Constant defining event type for AdBreak start*/AdBreakStart,/*** Constant defining event type for AdBreak complete*/AdBreakComplete,/*** Constant defining event type for Ad start*/AdStart,/*** Constant defining event type for Ad complete*/AdComplete,/*** Constant defining event type for Ad skip*/AdSkip,/*** Constant defining event type for Chapter start*/ChapterStart,/*** Constant defining event type for Chapter complete*/ChapterComplete,/*** Constant defining event type for Chapter skip*/ChapterSkip,/*** Constant defining event type for Seek start*/SeekStart,/*** Constant defining event type for Seek complete*/SeekComplete,/*** Constant defining event type for Buffer start*/BufferStart,/*** Constant defining event type for Buffer complete*/BufferComplete,/*** Constant defining event type for change in Bitrate*/BitrateChange,/*** Constant defining event type for State start*/StateStart,/*** Constant defining event type for State end*/StateEnd}}
Copied to your clipboard/*** These enumeration values define the type of a tracking event*/typedef NS_ENUM(NSInteger, ACPMediaEvent) {/*** Constant defining event type for AdBreak start*/ACPMediaEventAdBreakStart,/*** Constant defining event type for AdBreak complete*/ACPMediaEventAdBreakComplete,/*** Constant defining event type for Ad start*/ACPMediaEventAdStart,/*** Constant defining event type for Ad complete*/ACPMediaEventAdComplete,/*** Constant defining event type for Ad skip*/ACPMediaEventAdSkip,/*** Constant defining event type for Chapter start*/ACPMediaEventChapterStart,/*** Constant defining event type for Chapter complete*/ACPMediaEventChapterComplete,/*** Constant defining event type for Chapter skip*/ACPMediaEventChapterSkip,/*** Constant defining event type for Seek start*/ACPMediaEventSeekStart,/*** Constant defining event type for Seek complete*/ACPMediaEventSeekComplete,/*** Constant defining event type for Buffer start*/ACPMediaEventBufferStart,/*** Constant defining event type for Buffer complete*/ACPMediaEventBufferComplete,/*** Constant defining event type for change in Bitrate*/ACPMediaEventBitrateChange,/*** Constant defining event type for State start*/ACPMediaEventStateStart/*** Constant defining event type for State end*/ACPMediaEventStateEnd};
JavaScript
Copied to your clipboardimport {ACPMediaEvent} from '@adobe/react-native-acpmedia';ACPMediaEvent.EventAdBreakStartACPMediaEvent.EventAdBreakCompleteACPMediaEvent.EventAdStartACPMediaEvent.EventAdCompleteACPMediaEvent.EventAdSkipACPMediaEvent.EventChapterStartACPMediaEvent.EventChapterCompleteACPMediaEvent.EventChapterSkipACPMediaEvent.EventSeekStartACPMediaEvent.EventSeekCompleteACPMediaEvent.EventBufferStartACPMediaEvent.EventBufferCompleteACPMediaEvent.EventBitrateChangeACPMediaEvent.EventStateStartACPMediaEvent.EventStateEnd
Media resume
Constant to denote that the current tracking session is resuming a previously closed session. This information must be provided when starting a tracking session.
Java
Syntax
Copied to your clipboardpublic class MediaConstants {public static final class MediaObjectKey {/*** Constant defining explicit media resumed property. Set this to true on MediaObject if resuming a previously closed session.*/public static final String RESUMED;}}
Example
Copied to your clipboardHashMap<String, Object> mediaObject = Media.createMediaObject("media-name", "media-id", 60D, MediaConstants.StreamType.VOD, Media.MediaType.Video);// Attach media resumed information.mediaObject.put(MediaConstants.MediaObjectKey.RESUMED, true);_tracker.trackSessionStart(mediaObject, null);
Swift
Syntax
Copied to your clipboardpublic let ACPMediaKeyMediaResumed: String
Example
Copied to your clipboardvar mediaObject = ACPMedia.createMediaObject(withName: "media-name", mediaId: "media-id", length: 60, streamType: ACPMediaStreamTypeVod, mediaType:ACPMediaType.video)// Attach media resumed information.mediaObject[ACPMediaKeyMediaResumed] = true_tracker.trackSessionStart(mediaObject, data: nil)
Objective-C
Syntax
Copied to your clipboardFOUNDATION_EXPORT NSString* _Nonnull const ACPMediaKeyMediaResumed;
Example
Copied to your clipboardNSDictionary *mediaObject = [ACPMedia createMediaObjectWithName:@"media-name" mediaId:@"media-id" length:60 streamType:ACPMediaStreamTypeVod mediaType:ACPMediaTypeVideo];// Attach media resumed information.NSMutableDictionary *obj = [mediaObject mutableCopy];[obj setObject:@YES forKey:ACPMediaKeyMediaResumed];[_tracker trackSessionStart:obj data:nil];
Java
Syntax
Copied to your clipboardpublic class MediaConstants {public static final class MediaObjectKey {/*** Constant defining explicit media resumed property. Set this to true on MediaObject if resuming a previously closed session.*/public static final String RESUMED;}}
Example
Copied to your clipboardHashMap<String, Object> mediaObject = Media.createMediaObject("media-name", "media-id", 60D, MediaConstants.StreamType.VOD, Media.MediaType.Video);// Attach media resumed information.mediaObject.put(MediaConstants.MediaObjectKey.RESUMED, true);_tracker.trackSessionStart(mediaObject, null);
Swift
Syntax
Copied to your clipboardpublic let ACPMediaKeyMediaResumed: String
Example
Copied to your clipboardvar mediaObject = ACPMedia.createMediaObject(withName: "media-name", mediaId: "media-id", length: 60, streamType: ACPMediaStreamTypeVod, mediaType:ACPMediaType.video)// Attach media resumed information.mediaObject[ACPMediaKeyMediaResumed] = true_tracker.trackSessionStart(mediaObject, data: nil)
Objective-C
Syntax
Copied to your clipboardFOUNDATION_EXPORT NSString* _Nonnull const ACPMediaKeyMediaResumed;
Example
Copied to your clipboardNSDictionary *mediaObject = [ACPMedia createMediaObjectWithName:@"media-name" mediaId:@"media-id" length:60 streamType:ACPMediaStreamTypeVod mediaType:ACPMediaTypeVideo];// Attach media resumed information.NSMutableDictionary *obj = [mediaObject mutableCopy];[obj setObject:@YES forKey:ACPMediaKeyMediaResumed];[_tracker trackSessionStart:obj data:nil];