marinofaggiana 4 years ago
parent
commit
f373c56f5f
1 changed files with 1 additions and 4 deletions
  1. 1 4
      iOSClient/Viewer/NCViewerVideoAudio/NCViewerVideoAudio.swift

+ 1 - 4
iOSClient/Viewer/NCViewerVideoAudio/NCViewerVideoAudio.swift

@@ -55,13 +55,10 @@ class NCViewerVideoAudio: AVPlayerViewController {
         
             // At end go back to start
             NotificationCenter.default.addObserver(forName: .AVPlayerItemDidPlayToEndTime, object: nil, queue: nil) { (notification) in
-                
-                let player = notification.object as! AVPlayerItem
-                player.seek(to: CMTime.zero, completionHandler: nil)
+                self.player?.seek(to: CMTime.zero)
             }
         
             player?.addObserver(self, forKeyPath: "rate", options: [], context: nil)
-            
             player?.play()
         }
     }