Styling the default player UI's subtitles on Android (font, no background box) without replacing the whole UI

I confirm this is a Feature Request and NOT a support/technical query. Please use your Bitmovin Dashboard for raising support tickets.

on

Which product is your request related to?

Player

Description

Styling the default player UI’s subtitles on Android (font, no background box) without replacing the whole UI

Platform: Android
SDK: Bitmovin Player Flutter SDK (wrapping native player 3.151.0). We maintain a small fork of the Flutter bindings, so we can add native code where needed.

What we want

Change how subtitles look in the default PlayerView UI: remove the semi-transparent black background box behind the text, and use a clean sans-serif font with an outline for legibility. That’s it, just the subtitle appearance.

The constraint

We need to keep the default player UI: the standard controls and, importantly, the Google Cast button. So the CustomUiSubtitleView sample approach (PlayerViewConfig(uiConfig = UiConfig.Disabled) + adding our own SubtitleView) does not fit us, because disabling the UI removes the controls and the cast button. We want the default UI, just with restyled subtitles.

What we’ve tried

  1. StyleConfig.supplementalPlayerUiCss (an HTTPS CSS file targeting .bmpui-ui-subtitle-label etc.). No visible effect on the subtitles on Android. The subtitles appear to be rendered by a native view, not the web UI, so the CSS never reaches them. (The CSS file is confirmed served: HTTP 200, Content-Type: text/css.)

  2. Native access via our fork. In the native view wrapper we traverse the PlayerView’s child view tree looking for a com.bitmovin.player.SubtitleView, and if found apply a style:

kotlinval subtitleView = findSubtitleView(playerView) ?: return
subtitleView.setApplyEmbeddedStyles(false)
subtitleView.setStyle(
CaptionStyle(
Color.WHITE, // foreground
Color.TRANSPARENT, // background (no box)
Color.TRANSPARENT, // window
1, // edge type OUTLINE
Color.BLACK, // edge color
Typeface.SANS_SERIF,
),
)

private fun findSubtitleView(view: View): SubtitleView? {
if (view is SubtitleView) return view
if (view is ViewGroup) {
for (i in 0 until view.childCount) {
findSubtitleView(view.getChildAt(i))?.let { return it }
}
}
return null
}

This compiles, but has no visible effect. findSubtitleView appears to return null, i.e. the default UI’s subtitle rendering is not a com.bitmovin.player.SubtitleView in the PlayerView hierarchy.

Questions

With the default UI enabled, what is the supported way to style the subtitles (font, background, edge)? Is the internal subtitle view reachable from PlayerView, and if so what is its type?
Is there a config on PlayerConfig / StyleConfig / PlayerViewConfig / UiConfig to set the subtitle caption style for the default UI, rather than adding a separate SubtitleView?
Should supplementalPlayerUiCss affect subtitles on Android at all, or does it only style the web UI chrome? If it should style subtitles, what are the exact CSS selectors, and is there a minimum SDK version?

Thanks. Happy to share more of the fork/native code if useful.