From 2a37276c5ef6964d30ef8f2e704a46a03646b43f Mon Sep 17 00:00:00 2001 From: Charles Surett Date: Thu, 19 Nov 2020 17:04:01 -0500 Subject: [PATCH] Use a dispatch for setting the vpv.frame This is due to setting a UIframe needs to happen on the main thread. --- prototype/VideoPlayer.m | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/prototype/VideoPlayer.m b/prototype/VideoPlayer.m index 7930aa6..0cca6a9 100644 --- a/prototype/VideoPlayer.m +++ b/prototype/VideoPlayer.m @@ -2,6 +2,8 @@ @import UIKit; @import AVFoundation; +@import Dispatch; + @interface VideoPlayerView : UIView @property (nonatomic) AVPlayer *player; @@ -69,7 +71,10 @@ - (int) isPlaying { return YES; } - vpv.frame = window.frame; + dispatch_async(dispatch_get_main_queue(), ^{ + vpv.frame = window.frame; + }); + if (! player.rate) { [ self stop ];