Check command availability before getting tracks in PlayerView
#minor-release PiperOrigin-RevId: 554451569
This commit is contained in:
parent
ff3902debb
commit
117b18f54c
@ -589,7 +589,8 @@ public class PlayerView extends FrameLayout implements AdViewProvider {
|
||||
} else if (surfaceView instanceof SurfaceView) {
|
||||
player.setVideoSurfaceView((SurfaceView) surfaceView);
|
||||
}
|
||||
if (player.getCurrentTracks().isTypeSupported(C.TRACK_TYPE_VIDEO)) {
|
||||
if (!player.isCommandAvailable(COMMAND_GET_TRACKS)
|
||||
|| player.getCurrentTracks().isTypeSupported(C.TRACK_TYPE_VIDEO)) {
|
||||
// If the player already is or was playing a video, onVideoSizeChanged isn't called.
|
||||
updateAspectRatio();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user