suragch / flutter_audio_service_demo

Companion project for Flutter audio_service tutorial
https://suragch.medium.com/background-audio-in-flutter-with-audio-service-and-just-audio-3cce17b4a7d?sk=0837a1b1773e27a4f879ff3072e90305
MIT License
57 stars 28 forks source link

Button State still showing Loading #5

Closed zionnite closed 3 years ago

zionnite commented 3 years ago

Hello sir, thanks for these awesome work.

i did go through your arcticle and as a matter of fact to avoid errors i copy your codes words to words but this time am getting ButtonState.loading whien i print it out and the UI is still showing circluar progress indicator.

My Internet connection is good and am eve watching youtube videos with it please what am i doing wrong?

zionnite commented 3 years ago

i according to the way this script was built, the audio was to be loaded at once, but thats not what am getting, the playlist seem to be loaded, but it still seem nothing was actually loaded into it.

zionnite commented 3 years ago

i found out that when i load ConcatenatingAudioSource(children: []); with data, the music player play but when i remove it from the script nothing works

final _playlist = ConcatenatingAudioSource(children: [
    ClippingAudioSource(
      start: Duration(seconds: 60),
      end: Duration(seconds: 90),
      child: AudioSource.uri(Uri.parse(
          "https://s3.amazonaws.com/scifri-episodes/scifri20181123-episode.mp3")),
      tag: MediaItem(
        id: '${_nextMediaId++}',
        album: "Science Friday",
        title: "A Salute To Head-Scratching Science (30 seconds)",
        artUri: Uri.parse(
            "https://media.wnyc.org/i/1400/1400/l/80/1/ScienceFriday_WNYCStudios_1400.jpg"),
      ),
    ),
    AudioSource.uri(
      Uri.parse(
          "https://s3.amazonaws.com/scifri-episodes/scifri20181123-episode.mp3"),
      tag: MediaItem(
        id: '${_nextMediaId++}',
        album: "Science Friday",
        title: "A Salute To Head-Scratching Science",
        artUri: Uri.parse(
            "https://media.wnyc.org/i/1400/1400/l/80/1/ScienceFriday_WNYCStudios_1400.jpg"),
      ),
    ),
    AudioSource.uri(
      Uri.parse("https://s3.amazonaws.com/scifri-segments/scifri201711241.mp3"),
      tag: MediaItem(
        id: '${_nextMediaId++}',
        album: "Science Friday",
        title: "From Cat Rheology To Operatic Incompetence",
        artUri: Uri.parse(
            "https://media.wnyc.org/i/1400/1400/l/80/1/ScienceFriday_WNYCStudios_1400.jpg"),
      ),
    ),
  ]);

Can someone tell me whats wrong???

zionnite commented 3 years ago

okay, everything is working now, i made the mistake, what actually happen whats that i mix up everything simply because i have mutiple screen and my main screen whats different from the main screen of this tutorial.

thanks very much bro, i really appreciate what you are doing

suragch commented 3 years ago

Hi. I'm glad you were able to solve your problem. I've been busy the last few days and haven't had a chance to reply to GitHub issues recently.

girish54321 commented 2 years ago

Same here @zionnite 🥲 https://github.com/suragch/flutter_audio_service_demo/issues/8

zionnite commented 2 years ago

Same here @zionnite 🥲 #8

Sorry for my late reply, just seeing your comment now

what i did was to use the main.dart that was specify in their example, in my case, i did it wrong, following their example to the latter, i was able to solve my issue

kmigntw commented 2 years ago

Same here @zionnite 🥲 #8

Sorry for my late reply, just seeing your comment now

what i did was to use the main.dart that was specify in their example, in my case, i did it wrong, following their example to the latter, i was able to solve my issue

Could you please provide examples, what was different in your project. I have the same problem - it is still showing the loading state on iOS only. The only difference I have is that I have a main page and with a press of a button I show the one in this example

zionnite commented 2 years ago

you need to initialize everything on the main page