Skip to content

[video_player] add buffering controls #40931

Open
flutter/packages
#11950

Description

@lukepighetti

I'd like the ability to pause/resume buffering on video_player, why?

We've got a situation where we have multiple videos loading offscreen and we'd like video_player to buffer only enough to keep up once the user navigates to view that video. As far as I know, video_player currently buffers 100% of the video as quickly as possible which is normally appropriate but not when you have 6-12 videos buffering slightly off screen.

Activity

  1. changed the title [-]add partial buffer to video_player[/-] [+][video_player] add buffering controls[/+] on Sep 20, 2019
  2. added
    c: proposalA detailed proposal for a change to Flutter
    on Feb 5, 2020
  3. PaulRaphanaud commented on Apr 10, 2020

    @PaulRaphanaud
  4. guopeng1994 commented on Jun 10, 2020

    @guopeng1994
  5. lukepighetti commented on Jun 10, 2020

    @lukepighetti
    Author
  6. vishwajit76 commented on Jun 20, 2020

    @vishwajit76
  7. jpiabrantes commented on Jun 25, 2020

    @jpiabrantes
  8. lukepighetti commented on Jun 25, 2020

    @lukepighetti
    Author
  9. amirmhmdi commented on Aug 2, 2020

    @amirmhmdi
  10. lukepighetti commented on Aug 3, 2020

    @lukepighetti
    Author
  11. ayush221b commented on Jan 22, 2021

    @ayush221b

    This is a very critical issue actually. For use cases like mine where you have a feed of many videos, the buffering must be dependent on the current position of playback, in the current state it will buffer 100% of the video which increases the data consumed by the application a lot. In regions where people do not all have WiFi connections with unlimited data available, this causes them to hit their data limits within a very short span of time and provides a very negative impression of the app. Once this happens, they may never come back.

    Can we do something to control the percentage of video that is buffered ahead?

    cc: @TahaTesser

  12. 37 remaining items

  13. sanket-hv commented on Jul 13, 2023

    @sanket-hv

    In the video_player, I don't think it's currently available to control how many amounts of videos are to be buffered.
    But I did it by changing the native iOS code into a dependency file.

    for iOS we have one option to set a limit on buffering.
    Property is preferredForwardBufferDuration.
    For More info: https://developer.apple.com/documentation/avfoundation/avplayeritem/1643630-preferredforwardbufferduration

  14. yadavmanishraj commented on Jul 23, 2023

    @yadavmanishraj

    Any updates

  15. ShahzadUmarBaig commented on Jul 24, 2023

    @ShahzadUmarBaig

    Has there been any work on this lately? It would be great to have buffering controls and a way to stop buffering, de-initializing the controller causes the video to slow down every time we try to re-visit them.

  16. saurabhunify commented on Sep 23, 2023

    @saurabhunify

    Has anyone figured out any issue for this. My app which uses pageview builder for displaying videos loads 3 pageviews at time initializing 3 videos at a time on page change it loads another one. But the concern here is that for loading just 3-4 videos which are approximately 6-8 MB in size app consumes 80-90 MB of data which is huge for the users runnig app on mobile network.
    Moreover there is no way to track the network consumption and requests made by the video player controller for loading videos in the network profiler tab in the dev tools.
    @TahaTesser kindly help in this situation.

  17. mrabetachraf commented on Oct 5, 2023

    @mrabetachraf

    For people still looking for a solution, i've found a player that let's you configure the buffer. it's called better Player.
    Documentation : https://jhomlala.github.io/betterplayer/#/README
    buffering documentaion. https://jhomlala.github.io/betterplayer/#/bufferingconfiguration

    ps: if you have other player packages such as video player or chiwie it will cause a problem so make sure to remove them and run flutter clean.

  18. NicolasDionB commented on Oct 5, 2023

    @NicolasDionB

    For people still looking for a solution, i've found a player that let's you configure the buffer. it's called better Player. Documentation : https://jhomlala.github.io/betterplayer/#/README buffering documentaion. https://jhomlala.github.io/betterplayer/#/bufferingconfiguration

    ps: if you have other player packages such as video player or chiwie it will cause a problem so make sure to remove them and run flutter clean.

    It doesn't seems to work on the web and non-mobile platforms though.

  19. saileshbro commented on Jun 19, 2024

    @saileshbro

    Any updates on this? @lukepighetti do you have any workarounds? would love to see some implementation that would cache HLS streams, like how instagram reels, tiktok does.

  20. Laestry commented on Oct 14, 2024

    @Laestry

    For people still looking for a solution, i've found a player that let's you configure the buffer. it's called better Player. Documentation : https://jhomlala.github.io/betterplayer/#/README buffering documentaion. https://jhomlala.github.io/betterplayer/#/bufferingconfiguration
    ps: if you have other player packages such as video player or chiwie it will cause a problem so make sure to remove them and run flutter clean.

    It doesn't seems to work on the web and non-mobile platforms though.

    and it's only for android, plus having a function to call that actually stops/starts buffering would be amazing

  21. saninthottungal commented on Dec 26, 2025

    @saninthottungal

    is there anyone working on this?

    from my research, this can be done in Android, IOS and MACOS. these platforms supports this feature natively.
    and for web, i don't think its possible. or rather i didn't find any doc on if this can be implemented in web or not.

    so can i try implementing this for Android, IOS and MACOS?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projectc: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Flutterp: video_playerThe Video Player pluginpackageflutter/packages repository. See also p: labels.team-ecosystemOwned by Ecosystem teamtriaged-ecosystemTriaged by Ecosystem team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions