precheck video dimension

Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-04-23 17:08:51 +08:00
parent efc202c10f
commit 5b5983ed50
32 changed files with 237 additions and 81 deletions

View File

@@ -33,6 +33,17 @@ abstract final class Utils {
_ => color,
};
static bool getDimensionFromUri(String uri) {
try {
final params = Uri.parse(uri).queryParameters;
final width = int.parse(params['player_width']!);
final height = int.parse(params['player_height']!);
return params['player_rotate'] == '1' ? width > height : height > width;
} catch (_) {
return false;
}
}
static String themeUrl(bool isDark) =>
'native.theme=${isDark ? 2 : 1}&night=${isDark ? 1 : 0}';