Fix video message recording preview and haptic feedback on message options menu presentation

This commit is contained in:
Ilya Laktyushin 2020-05-06 16:25:25 +04:00
parent c1b6004478
commit 45b0700230
2 changed files with 19 additions and 4 deletions

View File

@ -220,8 +220,6 @@ const NSInteger TGVideoCameraRetainedBufferCount = 16;
[self _enableVideoStabilization];
_videoBufferOrientation = _videoConnection.videoOrientation;
return;
}
- (void)destroyCaptureSession
@ -232,7 +230,23 @@ const NSInteger TGVideoCameraRetainedBufferCount = 16;
[[NSNotificationCenter defaultCenter] removeObserver:_applicationWillEnterForegroundObserver];
_applicationWillEnterForegroundObserver = nil;
[_captureSession beginConfiguration];
[_captureSession removeOutput:_videoOutput];
[_captureSession removeInput:_videoInput];
[_captureSession removeOutput:_audioOutput];
[_captureSession removeInput:_audioInput];
[_captureSession commitConfiguration];
_audioInput = nil;
_audioDevice = nil;
_audioOutput = nil;
_audioConnection = nil;
_videoInput = nil;
_videoDevice = nil;
_videoOutput = nil;
_videoConnection = nil;
_captureSession = nil;
}
}

View File

@ -833,7 +833,7 @@ typedef enum
_didPlayToEndObserver = [[TGObserverProxy alloc] initWithTarget:self targetSelector:@selector(playerItemDidPlayToEndTime:) name:AVPlayerItemDidPlayToEndTimeNotification object:_player.currentItem];
_videoView = [[TGModernGalleryVideoView alloc] initWithFrame:_previewView.frame player:_player];
_videoView = [[TGModernGalleryVideoView alloc] initWithFrame: CGRectInset(_previewView.frame, -1.0, -1.0) player:_player];
[_previewView.superview insertSubview:_videoView belowSubview:_previewView];
UITapGestureRecognizer *gestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(unmutePressed)];
@ -950,6 +950,7 @@ typedef enum
{
[_capturePipeline stopRecording:completed];
[_buttonHandler ignoreEventsFor:1.0f andDisable:true];
[_capturePipeline stopRunning];
}
- (void)finishWithURL:(NSURL *)url dimensions:(CGSize)dimensions duration:(NSTimeInterval)duration liveUploadData:(id )liveUploadData thumbnailImage:(UIImage *)thumbnailImage isSilent:(bool)isSilent scheduleTimestamp:(int32_t)scheduleTimestamp