Edit in GitHubLog an issue

Java

Copied to your clipboard
String mediaExtensionVersion = Media.extensionVersion();

Swift

Syntax

Copied to your clipboard
+ (nonnull NSString*) extensionVersion;

Example

Copied to your clipboard
let mediaExtensionVersion = ACPMedia.extensionVersion()

Objective-C

Syntax

Copied to your clipboard
+ (NSString * _Nonnull)extensionVersion

Example

Copied to your clipboard
NSString *mediaExtensionVersion = [ACPMedia extensionVersion];

JavaScript

Copied to your clipboard
ACPMedia.extensionVersion().then(mediaExtensionVersion => console.log("AdobeExperienceSDK: ACPMedia version: " + mediaExtensionVersion));

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 clipboard
public static MediaTracker createTracker()
// Deprecated
public static void createTracker(AdobeCallback<MediaTracker> callback)

Example

Copied to your clipboard
MediaTracker mediaTracker = Media.createTracker(); // Use the instance for tracking media.
// Deprecated
Media.createTracker(new AdobeCallback<MediaTracker>() {
@Override
public 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 clipboard
static func createTracker()

Example

Copied to your clipboard
let mediaTracker = ACPMedia.createTracker() // Use the instance for tracking media.
// Deprecated
ACPMedia.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 clipboard
ACPMediaTracker *mediaTracker = [ACPMedia createTracker]; // Use the instance for tracking media.
// Deprecated
[ACPMedia createTracker:^(ACPMediaTracker * _Nullable mediaTracker) {
// Use the instance for tracking media.
}];

JavaScript

Copied to your clipboard
ACPMedia.createTracker().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 clipboard
public 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)
// Deprecated
public static void createTracker(Map<String, Object> config, final AdobeCallback<MediaTracker> callback)

Example

Copied to your clipboard
HashMap<String, Object> config = new HashMap<String, Object>();
config.put(MediaConstants.Config.CHANNEL, "custom-channel"); // Override channel configured in the Data Collection UI
config.put(MediaConstants.Config.DOWNLOADED_CONTENT, true); // Creates downloaded content tracker
MediaTracker mediaTracker = Media.createTracker(config); // Use the instance for tracking media.
// Deprecated
Media.createTracker(config, new AdobeCallback<MediaTracker>() {
@Override
public 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 clipboard
static func createTracker(withConfig config: [AnyHashable : Any]?)

Example

Copied to your clipboard
var config: [String: Any] = [:]
config[ACPMediaKeyConfigChannel] = "custom-channel" // Override channel configured in the Data Collection UI
config[ACPMediaKeyConfigDownloadedContent] = true // Creates downloaded content tracker
let mediaTracker = ACPMedia.createTrackerWithConfig(config); // Use the instance for tracking media.
// Deprecated
ACPMedia.createTrackerWithConfig(config, {mediaTracker in
// Use the instance for tracking media.
}

Objective-C

Syntax

Copied to your clipboard
FOUNDATION_EXPORT NSString* _Nonnull const ACPMediaKeyConfigChannel;
FOUNDATION_EXPORT NSString* _Nonnull const ACPMediaKeyConfigDownloadedContent;
+ (ACPMediaTracker* _Nullable) createTrackerWithConfig: (NSDictionary* _Nullable) config;
// Deprecated
+ (void) createTrackerWithConfig: (NSDictionary* _Nullable) config
callback: (void (^ _Nonnull) (ACPMediaTracker* _Nullable)) callback;

Example

Copied to your clipboard
NSMutableDictionary* config = [NSMutableDictionary dictionary];
config[ACPMediaKeyConfigChannel] = @"custom-channel"; // Override channel configured in the Data Collection UI
config[ACPMediaKeyConfigDownloadedContent] = @YES; // Creates downloaded content tracker
ACPMediaTracker *mediaTracker = [ACPMedia createTrackerWithConfig:config]; // Use the instance for tracking media.
// Deprecated
[ACPMedia createTrackerWithConfig: config
callback:^(ACPMediaTracker * _Nullable mediaTracker) {
// Use the instance for tracking media.
}];

JavaScript

Copied to your clipboard
var config = new Object();
config[ACPMediaConstants.ACPMediaKeyConfigChannel] = "customer-channel"; // Override channel configured in the Data Collection UI
config[ACPMediaConstants.ACPMediaKeyConfigDownloadedContent] = true; // Creates downloaded content tracker
ACPMedia.createTrackerWithConfig(config).then(tracker =>
this.setState({currentTracker: tracker})
);

Java

Returns a HashMap instance that contains information about the media.

Syntax

Copied to your clipboard
public static HashMap<String, Object> createMediaObject(String name,
String mediaId,
Double length,
String streamType,
MediaType mediaType);

Example

Copied to your clipboard
HashMap<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 clipboard
static func createMediaObject(withName name: String, mediaId: String, length: Double, streamType: String, mediaType: ACPMediaType)

Example

Copied to your clipboard
let 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) name
mediaId: (NSString* _Nonnull) mediaId
length: (double) length
streamType: (NSString* _Nonnull) streamType
mediaType: (ACPMediaType) mediaType;

Example

Copied to your clipboard
NSDictionary *mediaObject = [ACPMedia createMediaObjectWithName: @"video-name"
mediaId: @"video-id"
length: 60
streamType: ACPMediaStreamTypeVod
mediaType: ACPMediaTypeVideo];

JavaScript

Copied to your clipboard
let mediaObject = ACPMedia.createMediaObject("video-name", "video-id", 60, ACPMediaConstants.ACPMediaStreamTypeVod, ACPMediaType.Video);

Java

Returns a HashMap instance that contains information about the ad break.

Syntax

Copied to your clipboard
public static HashMap<String, Object> createAdBreakObject(String name, Long position, Double startTime);

Example

Copied to your clipboard
HashMap<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 clipboard
static func createAdBreakObject(withName name: String,
position: Double, tartTime: Double)

Example

Copied to your clipboard
let adBreakObject = ACPMedia.createAdBreakObject(withName: "adbreak-name",
position: 1,
startTime: 0)

Objective-C

Syntax

Copied to your clipboard
+ (NSDictionary* _Nonnull) createAdBreakObjectWithName: (NSString* _Nonnull) name
position: (double) position
startTime: (double) startTime;

Example

Copied to your clipboard
NSDictionary *adBreakObject = [ACPMedia createAdBreakObjectWithName: @"adbreak-name"
position: 1
startTime: 0];

JavaScript

Copied to your clipboard
let adBreakObject = ACPMedia.createAdBreakObject("adbreak-name", 1, 0);

Java

Returns a HashMap instance that contains information about the ad.

Syntax

Copied to your clipboard
public static HashMap<String, Object> createAdObject(String name, String adId, Long position, Double length);

Example

Copied to your clipboard
HashMap<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 clipboard
static func createAdObject(withName name: String,
adId: String,
position: Double,
length: Double)

Example

Copied to your clipboard
let 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) name
adId: (NSString* _Nonnull) adId
position: (double) position
length: (double) length;

Example

Copied to your clipboard
NSDictionary *adObject = [ACPMedia createAdObjectWithName: @"ad-name"
adId: @"ad-id"
position: 1
length: 15];

JavaScript

Copied to your clipboard
let adObject = ACPMedia.createAdObject("ad-name", "ad-id", 1, 15);

Java

Returns a HashMap instance that contains information about the chapter.

Syntax

Copied to your clipboard
public static HashMap<String, Object> createChapterObject(String name,
Long position,
Double length,
Double startTime);

Example

Copied to your clipboard
HashMap<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 clipboard
static func createChapterObject(withName name: String,
position: Double,
length: Double,
startTime: Double)

Example

Copied to your clipboard
let chapterObject = ACPMedia.createChapterObject(withName: "chapter-name", position: 1, length: 60, startTime: 0)

Objective-C

Syntax

Copied to your clipboard
+ (NSDictionary* _Nonnull) createChapterObjectWithName: (NSString* _Nonnull) name
position: (double) position
length: (double) length
startTime: (double) startTime;

Example

Copied to your clipboard
NSDictionary *chapterObject = [ACPMedia createChapterObjectWithName: @"chapter-name"
position: 1
length: 60
startTime: 0];

JavaScript

Copied to your clipboard
let chapterObject = ACPMedia.createChapterObject('chapter-name', 1, 60, 0);

Java

Returns a HashMap instance that contains information about the quality of experience.

Syntax

Copied to your clipboard
public static HashMap<String, Object> createQoEObject(Long bitrate,
Double startupTime,
Double fps,
Long droppedFrames);

Example

Copied to your clipboard
HashMap<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 clipboard
static func createQoEObject(withBitrate bitrate: Double,
startupTime: Double,
fps: Double,
droppedFrames: Double)

Example

Copied to your clipboard
let qoeObject = ACPMedia.createQoEObject(withBitrate: 10000000, startupTime: 2, fps: 23, droppedFrames: 10)

Objective-C

Syntax

Copied to your clipboard
+ (NSDictionary* _Nonnull) createQoEObjectWithBitrate: (double) bitrate
startupTime: (double) startupTime
fps: (double) fps
droppedFrames: (double) droppedFrames;

Example

Copied to your clipboard
NSDictionary *qoeObject = [ACPMedia createQoEObjectWithBitrate: 10000000
startupTime: 2
fps: 23
droppedFrames: 10];

JavaScript

Copied to your clipboard
let qoeObject = ACPMedia.createQoEObject(1000000, 2, 23, 10);

Java

Returns a HashMap instance that contains information about the State.

Syntax

Copied to your clipboard
public static HashMap<String, Object> createStateObject(String stateName);

Example

Copied to your clipboard
HashMap<String, Object> playerStateInfo = Media.createStateObject("fullscreen");

Returns an NSDictionary instance that contains information about the player state.

Swift

Syntax

Copied to your clipboard
static func createStateObject(withName stateName: String)

Example

Copied to your clipboard
let playerStateObject = ACPMedia.createStateObject(withName: "fullscreen")

Objective-C

Syntax

Copied to your clipboard
+ (NSDictionary* _Nonnull) createStateObjectWithName: (NSString* _Nonnull) stateName;

Example

Copied to your clipboard
NSDictionary *playerStateObject = [ACPMedia createStateObjectWithName: @"fullscreen"];

JavaScript

Copied to your clipboard
let playerStateObject = ACPMedia.createStateObject("fullscreen");

Java

Syntax

Copied to your clipboard
public void trackSessionStart(Map<String, Object> mediaInfo, Map<String, String> contextData);

Example

Copied to your clipboard
HashMap<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 keys
mediaMetadata.put("isUserLoggedIn", "false");
mediaMetadata.put("tvStation", "Sample TV Station");
_tracker.trackSessionStart(mediaInfo, mediaMetadata);

Swift

Syntax

Copied to your clipboard
func trackSessionStart(_ mediaInfo: [AnyHashable : Any], data contextData: [AnyHashable : Any]?)

Example

Copied to your clipboard
let 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 keys
mediaMetadata["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 clipboard
NSDictionary *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 clipboard
let 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 keys
mediaMetadata["isUserLoggedIn"] = "false";
mediaMetadata["tvStation"] = "Sample TV station";
tracker.trackSessionStart(mediaObject, mediaMetadata);

Java

Syntax

Copied to your clipboard
public void trackPlay();

Example

Copied to your clipboard
_tracker.trackPlay();

Swift

Syntax

Copied to your clipboard
func trackPlay()

Example

Copied to your clipboard
_tracker.trackPlay()

Objective-C

Syntax

Copied to your clipboard
- (void) trackPlay;

Example

Copied to your clipboard
[_tracker trackPlay];

JavaScript

Copied to your clipboard
tracker.trackPlay();

Java

Syntax

Copied to your clipboard
public void trackPause();

Example

Copied to your clipboard
_tracker.trackPause();

Swift

Syntax

Copied to your clipboard
func trackPause()

Example

Copied to your clipboard
_tracker.trackPause()

Objective-C

Syntax

Copied to your clipboard
- (void) trackPause;

Example

Copied to your clipboard
[_tracker trackPause];

JavaScript

Copied to your clipboard
tracker.trackPause();

Java

Syntax

Copied to your clipboard
public void trackComplete();

Example

Copied to your clipboard
_tracker.trackComplete();

Swift

Syntax

Copied to your clipboard
func trackComplete()

Example

Copied to your clipboard
_tracker.trackComplete()

Objective-C

Syntax

Copied to your clipboard
- (void) trackComplete;

Example

Copied to your clipboard
[_tracker trackComplete];

JavaScript

Copied to your clipboard
tracker.trackComplete();

Java

Syntax

Copied to your clipboard
public void trackSessionEnd();

Example

Copied to your clipboard
_tracker.trackSessionEnd();

Swift

Syntax

Copied to your clipboard
func trackSessionEnd()

Example

Copied to your clipboard
_tracker.trackSessionEnd()

Objective-C

Syntax

Copied to your clipboard
- (void) trackSessionEnd;

Example

Copied to your clipboard
[_tracker trackSessionEnd];

JavaScript

Copied to your clipboard
tracker.trackSessionEnd();

Java

Syntax

Copied to your clipboard
public void trackError(String errorId);

Example

Copied to your clipboard
_tracker.trackError("errorId");

Swift

Syntax

Copied to your clipboard
func trackError(_ errorId: String)

Example

Copied to your clipboard
_tracker.trackError("errorId")

Objective-C

Syntax

Copied to your clipboard
- (void) trackError: (NSString* _Nonnull) errorId;

Example

Copied to your clipboard
[_tracker trackError:@"errorId"];

JavaScript

Copied to your clipboard
tracker.trackError("errorId");

Java

Syntax

Copied to your clipboard
public void trackEvent(Media.Event event,
Map<String, Object> info,
Map<String, String> data);

Examples

Tracking player states

Copied to your clipboard
// StateStart
HashMap<String, Object> stateObject = Media.createStateObject("fullscreen");
_tracker.trackEvent(Media.Event.StateStart, stateObject, null);
// StateEnd
HashMap<String, Object> stateObject = Media.createStateObject("fullscreen");
_tracker.trackEvent(Media.Event.StateEnd, stateObject, null);

Tracking ad breaks

Copied to your clipboard
// AdBreakStart
HashMap<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
// AdStart
HashMap<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 keys
adMetadata.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
// ChapterStart
HashMap<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 clipboard
func trackEvent(_ event: ACPMediaEvent, info: [AnyHashable : Any]?, data: [AnyHashable : Any]?)

Examples

Tracking player states

Copied to your clipboard
// StateStart
let stateObject = ACPMedia.createStateObject(withName: "fullscreen")
_tracker.trackEvent(ACPMediaEvent.stateStart, info: stateObject, data: nil)
// StateEnd
let stateObject = ACPMedia.createStateObject(withName: "fullscreen")
_tracker.trackEvent(ACPMediaEvent.stateEnd, info: stateObject, data: nil)

Tracking ad breaks

Copied to your clipboard
// AdBreakStart
let 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
// AdStart
let 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 keys
adMetadata["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
// ChapterStart
let 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) event
info: (NSDictionary* _Nullable) info
data: (NSDictionary* _Nullable) data;

Examples

Tracking player states

Copied to your clipboard
// StateStart
NSDictionary* stateObject = [ACPMedia createStateObjectWithName:@"fullscreen"];
[_tracker trackEvent:ACPMediaEventStateStart mediaObject:stateObject data:nil];
// StateEnd
NSDictionary* stateObject = [ACPMedia createStateObjectWithName:@"fullscreen"];
[_tracker trackEvent:ACPMediaEventStateEnd mediaObject:stateObject data:nil];

Tracking ad breaks

Copied to your clipboard
// AdBreakStart
NSDictionary* 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
// AdStart
NSDictionary* 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
// ChapterStart
NSDictionary* 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
// StateStart
let stateObject = ACPMedia.createStateObject("fullscreen");
tracker.trackEvent(ACPMediaEvent.EventStateStart, stateObject, null);
// StateEnd
let stateObject = ACPMedia.createStateObject("fullscreen");
tracker.trackEvent(ACPMediaEvent.EventStateEnd, stateObject, null);

Tracking ad breaks

Copied to your clipboard
// AdBreakStart
let adBreakObject = ACPMedia.createAdBreakObject("adbreak-name", 1, 0);
tracker.trackEvent(ACPMediaEvent.EventAdBreakStart, adBreakObject, null);
// AdBreakComplete
tracker.trackEvent(ACPMediaEvent.EventAdBreakComplete, null, null);

Tracking ads

Copied to your clipboard
// AdStart
let 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 keys
adMetadata["affiliate"] = "Sample affiliate";
tracker.trackEvent(ACPMediaEvent.EventAdStart, adObject, adMetadata);
// AdComplete
tracker.trackEvent(ACPMediaEvent.EventAdComplete, null, null);
// AdSkip
tracker.trackEvent(ACPMediaEvent.EventAdSkip, null, null);

Tracking chapters

Copied to your clipboard
// ChapterStart
let chapterObject = ACPMedia.createChapterObject("chapter-name", 1, 60, 0);
var chapterMetadata = new Object();
chapterMetadata["segmentType"] = "Sample segment type";
tracker.trackEvent(ACPMediaEvent.EventChapterStart, chapterObject, chapterMetadata);
// ChapterComplete
tracker.trackEvent(ACPMediaEvent.EventChapterComplete, null, null);
// ChapterSkip
tracker.trackEvent(ACPMediaEvent.EventChapterSkip, null, null);

Tracking playback events

Copied to your clipboard
// BufferStart
tracker.trackEvent(ACPMediaEvent.EventBufferStart, null, null);
// BufferComplete
tracker.trackEvent(ACPMediaEvent.EventBufferComplete, null, null);
// SeekStart
tracker.trackEvent(ACPMediaEvent.EventSeekStart, null, null);
// SeekComplete
tracker.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 change
tracker.trackEvent(ACPMediaEvent.EventBitrateChange, null, null);

Java

Syntax

Copied to your clipboard
public 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 day
double timeFromMidnightInSecond = (System.currentTimeMillis()/1000) % 86400;
_tracker.updateCurrentPlayhead(timeFromMidnightInSecond);

Swift

Syntax

Copied to your clipboard
func 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 day
double secondsSince1970 = [[NSDate date] timeIntervalSince1970];
double timeFromMidnightInSecond = fmod(secondsSince1970 , 86400);
[_tracker updateCurrentPlayhead: timeFromMidnightInSecond];

JavaScript

Copied to your clipboard
tracker.updateCurrentPlayhead(1);

Java

Syntax

Copied to your clipboard
public void updateQoEObject(Map<String, Object> qoeObject);

Example

Copied to your clipboard
HashMap<String, Object> qoeObject = Media.createQoEObject(1000000L, 2D, 25D, 10D);
_tracker.updateQoEObject(qoeObject);

Swift

Syntax

Copied to your clipboard
func updateQoEObject(_ qoeObject: [AnyHashable : Any])

Example

Copied to your clipboard
let 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 clipboard
NSDictionary* qoeObject = [ACPMedia createQoEObjectWithBitrate:1000000 startupTime:2 fps:25 droppedFrames:10];
[_tracker updateQoEObject:qoeObject];

JavaScript

Copied to your clipboard
let qoeObject = ACPMedia.createQoEObject(1000000, 2, 25, 10);
tracker.updateQoEObject(qoeObject);
Copied to your clipboard
public class Media {
public enum MediaType {
/**
* Constant defining media type for Video streams
*/
Video,
/**
* Constant defining media type for Audio streams
*/
Audio
}
}
Copied to your clipboard
typedef NS_ENUM(NSInteger, ACPMediaType) {
/**
* Constant defining media type for Video streams
*/
ACPMediaTypeVideo,
/**
* Constant defining media type for Audio streams
*/
ACPMediaTypeAudio
};

JavaScript

Copied to your clipboard
import {ACPMediaType} from '@adobe/react-native-acpmedia';
ACPMediaType.Video
ACPMediaType.Audio
Copied to your clipboard
public 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 clipboard
import {ACPMediaConstants} from '@adobe/react-native-acpmedia';
ACPMediaConstants.ACPMediaStreamTypeVod
ACPMediaConstants.ACPMediaStreamTypeLive
ACPMediaConstants.ACPMediaConstantsACPMediaStreamTypeLinear
ACPMediaConstants.ACPMediaStreamTypePodcast
ACPMediaConstants.ACPMediaStreamTypeAudiobook
ACPMediaConstants.ACPMediaStreamTypeAod
Copied to your clipboard
public 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 clipboard
FOUNDATION_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 clipboard
import {ACPMediaConstants} from '@adobe/react-native-acpmedia';
ACPMediaConstants.ACPVideoMetadataKeyShow
ACPMediaConstants.ACPVideoMetadataKeySeason
ACPMediaConstants.ACPVideoMetadataKeyEpisode
ACPMediaConstants.ACPVideoMetadataKeyAssetId
ACPMediaConstants.ACPVideoMetadataKeyGenre
ACPMediaConstants.ACPVideoMetadataKeyFirstAirDate
ACPMediaConstants.ACPVideoMetadataKeyFirstDigitalDate
ACPMediaConstants.ACPVideoMetadataKeyRating
ACPMediaConstants.ACPVideoMetadataKeyOriginator
ACPMediaConstants.ACPVideoMetadataKeyNetwork
ACPMediaConstants.ACPVideoMetadataKeyShowType
ACPMediaConstants.ACPVideoMetadataKeyAdLoad
ACPMediaConstants.ACPVideoMetadataKeyMvpd
ACPMediaConstants.ACPVideoMetadataKeyAuthorized
ACPMediaConstants.ACPVideoMetadataKeyDayPart
ACPMediaConstants.ACPVideoMetadataKeyFeed
ACPMediaConstants.ACPVideoMetadataKeyStreamFormat
Copied to your clipboard
public 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 clipboard
FOUNDATION_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 clipboard
import {ACPMediaConstants} from '@adobe/react-native-acpmedia';
ACPMediaConstants.ACPAudioMetadataKeyArtist
ACPMediaConstants.ACPAudioMetadataKeyAlbum
ACPMediaConstants.ACPAudioMetadataKeyLabel
ACPMediaConstants.ACPAudioMetadataKeyAuthor
ACPMediaConstants.ACPAudioMetadataKeyStation
ACPMediaConstants.ACPAudioMetadataKeyPublisher
Copied to your clipboard
public 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 clipboard
FOUNDATION_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 clipboard
import {ACPMediaConstants} from '@adobe/react-native-acpmedia';
ACPMediaConstants.ACPAdMetadataKeyAdvertiser
ACPMediaConstants.ACPAdMetadataKeyCampaignId
ACPMediaConstants.ACPAdMetadataKeyCreativeId
ACPMediaConstants.ACPAdMetadataKeyPlacementId
ACPMediaConstants.ACPAdMetadataKeySiteId
ACPMediaConstants.ACPAdMetadataKeyCreativeUrl
Copied to your clipboard
public 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 clipboard
FOUNDATION_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 clipboard
import {ACPMediaConstants} from '@adobe/react-native-acpmedia';
ACPMediaConstants.ACPMediaPlayerStateFullScreen
ACPMediaConstants.ACPMediaPlayerStatePictureInPicture
ACPMediaConstants.ACPMediaPlayerStateClosedCaption
ACPMediaConstants.ACPMediaPlayerStateInFocus
ACPMediaConstants.ACPMediaPlayerStateMute
Copied to your clipboard
public 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 clipboard
import {ACPMediaEvent} from '@adobe/react-native-acpmedia';
ACPMediaEvent.EventAdBreakStart
ACPMediaEvent.EventAdBreakComplete
ACPMediaEvent.EventAdStart
ACPMediaEvent.EventAdComplete
ACPMediaEvent.EventAdSkip
ACPMediaEvent.EventChapterStart
ACPMediaEvent.EventChapterComplete
ACPMediaEvent.EventChapterSkip
ACPMediaEvent.EventSeekStart
ACPMediaEvent.EventSeekComplete
ACPMediaEvent.EventBufferStart
ACPMediaEvent.EventBufferComplete
ACPMediaEvent.EventBitrateChange
ACPMediaEvent.EventStateStart
ACPMediaEvent.EventStateEnd

Java

Syntax

Copied to your clipboard
public 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 clipboard
HashMap<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 clipboard
public let ACPMediaKeyMediaResumed: String

Example

Copied to your clipboard
var 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 clipboard
FOUNDATION_EXPORT NSString* _Nonnull const ACPMediaKeyMediaResumed;

Example

Copied to your clipboard
NSDictionary *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];

JavaScript

Copied to your clipboard
let mediaObject = ACPMedia.createMediaObject("media-name", "media-id", 60, ACPMediaConstants.ACPMediaStreamTypeVod, ACPMediaType.Video);
mediaObject[ACPMediaConstants.ACPMediaKeyMediaResumed] = true
tracker.trackSessionStart(mediaObject, null);
Was this helpful?
  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2024 Adobe. All rights reserved.