diff --git a/android/app/src/main/kotlin/com/edde746/plezy/exoplayer/ExoPlayerPlugin.kt b/android/app/src/main/kotlin/com/edde746/plezy/exoplayer/ExoPlayerPlugin.kt index 22ae6378..25fca1c3 100644 --- a/android/app/src/main/kotlin/com/edde746/plezy/exoplayer/ExoPlayerPlugin.kt +++ b/android/app/src/main/kotlin/com/edde746/plezy/exoplayer/ExoPlayerPlugin.kt @@ -519,40 +519,10 @@ class ExoPlayerPlugin : FlutterPlugin, MethodChannel.MethodCallHandler, result.error("INVALID_ARGS", "Missing 'mode'", null) return } - - // Translate mode to MPV properties so the fallback path (and any - // future fallback from this session) stays in sync with the UI state. - // Mirrors VideoFilterManager.updateVideoFilter's MPV branch. - val mpvProps = when (mode) { - 1 -> listOf( - "video-aspect-override" to "no", - "panscan" to "1.0", - "sub-ass-force-margins" to "yes", - ) - 2 -> { - val act = activity - val aspect = if (act != null) { - val dm = act.resources.displayMetrics - if (dm.heightPixels > 0) dm.widthPixels.toFloat() / dm.heightPixels else 0f - } else 0f - listOf( - "video-aspect-override" to (if (aspect > 0) aspect.toString() else "no"), - "panscan" to "0", - "sub-ass-force-margins" to "no", - ) - } - else -> listOf( - "video-aspect-override" to "no", - "panscan" to "0", - "sub-ass-force-margins" to "no", - ) - } - val keys = mpvProps.map { it.first }.toSet() - pendingMpvProperties.removeAll { it.first in keys } - pendingMpvProperties.addAll(mpvProps) - + // The MPV-property side (panscan / sub-ass-force-margins / video-aspect-override) + // is driven from Dart via setProperty and routed through setMpvProperty, which + // already handles both the fallback and pendingMpvProperties cases. if (usingMpvFallback) { - mpvProps.forEach { (k, v) -> mpvCore?.setProperty(k, v) } result.success(null) return } diff --git a/lib/services/video_filter_manager.dart b/lib/services/video_filter_manager.dart index 839282ad..67b0b3f0 100644 --- a/lib/services/video_filter_manager.dart +++ b/lib/services/video_filter_manager.dart @@ -134,9 +134,11 @@ class VideoFilterManager { /// When ambient lighting is active, video-aspect-override is managed by ambient lighting. void updateVideoFilter() async { try { - if (player.playerType == 'exoplayer') { + // ExoPlayer handles scaling via AspectRatioFrameLayout. The MPV properties + // below still run — on PlayerAndroid they forward to setMpvProperty, which + // queues them for any future fallback to MPV. + if (player is PlayerAndroid) { await (player as PlayerAndroid).setBoxFitMode(_boxFitMode); - return; } if (ambientLightingService?.isEnabled != true) {