iOS: fix native video

Fixed view not being displayed.
Fixed view orientation change.

(cherry picked from commit 6b2483c331)
This commit is contained in:
Sergey Minakov 2020-10-08 14:30:53 +03:00 committed by Rémi Verschelde
parent b2b5d9a7a3
commit 067d015d38
No known key found for this signature in database
GPG key ID: C3336907360768E1
2 changed files with 10 additions and 1 deletions

View file

@ -72,6 +72,12 @@
[self observeVideoAudio];
}
- (void)layoutSubviews {
[super layoutSubviews];
self.avPlayerLayer.frame = self.bounds;
}
- (void)observeVideoAudio {
printf("******** adding observer for sound routing changes\n");
[[NSNotificationCenter defaultCenter]

View file

@ -209,8 +209,11 @@
} else {
// Create autoresizing view for video playback.
GodotNativeVideoView *videoView = [[GodotNativeVideoView alloc] initWithFrame:self.view.bounds];
videoView.autoresizingMask = UIViewAutoresizingFlexibleWidth & UIViewAutoresizingFlexibleHeight;
videoView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
[self.view addSubview:videoView];
self.videoView = videoView;
return [self.videoView playVideoAtPath:filePath volume:videoVolume audio:audioTrack subtitle:subtitleTrack];
}
}