Sam*_*mir 5 avfoundation seekbar avaudioplayer 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]
并且还可以访问应用程序委托中的远程事件,以便从锁定屏幕播放,暂停,下一个,上一个事件.但搜索栏无法访问,即使我没有找到任何设置搜索属性的选项.
我想设置搜索属性,并希望在我的应用程序中访问搜索滑块更改事件.

我相信支持向前和向后搜索的唯一方法是通过上一个/前进按钮(它们在按住时发送开始/结束搜索通知)。
UIEventSubtypeRemoteControlBeginSeekingBackward, UIEventSubtypeRemoteControlBeginSeekingForward,
UIEventSubtypeRemoteControlEndSeekingBackward, UIEventSubtypeRemoteControlEndSeekingForward
Run Code Online (Sandbox Code Playgroud)
根据其他一些问题和文档,搜索栏只能通过Apple自己的应用程序访问( /sf/answers/1409949901/,/sf/answers/1463691281/ )。根据最后一个答案,似乎有些应用程序(尤其是 Spotify)通过音乐播放器路由音乐以利用搜索栏。