Hide subtitles when switching player in SimpleExoPlayerView

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=177941993
This commit is contained in:
olly 2017-12-05 05:19:48 -08:00 committed by Oliver Woodman
parent 9cb0c2f702
commit 02e32a1838
2 changed files with 6 additions and 2 deletions

View file

@ -425,6 +425,9 @@ public final class SimpleExoPlayerView extends FrameLayout {
if (shutterView != null) {
shutterView.setVisibility(VISIBLE);
}
if (subtitleView != null) {
subtitleView.setCues(null);
}
if (player != null) {
if (surfaceView instanceof TextureView) {
player.setVideoTextureView((TextureView) surfaceView);

View file

@ -19,6 +19,7 @@ import android.annotation.TargetApi;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Canvas;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.util.TypedValue;
import android.view.View;
@ -87,9 +88,9 @@ public final class SubtitleView extends View implements TextOutput {
/**
* Sets the cues to be displayed by the view.
*
* @param cues The cues to display.
* @param cues The cues to display, or null to clear the cues.
*/
public void setCues(List<Cue> cues) {
public void setCues(@Nullable List<Cue> cues) {
if (this.cues == cues) {
return;
}