| | |
| | | NSArray *sdCardRate; |
| | | NSArray *cloudRateStr; |
| | | NSArray *sdCardRateStr; |
| | | |
| | | // BOOL _isDoBack; |
| | | |
| | | // BOOL _isDoBack; |
| | | } |
| | | |
| | | @property (nonatomic, strong) NSIndexPath *selectedIndexPath; |
| | |
| | | [EZOPENSDK releasePlayer:_player]; |
| | | } |
| | | |
| | | - (void)viewWillAppear:(BOOL)animated |
| | | { |
| | | [super viewWillAppear:animated]; |
| | | self.navigationController.navigationBar.hidden = NO;//2021-02-01 |
| | | |
| | | } |
| | | |
| | | - (void)viewDidLoad { |
| | | [super viewDidLoad]; |
| | | // Do any additional setup after loading the view. |
| | |
| | | |
| | | [self.duringSlider setThumbImage:[UIImage imageNamed:@"slider"] forState:UIControlStateNormal]; |
| | | [self.duringSlider setThumbImage:[UIImage imageNamed:@"slider_sel"] forState:UIControlStateHighlighted]; |
| | | |
| | | |
| | | self.cloudButton.selected = YES; |
| | | self.largeBackButton.hidden = YES; |
| | | |
| | |
| | | [self.dateButton setTitle:[dateFormatter stringFromDate:self.datePicker.date] forState:UIControlStateNormal]; |
| | | dateFormatter.dateFormat = @"MM-dd △"; |
| | | [self.dateButton setTitle:[dateFormatter stringFromDate:self.datePicker.date] forState:UIControlStateSelected]; |
| | | |
| | | |
| | | _isShowToolbox = YES; |
| | | |
| | | cloudRate = @[@(EZOPENSDK_PLAY_RATE_1), |
| | |
| | | |
| | | cloudRateStr = @[@"x1",@"x4",@"x8",@"x16",@"x32"]; |
| | | sdCardRateStr = @[@"x1",@"x4",@"x8",@"x16"]; |
| | | |
| | | //2021-07-21 隐藏streamPlayBtn和rateBtn |
| | | [self.streamPlayBtn setHidden:YES]; |
| | | [self.rateBtn setHidden:YES]; |
| | | |
| | | |
| | | } |
| | | |
| | | - (void)viewWillDisappear:(BOOL)animated { |
| | |
| | | } |
| | | |
| | | /* |
| | | #pragma mark - Navigation |
| | | |
| | | // In a storyboard-based application, you will often want to do a little preparation before navigation |
| | | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { |
| | | // Get the new view controller using [segue destinationViewController]. |
| | | // Pass the selected object to the new view controller. |
| | | } |
| | | */ |
| | | #pragma mark - Navigation |
| | | |
| | | // In a storyboard-based application, you will often want to do a little preparation before navigation |
| | | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { |
| | | // Get the new view controller using [segue destinationViewController]. |
| | | // Pass the selected object to the new view controller. |
| | | } |
| | | */ |
| | | |
| | | - (UIInterfaceOrientationMask)supportedInterfaceOrientations |
| | | { |
| | |
| | | cell.deviceSerial = _cameraInfo.deviceSerial; |
| | | cell.isSelectedDevice = _isSelectedDevice; |
| | | cell.delegate = self; |
| | | //2021-07-21 隐藏下载按钮 |
| | | [cell.downloadBtn setHidden:YES]; |
| | | |
| | | if(_isSelectedDevice) |
| | | { |
| | |
| | | |
| | | [self invalidateTimer]; |
| | | |
| | | // [_player stopPlayback]; |
| | | // [_player stopPlayback]; |
| | | |
| | | if(_isSelectedDevice) |
| | | { |
| | |
| | | #pragma mark - ValidateCode Methods |
| | | |
| | | - (void)repeatDelay{ |
| | | |
| | | |
| | | self.selectedCell = NO; |
| | | } |
| | | |
| | |
| | | verifyCode:self.verifyCode |
| | | savePath:path |
| | | completion:^(EZDeviceRecordDownloadTask * _Nonnull task) { |
| | | |
| | | |
| | | //设置回调函数 |
| | | __weak typeof(task) weakTask = task; |
| | | [task setDownloadCallBackWithFinshed:^(EZRecordDownloaderStatus statusCode) { |
| | |
| | | |
| | | NSLog(@"GetStreamFetchType:%d", [self.player getStreamFetchType]); |
| | | |
| | | // [self showStreamFetchType]; |
| | | // [self showStreamFetchType]; |
| | | } |
| | | else if (messageCode == PLAYER_PLAYBACK_STOP) |
| | | { |
| | |
| | | } |
| | | |
| | | - (void) invalidateTimer { |
| | | |
| | | |
| | | if(self.playbackTimer) |
| | | { |
| | | [self.playbackTimer invalidate]; |
| | |
| | | |
| | | - (IBAction)hiddenPlayerToolbox:(id)sender |
| | | { |
| | | // [UIView animateWithDuration:0.3 |
| | | // animations:^{ |
| | | // self.playerToolbox.alpha = 0.0f; |
| | | // } |
| | | // completion:^(BOOL finished) { |
| | | // _isShowToolbox = NO; |
| | | // }]; |
| | | // [UIView animateWithDuration:0.3 |
| | | // animations:^{ |
| | | // self.playerToolbox.alpha = 0.0f; |
| | | // } |
| | | // completion:^(BOOL finished) { |
| | | // _isShowToolbox = NO; |
| | | // }]; |
| | | } |
| | | |
| | | #pragma mark - MJRefresh Methods |
| | |
| | | [self.operation cancel]; |
| | | [self.playbackList.header endRefreshing]; |
| | | __weak __typeof(self) weakSelf = self; |
| | | |
| | | |
| | | self.playbackList.header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{ |
| | | weakSelf.noVideoImageView.hidden = YES; |
| | | weakSelf.noVideoLabel.hidden = YES; |
| | |
| | | beginTime:weakSelf.beginTime |
| | | endTime:weakSelf.endTime |
| | | completion:^(NSArray *deviceRecords, NSError *error) { |
| | | NSLog(@"deviceRecords is %@, error is %@", deviceRecords, error); |
| | | if (!error) |
| | | { |
| | | [weakSelf.records removeAllObjects]; |
| | | if(deviceRecords.count == 0) |
| | | { |
| | | weakSelf.noVideoLabel.hidden = NO; |
| | | weakSelf.noVideoImageView.hidden = NO; |
| | | [weakSelf.playbackList reloadData]; |
| | | [weakSelf.playbackList.header endRefreshing]; |
| | | return; |
| | | } |
| | | if (deviceRecords.count > 0) |
| | | { |
| | | [weakSelf.records addObjectsFromArray:deviceRecords]; |
| | | [weakSelf.playbackList reloadData]; |
| | | [weakSelf.playbackList.header endRefreshing]; |
| | | [weakSelf doPlayback]; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | [UIView dd_showMessage:[NSString stringWithFormat:@"error code is %d",(int) error.code] onParentView:self.view]; |
| | | [weakSelf.playbackList.header endRefreshing]; |
| | | [weakSelf.records removeAllObjects]; |
| | | [weakSelf.playbackList reloadData]; |
| | | } |
| | | }]; |
| | | NSLog(@"deviceRecords is %@, error is %@", deviceRecords, error); |
| | | if (!error) |
| | | { |
| | | [weakSelf.records removeAllObjects]; |
| | | if(deviceRecords.count == 0) |
| | | { |
| | | weakSelf.noVideoLabel.hidden = NO; |
| | | weakSelf.noVideoImageView.hidden = NO; |
| | | [weakSelf.playbackList reloadData]; |
| | | [weakSelf.playbackList.header endRefreshing]; |
| | | return; |
| | | } |
| | | if (deviceRecords.count > 0) |
| | | { |
| | | [weakSelf.records addObjectsFromArray:deviceRecords]; |
| | | [weakSelf.playbackList reloadData]; |
| | | [weakSelf.playbackList.header endRefreshing]; |
| | | [weakSelf doPlayback]; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | NSString *mes = [NSString stringWithFormat:@"%@(%ld)",NSLocalizedString(@"setting_opration_fail", @"操作失败"), (long)error.code]; |
| | | [UIView dd_showMessage:mes onParentView:self.view]; |
| | | [weakSelf.playbackList.header endRefreshing]; |
| | | [weakSelf.records removeAllObjects]; |
| | | [weakSelf.playbackList reloadData]; |
| | | } |
| | | }]; |
| | | } |
| | | else |
| | | { |
| | |
| | | beginTime:weakSelf.beginTime |
| | | endTime:weakSelf.endTime |
| | | completion:^(NSArray *cloudRecords, NSError *error) { |
| | | |
| | | NSLog(@"cloudRecords is %@, error is %@", cloudRecords, error); |
| | | if (error) |
| | | { |
| | | if (error.code > 0) { |
| | | [UIView dd_showMessage:[NSString stringWithFormat:@"error code is %d",(int) error.code] onParentView:self.view]; |
| | | } |
| | | [weakSelf.playbackList.header endRefreshing]; |
| | | [weakSelf.records removeAllObjects]; |
| | | [weakSelf.playbackList reloadData]; |
| | | return ; |
| | | } |
| | | [weakSelf.records removeAllObjects]; |
| | | if(cloudRecords.count == 0) |
| | | { |
| | | weakSelf.noVideoLabel.hidden = NO; |
| | | weakSelf.noVideoImageView.hidden = NO; |
| | | [weakSelf.playbackList reloadData]; |
| | | [weakSelf.playbackList.header endRefreshing]; |
| | | return; |
| | | } |
| | | |
| | | if (cloudRecords.count > 0) |
| | | { |
| | | [weakSelf.records addObjectsFromArray:cloudRecords]; |
| | | [weakSelf.playbackList reloadData]; |
| | | [weakSelf.playbackList.header endRefreshing]; |
| | | [weakSelf doPlayback]; |
| | | } |
| | | }]; |
| | | |
| | | NSLog(@"cloudRecords is %@, error is %@", cloudRecords, error); |
| | | if (error) |
| | | { |
| | | if (error.code > 0) { |
| | | NSString *mes = [NSString stringWithFormat:@"%@(%ld)",NSLocalizedString(@"setting_opration_fail", @"操作失败"), (long)error.code]; |
| | | [UIView dd_showMessage:mes onParentView:self.view]; |
| | | |
| | | } |
| | | [weakSelf.playbackList.header endRefreshing]; |
| | | [weakSelf.records removeAllObjects]; |
| | | [weakSelf.playbackList reloadData]; |
| | | return ; |
| | | } |
| | | [weakSelf.records removeAllObjects]; |
| | | if(cloudRecords.count == 0) |
| | | { |
| | | weakSelf.noVideoLabel.hidden = NO; |
| | | weakSelf.noVideoImageView.hidden = NO; |
| | | [weakSelf.playbackList reloadData]; |
| | | [weakSelf.playbackList.header endRefreshing]; |
| | | return; |
| | | } |
| | | |
| | | if (cloudRecords.count > 0) |
| | | { |
| | | [weakSelf.records addObjectsFromArray:cloudRecords]; |
| | | [weakSelf.playbackList reloadData]; |
| | | [weakSelf.playbackList.header endRefreshing]; |
| | | [weakSelf doPlayback]; |
| | | } |
| | | }]; |
| | | } |
| | | }]; |
| | | self.playbackList.header.automaticallyChangeAlpha = YES; |
| | |
| | | [_player setPlaybackRate:rate mode:0]; |
| | | } |
| | | else { |
| | | |
| | | |
| | | EZPlaybackRate rate = [cloudRate[indexPath.row] intValue]; |
| | | [_player setPlaybackRate:rate mode:0]; |
| | | } |
| | |
| | | } |
| | | |
| | | - (IBAction)clickRateBtn:(UIButton *)sender { |
| | | |
| | | |
| | | self.rateBtnTimer = [NSTimer scheduledTimerWithTimeInterval:2.5f target:self selector:@selector(hideRateView) userInfo:nil repeats:NO]; |
| | | |
| | | if(_isSelectedDevice) { |
| | |
| | | self.selectedIndexPath = nil; |
| | | [UIView animateWithDuration:0.3 |
| | | animations:^{ |
| | | self.selectedImageViewConstraint.constant = 0; |
| | | [self.toolView setNeedsUpdateConstraints]; |
| | | [self.toolView layoutIfNeeded]; |
| | | } |
| | | self.selectedImageViewConstraint.constant = 0; |
| | | [self.toolView setNeedsUpdateConstraints]; |
| | | [self.toolView layoutIfNeeded]; |
| | | } |
| | | completion:^(BOOL finished) { |
| | | self.cloudButton.selected = YES; |
| | | self.deviceButton.selected = NO; |
| | | }]; |
| | | self.cloudButton.selected = YES; |
| | | self.deviceButton.selected = NO; |
| | | }]; |
| | | _isSelectedDevice = NO; |
| | | [self.records removeAllObjects]; |
| | | [self.playbackList reloadData]; |
| | |
| | | self.selectedIndexPath = nil; |
| | | [UIView animateWithDuration:0.3 |
| | | animations:^{ |
| | | self.selectedImageViewConstraint.constant = self.view.bounds.size.width / 2.0f; |
| | | [self.toolView setNeedsUpdateConstraints]; |
| | | [self.toolView layoutIfNeeded]; |
| | | } |
| | | self.selectedImageViewConstraint.constant = self.view.bounds.size.width / 2.0f; |
| | | [self.toolView setNeedsUpdateConstraints]; |
| | | [self.toolView layoutIfNeeded]; |
| | | } |
| | | completion:^(BOOL finished) { |
| | | self.cloudButton.selected = NO; |
| | | self.deviceButton.selected = YES; |
| | | }]; |
| | | self.cloudButton.selected = NO; |
| | | self.deviceButton.selected = YES; |
| | | }]; |
| | | _isSelectedDevice = YES; |
| | | [self.records removeAllObjects]; |
| | | [self.playbackList reloadData]; |
| | |
| | | - (void)playBoxToolRefresh:(NSTimer *)timer |
| | | { |
| | | NSDate *currentTime = [_player getOSDTime]; |
| | | NSLog(@"getOSDTime === %@", currentTime); |
| | | NSLog(@"getOSDTime === %@", currentTime); |
| | | if(_isSelectedDevice) |
| | | { |
| | | _playSeconds = [currentTime timeIntervalSinceDate:_deviceRecord.startTime]; |
| | |
| | | { |
| | | _playSeconds = [currentTime timeIntervalSinceDate:_cloudRecord.startTime]; |
| | | } |
| | | |
| | | |
| | | if(_playSeconds >= 3600) |
| | | { |
| | | int hour = (int)_playSeconds / 3600; |
| | |
| | | - (void)streamPlayer:(EZStreamPlayer *)player didReceivedMessage:(EZStreamPlayerMsgType)msgType |
| | | { |
| | | dispatch_async(dispatch_get_main_queue(), ^{ |
| | | |
| | | |
| | | NSString *msg; |
| | | switch (msgType) { |
| | | case EZStreamPlayerMsgTypeRealPlayStart: |
| | | msg = @"开启预览成功"; |
| | | break; |
| | | case EZStreamPlayerMsgTypeRealPlayClose: |
| | | case EZStreamPlayerMsgTypeRealPlayClose: |
| | | msg = @"关闭预览成功"; |
| | | break; |
| | | case EZStreamPlayerMsgTypePlayBackStart: |
| | | case EZStreamPlayerMsgTypePlayBackStart: |
| | | msg = @"开启设备回放成功"; |
| | | break; |
| | | case EZStreamPlayerMsgTypePlayBackClose: |
| | | case EZStreamPlayerMsgTypePlayBackClose: |
| | | msg = @"关闭设备回放成功"; |
| | | break; |
| | | default: |
| | |
| | | { |
| | | if (dataType == EZStreamDataTypeHeader) { |
| | | dispatch_async(dispatch_get_main_queue(), ^{ |
| | | |
| | | |
| | | [self.navigationController.view makeToast:@"开始写入文件"]; |
| | | }); |
| | | } |
| | | else if (dataType == EZStreamDataTypeStreamEnd) |
| | | { |
| | | dispatch_async(dispatch_get_main_queue(), ^{ |
| | | |
| | | |
| | | self.streamPlayBtn.selected = NO; |
| | | }); |
| | | |