Explorar o código

Remote Command Center

Signed-off-by: marinofaggiana <marino@marinofaggiana.com>
marinofaggiana %!s(int64=3) %!d(string=hai) anos
pai
achega
c8da10b6a1
Modificáronse 1 ficheiros con 7 adicións e 0 borrados
  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