Commit 212a912d by kimvde Committed by Tianyi Feng

Check command availability before getting tracks in PlayerView

#minor-release

PiperOrigin-RevId: 554451569
(cherry picked from commit 2063db12da9174a1f7b31e6e4b34e6ce226f30be)
parent 5ccbeec4
......@@ -591,7 +591,8 @@ public class StyledPlayerView 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();
}
......
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