读取mp3里的图片

来源:互联网 发布:130万网络摄像机软件 编辑:程序博客网 时间:2024/04/29 09:45

    NSURL *url = [NSURLURLWithString:@"http://xxx.mp3"];

    

    AVAsset *asset = [AVAssetassetWithURL:url];

    for (AVMetadataItem *metadataItemin asset.commonMetadata) {

 

        if ([metadataItem.commonKeyisEqualToString:@"artwork"]){

            NSDictionary *imageDataDictionary = (NSDictionary *)metadataItem.value;

            NSData *imageData = [imageDataDictionaryobjectForKey:@"data"];

            UIImage *image = [UIImageimageWithData:imageData];

            // Display this image on my UIImageView property imageView

            // self.imageView.image = image; 

        }

    }

原创粉丝点击