marinofaggiana 4 years ago
parent
commit
e7cf5a2c64

+ 10 - 10
iOSClient/Main/Account Request/NCAccountRequest.storyboard

@@ -37,28 +37,28 @@
                                 <rect key="frame" x="10" y="113" width="280" height="187"/>
                                 <color key="backgroundColor" systemColor="systemBackgroundColor"/>
                                 <prototypes>
-                                    <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="none" indentationWidth="10" reuseIdentifier="Cell" rowHeight="43.5" id="Q4K-la-J3W">
-                                        <rect key="frame" x="0.0" y="28" width="280" height="43.5"/>
+                                    <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="none" indentationWidth="10" reuseIdentifier="Cell" rowHeight="60" id="Q4K-la-J3W">
+                                        <rect key="frame" x="0.0" y="28" width="280" height="60"/>
                                         <autoresizingMask key="autoresizingMask"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="Q4K-la-J3W" id="IkA-cK-iZV">
-                                            <rect key="frame" x="0.0" y="0.0" width="280" height="43.5"/>
+                                            <rect key="frame" x="0.0" y="0.0" width="280" height="60"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                             <subviews>
                                                 <imageView clipsSubviews="YES" userInteractionEnabled="NO" tag="10" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="4cH-oC-YBd" userLabel="Avatar">
-                                                    <rect key="frame" x="5" y="7" width="30" height="30"/>
+                                                    <rect key="frame" x="0.0" y="10" width="40" height="40"/>
                                                     <constraints>
-                                                        <constraint firstAttribute="height" constant="30" id="Efd-BU-u61"/>
-                                                        <constraint firstAttribute="width" constant="30" id="qFy-Tu-ov6"/>
+                                                        <constraint firstAttribute="height" constant="40" id="Efd-BU-u61"/>
+                                                        <constraint firstAttribute="width" constant="40" id="qFy-Tu-ov6"/>
                                                     </constraints>
                                                 </imageView>
                                                 <label opaque="NO" userInteractionEnabled="NO" tag="20" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="pWI-iZ-BTy" userLabel="Account">
-                                                    <rect key="frame" x="40" y="14.5" width="210" height="14.5"/>
+                                                    <rect key="frame" x="45" y="23" width="210" height="14.5"/>
                                                     <fontDescription key="fontDescription" type="system" pointSize="12"/>
                                                     <nil key="textColor"/>
                                                     <nil key="highlightedColor"/>
                                                 </label>
                                                 <imageView clipsSubviews="YES" userInteractionEnabled="NO" tag="30" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="x47-dQ-alI" userLabel="Active">
-                                                    <rect key="frame" x="255" y="12" width="20" height="20"/>
+                                                    <rect key="frame" x="260" y="20" width="20" height="20"/>
                                                     <constraints>
                                                         <constraint firstAttribute="height" constant="20" id="SXt-LG-c5N"/>
                                                         <constraint firstAttribute="width" constant="20" id="vdZ-4R-gY5"/>
@@ -66,8 +66,8 @@
                                                 </imageView>
                                             </subviews>
                                             <constraints>
-                                                <constraint firstItem="4cH-oC-YBd" firstAttribute="leading" secondItem="IkA-cK-iZV" secondAttribute="leading" constant="5" id="3cz-yE-yoQ"/>
-                                                <constraint firstAttribute="trailing" secondItem="x47-dQ-alI" secondAttribute="trailing" constant="5" id="Dna-rj-LLQ"/>
+                                                <constraint firstItem="4cH-oC-YBd" firstAttribute="leading" secondItem="IkA-cK-iZV" secondAttribute="leading" id="3cz-yE-yoQ"/>
+                                                <constraint firstAttribute="trailing" secondItem="x47-dQ-alI" secondAttribute="trailing" id="Dna-rj-LLQ"/>
                                                 <constraint firstItem="x47-dQ-alI" firstAttribute="centerY" secondItem="IkA-cK-iZV" secondAttribute="centerY" id="Ghs-sZ-Bzf"/>
                                                 <constraint firstItem="pWI-iZ-BTy" firstAttribute="centerY" secondItem="IkA-cK-iZV" secondAttribute="centerY" id="TaB-23-hA1"/>
                                                 <constraint firstItem="4cH-oC-YBd" firstAttribute="centerY" secondItem="IkA-cK-iZV" secondAttribute="centerY" id="WuT-iT-3xk"/>

+ 4 - 0
iOSClient/Main/Account Request/NCAccountRequest.swift

@@ -115,6 +115,10 @@ extension NCAccountRequest: UITableViewDelegate {
 //        startTimer()
     }
     
+    func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
+        return 60
+    }
+    
     func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
         
         let account = accounts[indexPath.row]

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

@@ -59,6 +59,7 @@ class NCViewerImage: UIViewController {
     private var videoLayer: AVPlayerLayer?
     private var timeObserverToken: Any?
     private var rateObserverToken: Any?
+    private var timeObserver: Any?
     var pictureInPictureOcId: String = ""
     var textColor: UIColor = NCBrandColor.shared.textView
 
@@ -375,7 +376,7 @@ class NCViewerImage: UIViewController {
                 
                 let time = CMTime(seconds: interval, preferredTimescale: CMTimeScale(NSEC_PER_SEC))
                 if CMTIME_IS_VALID(time) {
-                    player?.addPeriodicTimeObserver(forInterval: time, queue: nil, using: { (time) in
+                    timeObserver = player?.addPeriodicTimeObserver(forInterval: time, queue: nil, using: { (time) in
                         self.updateVideoProgressBar(time: time)
                     })
                 }
@@ -402,6 +403,10 @@ class NCViewerImage: UIViewController {
         player?.pause()
         player?.seek(to: CMTime.zero)
         
+        if let timeObserver = timeObserver {
+            player?.removeTimeObserver(timeObserver)
+        }
+        
         if rateObserverToken != nil {
             player?.removeObserver(self, forKeyPath: "rate")
             NotificationCenter.default.removeObserver(self, name: NSNotification.Name.AVPlayerItemDidPlayToEndTime, object: nil)