Search code examples
swifttvosapple-tvavplayerviewcontrolleravplayeritem

tvOS AVPlayerItem external artwork metadata size


Ok so I’m adding an image to the Info tab of the AVPlayerViewController as such:

let artworkMetadataItem = AVMutableMetadataItem()
artworkMetadataItem.locale = NSLocale.currentLocale()
artworkMetadataItem.identifier = AVMetadataCommonIdentifierArtwork
artworkMetadataItem.value = UIImageJPEGRepresentation(image, 1.0) 
playerItem.externalMetadata.append(artworkMetadataItem)

I just want to know how to make that image larger, it shows up as a tiny picture (65x97), but it is 320x480 in actuality so it should look much larger. How do I increase the size?


Solution

  • Image scales according to the size of title and description metadata items. You can add AVMutableMetadataItem with AVMetadataCommonKeyDescription identifier and @"\n\n\n" value.

    I wish there was a better way to do it, but I couldn't find any..