Skip to content

Commit

Permalink
添加p2p下载失败的处理
Browse files Browse the repository at this point in the history
tapd: http://tapd.oa.com/NEW_IOT/prong/stories/view/1020393192870647767
Change-Id: I85db2c4a336abc11f94d825c8c1eef1d9b933dc1
  • Loading branch information
tonychanchen committed Mar 2, 2022
1 parent bebdc20 commit 19892a5
Showing 1 changed file with 18 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ @interface TIoTDemoLocalRecordVC ()<UIScrollViewDelegate,UITableViewDelegate,UIT
@property (nonatomic, strong) TIoTDemoCalendarCustomView *tempCustomView;
@property (nonatomic, assign) BOOL isReAppearPause; //标记切换云存和本地录像
@property (nonatomic, strong) NSFileHandle *saveDownloadFile;
@property (nonatomic, assign) BOOL downLoading; //标记下载状态;
@end

@implementation TIoTDemoLocalRecordVC
Expand Down Expand Up @@ -746,6 +747,7 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath

#pragma mark - TIoTDemoLocalDayCustomCellDelegate
- (void)downLoadResWithModel:(TIoTDemoLocalFileModel *)model {
self.downLoading = YES;

[TIoTCoreXP2PBridge sharedInstance].logEnable = NO;
[MBProgressHUD showLodingNoneEnabledInView:self.view withMessage:@"下载资源中"];
Expand Down Expand Up @@ -774,11 +776,23 @@ - (char *)reviceDeviceMsgWithID:(NSString *)dev_name data:(NSData *)data { retur
//下载完成事件
- (void)reviceEventMsgWithID:(NSString *)dev_name eventType:(XP2PType)eventType {
if (eventType == XP2PTypeDownloadEnd) {//下载完成的事件
NSLog(@"----videodataFFFFFFFFFinsi===%d",eventType);
[[TIoTCoreXP2PBridge sharedInstance] stopAvRecvService:self.deviceName?:@""];

[MBProgressHUD dismissInView:self.view];
[MBProgressHUD showError:@"文件已下载完成"];
if (self.downLoading) {
NSLog(@"----videodataFinsish===%d",eventType);
[[TIoTCoreXP2PBridge sharedInstance] stopAvRecvService:self.deviceName?:@""];

[MBProgressHUD dismissInView:self.view];
[MBProgressHUD showError:@"文件已下载完成"];

self.downLoading = NO;
}
}else if (eventType == XP2PTypeDisconnect) {

if (self.downLoading) {
[MBProgressHUD dismissInView:self.view];
[MBProgressHUD showError:@"下载失败"];
self.downLoading = NO;
}
}
}
#pragma mark - handler orientation event
Expand Down

0 comments on commit 19892a5

Please sign in to comment.