AVPlayerViewController info view which shows external meta data does not remove from view on menu press on apple tv remote

时间:2016-08-31 17:23:16

标签: objective-c tvos avplayerviewcontroller

I am setting external metadata item using below code and it is working properly but the problem I am facing is when controller is pop using apple TV remote menu that info view still exist.

AVMutableMetadataItem *titleMetadataItem = [[AVMutableMetadataItem alloc] init];
   titleMetadataItem.locale = [NSLocale currentLocale];
   titleMetadataItem.key = AVMetadataCommonKeyTitle;
   titleMetadataItem.keySpace = AVMetadataKeySpaceCommon;
   titleMetadataItem.value = @"Some value";

AVMutableMetadataItem *descriptionMetadataItem = [[AVMutableMetadataItem alloc] init];
descriptionMetadataItem.locale = [NSLocale currentLocale];
descriptionMetadataItem.identifier = AVMetadataIdentifierQuickTimeMetadataInformation;
descriptionMetadataItem.value = @"Some value";

AVMutableMetadataItem *artworkMetadataItem = [[AVMutableMetadataItem alloc] init];
artworkMetadataItem.locale = [NSLocale currentLocale];
artworkMetadataItem.key = AVMetadataCommonKeyArtwork;
artworkMetadataItem.keySpace = AVMetadataKeySpaceCommon;


NSArray *metadataArray = [[NSArray alloc] initWithObjects:titleMetadataItem,descriptionMetadataItem,artworkMetadataItem, nil];

self.playerItem.externalMetadata = metadataArray;

I am adding AVPlayerViewController view as subview on UIViewController view.

0 个答案:

没有答案