How to get the artwork from live streaming audio only url in ios

348 views Asked by At

I need to fetch album artworks from all the songs played in live streaming url.I am using AVPlayer to play music from the URL.

Here is my code for getting the metadata from asset:

   AVURLAsset *ass = player.currentItem.asset;
   for (AVMetadataItem *metadataItem in ass.commonMetadata) {
        if ([metadataItem.commonKey isEqualToString:@"artwork"]){
            NSDictionary *imageDataDictionary = (NSDictionary *)metadataItem.value;
            UIImage *image = [UIImage imageWithData:imageDataDictionary];
            imgArt.image = image;
        }
    }

Note : This code was working for local mp3 file but not for live streaming URL.

0

There are 0 answers