From 3fcbfd4a51ac49fd3ea58508a59575cddef4ea6b Mon Sep 17 00:00:00 2001 From: zechs Date: Thu, 9 Feb 2023 17:52:29 +0530 Subject: [PATCH] default refresh rate on lower android versions --- mpv/src/main/java/zechs/mpv/MPVView.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mpv/src/main/java/zechs/mpv/MPVView.kt b/mpv/src/main/java/zechs/mpv/MPVView.kt index 5ad309c..0b19882 100644 --- a/mpv/src/main/java/zechs/mpv/MPVView.kt +++ b/mpv/src/main/java/zechs/mpv/MPVView.kt @@ -42,7 +42,9 @@ class MPVView( @Suppress("DEPRECATION") wm.defaultDisplay } - val refreshRate = display.mode.refreshRate + val refreshRate = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + display.mode.refreshRate + } else 60.0F val deviceLanguage = Locale.getDefault().isO3Language Log.d(TAG, "Device language: $deviceLanguage")