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
This commit is contained in:
samrobinson 2020-09-28 11:45:00 +01:00 committed by Oliver Woodman
parent 1bdccd4bfb
commit 89cd796bf6
2 changed files with 10 additions and 5 deletions

View File

@ -11,6 +11,9 @@
([#7866](https://github.com/google/ExoPlayer/issues/7866)). ([#7866](https://github.com/google/ExoPlayer/issues/7866)).
* Text: * Text:
* Add support for `\h` SSA/ASS style override code (non-breaking space). * 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: * Extractors:
* Add support for .mp2 boxes in the `AtomParsers` * Add support for .mp2 boxes in the `AtomParsers`
([#7967](https://github.com/google/ExoPlayer/issues/7967)). ([#7967](https://github.com/google/ExoPlayer/issues/7967)).

View File

@ -2005,11 +2005,13 @@ public class StyledPlayerControlView extends FrameLayout {
break; break;
} }
} }
checkNotNull(subtitleButton)
.setImageDrawable(subtitleIsOn ? subtitleOnButtonDrawable : subtitleOffButtonDrawable); if (subtitleButton != null) {
checkNotNull(subtitleButton) subtitleButton.setImageDrawable(
.setContentDescription( subtitleIsOn ? subtitleOnButtonDrawable : subtitleOffButtonDrawable);
subtitleIsOn ? subtitleOnContentDescription : subtitleOffContentDescription); subtitleButton.setContentDescription(
subtitleIsOn ? subtitleOnContentDescription : subtitleOffContentDescription);
}
this.rendererIndices = rendererIndices; this.rendererIndices = rendererIndices;
this.tracks = trackInfos; this.tracks = trackInfos;
this.mappedTrackInfo = mappedTrackInfo; this.mappedTrackInfo = mappedTrackInfo;