Explorar o código

update view video

marinofaggiana %!s(int64=4) %!d(string=hai) anos
pai
achega
6b7d56e3f1

+ 8 - 0
iOSClient/Viewer/NCViewerImage/NCViewerImagePageContainer.swift

@@ -260,6 +260,14 @@ class NCViewerImagePageContainer: UIViewController, UIGestureRecognizerDelegate
     }
     
     @objc func didSingleTapWith(gestureRecognizer: UITapGestureRecognizer) {
+        // VIDEO
+        if currentMetadata.typeFile == k_metadataTypeFile_video || currentMetadata.typeFile == k_metadataTypeFile_audio {
+            if let viewerImageVideo = UIStoryboard(name: "NCViewerImageVideo", bundle: nil).instantiateInitialViewController() as? NCViewerImageVideo {
+                viewerImageVideo.metadata = currentMetadata
+                present(viewerImageVideo, animated: false) { }
+            }
+            return
+        }
         if currentMode == .full {
             changeScreenMode(to: .normal)
             currentMode = .normal

+ 20 - 8
iOSClient/Viewer/NCViewerImage/NCViewerImageVideo.storyboard

@@ -1,10 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15705" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="Mmv-kq-uRN">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="17156" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="Mmv-kq-uRN">
     <device id="retina6_1" orientation="portrait" appearance="light"/>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15706"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17126"/>
         <capability name="Safe area layout guides" minToolsVersion="9.0"/>
+        <capability name="System colors in document resources" minToolsVersion="11.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <scenes>
@@ -21,14 +22,17 @@
                                 <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"/>
+                                <rect key="frame" x="8" y="20" width="45" height="26"/>
                                 <subviews>
-                                    <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="QdX-GD-p2D">
+                                    <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>
+                                        <state key="normal">
+                                            <color key="titleColor" systemColor="systemGrayColor"/>
+                                        </state>
                                         <connections>
                                             <action selector="touchUpInsidecloseButton:" destination="Mmv-kq-uRN" eventType="touchUpInside" id="sQX-6Y-Yg3"/>
                                         </connections>
@@ -43,21 +47,21 @@
                                 </constraints>
                             </view>
                         </subviews>
-                        <color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
+                        <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="oHy-h6-oBZ" firstAttribute="top" secondItem="ZUd-xF-jbc" secondAttribute="top" constant="20" id="WU4-yL-oxZ"/>
                             <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>
-                        <viewLayoutGuide key="safeArea" id="I8r-2q-gEp"/>
                     </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"/>
+                        <outlet property="videoView" destination="U2u-Ng-quR" id="rV3-kh-dBU"/>
                     </connections>
                 </viewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="gwo-1E-fE5" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
@@ -65,4 +69,12 @@
             <point key="canvasLocation" x="18.840579710144929" y="140.625"/>
         </scene>
     </scenes>
+    <resources>
+        <systemColor name="systemBackgroundColor">
+            <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+        </systemColor>
+        <systemColor name="systemGrayColor">
+            <color red="0.55686274509803924" green="0.55686274509803924" blue="0.57647058823529407" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+        </systemColor>
+    </resources>
 </document>

+ 5 - 3
iOSClient/Viewer/NCViewerImage/NCViewerImageVideo.swift

@@ -26,7 +26,7 @@ import Foundation
 
 class NCViewerImageVideo: UIViewController {
     
-    @IBOutlet weak var backgroundView: UIView!
+    @IBOutlet weak var videoView: UIView!
     @IBOutlet weak var closeView: UIView!
     @IBOutlet weak var closeButton: UIButton!
 
@@ -41,12 +41,14 @@ class NCViewerImageVideo: UIViewController {
         super.viewDidLoad()
         
         view.backgroundColor = .black
+        
         closeView.layer.cornerRadius = 7
+        closeView.backgroundColor = .yellow
+        
         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)
-        NCViewerVideoCommon.shared.viewMedia(metadata, view: backgroundView, frame: frame)
+        NCViewerVideoCommon.shared.viewMedia(metadata, view: videoView, frame: CGRect(x: 0, y: 0, width: videoView.frame.width, height: videoView.frame.height))
     }
     
     @IBAction func touchUpInsidecloseButton(_ sender: Any) {