回答

1

首先,你需要设置一个NSNotification,这样你可以在特定的时间间隔获取数据,就像这样:

[[NSNotificationCenter defaultCenter] addObserver:self 
             selector:@selector(StreamMeta:) 
             name:MPMoviePlayerTimedMetadataUpdatedNotification 
             object:nil]; 

接下来,创建方法。我将使用streamMPMoviePlayer为您MPMoviePlayerControllermetaString的名称作为NSString将存储元数据值:

- (void)StreamMeta:(NSNotification*)notification 
{ 
    if ([streamMPMoviePlayer timedMetadata] != nil) { 
     MPTimedMetadata *meta = [[streamMPMoviePlayer timedMetadata] objectAtIndex:0]; 
     metaString = meta.value; // gives the NSString the artist/song information 
    } 
    else { 
    // No metadata available 
    } 
} 
+0

看,这就是对MPMusicPlayer。我要求MPMoviePlayer在线流媒体,即无线网址流媒体。 – user2174560 2013-03-15 15:30:51

+0

@ user2174560检查我的更新。它有用吗? – lifetimes 2013-03-15 16:09:31

+1

是的,它的工作thanx ... :) – user2174560 2013-03-18 05:12:19