I use MPMoviePlayerController to stream audio. I also use its timedMetadata property to get the ID3 tag of the mp3 song. This works just fine in iOS 4.x but not in iOS 5.
Here is the piece of code the I use:
MPMoviePlayerController* streamPlayer;
// allocation and initialization code ...
- (void) metadataUpdate: (id) sender {
NSLog(@"GOT METADATA!!!!!");
if ([streamPlayer timedMetadata]!=nil && [[streamPlayer timedMetadata] count] > 0) {
NSLog(@"metadata count = %d", [[streamPlayer timedMetadata] count]);
for (MPTimedMetadata *metadata in [streamPlayer timedMetadata]) {
NSLog(@"description %@", metadata.allMetadata);
if ([[metadata.allMetadata valueForKey:@"key"] isEqualToString:@"title"]) {
song.text = [metadata.allMetadata valueForKey:@"value"];
filename = song.text;
}
}
}
}
More specifically, under iOS 5 the metadata.allMetadata returns blank in the above code while the [[streamPlayer timedMetadata] count] is 2.
is this a bug in iOS 5?