From 0477674810bc4d423ca12d5457bb99fe92a6006e Mon Sep 17 00:00:00 2001 From: jiggles Date: Mon, 1 Jun 2026 05:59:59 -0500 Subject: [PATCH] android: set audiofocus none in popup video views (#611) fixed popups interrupting media playback --- .../kavishdevar/librepods/presentation/overlays/IslandWindow.kt | 2 ++ .../kavishdevar/librepods/presentation/overlays/PopupWindow.kt | 2 ++ 2 files changed, 4 insertions(+) diff --git a/android/app/src/main/java/me/kavishdevar/librepods/presentation/overlays/IslandWindow.kt b/android/app/src/main/java/me/kavishdevar/librepods/presentation/overlays/IslandWindow.kt index bb688765..bf5eff89 100644 --- a/android/app/src/main/java/me/kavishdevar/librepods/presentation/overlays/IslandWindow.kt +++ b/android/app/src/main/java/me/kavishdevar/librepods/presentation/overlays/IslandWindow.kt @@ -33,6 +33,7 @@ import android.content.IntentFilter import android.content.res.Resources import android.graphics.PixelFormat import android.graphics.drawable.GradientDrawable +import android.media.AudioManager import android.os.Build import android.os.Handler import android.os.Looper @@ -374,6 +375,7 @@ class IslandWindow(private val context: Context) { val videoView = islandView.findViewById(R.id.island_video_view) val videoUri = "android.resource://me.kavishdevar.librepods/${R.raw.island}".toUri() + videoView.setAudioFocusRequest(AudioManager.AUDIOFOCUS_NONE) videoView.setVideoURI(videoUri) videoView.setOnPreparedListener { mediaPlayer -> mediaPlayer.isLooping = true diff --git a/android/app/src/main/java/me/kavishdevar/librepods/presentation/overlays/PopupWindow.kt b/android/app/src/main/java/me/kavishdevar/librepods/presentation/overlays/PopupWindow.kt index 13bd22a0..4247ea47 100644 --- a/android/app/src/main/java/me/kavishdevar/librepods/presentation/overlays/PopupWindow.kt +++ b/android/app/src/main/java/me/kavishdevar/librepods/presentation/overlays/PopupWindow.kt @@ -29,6 +29,7 @@ import android.content.Context import android.content.Intent import android.content.IntentFilter import android.graphics.PixelFormat +import android.media.AudioManager import android.os.Build import android.os.Handler import android.os.Looper @@ -137,6 +138,7 @@ class PopupWindow( updateBatteryStatus(batteryNotification) val vid = mView.findViewById(R.id.video) + vid.setAudioFocusRequest(AudioManager.AUDIOFOCUS_NONE) vid.setVideoPath("android.resource://me.kavishdevar.librepods/" + R.raw.connected) vid.resolveAdjustedSize(vid.width, vid.height) vid.start()