mirror of
https://github.com/revanced/revanced-patches
synced 2024-11-10 10:39:22 +01:00
feat(youtube): remove fix-playback
patch
This commit is contained in:
parent
ef030eee95
commit
edcb6cc949
@ -16,12 +16,11 @@ import app.revanced.patches.shared.settings.preference.impl.StringResource
|
|||||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||||
import app.revanced.patches.youtube.ad.video.annotations.VideoAdsCompatibility
|
import app.revanced.patches.youtube.ad.video.annotations.VideoAdsCompatibility
|
||||||
import app.revanced.patches.youtube.ad.video.fingerprints.LoadVideoAdsFingerprint
|
import app.revanced.patches.youtube.ad.video.fingerprints.LoadVideoAdsFingerprint
|
||||||
import app.revanced.patches.youtube.misc.fix.playback.patch.FixPlaybackPatch
|
|
||||||
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
||||||
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
||||||
|
|
||||||
@Patch
|
@Patch
|
||||||
@DependsOn([IntegrationsPatch::class, SettingsPatch::class, FixPlaybackPatch::class])
|
@DependsOn([IntegrationsPatch::class, SettingsPatch::class])
|
||||||
@Name("video-ads")
|
@Name("video-ads")
|
||||||
@Description("Removes ads in the video player.")
|
@Description("Removes ads in the video player.")
|
||||||
@VideoAdsCompatibility
|
@VideoAdsCompatibility
|
||||||
|
@ -1,13 +0,0 @@
|
|||||||
package app.revanced.patches.youtube.misc.fix.playback.annotations
|
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Compatibility
|
|
||||||
import app.revanced.patcher.annotation.Package
|
|
||||||
|
|
||||||
@Compatibility(
|
|
||||||
[Package(
|
|
||||||
"com.google.android.youtube", arrayOf("17.49.37")
|
|
||||||
)]
|
|
||||||
)
|
|
||||||
@Target(AnnotationTarget.CLASS)
|
|
||||||
@Retention(AnnotationRetention.RUNTIME)
|
|
||||||
internal annotation class FixPlaybackCompatibility
|
|
@ -1,52 +0,0 @@
|
|||||||
package app.revanced.patches.youtube.misc.fix.playback.patch
|
|
||||||
|
|
||||||
import app.revanced.patcher.annotation.Description
|
|
||||||
import app.revanced.patcher.annotation.Name
|
|
||||||
import app.revanced.patcher.annotation.Version
|
|
||||||
import app.revanced.patcher.data.ResourceContext
|
|
||||||
import app.revanced.patcher.patch.PatchResult
|
|
||||||
import app.revanced.patcher.patch.PatchResultSuccess
|
|
||||||
import app.revanced.patcher.patch.ResourcePatch
|
|
||||||
import app.revanced.patcher.patch.annotations.DependsOn
|
|
||||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
|
||||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
|
||||||
import app.revanced.patches.youtube.misc.fix.playback.annotations.FixPlaybackCompatibility
|
|
||||||
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
|
||||||
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
|
||||||
import app.revanced.patches.youtube.misc.video.information.patch.VideoInformationPatch
|
|
||||||
import app.revanced.patches.youtube.misc.video.videoid.patch.VideoIdPatch
|
|
||||||
|
|
||||||
@DependsOn([
|
|
||||||
IntegrationsPatch::class,
|
|
||||||
VideoInformationPatch::class, // updates video length and adds method to seek in video, necessary for this patch
|
|
||||||
SettingsPatch::class,
|
|
||||||
VideoIdPatch::class
|
|
||||||
])
|
|
||||||
@Name("fix-playback")
|
|
||||||
@Description("Fixes the issue with videos not playing when video ads are removed.")
|
|
||||||
@FixPlaybackCompatibility
|
|
||||||
@Version("0.0.1")
|
|
||||||
class FixPlaybackPatch : ResourcePatch {
|
|
||||||
override fun execute(context: ResourceContext): PatchResult {
|
|
||||||
SettingsPatch.PreferenceScreen.MISC.addPreferences(
|
|
||||||
SwitchPreference(
|
|
||||||
"revanced_fix_playback",
|
|
||||||
StringResource("revanced_fix_playback_title", "Fix video playback issues"),
|
|
||||||
false,
|
|
||||||
StringResource(
|
|
||||||
"revanced_fix_playback_summary_on",
|
|
||||||
"The fix is enabled"
|
|
||||||
),
|
|
||||||
StringResource(
|
|
||||||
"revanced_fix_playback_summary_off",
|
|
||||||
"The fix is disabled"
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
// If a new video loads, fix the playback issue
|
|
||||||
VideoIdPatch.injectCall("Lapp/revanced/integrations/patches/FixPlaybackPatch;->newVideoLoaded(Ljava/lang/String;)V")
|
|
||||||
|
|
||||||
return PatchResultSuccess()
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user