Feat(exoplayer): optional decoders (#533)
* Change Layout * Add string * Who did this? * Add listener * Made NextLib Conditional * Add Preferences
This commit is contained in:
parent
404d265a2d
commit
f13225e032
6 changed files with 39 additions and 27 deletions
|
@ -1703,8 +1703,12 @@ class ExoplayerView : AppCompatActivity(), Player.Listener, SessionAvailabilityL
|
|||
|
||||
hideSystemBars()
|
||||
|
||||
val decoder = DefaultRenderersFactory.EXTENSION_RENDERER_MODE_PREFER
|
||||
|
||||
val useExtensionDecoder = PrefManager.getVal<Boolean>(PrefName.UseAdditionalCodec)
|
||||
val decoder = if (useExtensionDecoder) {
|
||||
DefaultRenderersFactory.EXTENSION_RENDERER_MODE_PREFER
|
||||
} else {
|
||||
DefaultRenderersFactory.EXTENSION_RENDERER_MODE_OFF
|
||||
}
|
||||
val renderersFactory = NextRenderersFactory(this)
|
||||
.setEnableDecoderFallback(true)
|
||||
.setExtensionRendererMode(decoder)
|
||||
|
|
|
@ -276,7 +276,12 @@ class PlayerSettingsActivity : AppCompatActivity() {
|
|||
binding.playerSettingsRotate.setOnCheckedChangeListener { _, isChecked ->
|
||||
PrefManager.setVal(PrefName.RotationPlayer, isChecked)
|
||||
}
|
||||
|
||||
|
||||
binding.playerSettingsAdditionalCodec.isChecked = PrefManager.getVal(PrefName.UseAdditionalCodec)
|
||||
binding.playerSettingsAdditionalCodec.setOnCheckedChangeListener { _, isChecked ->
|
||||
PrefManager.setVal(PrefName.UseAdditionalCodec, isChecked)
|
||||
}
|
||||
|
||||
val resizeModes = arrayOf("Original", "Zoom", "Stretch")
|
||||
binding.playerResizeMode.setOnClickListener {
|
||||
customAlertDialog().apply {
|
||||
|
|
|
@ -128,6 +128,7 @@ enum class PrefName(val data: Pref) { //TODO: Split this into multiple files
|
|||
Pip(Pref(Location.Player, Boolean::class, true)),
|
||||
RotationPlayer(Pref(Location.Player, Boolean::class, true)),
|
||||
TorrentEnabled(Pref(Location.Player, Boolean::class, false)),
|
||||
UseAdditionalCodec(Pref(Location.Player, Boolean::class, true)),
|
||||
|
||||
//Reader
|
||||
ShowSource(Pref(Location.Reader, Boolean::class, true)),
|
||||
|
@ -199,8 +200,6 @@ enum class PrefName(val data: Pref) { //TODO: Split this into multiple files
|
|||
RefreshStatus(Pref(Location.Irrelevant, Boolean::class, false)),
|
||||
rpcEnabled(Pref(Location.Irrelevant, Boolean::class, true)),
|
||||
|
||||
//testing
|
||||
|
||||
//Protected
|
||||
DiscordToken(Pref(Location.Protected, String::class, "")),
|
||||
DiscordId(Pref(Location.Protected, String::class, "")),
|
||||
|
@ -218,4 +217,4 @@ enum class PrefName(val data: Pref) { //TODO: Split this into multiple files
|
|||
Socks5ProxyPort(Pref(Location.Protected, String::class, "")),
|
||||
Socks5ProxyUsername(Pref(Location.Protected, String::class, "")),
|
||||
Socks5ProxyPassword(Pref(Location.Protected, String::class, "")),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue