Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: Android memory leaks when using the "repeat" property #4343

Open
ramanradzivonau opened this issue Dec 18, 2024 · 2 comments
Open

[BUG]: Android memory leaks when using the "repeat" property #4343

ramanradzivonau opened this issue Dec 18, 2024 · 2 comments
Labels
Accepted Issue is confirmed and accepted by maintainers team bug

Comments

@ramanradzivonau
Copy link

Version

6.8.2

What platforms are you having the problem on?

Android

System Version

Android 10.0(real), android 15.0(simulator)

On what device are you experiencing the issue?

Real device, Simulator

Architecture

Old architecture

What happened?

I use your library to play a video as a loader. The video resolution is 750x1624, the duration is 3 seconds. I need to play the video continuously while the requests are loading. I encountered that when using the "repeat" property, the memory consumption increases significantly (about 150 MB compared to the same video but without the "repeat" property).

Reproduction Link

repository link

Reproduction

Use 'repeat' property

import React from 'react';
import Video from 'react-native-video';

function App(): React.JSX.Element {
  return (
    <Video
      source={{ uri: 'file:///android_asset/video/loader.mp4' }}
      repeat
    />
  );
}

export default App;
Copy link

Thank you for your issue report. Please note that the following information is missing or incomplete:

  • reproduction link

Please update your issue with this information to help us address it more effectively.

Note: issues without complete information have a lower priority

@dr-crsa
Copy link

dr-crsa commented Jan 14, 2025

I've experienced the same issue. I have quite a few videos looping on a screen, and when repeat is set to true, the memory consumption can cause the app to crash.

A temporary alternative could be to use this instead: onEnd={() => videoRef.current?.seek(0)} After adding this, the app feels smoother when scrolling, and it doesn't crash anymore. I've not tested it properly, though.

@freeboub freeboub added the Accepted Issue is confirmed and accepted by maintainers team label Jan 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepted Issue is confirmed and accepted by maintainers team bug
Projects
None yet
Development

No branches or pull requests

3 participants