Commit 89cd796b by samrobinson Committed by Oliver Woodman

Do not require subtitleButton in custom layouts of StyledPlayerView

Every other subtitleButton has an if not null check, but does not force non null.

Issue: #7962
PiperOrigin-RevId: 334124323
parent 1bdccd4b
......@@ -11,6 +11,9 @@
([#7866](https://github.com/google/ExoPlayer/issues/7866)).
* Text:
* Add support for `\h` SSA/ASS style override code (non-breaking space).
* UI:
* Do not require subtitleButton in custom layouts of StyledPlayerView
([#7962](https://github.com/google/ExoPlayer/issues/7962)).
* Extractors:
* Add support for .mp2 boxes in the `AtomParsers`
([#7967](https://github.com/google/ExoPlayer/issues/7967)).
......
......@@ -2005,11 +2005,13 @@ public class StyledPlayerControlView extends FrameLayout {
break;
}
}
checkNotNull(subtitleButton)
.setImageDrawable(subtitleIsOn ? subtitleOnButtonDrawable : subtitleOffButtonDrawable);
checkNotNull(subtitleButton)
.setContentDescription(
subtitleIsOn ? subtitleOnContentDescription : subtitleOffContentDescription);
if (subtitleButton != null) {
subtitleButton.setImageDrawable(
subtitleIsOn ? subtitleOnButtonDrawable : subtitleOffButtonDrawable);
subtitleButton.setContentDescription(
subtitleIsOn ? subtitleOnContentDescription : subtitleOffContentDescription);
}
this.rendererIndices = rendererIndices;
this.tracks = trackInfos;
this.mappedTrackInfo = mappedTrackInfo;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment