-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(YouTube - Remove background playback restrictions): Add PiP mode…
… support in Shorts
- Loading branch information
Showing
5 changed files
with
71 additions
and
65 deletions.
There are no files selected for viewing
16 changes: 14 additions & 2 deletions
16
...ed/src/main/java/app/revanced/extension/youtube/patches/misc/BackgroundPlaybackPatch.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,24 @@ | ||
package app.revanced.extension.youtube.patches.misc; | ||
|
||
import app.revanced.extension.youtube.settings.Settings; | ||
import app.revanced.extension.youtube.shared.ShortsPlayerState; | ||
|
||
@SuppressWarnings("unused") | ||
public class BackgroundPlaybackPatch { | ||
|
||
public static boolean allowBackgroundPlayback(boolean original) { | ||
return original || ShortsPlayerState.getCurrent().isClosed(); | ||
/** | ||
* Injection point. | ||
*/ | ||
public static boolean isBackgroundPlaybackAllowed(boolean original) { | ||
if (original) return true; | ||
return ShortsPlayerState.getCurrent().isClosed(); | ||
} | ||
|
||
/** | ||
* Injection point. | ||
*/ | ||
public static boolean isBackgroundShortsPlaybackAllowed(boolean original) { | ||
return !Settings.DISABLE_SHORTS_BACKGROUND_PLAYBACK.get(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters