mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-11-05 18:30:59 +01:00
Fix subtitle outline width not applying in release builds (#1687)
## Description Fix applying the subtitle outline width in ExoPlayer for release builds The outline width field isn't public, so reflection is used to bypass and modify it. Since proguard/r8 renames all of the classes and fields, this meant the field was no longer found. The fix is to have proguard preserve the necessary field names. ### Related issues Fixes #1681 ### Testing Emulator w/ release build ## Screenshots N/a ## AI or LLM usage None
This commit is contained in:
parent
26124a5348
commit
f74306a12c
2 changed files with 14 additions and 0 deletions
11
app/proguard-rules.pro
vendored
11
app/proguard-rules.pro
vendored
|
|
@ -11,3 +11,14 @@
|
|||
|
||||
# TODO investigate using smaller scope
|
||||
-keep class com.google.common.cache.** { *; }
|
||||
|
||||
# Media3SubtitleOverride uses reflection to access/modify these fields
|
||||
-keep class androidx.media3.ui.SubtitleView {
|
||||
private androidx.media3.ui.SubtitleView$Output output;
|
||||
}
|
||||
-keep class androidx.media3.ui.CanvasSubtitleOutput {
|
||||
private final java.util.List painters;
|
||||
}
|
||||
-keep class androidx.media3.ui.SubtitlePainter {
|
||||
private final float outlineWidth;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
package com.github.damontecres.wholphin.util
|
||||
|
||||
import androidx.annotation.OptIn
|
||||
import androidx.media3.common.util.UnstableApi
|
||||
import androidx.media3.ui.SubtitleView
|
||||
import timber.log.Timber
|
||||
import java.lang.reflect.Field
|
||||
|
|
@ -7,6 +9,7 @@ import java.lang.reflect.Field
|
|||
/**
|
||||
* Utility class to override private fields in media3's [SubtitleView]
|
||||
*/
|
||||
@OptIn(UnstableApi::class)
|
||||
class Media3SubtitleOverride(
|
||||
val outlineThicknessPx: Float,
|
||||
) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue