GithubHelp home page GithubHelp logo

Comments (9)

brentvatne avatar brentvatne commented on April 28, 2024

@johanneslumpe - are there any tradeoffs here? what is the cost of throwing away & creating a new one?

from react-native-video.

eduedix avatar eduedix commented on April 28, 2024

@brentvatne: I am going back and forth in the Navigator in my small app, which has a page that loads Video.
Everytime i go to the page with Video, memory usage jumps by around 70MB. I think thats cos new instance is alloc'ed each time.

from react-native-video.

brentvatne avatar brentvatne commented on April 28, 2024

@eduedix - that sounds like a good enough reason right there! thanks

from react-native-video.

eduedix avatar eduedix commented on April 28, 2024

It would be indeed useful to have an API, which could let me kill the instance. It seems having only 1 instance is still not the optimum solution.
I might be wrong about this.

from react-native-video.

brentvatne avatar brentvatne commented on April 28, 2024

@eduedix - ideally how would you like to manage this?

from react-native-video.

johanneslumpe avatar johanneslumpe commented on April 28, 2024

@eduedix it's one instance per element, not sure why you need multiple players per element?

from react-native-video.

johanneslumpe avatar johanneslumpe commented on April 28, 2024

@brentvatne at the very least we'd save the cost of allocating a new instance. It might not be a huge optimization, but less allocation is always better ;)

from react-native-video.

eduedix avatar eduedix commented on April 28, 2024

@brentvatne @johanneslumpe I am still in for only one instance. But it seems instance stays on in the background forever.

from react-native-video.

johanneslumpe avatar johanneslumpe commented on April 28, 2024

@brentvatne @eduedix I just pushed a small fix branch for this.
https://github.com/brentvatne/react-native-video/tree/feature/fix-unremoved-playerlayer

After that gets merged, you should see a significant memory drop, when removing the view with the video.

from react-native-video.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.