flutter
flutter copied to clipboard
[video_player] Buffering works only from current position. Proposal to seek backward through buffer by default.
Use case
When I turn off wifi I can only seek forward through buffer but if I try seek backward it stalls.
Proposal
I think video_player should provide possibility to seek backward through buffer by default.
@IlyaMax I tried the use case using plugin's example on iOS. Ran the example with which a video played over the network can seek forward and backward properly, then I turned OFF wifi after which I was able to seek forward and back properly:
https://user-images.githubusercontent.com/67046386/151551856-c87e8dde-4753-41d4-8bdf-3a569814aa6f.MP4
Please let me know if this is a correct interpretation or not. Alternatively, please see if this issue is similar to your case.
@darshankawar I'm not sure that video of this length is suitable for this feature request. Please try https://multiplatform-f.akamaihd.net/i/multi/will/bunny/big_buck_bunny_,640x360_400,640x360_700,640x360_1000,950x540_1500,.f4v.csmil/master.m3u8 this. As you can see on attached video for ios I can seek forward but can't seek backward.
https://user-images.githubusercontent.com/33570996/152215169-823fcb8c-3682-4bfe-a020-b068c627a8ad.mp4
@IlyaMax
Thanks for the details. I tried with the given link and do see the the seek doesn't work backwards when wifi is turned OFF. But I observed the same behavior using wifi as well, so I think if you are hitting https://github.com/flutter/flutter/issues/78998. Can you check that issue once and confirm ?
https://user-images.githubusercontent.com/67046386/152290107-2f7cdf4e-d0f3-4cb1-b372-fd5060fa1ec0.MP4
@darshankawar no, that's not the same. I mean for seek you need to just tap, but not slide. It's not expected also that you can seek to any position by tap. Just when internet is off as user if I can seek forward to some position within buffered segment, I expect that something is buffered before current position and I can seek within that segment also.
Thanks for the update.
What platform is this on? This sounds like a behavior of the underlying player library, not the plugin.
@stuartmorgan video player gets error on android too when trying to seek backward
It looks like this feature is just not implemented on both platforms, not sure for now, didn't investigate better.
I'll leave this open in case someone in the community wants to investigate further; my expectation is that this is beyond the control of the plugin.
Same here
For Android, ExoPlayer has method "setBackBuffer" for buffering video. How can we access it to pass our own parameters?
https://github.com/google/ExoPlayer/blob/d5d78238773d6dc53b54849ca10d845a4421284c/library/core/src/main/java/com/google/android/exoplayer2/DefaultLoadControl.java#L203-L213
https://github.com/google/ExoPlayer/issues/3583
There is no way to directly access the underlying players; the plugin is an abstraction around them. Features need to be added to the plugin wrapper.