2014-11-14 2 views
8

컨트롤 센터에서 사용할 수있는 재생 컨트롤에 대한 지원을 구현하려고합니다. 플레이/I 시도하고 내가 어떤 이벤트를하지 않는 재생 위치를 드래그 그러나 때 등,ControlCenter에서 검색을 구현하는 방법은 무엇입니까?

UIEventTypeRemoteControl 이벤트를 처리하고 하위 UIEventSubtypeRemoteControlPlay/UIEventSubtypeRemoteControlPause 찾고 있어요 등을 일시 중지합니다. 탐색을 처리하는 다른 방법이 있습니까? 이벤트의

답변

9

당신은 음악 응용 프로그램을 사용할 때이하는 것처럼 트랙이 줄을 추구하여 트랙 위치를 추구 할 수 없다. 앱에서 검색 바를 사용하려면 트랙이 기기의 음악 라이브러리에 있어야합니다. 화면 잠금/제어 센터 추적을 지원하는 앱을 많이 보았지만 기기의 뮤직 라이브러리에서 트랙을 가져 왔습니다. SoundCloud와 같은 앱은이 시점에서 트랙 탐색을 지원하지 않습니다.

앞으로 및 뒤로 탐색을 지원하는 유일한 방법은 길게 누르면 시작/끝 찾기 알림을 보내는 이전/다음 버튼입니다.

UIEventSubtypeRemoteControlBeginSeekingBackward, UIEventSubtypeRemoteControlBeginSeekingForward, 
UIEventSubtypeRemoteControlEndSeekingBackward, UIEventSubtypeRemoteControlEndSeekingForward 

다른 답변에 따르면 현재로서는 추구 할 수없는 것으로 보입니다. https://stackoverflow.com/a/21555847/1781918, https://stackoverflow.com/a/20909875/1781918

0

목록 :

UIEventSubtypeRemoteControlPlay 
    UIEventSubtypeRemoteControlPause 
    UIEventSubtypeRemoteControlStop 
    UIEventSubtypeRemoteControlTogglePlayPause 
    UIEventSubtypeRemoteControlNextTrack 
    UIEventSubtypeRemoteControlPreviousTrack 
    // may be it is what you want 
    UIEventSubtypeRemoteControlBeginSeekingBackward 
    UIEventSubtypeRemoteControlEndSeekingBackward 
    UIEventSubtypeRemoteControlBeginSeekingForward 
    UIEventSubtypeRemoteControlEndSeekingForward 

는 또한 MPNowPlayingInfoCenter이 키를 가지고 :

MPNowPlayingInfoPropertyElapsedPlaybackTime; 
관련 문제