From 05139303998f5bfdbc4c9b704fafd24284d775e7 Mon Sep 17 00:00:00 2001 From: David Peek Date: Tue, 14 Jul 2015 16:35:29 +0100 Subject: [PATCH] Disables default system animation when resizing AVPlayerLayer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Not sure if this something you will want – perhaps it could go behind a flag. When animating video size, the default system animation makes the rendered size of the video lag behind the bounds of the react view. This patch disables the default animation, ensuring the video renders at the correct size. --- RCTVideo.m | 3 +++ 1 file changed, 3 insertions(+) diff --git a/RCTVideo.m b/RCTVideo.m index 73d3a361..d9895cf2 100644 --- a/RCTVideo.m +++ b/RCTVideo.m @@ -405,7 +405,10 @@ static NSString *const statusKeyPath = @"status"; - (void)layoutSubviews { [super layoutSubviews]; + [CATransaction begin]; + [CATransaction setAnimationDuration:0]; _playerLayer.frame = self.bounds; + [CATransaction commit]; } #pragma mark - Lifecycle