react-native-video: resizeMode not working in iOS 10
resizeMode='cover' in iOS 9.3 works as expected. In iOS 10.0 the video doesn’t resize to take up the full Video component size so I have blank space at the top and bottom of the video.
What’s actually really interesting is that if I have hot loading on and I switch resizeMode to container and then back to cover it works properly. It seems like it just doesn’t resize when the video first loads.
Same issue with stretch - it does not resize on initial load.
If I add the repeat prop it will resize after the first loop.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 6
- Comments: 19 (4 by maintainers)
“Interesting” behaviour: when I use the ‘muted’ property the video does resize as expected (we don’t use any sound, it’s a background video)
Sorry I missed this thread… one sec while I take a look…
I found a hackie workaround that maybe help someone till this is fixed.
Maybe this can be related to #331 and #297
@jpgarcia expanding on your hack, here’s a solution that is working for me for repeat and non-repeat videos. You can just import this component instead of
react-native-videoand it’ll “fix” the issue.Fair warning the above code is definitely a hack. It can mess up iOS <= 9.3 because it calls onEnd twice in the beginning so your video will never play. I’d recommend checking the Device version or using debounce.