feat(YouTube): add Enable OPUS codec patch

This commit is contained in:
inotia00
2024-06-11 03:57:12 +09:00
parent 89dd62de26
commit ac6c4d885d
4 changed files with 48 additions and 0 deletions

View File

@ -0,0 +1,8 @@
package app.revanced.patches.youtube.misc.codecs
import app.revanced.patches.youtube.utils.integrations.Constants.MISC_PATH
import app.revanced.patches.shared.opus.BaseOpusCodecsPatch
object OpusCodecBytecodePatch : BaseOpusCodecsPatch(
"$MISC_PATH/OpusCodecPatch;->enableOpusCodec()Z"
)

View File

@ -0,0 +1,33 @@
package app.revanced.patches.youtube.misc.codecs
import app.revanced.patcher.data.ResourceContext
import app.revanced.patches.youtube.utils.compatibility.Constants.COMPATIBLE_PACKAGE
import app.revanced.patches.youtube.utils.settings.SettingsPatch
import app.revanced.util.patch.BaseResourcePatch
@Suppress("unused")
object OpusCodecPatch : BaseResourcePatch(
name = "Enable OPUS codec",
description = "Adds an options to enable the OPUS audio codec if the player response includes.",
dependencies = setOf(
OpusCodecBytecodePatch::class,
SettingsPatch::class
),
compatiblePackages = COMPATIBLE_PACKAGE
) {
override fun execute(context: ResourceContext) {
/**
* Add settings
*/
SettingsPatch.addPreference(
arrayOf(
"PREFERENCE_CATEGORY: MISC_EXPERIMENTAL_FLAGS",
"SETTINGS: ENABLE_OPUS_CODEC"
)
)
SettingsPatch.updatePatchStatus(this)
}
}