mirror of
https://github.com/androidx/media.git
synced 2025-05-10 09:12:16 +08:00
Fix StyledPlayerView detachment
Issue: #8985 #minor-release PiperOrigin-RevId: 375913914
This commit is contained in:
parent
f49c14479e
commit
68eb7eb8df
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user