marinofaggiana 4 years ago
parent
commit
e1ce79f40e

+ 2 - 0
iOSClient/Main/Menu/NCViewer+Menu.swift

@@ -263,6 +263,7 @@ extension NCViewer {
         //
         // IMAGE - VIDEO - AUDIO
         //
+        /*
         if metadata.session == "" {
             if (metadata.typeFile == k_metadataTypeFile_image || metadata.typeFile == k_metadataTypeFile_video || metadata.typeFile == k_metadataTypeFile_audio) && !CCUtility.fileProviderStorageExists(appDelegate.activeDetail.metadata?.ocId, fileNameView: appDelegate.activeDetail.metadata?.fileNameView) && metadata.session == "" && metadata.typeFile == k_metadataTypeFile_image {
                 actions.append(
@@ -275,6 +276,7 @@ extension NCViewer {
                 )
             }
         }
+        */
         
         if metadata.typeFile == k_metadataTypeFile_image || metadata.typeFile == k_metadataTypeFile_video || metadata.typeFile == k_metadataTypeFile_audio {
             if let metadataLive = NCManageDatabase.sharedInstance.isLivePhoto(metadata: metadata) {

+ 3 - 29
iOSClient/Viewer/NCViewerVideo/NCViewerVideo.storyboard

@@ -18,47 +18,21 @@
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <subviews>
                             <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="U2u-Ng-quR">
-                                <rect key="frame" x="0.0" y="69" width="414" height="773"/>
+                                <rect key="frame" x="0.0" y="44" width="414" height="818"/>
                                 <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                             </view>
-                            <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="oHy-h6-oBZ">
-                                <rect key="frame" x="8" y="44" width="45" height="26"/>
-                                <subviews>
-                                    <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="QdX-GD-p2D">
-                                        <rect key="frame" x="11.5" y="2" width="22" height="22"/>
-                                        <constraints>
-                                            <constraint firstAttribute="height" constant="22" id="dQc-qo-agC"/>
-                                            <constraint firstAttribute="width" constant="22" id="xnb-gI-bEr"/>
-                                        </constraints>
-                                        <connections>
-                                            <action selector="touchUpInsidecloseButton:" destination="Mmv-kq-uRN" eventType="touchUpInside" id="sQX-6Y-Yg3"/>
-                                        </connections>
-                                    </button>
-                                </subviews>
-                                <color key="backgroundColor" white="0.33333333333333331" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
-                                <constraints>
-                                    <constraint firstItem="QdX-GD-p2D" firstAttribute="centerX" secondItem="oHy-h6-oBZ" secondAttribute="centerX" id="4aU-y2-eVX"/>
-                                    <constraint firstItem="QdX-GD-p2D" firstAttribute="centerY" secondItem="oHy-h6-oBZ" secondAttribute="centerY" id="mBW-kE-lTZ"/>
-                                    <constraint firstAttribute="height" constant="26" id="qKQ-Gt-Qwc"/>
-                                    <constraint firstAttribute="width" constant="45" id="zII-t1-FVR"/>
-                                </constraints>
-                            </view>
                         </subviews>
                         <viewLayoutGuide key="safeArea" id="I8r-2q-gEp"/>
                         <color key="backgroundColor" systemColor="systemBackgroundColor"/>
                         <constraints>
-                            <constraint firstItem="U2u-Ng-quR" firstAttribute="top" secondItem="I8r-2q-gEp" secondAttribute="top" constant="25" id="JMx-LP-euj"/>
-                            <constraint firstItem="I8r-2q-gEp" firstAttribute="bottom" secondItem="U2u-Ng-quR" secondAttribute="bottom" constant="20" id="OB5-oL-uWd"/>
-                            <constraint firstItem="oHy-h6-oBZ" firstAttribute="leading" secondItem="ZUd-xF-jbc" secondAttribute="leading" constant="8" id="V0z-bW-qho"/>
-                            <constraint firstItem="oHy-h6-oBZ" firstAttribute="top" secondItem="I8r-2q-gEp" secondAttribute="top" id="WU4-yL-oxZ"/>
+                            <constraint firstItem="U2u-Ng-quR" firstAttribute="top" secondItem="I8r-2q-gEp" secondAttribute="top" id="JMx-LP-euj"/>
+                            <constraint firstItem="I8r-2q-gEp" firstAttribute="bottom" secondItem="U2u-Ng-quR" secondAttribute="bottom" id="OB5-oL-uWd"/>
                             <constraint firstAttribute="trailing" secondItem="U2u-Ng-quR" secondAttribute="trailing" id="fK9-2n-mIB"/>
                             <constraint firstItem="U2u-Ng-quR" firstAttribute="leading" secondItem="ZUd-xF-jbc" secondAttribute="leading" id="zBR-Jl-ZtK"/>
                         </constraints>
                     </view>
                     <connections>
                         <outlet property="backgroundView" destination="U2u-Ng-quR" id="f7b-ke-Ojf"/>
-                        <outlet property="closeButton" destination="QdX-GD-p2D" id="1Qj-mY-fpU"/>
-                        <outlet property="closeView" destination="oHy-h6-oBZ" id="ii6-LY-JDp"/>
                     </connections>
                 </viewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="gwo-1E-fE5" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>

+ 1 - 21
iOSClient/Viewer/NCViewerVideo/NCViewerVideo.swift

@@ -27,8 +27,6 @@ import Foundation
 class NCViewerVideo: UIViewController {
     
     @IBOutlet weak var backgroundView: UIView!
-    @IBOutlet weak var closeView: UIView!
-    @IBOutlet weak var closeButton: UIButton!
 
     let appDelegate = UIApplication.shared.delegate as! AppDelegate
     var metadata = tableMetadata()
@@ -41,11 +39,7 @@ class NCViewerVideo: UIViewController {
         super.viewDidLoad()
         
         view.backgroundColor = .black
-        closeView.layer.cornerRadius = 7
-        let image = CCGraphics.changeThemingColorImage(UIImage(named: "exit"), width: 50, height: 50, color: .black)
-        closeButton.setImage(image, for: .normal)
-        
-        let frame = CGRect(x: 0, y: 0, width: self.backgroundView.frame.width, height: self.backgroundView.frame.height)
+        let frame = CGRect(x: 0, y: 0, width: backgroundView.frame.width, height: backgroundView.frame.height)
         NCViewerVideoCommon.sharedInstance.viewMedia(metadata, view: backgroundView, frame: frame)
     }
     
@@ -66,18 +60,4 @@ class NCViewerVideo: UIViewController {
     @objc func openMenuMore() {
         NCViewer.shared.toggleMoreMenu(viewController: self, metadata: metadata)
     }
-    
-    @IBAction func touchUpInsidecloseButton(_ sender: Any) {
-        
-        if appDelegate.player != nil && appDelegate.player.rate != 0 {
-            appDelegate.player.pause()
-        }
-        
-        if appDelegate.isMediaObserver {
-            appDelegate.isMediaObserver = false
-            NCViewerVideoCommon.sharedInstance.removeObserver()
-        }
-
-        dismiss(animated: false) { }
-    }
 }