mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-28 07:50:31 +05:30
feat: add "Rich caption rendering" setting (#5371)
This commit is contained in:
parent
1e67660879
commit
f60375a110
@ -71,6 +71,7 @@ object PreferenceKeys {
|
||||
const val SEARCH_HISTORY_TOGGLE = "search_history_toggle"
|
||||
const val SYSTEM_CAPTION_STYLE = "system_caption_style"
|
||||
const val CAPTION_SETTINGS = "caption_settings"
|
||||
const val RICH_CAPTION_RENDERING = "rich_caption_rendering"
|
||||
const val SEEK_INCREMENT = "seek_increment"
|
||||
const val DEFAULT_RESOLUTION = "default_res"
|
||||
const val DEFAULT_RESOLUTION_MOBILE = "default_res_mobile"
|
||||
|
@ -165,6 +165,12 @@ object PlayerHelper {
|
||||
true
|
||||
)
|
||||
|
||||
val useRichCaptionRendering: Boolean
|
||||
get() = PreferenceHelper.getBoolean(
|
||||
PreferenceKeys.RICH_CAPTION_RENDERING,
|
||||
false
|
||||
)
|
||||
|
||||
private val bufferingGoal: Int
|
||||
get() = PreferenceHelper.getString(
|
||||
PreferenceKeys.BUFFERING_GOAL,
|
||||
|
@ -605,8 +605,8 @@ open class CustomExoPlayerView(
|
||||
val captionStyle = PlayerHelper.getCaptionStyle(context)
|
||||
subtitleView?.apply {
|
||||
setApplyEmbeddedFontSizes(false)
|
||||
setViewType(SubtitleView.VIEW_TYPE_WEB)
|
||||
setFixedTextSize(Cue.TEXT_SIZE_TYPE_ABSOLUTE, PlayerHelper.captionsTextSize)
|
||||
if (PlayerHelper.useRichCaptionRendering) setViewType(SubtitleView.VIEW_TYPE_WEB)
|
||||
if (!PlayerHelper.useSystemCaptionStyle) return
|
||||
setApplyEmbeddedStyles(captionStyle == CaptionStyleCompat.DEFAULT)
|
||||
setStyle(captionStyle)
|
||||
|
@ -223,6 +223,8 @@
|
||||
<string name="watch_positions_title">Remembered playback positions</string>
|
||||
<string name="reset_watch_positions">Reset</string>
|
||||
<string name="system_caption_style">System caption style</string>
|
||||
<string name="rich_caption_rendering">Rich caption rendering</string>
|
||||
<string name="rich_caption_rendering_summary">Render web captions for a more rich and customized experience.</string>
|
||||
<string name="captions">Captions</string>
|
||||
<string name="none">None</string>
|
||||
<string name="general">General</string>
|
||||
|
@ -123,6 +123,13 @@
|
||||
app:key="caption_settings"
|
||||
app:title="@string/caption_settings" />
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:icon="@drawable/ic_caption"
|
||||
app:defaultValue="false"
|
||||
app:key="rich_caption_rendering"
|
||||
app:title="@string/rich_caption_rendering"
|
||||
android:summary="@string/rich_caption_rendering_summary"/>
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
<PreferenceCategory app:title="@string/queue">
|
||||
|
Loading…
x
Reference in New Issue
Block a user