Browse Source

fix autostart video

Signed-off-by: Marino Faggiana <marino@marinofaggiana.com>
Marino Faggiana 2 years ago
parent
commit
978993f115

+ 2 - 1
iOSClient/Viewer/NCViewerMedia/NCPlayer/NCPlayer.swift

@@ -135,7 +135,8 @@ class NCPlayer: NSObject {
             if let player = self.player,
                let playerItem = player.currentItem,
                let object = player.currentItem,
-               playerItem === object {
+               playerItem === object,
+               self.viewController != nil {
 
                 if self.isStartPlayer {
                     return

+ 0 - 1
iOSClient/Viewer/NCViewerMedia/NCViewerMedia.swift

@@ -77,7 +77,6 @@ class NCViewerMedia: UIViewController {
         print("deinit NCViewerMedia")
 
         self.tipView?.dismiss()
-        NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterPauseMedia, userInfo: nil)
         NotificationCenter.default.removeObserver(self, name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterOpenMediaDetail), object: nil)
     }