mirror of
https://github.com/samsonjs/media.git
synced 2026-04-26 14:57:47 +00:00
Check command availability before getting tracks in PlayerView
#minor-release
PiperOrigin-RevId: 554451569
(cherry picked from commit 117b18f54c)
This commit is contained in:
parent
c0c67dd5e6
commit
4b3a4b3395
1 changed files with 2 additions and 1 deletions
|
|
@ -584,7 +584,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…
Reference in a new issue