소스 검색

Remote Command Center

Signed-off-by: marinofaggiana <marino@marinofaggiana.com>
marinofaggiana 3 년 전
부모
커밋
c8da10b6a1
1개의 변경된 파일7개의 추가작업 그리고 0개의 파일을 삭제
  1. 7 0
      iOSClient/Viewer/NCViewerMedia/NCPlayer/NCPlayer.swift

+ 7 - 0
iOSClient/Viewer/NCViewerMedia/NCPlayer/NCPlayer.swift

@@ -197,8 +197,15 @@ class NCPlayer: NSObject {
             print(error)
         }
         
+        // Remote Command Center
         UIApplication.shared.endReceivingRemoteControlEvents()
         MPNowPlayingInfoCenter.default().nowPlayingInfo = [:]
+        if let playCommand = playerToolBar?.playCommand {
+            MPRemoteCommandCenter.shared().playCommand.removeTarget(playCommand)
+        }
+        if let pauseCommand = playerToolBar?.pauseCommand {
+            MPRemoteCommandCenter.shared().pauseCommand.removeTarget(pauseCommand)
+        }
     }
     
     //MARK: - NotificationCenter