mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-06-12 05:07:41 +02:00
feat(YouTube): add Enable OPUS codec
patch
This commit is contained in:
@ -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"
|
||||
)
|
@ -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)
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user