I set metadata for AVPlayer video in tvOS. The video title is always truncated, and the cover image is much smaller than it should be, my code is below, any ideas?
AVMutableMetadataItem *titleMetadataItem = [[AVMutableMetadataItem alloc] init]; titleMetadataItem.locale = NSLocale.currentLocale; titleMetadataItem.key = AVMetadataCommonKeyTitle; titleMetadataItem.keySpace = AVMetadataKeySpaceCommon; titleMetadataItem.identifier = AVMetadataCommonIdentifierTitle; titleMetadataItem.value = @"A long title that gets truncated"; AVMutableMetadataItem *artwork1 = [[AVMutableMetadataItem alloc] init]; artwork1.key = AVMetadataCommonKeyArtwork; artwork1.keySpace = AVMetadataKeySpaceCommon; artwork1.dataType = (__bridge NSString * _Nullable)(kCMMetadataBaseDataType_JPEG); UIImage *image = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:urlImgThumbnail]]]; artwork1.value = UIImageJPEGRepresentation(image, .4); artwork1.locale = [NSLocale currentLocale];
source share