Seek method of just_audio is not working in Flutter

146 views Asked by At

I have Implemented audio player in my application using just_audio library. currently I'm facing the problem that is I have put one slider to seek audio and play at specific time duration, So when try to seek slider in backwards side it gives following error but while seek to forward it is working fine.

Client returned a buffer it does not own according to our record: 0

Here is the code for that

Consumer<PlayerStateModel>(
  builder: (context, playerState, child) {
    return Slider(
      value: playerState.currentPosition.inSeconds.toDouble(),
      min: 0.0,
      max: playerState.duration.inSeconds.toDouble(),
      inactiveColor: globals.shadowColor,
      onChanged: (newValue) {
        final clampedValue = newValue.clamp(_value, playerState.duration.inSeconds.toDouble());
        debugPrint("CLAMPED VALUE $clampedValue");
        audioPlayer.seek(Duration(seconds: clampedValue.toInt()));
        setState(() {
          _value = clampedValue;
        });
      },
    );
   },
  )
0

There are 0 answers