Ver código fonte

Update NCPlayer.swift

Marino Faggiana 1 ano atrás
pai
commit
a47ca0185d

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

@@ -93,8 +93,12 @@ class NCPlayer: NSObject {
 
         playerToolBar?.setBarPlayer(ncplayer: self, position: positionSliderToolBar, metadata: metadata, viewerMediaPage: viewerMediaPage)
 
-        if autoplay {
-            player.play()
+        DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
+            self.player.play()
+            if !autoplay {
+                self.player.pause()
+                self.player.position = 0
+            }
         }
 
         NotificationCenter.default.addObserver(self, selector: #selector(applicationDidEnterBackground(_:)), name: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterApplicationDidEnterBackground), object: nil)