1
0
mirror of https://github.com/godotengine/godot.git synced 2026-01-06 19:41:11 +00:00

iOS: fix native video

Fixed view not being displayed.
Fixed view orientation change.
This commit is contained in:
Sergey Minakov
2020-10-08 14:30:53 +03:00
parent 8be6db951d
commit 6b2483c331
2 changed files with 10 additions and 1 deletions

View File

@@ -71,6 +71,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

@@ -208,8 +208,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];
}
}