mirror of
https://github.com/yattee/yattee.git
synced 2025-08-09 20:24:06 +00:00
Aspect ratio improvements
This commit is contained in:
@@ -33,18 +33,11 @@ struct VideoPlayerSizeModifier: ViewModifier {
|
||||
}
|
||||
|
||||
var usedAspectRatio: Double {
|
||||
guard aspectRatio != nil, aspectRatio != 0 else {
|
||||
guard let aspectRatio = aspectRatio, aspectRatio != 0 else {
|
||||
return VideoPlayerView.defaultAspectRatio
|
||||
}
|
||||
|
||||
let ratio = [aspectRatio!, VideoPlayerView.defaultAspectRatio].min()!
|
||||
let viewRatio = geometry.size.width / geometry.size.height
|
||||
|
||||
#if os(iOS)
|
||||
return verticalSizeClass == .regular ? ratio : viewRatio
|
||||
#else
|
||||
return ratio
|
||||
#endif
|
||||
return [aspectRatio, VideoPlayerView.defaultAspectRatio].min()!
|
||||
}
|
||||
|
||||
var usedAspectRatioContentMode: ContentMode {
|
||||
|
Reference in New Issue
Block a user