Implement standard metadata on iOS
Last update: November 11, 2022
- Topics:
- Media Analytics
CREATED FOR:
- User
- Admin
- Developer
Metadata constants
Constant name | Description |
---|---|
ADBMediaObjectKeyStandardMediaMetadata | Constant for attaching standard metadata on MediaInfo ADBMediaObject |
Implementation
-
Create a dictionary of standard metadata key value pairs using the
ADBStandardMetadataKeys
IOS metadata keys -
Set the standard metadata dictionary on
MediaInfo
ADBMediaObject
instance using the Standard Metadata constant for metadata. -
Provide this
MediaInfo
object while invoking thetrackSessionStart
API.
Sample implementation
Instantiate a standard metdata object, populate the desired variables, and set the metadata object on the Media Heartbeat object. For example:
// Sample implementation for using standard video metadata keys
NSMutableDictionary *standardVideoMetadata = [[NSMutableDictionary alloc] init];
[standardVideoMetadata setObject:@"Sample Show" forKey:ADBVideoMetadataKeySHOW];
[standardVideoMetadata setObject:@"Sample Season" forKey:ADBVideoMetadataKeySEASON];
[standardVideoMetadata setObject:@"Sample Episode" forKey:ADBVideoMetadataKeyEPISODE];
[mediaObject setValue:standardVideoMetadata forKey:ADBMediaObjectKeyStandardMediaMetadata];
// Sample implementation for using standard audio metadata keys
NSMutableDictionary *standardAudioMetadata = [[NSMutableDictionary alloc] init];
[standardAudioMetadata setObject:@"Sample Album" forKey:ADBAudioMetadataKeyALBUM];
[standardAudioMetadata setObject:@"Sample Label" forKey:ADBAudioMetadataKeyLABEL];
[mediaObject setValue:standardAudioMetadata forKey:ADBMediaObjectKeyStandardMediaMetadata];
recommendation-more-help
c8eee520-cef5-4f8c-a38a-d4952cfae4eb