Open snipd-min opened 1 year ago
Adding on top of what @snipd-min commented, we have made the following observations on the native side:
timeControlStatus
is reported to be AVPlayerTimeControlStatusPlaying
. However, I would expect it to be AVPlayerTimeControlStatusWaitingToPlayAtSpecifiedRate
since nothing is being playedaddPeriodicTimeObserverForInterval
and checkForDiscontinuity
is called, once the audio is playing the current position is correctedcurrentTime
of the playerItem
is buffered, by observing and checking loadedTimeRanges
, we noticed that sometimes when the timeControlStatus
is AVPlayerTimeControlStatusPlaying
, the currentTime
is not buffered yet (it’s not contained in any of the loadedTimeRanges
)I have got same error when seek to on Android device. Progress bar still going with no sound
I have the same issue with both iOS and Android.
@snipd-min @mohammad-adk @ryanheise @snipd-mikel any update on a solution for ios? I have been facing recently with flutter version 3.19.5
@ryanheise I am still facing issue more frequently as of now, could you please help me with what can be done and which flutter version is best for this library?
Which API doesn't behave as documented, and how does it misbehave? When the player is already playing, the
seek
method sometimes (esp. under bad network conditions) causes the player to not detect the buffering state correctly. After seeking, the players showsprocessing ready
state when it's actually buffering and there is no sound. The position stream also moves on during this period. After a while, the sound comes back but the position stream is still offset-ed with the silence duration. After clicking "pause" and "play" again, the position is then correctly reported.Minimal reproduction project The example.
To Reproduce (i.e. user steps, not code) Steps to reproduce the behavior:
Error messages There is no error messages. The processing status seems to be wrong when there is no sound, as it should be buffering instead of ready.
Expected behavior The player should show "buffering" processing state when this happens and should not show the "ready" state with no sound.
Screenshots Video reproducing the issue Note: at around 0:14 seconds after I hit pause, the position stream is "fixed".
Smartphone (please complete the following information):
Flutter SDK version
Potential workaround It seems like by not calling
self->_player.rate = self->_speed;
immediately in theseek:position completionHandler
and instead use a flag and call it when observingplaybackLikelyToKeepUp
makes it better, i.e. it buffers and only showsready
& moves the position after it's really playing. But this is still a bit unreliable at times.