google / google/ExoPlayer

WebView-based subtitle styling doesn't render EDGE_TYPE_OUTLINE correctly

Open
#10,137 0 comments 0 reactions 1 assignee Claimed by @icbaker View on GitHub
bug
Dominant language
Java
Stars
21.9k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Copying from https://github.com/google/ExoPlayer/issues/2194#issuecomment-1084271458:

> If I use the webview by `subView.setViewType(SubtitleView.VIEW_TYPE_WEB)` , the Arabic comma appears at the correct place. But in this mode, the subtitle's style is unruly. **For example, `CaptionStyleCompat.EDGE_TYPE_OUTLINE` the outline is oddly**,

I can reproduce this in 2.17.1 (screenshots below), using the "TTML positioning" sample and the following patch to the demo app in `PlayerActivity#onCreate`:
```java
playerView.getSubtitleView().setViewType(SubtitleView.VIEW_TYPE_WEB);
playerView.getSubtitleView().setStyle(new CaptionStyleCompat(
/* foregroundColor= */ Color.RED,
/* backgroundColor= */ Color.GREEN,
/* windowColor= */ Color.CYAN,
CaptionStyleCompat.EDGE_TYPE_OUTLINE,
/* edgeColor= */ Color.BLACK,
/* typeface= */ null
));
```

Outline screenshots

**Canvas**

![Canvas with outline](https://user-images.githubusercontent.com/1279752/161011358-574e3f38-8f10-42c9-8015-80c3e05a229b.png)

-----

**WebView**

![WebView with outline](https://user-images.githubusercontent.com/1279752/161011372-08f6e8c2-0180-4801-92b3-9cd55b6d6ed3.png)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.