You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had a problem when I was playing a long audio URL, for example, after 800 seconds, I had an error because the data was not buffered. It seems to me that this hook solves this problem
player.setOnBufferingUpdateListener(object : MediaPlayer.OnBufferingUpdateListener {
override fun onBufferingUpdate(mp: MediaPlayer?, percent: Int) {
if (shouldSeekTo > 0) {
mp?.let {
val duration = it.duration
val startFromInPercentage = ((shouldSeekTo * 100) / duration)
Log.d("WrappedMediaPlayer", "onBufferingUpdate: $percent\trequired: $startFromInPercentage")
if (percent > startFromInPercentage) {
if (!it.isPlaying) {
mp.start()
ref.handleIsPlaying()
playing = true
}
it.seekTo(shouldSeekTo)
shouldSeekTo = -1
} else {
if (it.isPlaying) {
it.pause()
playing = false
}
}
}
}
}
})
The text was updated successfully, but these errors were encountered:
flutter_audioplayers/android/src/main/java/xyz/luan/audioplayers/WrappedMediaPlayer.java
Line 231 in f8ef363
I had a problem when I was playing a long audio URL, for example, after 800 seconds, I had an error because the data was not buffered. It seems to me that this hook solves this problem
The text was updated successfully, but these errors were encountered: