更新时间:2023-02-03 10:31:08
You can control this information with the MPNowPlayingInfoCenter. The defaultCenter
's nowPlayingInfo
dictionary controls what is displayed about the current audio track on the lock screen and command center.
MPNowPlayingInfoCenter *infoCenter = [MPNowPlayingInfoCenter defaultCenter];
NSDictionary *nowPlayingInfo = @{
MPMediaItemPropertyTitle : @"Media Name",
MPMediaItemPropertyArtist : @"Media Artist"
};
[infoCenter setNowPlayingInfo:[NSDictionary dictionaryWithDictionary:nowPlayingInfo]];
文档中列出了完整的键列表,但是您似乎想将曲目名称设置为空字符串.
The full list of keys are listed in the docs, but it looks like you want to set the track name to the empty string.
MPMediaItemPropertyTitle : @""