ReactVision / viro

ViroReact: The AR and VR library for React Native šŸ“³šŸ’™šŸ’›šŸ¤šŸ’š
MIT License
1.41k stars 164 forks source link

ViroVideo playing videos very slow after some seconds #225

Open alcristog opened 1 year ago

alcristog commented 1 year ago

Requirements:

Please go through this checklist before opening a new issue

Environment

Development OS: Windows 11 Device OS & Version: Google Pixel 4a 5G, Android 13 Version: React Native 7.8.0, React Viro: 2.23.0 Device: Google Pixel 4a 5G, Android 13

Description

Hi, I am executing an AR Scene with a ViroVideo component. The video to be played is more than 2 minutes long. I have realized that the video is played fluently, however, when it reaches 30 seconds, the general performance is quite low. The video and the application in general becomes very slow, making it to stop and close suddenly sometimes (and you have to start it again).

I have carried out some tests with different formats (MP4 and WEBM), even decreasing the video quality considerably (no more than 2MB) but the problem persists. It must be an error caused by the lengths of the videos I use (a buffer issue perhaps?).

My solution was to split the video in small videos of 30 secs length, and use different ViroVideo components that become active (paused=false and visible=true) when the previous one has finished. I have noticed a better performance in this case, but it is not a very fluent solution though, and sometimes it also fails and closes the app as before.

Any suggestion / consideration / recommendation when using long length VideoVideo components, please?

Thanks in advance.