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:
parent
8962720f56
commit
dbf1a4e034
@ -12,6 +12,7 @@
|
|||||||
- Added preventsDisplaySleepDuringVideoPlayback (#2019)
|
- Added preventsDisplaySleepDuringVideoPlayback (#2019)
|
||||||
- Reverted the JS fullscreening for Android. [#2013](https://github.com/react-native-community/react-native-video/pull/2013)
|
- Reverted the JS fullscreening for Android. [#2013](https://github.com/react-native-community/react-native-video/pull/2013)
|
||||||
- Set iOS request headers without needing to edit RCTVideo.m. [#2014](https://github.com/react-native-community/react-native-video/pull/2014)
|
- Set iOS request headers without needing to edit RCTVideo.m. [#2014](https://github.com/react-native-community/react-native-video/pull/2014)
|
||||||
|
- Fix exoplayer aspect ratio update on source changes [#2053](https://github.com/react-native-community/react-native-video/pull/2053)
|
||||||
|
|
||||||
### Version 5.1.0-alpha5
|
### Version 5.1.0-alpha5
|
||||||
|
|
||||||
|
@ -67,6 +67,10 @@ public final class AspectRatioFrameLayout extends FrameLayout {
|
|||||||
return videoAspectRatio;
|
return videoAspectRatio;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void invalidateAspectRatio() {
|
||||||
|
videoAspectRatio = 0;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the resize mode which can be of value {@link ResizeMode.Mode}
|
* 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);
|
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,
|
private final class ComponentListener implements SimpleExoPlayer.VideoListener,
|
||||||
TextOutput, ExoPlayer.EventListener {
|
TextOutput, ExoPlayer.EventListener {
|
||||||
|
|
||||||
|
@ -410,6 +410,8 @@ class ReactExoplayerView extends FrameLayout implements
|
|||||||
player.setPlaybackParameters(params);
|
player.setPlaybackParameters(params);
|
||||||
}
|
}
|
||||||
if (playerNeedsSource && srcUri != null) {
|
if (playerNeedsSource && srcUri != null) {
|
||||||
|
exoPlayerView.invalidateAspectRatio();
|
||||||
|
|
||||||
ArrayList<MediaSource> mediaSourceList = buildTextSources();
|
ArrayList<MediaSource> mediaSourceList = buildTextSources();
|
||||||
MediaSource videoSource = buildMediaSource(srcUri, extension);
|
MediaSource videoSource = buildMediaSource(srcUri, extension);
|
||||||
MediaSource mediaSource;
|
MediaSource mediaSource;
|
||||||
|
Loading…
Reference in New Issue
Block a user