Fix exoplayer aspect ratio update on source changes (#2053)
* Fix exoplayer aspect ratio update on source changes * Update CHANGELOG.md
This commit is contained in:
		| @@ -67,6 +67,10 @@ public final class AspectRatioFrameLayout extends FrameLayout { | ||||
|         return videoAspectRatio; | ||||
|     } | ||||
|  | ||||
|     public void invalidateAspectRatio() { | ||||
|         videoAspectRatio = 0; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Sets the resize mode which can be of value {@link ResizeMode.Mode} | ||||
|      * | ||||
|   | ||||
| @@ -200,6 +200,11 @@ public final class ExoPlayerView extends FrameLayout { | ||||
|         shutterView.setVisibility(VISIBLE); | ||||
|     } | ||||
|  | ||||
|     public void invalidateAspectRatio() { | ||||
|         // Resetting aspect ratio will force layout refresh on next video size changed | ||||
|         layout.invalidateAspectRatio(); | ||||
|     } | ||||
|  | ||||
|     private final class ComponentListener implements SimpleExoPlayer.VideoListener, | ||||
|             TextOutput, ExoPlayer.EventListener { | ||||
|  | ||||
|   | ||||
| @@ -410,6 +410,8 @@ class ReactExoplayerView extends FrameLayout implements | ||||
|                     player.setPlaybackParameters(params); | ||||
|                 } | ||||
|                 if (playerNeedsSource && srcUri != null) { | ||||
|                     exoPlayerView.invalidateAspectRatio(); | ||||
|  | ||||
|                     ArrayList<MediaSource> mediaSourceList = buildTextSources(); | ||||
|                     MediaSource videoSource = buildMediaSource(srcUri, extension); | ||||
|                     MediaSource mediaSource; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user