Browse Source

auto play video

marinofaggiana 5 years ago
parent
commit
cd197521d2
1 changed files with 4 additions and 1 deletions
  1. 4 1
      iOSClient/Viewer/NCViewerMedia.swift

+ 4 - 1
iOSClient/Viewer/NCViewerMedia.swift

@@ -89,7 +89,10 @@ class NCViewerMedia: NSObject {
         
         appDelegate.player.addObserver(self, forKeyPath: "rate", options: [], context: nil)
         appDelegate.isMediaObserver = true
-        appDelegate.player.play()
+        
+        DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
+            self.appDelegate.player.play()
+        }
     }
     
     override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {