refactor: optimize player UI resizing to avoid animations

This commit is contained in:
tapframe 2026-06-10 02:58:30 +05:30
parent 14a461ab92
commit 4913800b6a
3 changed files with 12 additions and 10 deletions

View file

@ -1183,9 +1183,6 @@ static NSString *redactUrlsInText(NSString *text) {
_webView = [[WKWebView alloc] initWithFrame:_hostView.bounds configuration:configuration];
_webView.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable;
_webView.wantsLayer = YES;
_webView.layerContentsRedrawPolicy = NSViewLayerContentsRedrawDuringViewResize;
_webView.layer.needsDisplayOnBoundsChange = YES;
_webView.layer.drawsAsynchronously = YES;
[_webView setValue:@NO forKey:@"drawsBackground"];
[_hostView addSubview:_webView positioned:NSWindowAbove relativeTo:_videoView];
NSURL *controlsURL = [NSURL URLWithString:controlsUrl ?: @""];

View file

@ -160,10 +160,19 @@ button:disabled {
transition: opacity 160ms ease;
}
.player.native-resizing,
.player.native-resizing * {
.player.native-resizing .top-gradient,
.player.native-resizing .bottom-gradient,
.player.native-resizing .metadata,
.player.native-resizing .parental-guide,
.player.native-resizing .skip-prompt,
.player.native-resizing .next-episode-card,
.player.native-resizing .header-actions,
.player.native-resizing .center-controls,
.player.native-resizing .progress,
.player.native-resizing .locked-overlay,
.player.native-resizing .modal-layer,
.player.native-resizing .track-panel {
transition-duration: 1ms !important;
animation-duration: 1ms !important;
}
.player.chrome-hidden .top-gradient,

View file

@ -1391,10 +1391,6 @@ window.nuvioNativeViewportChanged = () => {
if (activeModal) renderActiveModal();
};
window.addEventListener("resize", () => {
window.nuvioNativeViewportChanged();
});
const trackListSignature = tracks =>
normalizeTracks(tracks)
.map(track => [