marinofaggiana 3 жил өмнө
parent
commit
0cd971e3f0

+ 4 - 4
iOSClient/Viewer/NCViewerImage/NCViewerImage.storyboard

@@ -271,7 +271,7 @@
                                                 <nil key="highlightedColor"/>
                                             </label>
                                             <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="F9L-PP-AbM">
-                                                <rect key="frame" x="216.99999999999994" y="63.666666666666629" width="20" height="23"/>
+                                                <rect key="frame" x="246.99999999999994" y="63.666666666666629" width="20" height="23"/>
                                                 <constraints>
                                                     <constraint firstAttribute="width" constant="20" id="hlL-XQ-OLa"/>
                                                     <constraint firstAttribute="height" constant="23" id="vEe-Fb-a9N"/>
@@ -282,7 +282,7 @@
                                                 </connections>
                                             </button>
                                             <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Isy-sX-Gji">
-                                                <rect key="frame" x="117" y="63.666666666666629" width="20" height="23"/>
+                                                <rect key="frame" x="97" y="63.666666666666629" width="20" height="23"/>
                                                 <constraints>
                                                     <constraint firstAttribute="width" constant="20" id="COm-r2-ubw"/>
                                                     <constraint firstAttribute="height" constant="23" id="mbb-ql-zCc"/>
@@ -296,17 +296,17 @@
                                         <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                                         <constraints>
                                             <constraint firstAttribute="trailing" secondItem="8AB-hx-yqN" secondAttribute="trailing" constant="10" id="4LY-8e-z3y"/>
-                                            <constraint firstItem="F9L-PP-AbM" firstAttribute="leading" secondItem="x3E-b2-obf" secondAttribute="trailing" constant="20" id="5uf-6l-2qg"/>
                                             <constraint firstAttribute="bottom" secondItem="x3E-b2-obf" secondAttribute="bottom" constant="10" id="7W8-qk-uwn"/>
                                             <constraint firstAttribute="bottom" secondItem="8AB-hx-yqN" secondAttribute="bottom" constant="10" id="CUW-6d-CGn"/>
                                             <constraint firstAttribute="height" constant="100" id="EyI-HW-pHA"/>
                                             <constraint firstItem="Isy-sX-Gji" firstAttribute="centerY" secondItem="x3E-b2-obf" secondAttribute="centerY" id="Hif-Fa-xc2"/>
-                                            <constraint firstItem="x3E-b2-obf" firstAttribute="leading" secondItem="Isy-sX-Gji" secondAttribute="trailing" constant="30" id="HqJ-Pz-igl"/>
                                             <constraint firstAttribute="trailing" secondItem="SR4-e8-1hC" secondAttribute="trailing" constant="10" id="Q3r-ex-Cpf"/>
+                                            <constraint firstItem="F9L-PP-AbM" firstAttribute="leading" secondItem="x3E-b2-obf" secondAttribute="trailing" constant="50" id="VPD-ln-2aN"/>
                                             <constraint firstItem="SR4-e8-1hC" firstAttribute="leading" secondItem="sBp-t2-eFh" secondAttribute="leading" constant="10" id="Xec-gd-9AB"/>
                                             <constraint firstItem="F9L-PP-AbM" firstAttribute="centerY" secondItem="x3E-b2-obf" secondAttribute="centerY" id="cIu-i5-mbJ"/>
                                             <constraint firstAttribute="trailing" secondItem="OUD-HH-cXH" secondAttribute="trailing" constant="10" id="j5v-RG-0JI"/>
                                             <constraint firstItem="kVv-X4-6SK" firstAttribute="top" secondItem="SR4-e8-1hC" secondAttribute="bottom" id="l6a-l5-ZvL"/>
+                                            <constraint firstItem="x3E-b2-obf" firstAttribute="leading" secondItem="Isy-sX-Gji" secondAttribute="trailing" constant="50" id="sIc-bL-Yjz"/>
                                             <constraint firstItem="x3E-b2-obf" firstAttribute="centerX" secondItem="sBp-t2-eFh" secondAttribute="centerX" id="uPa-tM-Vx6"/>
                                             <constraint firstItem="SR4-e8-1hC" firstAttribute="top" secondItem="sBp-t2-eFh" secondAttribute="top" constant="15" id="uu1-ai-wmJ"/>
                                             <constraint firstItem="OUD-HH-cXH" firstAttribute="top" secondItem="SR4-e8-1hC" secondAttribute="bottom" constant="-3" id="wwk-tz-5dj"/>

+ 7 - 5
iOSClient/Viewer/NCViewerVideo/NCViewerVideo.swift

@@ -83,11 +83,7 @@ class NCViewerVideo: NSObject {
             }
                         
             self.rateObserver = self.player?.addObserver(self, forKeyPath: "rate", options: [], context: nil)
-            
-            if self.pictureInPictureOcId != metadata.ocId {
-                self.player?.play()
-            }
-            
+            self.player?.play()
             
             viewerVideoToolBar?.setBarPlayer(player: self.player)
         }
@@ -136,6 +132,8 @@ class NCViewerVideo: NSObject {
                 if let time = NCManageDatabase.shared.getVideoTime(metadata: metadata) {
                     self.player?.seek(to: time)
                     self.player?.isMuted = CCUtility.getAudioMute()
+                    let timeSecond = Double(CMTimeGetSeconds(time))
+                    print("Play video at: \(timeSecond)")
                 }
                 
             } else if !metadata.livePhoto {
@@ -145,6 +143,10 @@ class NCViewerVideo: NSObject {
                     let durationSeconds = Double(CMTimeGetSeconds(duration))
                     if timeSecond < durationSeconds {
                         NCManageDatabase.shared.addVideoTime(metadata: metadata, time: self.player?.currentTime())
+                        if let time = self.player?.currentTime() {
+                            let timeSecond = Double(CMTimeGetSeconds(time))
+                            print("Stop video at: \(timeSecond)")
+                        }
                     } else {
                         NCManageDatabase.shared.deleteVideoTime(metadata: metadata)
                     }