mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Check command availability before getting tracks in PlayerView
#minor-release PiperOrigin-RevId: 554451569
This commit is contained in:
parent
ff3902debb
commit
117b18f54c
1 changed files with 2 additions and 1 deletions
|
|
@ -589,7 +589,8 @@ public class PlayerView extends FrameLayout implements AdViewProvider {
|
||||||
} else if (surfaceView instanceof SurfaceView) {
|
} else if (surfaceView instanceof SurfaceView) {
|
||||||
player.setVideoSurfaceView((SurfaceView) 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.
|
// If the player already is or was playing a video, onVideoSizeChanged isn't called.
|
||||||
updateAspectRatio();
|
updateAspectRatio();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue