Skip to content

Commit f99281d

Browse files
committed
YouTube: Update BackgroundPlayback add Fix PiP buttons not working after locking/unlocking device screen
1 parent 2070508 commit f99281d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

app/src/main/java/io/github/chsbuffer/revancedxposed/youtube/misc/backgroundplayback/BackgroundPlaybackPatch.kt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ package io.github.chsbuffer.revancedxposed.youtube.misc.backgroundplayback
22

33
import app.revanced.extension.youtube.patches.BackgroundPlaybackPatch
44
import de.robv.android.xposed.XC_MethodReplacement.returnConstant
5+
import io.github.chsbuffer.revancedxposed.scopedHook
56
import io.github.chsbuffer.revancedxposed.shared.misc.settings.preference.SwitchPreference
67
import io.github.chsbuffer.revancedxposed.youtube.YoutubeHook
8+
import io.github.chsbuffer.revancedxposed.youtube.misc.litho.filter.featureFlagCheck
79
import io.github.chsbuffer.revancedxposed.youtube.misc.settings.PreferenceScreen
810

911
fun YoutubeHook.BackgroundPlayback() {
@@ -33,5 +35,10 @@ fun YoutubeHook.BackgroundPlayback() {
3335
// Force allowing background play for videos labeled for kids.
3436
::kidsBackgroundPlaybackPolicyControllerFingerprint.hookMethod(returnConstant(Unit))
3537

36-
// TODO Fix PiP buttons not working after locking/unlocking device screen.
38+
// Fix PiP buttons not working after locking/unlocking device screen.
39+
runCatching {
40+
::pipInputConsumerFeatureFlagFingerprint.hookMethod(scopedHook(::featureFlagCheck.member) {
41+
before { if (it.args[0] == PIP_INPUT_CONSUMER_FEATURE_FLAG) it.result = false }
42+
})
43+
}
3744
}

0 commit comments

Comments
 (0)