Skip to content

Commit

Permalink
fix: wrong stretch aspect ratios
Browse files Browse the repository at this point in the history
  • Loading branch information
abdallahmehiz committed Jun 4, 2024
1 parent f1ed68c commit ea34ad7
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package live.mehiz.mpvkt.ui.player

import android.media.AudioManager
import android.net.Uri
import android.util.DisplayMetrics
import androidx.core.view.WindowInsetsCompat
import androidx.lifecycle.ViewModel
import `is`.xyz.mpv.MPVLib
Expand Down Expand Up @@ -286,8 +287,9 @@ class PlayerViewModel(
}

VideoAspect.Stretch -> {
ratio =
activity.resources.displayMetrics.widthPixels / activity.resources.displayMetrics.heightPixels.toDouble()
val dm = DisplayMetrics()
activity.windowManager.defaultDisplay.getRealMetrics(dm)
ratio = dm.widthPixels / dm.heightPixels.toDouble()
pan = 0.0
}
}
Expand Down

0 comments on commit ea34ad7

Please sign in to comment.