视频录制bug修复

This commit is contained in:
kai60
2020-10-19 22:17:35 +08:00
parent 52c13cc416
commit 0611c6147b
12 changed files with 85 additions and 34 deletions
@@ -22,7 +22,7 @@
if (self) {
CGFloat viewH =200;
UIView *holdView = [[UIView alloc] initWithFrame:CGRectMake(0,frame.size.height/2 -viewH, kScreenSize.width, viewH)];
UIView *holdView = [[UIView alloc] initWithFrame:self.bounds];
self.backgroundColor = TABLE_BACKGROUD_COLOR;
holdView.backgroundColor = TABLE_BACKGROUD_COLOR;
//self.backgroundColor = [UIColor redColor];
@@ -55,15 +55,15 @@
if (self.dataType == noDataViewTypeNOSDCard) {
CGFloat imgX = self.frame.size.width/2 - 110*KWidth_Scale/2;
self.backImg.frame =CGRectMake(imgX ,kScreenSize.height/4,110*KWidth_Scale, 110*KWidth_Scale*0.82);
CGFloat imgX = self.frame.size.width/2 - 110/2;
self.backImg.frame =CGRectMake(imgX,(self.frame.size.height-110*0.82)/2, 110, 110*0.82);
self.title.frame =CGRectMake(0, CGRectGetMaxY(self.backImg.frame) + 20 , self.frame.size.width,20);
self.subTitle.frame = CGRectMake(0, CGRectGetMaxY(self.title.frame) + 10, self.frame.size.width,20);
}else{
CGFloat imgX = self.frame.size.width/2 - 90*KWidth_Scale/2;
self.backImg.frame =CGRectMake(imgX ,kScreenSize.height/4,90*KWidth_Scale, 90*KWidth_Scale*0.86);
CGFloat imgX = self.frame.size.width/2 - 110/2;
self.backImg.frame =CGRectMake(imgX,(self.frame.size.height-110*0.82)/2, 110, 110*0.82);
self.title.frame =CGRectMake(0, CGRectGetMaxY(self.backImg.frame) + 23 , self.frame.size.width,20);
//self.backgroundColor = [UIColor blueColor];
}
@@ -73,6 +73,7 @@
if (success)
{
self.hasSDCard=YES;
[self initNoSDDataViewHidden:YES];
}
else
{
@@ -164,8 +165,8 @@
NSString *string = [formatter stringFromDate:nowDate]; //
[self.startBtn setTitle:[formatter stringFromDate:[nowDate dateByAddingTimeInterval:-60*60]] forState:UIControlStateNormal];
[self.endBtn setTitle:string forState:UIControlStateNormal];
self.startDate=nowDate;
self.startDate=[nowDate dateByAddingTimeInterval:-60*60*2];
self.startDate=[nowDate dateByAddingTimeInterval:-60*60];
self.endDate=nowDate;
}
- (IBAction)startTimeClick:(UIButton *)sender {
@@ -215,6 +216,10 @@
}
- (IBAction)searchClick:(UIButton *)sender {
if ([self.startDate compare:self.endDate]==NSOrderedDescending) {
[self.view makeToast:@"开始时间必须小于结束时间"];
return;;
}
[MBProgressHUD showHUDAddedTo:self.view animated:YES];
[[GWP2PClient sharedClient] getDevicePlaybackFilesWithDeviceID:self.camera.cameraId devicePassword:self.camera.cameraPass startDate:self.startDate endDate:self.endDate completionBlock:^(GWP2PClient *client, BOOL success, NSDictionary<NSString *,id> *dataDictionary) {
[MBProgressHUD hideHUDForView:self.view animated:YES];
@@ -226,6 +231,7 @@
NSArray*files=dataDictionary[@"files"];
if ([files isKindOfClass:[NSArray class]]&&files.count)
{
[self initNoVideoDataViewHidden:YES];
[self.playbackFiles addObjectsFromArray:files];
[self.tableView reloadData];
@@ -238,6 +244,7 @@
else
{
[self initNoVideoDataViewHidden:NO];
[self connectDevice];
}
}];
}
@@ -290,6 +297,7 @@
[self.navigationController pushViewController:play animated:YES];
[tableView deselectRowAtIndexPath:indexPath animated:YES];
}
@@ -48,15 +48,15 @@
<constraints>
<constraint firstAttribute="width" constant="100" id="eRB-vs-cgp"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="18"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="kku-gY-Q7f" userLabel="startBtn">
<rect key="frame" x="132" y="10" width="150" height="40"/>
<rect key="frame" x="137" y="10" width="140" height="40"/>
<color key="backgroundColor" red="0.85882914070000005" green="0.85481816529999999" blue="0.8588245511" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>
<constraints>
<constraint firstAttribute="width" constant="150" id="cyL-N8-h3p"/>
<constraint firstAttribute="width" constant="140" id="cyL-N8-h3p"/>
</constraints>
<state key="normal" title="2020-10-17 15:44">
<color key="titleColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>
@@ -102,7 +102,7 @@
<constraints>
<constraint firstAttribute="width" constant="100" id="Ecq-wU-f1p"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="18"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
@@ -114,10 +114,10 @@
</constraints>
</view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="tn6-eP-Fcy" userLabel="endBtn">
<rect key="frame" x="132" y="10" width="150" height="40"/>
<rect key="frame" x="137" y="10" width="140" height="40"/>
<color key="backgroundColor" red="0.86272245650000001" green="0.85881525280000004" blue="0.85882407429999996" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>
<constraints>
<constraint firstAttribute="width" constant="150" id="X9l-lJ-tdi"/>
<constraint firstAttribute="width" constant="140" id="X9l-lJ-tdi"/>
</constraints>
<state key="normal" title="2020-10-17 15:44">
<color key="titleColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>
@@ -159,28 +159,40 @@
<rect key="frame" x="0.0" y="0.0" width="414" height="50"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="开始时间" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ycQ-nI-y8x">
<rect key="frame" x="0.0" y="15" width="138" height="20.5"/>
<rect key="frame" x="0.0" y="0.0" width="138" height="50"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="结束时间" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="2KQ-jC-hOC">
<rect key="frame" x="138" y="15" width="138" height="20.5"/>
<rect key="frame" x="138" y="0.0" width="138" height="50"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="点击播放" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="c9x-ah-UDf">
<rect key="frame" x="276" y="15" width="138" height="20.5"/>
<rect key="frame" x="276" y="0.0" width="138" height="50"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" red="0.86272245650000001" green="0.85881525280000004" blue="0.85882407429999996" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="ycQ-nI-y8x" firstAttribute="top" secondItem="zSW-Qs-mlC" secondAttribute="top" id="4X7-Lq-oVR"/>
<constraint firstItem="2KQ-jC-hOC" firstAttribute="top" secondItem="zSW-Qs-mlC" secondAttribute="top" id="XVc-8x-dEb"/>
<constraint firstAttribute="bottom" secondItem="c9x-ah-UDf" secondAttribute="bottom" id="XWB-Nq-MKw"/>
<constraint firstAttribute="bottom" secondItem="2KQ-jC-hOC" secondAttribute="bottom" id="Zt7-Ka-OPb"/>
<constraint firstAttribute="bottom" secondItem="ycQ-nI-y8x" secondAttribute="bottom" id="fBG-AY-ao5"/>
<constraint firstItem="c9x-ah-UDf" firstAttribute="top" secondItem="zSW-Qs-mlC" secondAttribute="top" id="tRq-Ha-QiN"/>
</constraints>
</stackView>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<color key="backgroundColor" red="0.85882914070000005" green="0.85481816529999999" blue="0.8588245511" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>
<color key="tintColor" red="0.50594329829999996" green="0.50971984859999997" blue="0.51372647289999995" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>
<constraints>
<constraint firstItem="zSW-Qs-mlC" firstAttribute="top" secondItem="scl-co-ww3" secondAttribute="top" id="FXx-hH-bkT"/>
<constraint firstAttribute="bottom" secondItem="zSW-Qs-mlC" secondAttribute="bottom" id="NsQ-qX-yNh"/>
@@ -228,7 +240,7 @@
<constraint firstItem="HW3-zp-qaz" firstAttribute="top" secondItem="arN-mi-hdC" secondAttribute="top" constant="20" id="p1u-8F-9Ts"/>
</constraints>
</view>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="4mg-Y4-tdd">
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="4mg-Y4-tdd">
<rect key="frame" x="0.0" y="304" width="414" height="558"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<connections>
@@ -22,14 +22,14 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="mNp-Wq-9sr" userLabel="playView">
<rect key="frame" x="0.0" y="298" width="414" height="300"/>
<rect key="frame" x="0.0" y="331.5" width="414" height="233"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstAttribute="height" constant="300" id="Zpl-26-a1t"/>
<constraint firstAttribute="width" secondItem="mNp-Wq-9sr" secondAttribute="height" multiplier="16:9" id="Sov-CF-1ZL"/>
</constraints>
</view>
<button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="JXh-6B-ny2">
<rect key="frame" x="185" y="678" width="44" height="44"/>
<rect key="frame" x="185" y="644.5" width="44" height="44"/>
<constraints>
<constraint firstAttribute="width" constant="44" id="aIO-hU-m50"/>
<constraint firstAttribute="height" constant="44" id="eI2-fw-A9X"/>