mirror of
https://github.com/godotengine/godot
synced 2024-09-16 01:12:42 +00:00
Merge pull request #42648 from naithar/fix/native_video_view
[iOS] Native video fixes
This commit is contained in:
commit
4159baff6c
|
@ -71,6 +71,12 @@
|
||||||
[self observeVideoAudio];
|
[self observeVideoAudio];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)layoutSubviews {
|
||||||
|
[super layoutSubviews];
|
||||||
|
|
||||||
|
self.avPlayerLayer.frame = self.bounds;
|
||||||
|
}
|
||||||
|
|
||||||
- (void)observeVideoAudio {
|
- (void)observeVideoAudio {
|
||||||
printf("******** adding observer for sound routing changes\n");
|
printf("******** adding observer for sound routing changes\n");
|
||||||
[[NSNotificationCenter defaultCenter]
|
[[NSNotificationCenter defaultCenter]
|
||||||
|
|
|
@ -218,8 +218,11 @@
|
||||||
} else {
|
} else {
|
||||||
// Create autoresizing view for video playback.
|
// Create autoresizing view for video playback.
|
||||||
GodotNativeVideoView *videoView = [[GodotNativeVideoView alloc] initWithFrame:self.view.bounds];
|
GodotNativeVideoView *videoView = [[GodotNativeVideoView alloc] initWithFrame:self.view.bounds];
|
||||||
videoView.autoresizingMask = UIViewAutoresizingFlexibleWidth & UIViewAutoresizingFlexibleHeight;
|
videoView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
|
||||||
[self.view addSubview:videoView];
|
[self.view addSubview:videoView];
|
||||||
|
|
||||||
|
self.videoView = videoView;
|
||||||
|
|
||||||
return [self.videoView playVideoAtPath:filePath volume:videoVolume audio:audioTrack subtitle:subtitleTrack];
|
return [self.videoView playVideoAtPath:filePath volume:videoVolume audio:audioTrack subtitle:subtitleTrack];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue