Allow pinch-to-panscan on the video in the corner layout

The window-level pinch was blocked whenever the landscape panel was
pinned and visible (the corner layout always counts as pinned) or a
stale portrait-panel flag was set. In the corner layout the pinch now
starts when it begins inside the video region, and the panscan
control button is enabled there too.
This commit is contained in:
Arkadiusz Fal
2026-10-20 23:43:47 +02:00
parent b98cc216ad
commit e276c99d0b
3 changed files with 37 additions and 1 deletions

View File

@@ -1373,6 +1373,19 @@ extension ExpandedPlayerSheet {
fullWidth: width,
fullHeight: height
)
#if os(iOS)
.background {
GeometryReader { proxy in
Color.clear
.onChange(of: proxy.frame(in: .global), initial: true) { _, frame in
navigationCoordinator?.cornerVideoFrame = frame
}
.onDisappear {
navigationCoordinator?.cornerVideoFrame = .zero
}
}
}
#endif
},
onChannelTap: video.author.hasRealChannelInfo ? {
navigationCoordinator?.navigateToChannel(for: video, collapsePlayer: true)
@@ -1686,7 +1699,10 @@ extension ExpandedPlayerSheet {
playerService.selectEmbeddedSubtitleTrack(trackID)
},
panscanValue: navigationCoordinator?.pinchPanscan ?? 0.0,
isPanscanAllowed: !(isPanelPinned && isPanelVisible),
// Corner layout: the video owns its own region, so it can
// fill it even with the panels showing
isPanscanAllowed: !(isPanelPinned && isPanelVisible)
|| appEnvironment?.navigationCoordinator.isCornerLayoutActive == true,
onTogglePanscan: { [weak navigationCoordinator] in
navigationCoordinator?.togglePanscan()
},