marinofaggiana 4 years ago
parent
commit
676ab0726c

+ 0 - 1
iOSClient/Brand/Intro/NCIntroViewController.swift

@@ -172,7 +172,6 @@ class NCIntroViewController: UIViewController, UICollectionViewDataSource, UICol
     }
 
     @IBAction func host(_ sender: Any) {
-        
         guard let url = URL(string: NCBrandOptions.shared.linkLoginHost) else { return }
         UIApplication.shared.open(url)
     }

+ 6 - 4
iOSClient/Viewer/NCViewerImage/NCViewerImage.swift

@@ -372,11 +372,13 @@ class NCViewerImage: UIViewController {
                     let width = Double(progressView.bounds.width)
                     interval = (0.5 * durationSeconds) / width
                 }
+                
                 let time = CMTime(seconds: interval, preferredTimescale: CMTimeScale(NSEC_PER_SEC))
-
-                player?.addPeriodicTimeObserver(forInterval: time, queue: nil, using: { (time) in
-                    self.updateVideoProgressBar(time: time)
-                })
+                if CMTIME_IS_VALID(time) {
+                    player?.addPeriodicTimeObserver(forInterval: time, queue: nil, using: { (time) in
+                        self.updateVideoProgressBar(time: time)
+                    })
+                }
                 
                 // At end go back to start
                 NotificationCenter.default.addObserver(forName: .AVPlayerItemDidPlayToEndTime, object: player?.currentItem, queue: .main) { (notification) in