Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loading (buffering) state over 3G connection is not triggered when the mp3 file is being loaded #69

Closed
alangumer opened this issue Jul 1, 2019 · 5 comments

Comments

@alangumer
Copy link

alangumer commented Jul 1, 2019

Describe the bug
Loading (buffering) state over 3G connection is not fired when the mp3 file is being loaded. Over Wifi it works OK, I guess because it loads the mp3 file faster.

To Reproduce
Just play an MP3 file over a 3G connection and you will see that the loading state is not triggered until the very end.
Edit:
This only happens the first time you load/play an MP3 file, after stopping the playback and playing it again it triggers the loading state immediately as it should.

Expected behavior
The loading state should be triggered as soon as the MP3 file starts to being loaded. This is useful for people over 3G connections to know that the MP3 is being loaded.

Desktop (please complete the following information):

  • OS: iOS 12.2
  • Version: Latest

Smartphone (please complete the following information):

  • Device: iPhone SE
  • OS: 12.3.1
  • Version: Latest
@alangumer alangumer changed the title Loading (buffering) state over 3G connection is not when the mp3 file is being loaded Loading (buffering) state over 3G connection is not triggered when the mp3 file is being loaded Jul 1, 2019
@jorgenhenrichsen
Copy link
Owner

Okay, so I have tried to run the example app on a device (iPhone X), with a simulated 3G connection, but I cannot reproduce what you describe here. I tried with streaming a longer mp3 file, about 7 minutes, and could not reproduce the problem. I do not have a SE available 📱.

Could you describe in more detail what is happening and what kind of file you try to play? How large is it? How long is it? Examples of the code that loads the file would be useful as well :)

I don't quite grasp what you mean here:

Just play an MP3 file over a 3G connection and you will see that the loading state is not triggered until the very end.

Do you mean that the loading state is entered after the playing state? Or that it never reaches the loading state? Or do you mean that you would like the first state to be the loading state (omitting the ready state)?

@alangumer
Copy link
Author

alangumer commented Jul 2, 2019

This only happens with longer MP3 files, for example, this 14.7 MB file https://drive.google.com/uc?export=download&id=17EBe2XD_XXKH3izZFl1RKd4tA_TZitk5.

What I mean by the loading state is not triggered immediately is that the loading (buffering) state is not entered immediately after you add/load the mp3 file, there is a delay between the time when you play the file and the time the MediaPlayer enters the loading state. This is not noticeable when the file is small because it loads faster.

On my app I'm using the loading (buffering) state to show a loading spinner to inform the user that the MP3 file is being loaded, however, it is not showing the loading spinner for the first 3 to 6 secs, (the delay that I mentioned above) because that is how long it is taking for my app to receive the loading state, the loading state lasts about 1 second and then it changes to the playing state at which point it begins the playback.

Everything is working great, is just that initial delay before any state is entered.
I would suggest for the loading state to be entered immediately after we add/play an item and once the file is loaded/buffered then enter the ready state.

Thanks for this awesome library 👍

@jorgenhenrichsen
Copy link
Owner

Okay, thanks for the details! I will look into how it behaves when larger files are played over a slow connection.

@jorgenhenrichsen
Copy link
Owner

Version 0.10.0 should solve this problem 👍

@alangumer
Copy link
Author

Awesome, thanks! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants