fix: video streatched when changing resolution in stream

This commit is contained in:
Acaki
2026-04-04 17:02:52 +08:00
parent ae526ecddf
commit b12cb96416
2 changed files with 55 additions and 3 deletions
@@ -710,6 +710,11 @@
name:@"OscLayoutCloseNotification"
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(handleStreamAspectRatioChanged:)
name:@"StreamAspectRatioChanged"
object:nil];
#if 0
// FIXME: This doesn't work reliably on iPad for some reason. Showing and hiding the keyboard
// several times in a row will not correctly restore the state of the UIScrollView.
@@ -812,6 +817,15 @@
[self->_streamView reloadOnScreenWidgetViews:true]; //update keyboard buttons here
}
- (void)handleStreamAspectRatioChanged:(NSNotification *)notification {
NSNumber *aspectRatioNum = notification.userInfo[@"aspectRatio"];
if (aspectRatioNum && _streamView) {
CGFloat aspectRatio = [aspectRatioNum doubleValue];
Log(LOG_I, @"Updating StreamView aspect ratio to %.4f", aspectRatio);
_streamView.streamAspectRatio = aspectRatio;
}
}
- (void)setUserInteractionEnabledForStreamView:(bool)enabled{
_streamView.userInteractionEnabled = enabled;
for(UIView* view in self.view.subviews){