mirror of
https://github.com/yattee/yattee.git
synced 2025-01-10 03:20:33 +05:30
Fix player size handling
This commit is contained in:
parent
13688adb6e
commit
84a283ff1d
@ -49,14 +49,20 @@ struct VideoPlayerView: View {
|
|||||||
.onOpenURL { OpenURLHandler(accounts: accounts, player: player).handle($0) }
|
.onOpenURL { OpenURLHandler(accounts: accounts, player: player).handle($0) }
|
||||||
.frame(minWidth: 950, minHeight: 700)
|
.frame(minWidth: 950, minHeight: 700)
|
||||||
#else
|
#else
|
||||||
|
GeometryReader { geometry in
|
||||||
HStack(spacing: 0) {
|
HStack(spacing: 0) {
|
||||||
content
|
content
|
||||||
.onAppear {
|
.onAppear {
|
||||||
|
playerSize = geometry.size
|
||||||
|
|
||||||
#if os(iOS)
|
#if os(iOS)
|
||||||
configureOrientationUpdatesBasedOnAccelerometer()
|
configureOrientationUpdatesBasedOnAccelerometer()
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.onChange(of: geometry.size) { size in
|
||||||
|
self.playerSize = size
|
||||||
|
}
|
||||||
.onChange(of: fullScreenDetails) { value in
|
.onChange(of: fullScreenDetails) { value in
|
||||||
player.backend.setNeedsDrawing(!value)
|
player.backend.setNeedsDrawing(!value)
|
||||||
}
|
}
|
||||||
@ -79,6 +85,7 @@ struct VideoPlayerView: View {
|
|||||||
motionManager = nil
|
motionManager = nil
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user