Browse Source

Remote Command Center

Signed-off-by: marinofaggiana <marino@marinofaggiana.com>
marinofaggiana 3 năm trước cách đây
mục cha
commit
c8da10b6a1
1 tập tin đã thay đổi với 7 bổ sung0 xóa
  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