From cda7528e91cfb78a45011b6bd38c156e3b6ca419 Mon Sep 17 00:00:00 2001 From: anandnet Date: Sun, 15 Sep 2024 15:57:25 +0530 Subject: [PATCH] Some changes to achieve #133 --- lib/services/audio_handler.dart | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/services/audio_handler.dart b/lib/services/audio_handler.dart index 3ed6b18d..c1044347 100644 --- a/lib/services/audio_handler.dart +++ b/lib/services/audio_handler.dart @@ -63,7 +63,14 @@ class MyAudioHandler extends BaseAudioHandler with GetxServiceMixin { JustAudioMediaKit.title = 'Harmony music'; JustAudioMediaKit.protocolWhitelist = const ['http', 'https', 'file']; } - _player = AudioPlayer(); + _player = AudioPlayer( + audioLoadConfiguration: const AudioLoadConfiguration( + androidLoadControl: AndroidLoadControl( + minBufferDuration: Duration(seconds: 50), + maxBufferDuration: Duration(seconds: 120), + bufferForPlaybackDuration: Duration(milliseconds: 800), + bufferForPlaybackAfterRebufferDuration: Duration(seconds: 3), + ))); _createCacheDir(); _addEmptyList(); _notifyAudioHandlerAboutPlaybackEvents();