cocoa|锁屏显示正在播放的音乐
Class playingInfoCenter = NSClassFromString(@"MPNowPlayingInfoCenter");
if (playingInfoCenter) {NSMutableDictionary *songInfo = [ [NSMutableDictionary alloc] init];
MPMediaItemArtwork *albumArt = [ [MPMediaItemArtwork alloc] initWithImage: [UIImage imagedNamed:@"AlbumArt"] ];
[ songInfo setObject: @"Audio Title" forKey:MPMediaItemPropertyTitle ];
[ songInfo setObject: @"Audio Author" forKey:MPMediaItemPropertyArtist ];
[ songInfo setObject: @"Audio Album" forKey:MPMediaItemPropertyAlbumTitle ];
[ songInfo setObject: albumArt forKey:MPMediaItemPropertyArtwork ];
[ [MPNowPlayingInfoCenter defaultCenter] setNowPlayingInfo:songInfo ];
}
【cocoa|锁屏显示正在播放的音乐】
推荐阅读
- CocoaAsyncSocket|CocoaAsyncSocket (GCDAsyncSocket)适配IPv6
- 工程中屏蔽CocoaPods里的警告
- 后端返回image的Buffer,显示图片
- Android实现未读消息小红点显示实例
- 球幕系统哪些是决定显示效果的关键因素()
- css|css中元素的显示与隐藏
- 批量获取win10的聚焦锁屏图片
- jvm常用命令
- echarts插件-从后台请求的数据在页面显示空白的问题
- Latex文档中高亮显示代码