Commit 68eb7eb8 by olly Committed by Oliver Woodman

Fix StyledPlayerView detachment

Issue: #8985
#minor-release
PiperOrigin-RevId: 375913914
parent f49c1447
......@@ -19,6 +19,10 @@
* Keep subtitle language features embedded (e.g. rubies & tate-chu-yoko)
in `Cue.text` even when `SubtitleView#setApplyEmbeddedStyles()` is
false.
* UI
* Fix `NullPointerException` in `StyledPlayerView` that could occur after
calling `StyledPlayerView.setPlayer(null)`
([#8985](https://github.com/google/ExoPlayer/issues/8985)).
### 2.14.0 (2021-05-13)
......
......@@ -570,6 +570,7 @@ public class StyledPlayerView extends FrameLayout implements AdViewProvider {
}
@Nullable Player oldPlayer = this.player;
if (oldPlayer != null) {
oldPlayer.removeListener(componentListener);
if (surfaceView instanceof TextureView) {
oldPlayer.clearVideoTextureView((TextureView) surfaceView);
} else if (surfaceView instanceof SurfaceView) {
......
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