相关疑难解决方法(0)

如何在iOS Lock Screen控制面板中启用音频滑块?

我有以下MPNowPlayingInfoCenter字典

@{MPMediaItemPropertyAlbumTitle: @"First Title",
                                MPMediaItemPropertyArtwork: [[MPMediaItemArtwork alloc] initWithImage:[UIImage imageNamed:@"Album-Cover.jpg"]],
                                MPMediaItemPropertyPlaybackDuration:[NSNumber numberWithDouble:self.storyAudioPlayer.duration],
                                MPNowPlayingInfoPropertyElapsedPlaybackTime:[NSNumber numberWithDouble:self.storyAudioPlayer.currentTime],
                                MPNowPlayingInfoPropertyPlaybackRate:@1.0
                                }
Run Code Online (Sandbox Code Playgroud)

其他一切工作正常,但我无法使用滑块寻找歌曲.如图所示.我错过了什么参数?

锁屏截图

avaudioplayer ios avaudiosession mpnowplayinginfocenter

13
推荐指数
1
解决办法
4649
查看次数

在锁定屏幕上设置和访问iOS搜索栏

我正在使用AVQueuePlayer/AVFoundation在iOS应用程序中播放音频文件.我已经设置了MPNowPlayingInfoCenter现在播放的信息,如专辑标题,艺术家,艺术品,像这样

NSMutableDictionary *albumInfo = [[NSMutableDictionary alloc] init];
MPMediaItemArtwork *artworkP;
UIImage *artWork = [UIImage imageNamed:album.imageUrl];
[albumInfo setObject:album.title forKey:MPMediaItemPropertyTitle];
[albumInfo setObject:album.auther forKey:MPMediaItemPropertyArtist];
[albumInfo setObject:album.title forKey:MPMediaItemPropertyAlbumTitle];
[albumInfo setObject:artworkP forKey:MPMediaItemPropertyArtwork];
[[MPNowPlayingInfoCenter defaultCenter] setNowPlayingInfo:albumInfo]

并且还可以访问应用程序委托中的远程事件,以便从锁定屏幕播放,暂停,下一个,上一个事件.但搜索栏无法访问,即使我没有找到任何设置搜索属性的选项.

我想设置搜索属性,并希望在我的应用程序中访问搜索滑块更改事件.

这是锁定屏幕的屏幕截图.

avfoundation seekbar avaudioplayer ios

5
推荐指数
1
解决办法
2744
查看次数