How to fetch recent played songs with last played duration of songs with audio service and just audio in flutter

0 votes

If it is not possible with audio_service and just_audio package then it is possible to direct fetch recent played songs list with use of any flutter packages?

Mar 14, 2023 in Android by anonymous
• 780 points
1,477 views

1 answer to this question.

0 votes

To fetch the recent played songs with last played duration, you can use the just_audio package to play audio files and get the current playback position. Then, you can use the shared_preferences package to store the recently played songs and their playback positions. You can add a listener to the positionStream to track the current playback position and store it in shared preferences. When a new song is played, its last playback position is retrieved from shared preferences and the song is played from that position. Finally, the song is added to the recently played list and its ID is stored in shared preferences. You can use the recent_songs list from shared preferences to display the recently played songs in your app, along with their last playback position.

answered Mar 18, 2023 by vinayak

Related Questions In Android

0 votes
0 answers

How to get current time and date in Android?

How can I get the current time ...READ MORE

Nov 22, 2022 in Android by Edureka
• 12,690 points
512 views
0 votes
0 answers
0 votes
1 answer

How to change package name in flutter?

Yes, you can change the package name ...READ MORE

answered Mar 1, 2023 in Android by vishalini
3,212 views
0 votes
1 answer

How to create number input field in Flutter?

Yes, Flutter has a built-in widget called ...READ MORE

answered Mar 1, 2023 in Android by vishalini
8,008 views
0 votes
1 answer
0 votes
1 answer

Lock screen audio player notification not appearing when target SDK is 33?

This issue may be related to the ...READ MORE

answered Apr 6, 2023 in Flutter by vishwa
1,599 views
0 votes
1 answer

What is the future of flutter?

Hi@MD, Flutter is a rather new cross-platform framework ...READ MORE

answered Jul 17, 2020 in Others by akhtar
• 38,260 points
1,147 views
0 votes
1 answer

What is Flutter?

Hi@akhtar, Flutter is an app SDK for building ...READ MORE

answered Jul 17, 2020 in Others by MD
• 95,460 points
1,450 views
0 votes
1 answer

How can I add a border to a widget in Flutter?

To add a border to a widget ...READ MORE

answered Mar 1, 2023 in Android by vishalini
11,460 views
0 votes
1 answer

How to run code after some delay in Flutter?

You can use the Future.delayed function in ...READ MORE

answered Mar 18, 2023 in Android by vishalini
2,577 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP