Merge pull request #42648 from naithar/fix/native_video_view

[iOS] Native video fixes
This commit is contained in:
Rémi Verschelde 2020-11-24 10:41:01 +01:00 committed by GitHub
commit 4159baff6c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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

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