Show Menu
TOPICS×

Implement standard metadata on iOS

Metadata constants

Constant name
Description  
ADBMediaObjectKeyStandardMediaMetadata
Constant for attaching standard metadata on
MediaInfo ADBMediaObject

Implementation

  1. Create a dictionary of standard metadata key value pairs using the
    ADBStandardMetadataKeys
    IOS metadata keys
  2. Set the standard metadata dictionary on
    MediaInfo
    ADBMediaObject
    instance using the Standard Metadata constant for metadata.
  3. Provide this
    MediaInfo
    object while invoking the
    trackSessionStart
    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];