Skip to content

Commit

Permalink
Document that the order of cues passed to TextOutput is important
Browse files Browse the repository at this point in the history
Fix WebViewSubtitleOutput to respect this (CanvasSubtitleOutput already
does).

Issue: #8704
PiperOrigin-RevId: 365534018
  • Loading branch information
icbaker authored and ojw28 committed Apr 1, 2021
1 parent 9be84e4 commit dd3597c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ public interface TextOutput {
/**
* Called when there is a change in the {@link Cue Cues}.
*
* <p>{@code cues} is in ascending order of priority. If any of the cue boxes overlap when
* displayed, the {@link Cue} nearer the end of the list should be shown on top.
*
* @param cues The {@link Cue Cues}. May be empty.
*/
void onCues(List<Cue> cues);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ private void updateWebView() {
Util.formatInvariant(
"<div style='"
+ "position:absolute;"
+ "z-index:%s;"
+ "%s:%.2f%%;"
+ "%s:%s;"
+ "%s:%s;"
Expand All @@ -287,6 +288,7 @@ private void updateWebView() {
+ "background-color:%s;"
+ "transform:translate(%s%%,%s%%);"
+ "'>",
/* z-index */ i,
positionProperty,
positionPercent,
lineProperty,
Expand Down

0 comments on commit dd3597c

Please sign in to comment.