TvOS video: header metadata trimmed, work size too small

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]; // NSArray *externalMetadata = [[NSArray alloc] initWithObjects:titleMetadataItem, artwork1, nil]; player.currentItem.externalMetadata = externalMetadata; 
+5
source share
1 answer

Currently, the best solution I could find to expand the size of the metadata view is to add the \ n pair to the description metadata element. When the size of the metadata view is increased, the displayed image will be larger. It should also prevent the reduction of your title.

+3
source

Source: https://habr.com/ru/post/1246688/


All Articles