Giter Site home page Giter Site logo

Lag in autoplay about toro HOT 4 CLOSED

eneim avatar eneim commented on May 16, 2024
Lag in autoplay

from toro.

Comments (4)

eneim avatar eneim commented on May 16, 2024

I would investigate this issue. But there is some points I could list out for the concern:

  • If a ViewHolder is out of the viewport, there is a high chance it got recycled. In that case, when you see the video again, it need to be bound to the data again, therefore, the Video got prepared again.
  • In single video list, I did not see the issue yet, so maybe it has something related to the Internet connection too. But if you could provide a gif file or a video demonstrate the issue it would be really helpful.

from toro.

rahulrj avatar rahulrj commented on May 16, 2024

The first point is correct. It needs to be bound to data again. So there will always be slight lag.
I saw this issue in the sample app provided with this library running on WIFI. I will post the gif.
In a single video list also, this issue is bound to happen because the same recycling logic will happen if its a single or multiple video.

from toro.

rahulrj avatar rahulrj commented on May 16, 2024

@eneim . It certainly performs better than the Android MediaPlayer. +1 for that.
But can you please let me know one thing? Using Toro, suppose i have a ListView and i have video at position 8 and 15. Now i watch video at position 8 and scroll down to position from there. Now if i scroll back to position 8, its a high chance that the view that i get there is a recycled view. So for position 8, i will have to set the data-source of the video again and then it will prepare again and start playing.

So how does Toro handles this prepare delay? Have you taken care of anything extra from Android Media Player to reduce this prepare time-delay?

If not, is it possible that i save partial-downloaded video(10 s out of 60s) in a local temp file and then play the video using that local file? In this way, i already have the partial downloaded content,so it wont take much time to prepare.

from toro.

eneim avatar eneim commented on May 16, 2024

@rahulrj I understand your need. As said, I try to keep Toro staying out of the core implementation of playback process. Playing video is hard, I can say. And there are many ways to do so (and each will give a slightly different cycle). In fact, I'm trying to research more about some popular playback libraries to improve my playback cycle and implementation. It could turns out to be an extension of Toro which will support the playback only.

For you case, I want to try to play a list of local video (called a Playlist). But before any implementation, I would like to ask how would you play your parts smoothly? I know about HLS which could provide a playlist of such small parts of a Video so that client could play it more effectively. But for a list of local part files (list of .mp4, I guess), I have no imagine of how it would work. If you can help me this, I can make up some ideas.

By the mean time, I think a proper way of caching the video locally could be a good solution. Take a look at this if it help (I have no idea for sure, but I will try too): AndroidVideoCache

from toro.

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.