I would like to get the file name and, if possible, album image from a streaming URL in a AVPlayerItem that I am playing with AVQueuePlayer but I don\'t know how to go about doi
When retrieving a particular item I would use the Metadata common keys constant declared in AVMetadataFormat.h, i.e.: AVMetadataCommonKeyTitle.
NSUInteger titleIndex = [avItem.asset.commonMetadata indexOfObjectPassingTest:^BOOL(id obj, NSUInteger idx, BOOL *stop) {
AVMutableMetadataItem *metaItem = (AVMutableMetadataItem *)obj;
if ([metaItem.commonKey isEqualToString:AVMetadataCommonKeyTitle]) {
return YES;
}
return NO;
}];
AVMutableMetadataItem *item = [avItem.asset.commonMetadata objectAtIndex:titleIndex];
NSString *title = (NSString *)item.value;