Document that the order of cues passed to TextOutput is important

Fix WebViewSubtitleOutput to respect this (CanvasSubtitleOutput already
does).

Issue: #8704
PiperOrigin-RevId: 365534018
This commit is contained in:
ibaker 2021-03-29 10:47:56 +01:00 committed by Oliver Woodman
parent 9be84e4998
commit dd3597c2c1
2 changed files with 5 additions and 0 deletions

View File

@ -25,6 +25,9 @@ public interface TextOutput {
/** /**
* Called when there is a change in the {@link Cue Cues}. * 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. * @param cues The {@link Cue Cues}. May be empty.
*/ */
void onCues(List<Cue> cues); void onCues(List<Cue> cues);

View File

@ -278,6 +278,7 @@ import java.util.Map;
Util.formatInvariant( Util.formatInvariant(
"<div style='" "<div style='"
+ "position:absolute;" + "position:absolute;"
+ "z-index:%s;"
+ "%s:%.2f%%;" + "%s:%.2f%%;"
+ "%s:%s;" + "%s:%s;"
+ "%s:%s;" + "%s:%s;"
@ -287,6 +288,7 @@ import java.util.Map;
+ "background-color:%s;" + "background-color:%s;"
+ "transform:translate(%s%%,%s%%);" + "transform:translate(%s%%,%s%%);"
+ "'>", + "'>",
/* z-index */ i,
positionProperty, positionProperty,
positionPercent, positionPercent,
lineProperty, lineProperty,