-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce edgeLayout to keep outline color #6724
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
@googlebot I signed it! |
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
@icbaker - Please take a look. Thanks! |
Thanks for the contribution! I'm afraid I'm not 100% clear what bug/problem you're solving here - would it be possible to provide repro instructions and/or test media that demonstrates the problem? You can email test media to dev.exoplayer@gmail.com if you're unable to share it directly on github - make sure the subject is |
To reproduce, and see that the outline is painted with the foreground color: either manually change user captionning style switch caption style to custom (last row radio button), or you can programmatically do (my codebase is in Kotlin)
in library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerView.java:449 Test in exoplayer demo in Subtitles -> WebVTT with the following patch applied:
|
Thanks for the clear repro instructions & screenshots - I can see the problem you're fixing here. I think what we've got so far isn't quite right - or rather doesn't interact well with existing decisions. With your change and a non-transparent CaptionStyleCompat outlineWithBackgroundNoWindow =
new CaptionStyleCompat(
/* foregroundColor= */ Color.WHITE,
/* backgroundColor= */ Color.CYAN,
/* windowColor= */ Color.TRANSPARENT,
CaptionStyleCompat.EDGE_TYPE_OUTLINE,
/* edgeColor= */ Color.BLACK,
/* typeface= */ null);
subtitleView.setStyle(outlineWithBackgroundNoWindow); Can you have a go at seeing if you can get the edge to appear in front of the background? I think it's happening because the This might be a bit tricky in the current code layout - if there's an obvious way to reshuffle things a bit to make it much better feel free to have a go. |
Hey @nnoury. We need more information to resolve this issue but there hasn't been an update in 14 days. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically. If you have more information that will help us get to the bottom of this, just add a comment! |
Quick update: we initially thought that the issue raised would need to add yet another painter, and that it would raise other issues, but we checked again and now it seems pretty straightforward. We'll try reporting back soon. |
Fix outline style subtitle When a ForegroundColorSpan changes the foreground color, it is also applied to the outline painter. In order to keep the correct color, one needs to filter out theses span. We do this with a new cue that is our text source for the specific edgeLayout. Take care to only apply background color once Test: Manual check - Subtitle view can show custom color subtitles from specific Subtitle Renderer and outline is shown correctly using user defined color.
259d487
to
1e72e1a
Compare
Fix outline color style in subtitles
When a ForegroundColorSpan changes the foreground color, it is also applied
to the outline painter. In order to keep the correct color, one needs to
filter out theses span. We do this with a new cue that is our text source
for the specific edgeLayout.
Test: Manual check - Subtitle view can show custom color subtitles from specific Subtitle
Renderer and outline is shown correctly using user defined color.