amugofjava / anytime_podcast_player

Simple, easy to use Podcast player app written in Flutter and Dart.
BSD 3-Clause "New" or "Revised" License
377 stars 99 forks source link

while playing any episode when press back button and exit of application and going to it again you will have same exceptions #38

Closed Anthony-Sol closed 1 year ago

Anthony-Sol commented 3 years ago

Hi Ben ,I hope you are well. while playing any episode when press back button and exit of application and going to it again you will have same exceptions that it make very problem while using app To Reproduce Steps to reproduce the behavior:

  1. play any episode
  2. Click on back button and exit of application
  3. and going to app again
  4. you will have very exception

it is a image of exceptions bug

amugofjava commented 3 years ago

Thanks for reporting this issue @mohammad-soltani77. A few questions:

  1. When you backed out using the back button was the episode playing, paused or stopped?
  2. Does this happen every time you exit via the back button or only sometimes?
  3. What version of Android are you running on?

Thanks,

Ben.

Anthony-Sol commented 3 years ago

@amugofjava if episode was played from net(feed) sometimes that you press back button and exit of app and going to it again ,episode will not stop or pause but miniPlayer will be blank and you will get very exceptions android version may phone is 8.0.0

here is a video of what I said that I put in dropbox: https://www.dropbox.com/s/mlymfznrr4hx5px/anytime.mp4?dl=0

amugofjava commented 3 years ago

Thanks for the video @mohammad-soltani77. I can now recreate the issues. This back button is proving to be a source of issues.

Anthony-Sol commented 3 years ago

Do you know where the problem comes from? because when episode was played from download list it is fine(don't have exception and miniPlayer don't be blank ).

amugofjava commented 3 years ago

Yes. When you download or subscribe to a podcast the details of the podcast and episodes are stored in a local database. When you back out of the app and then return the details of the current episode can be loaded back from the database. When you stream an ad-hoc episode, in your case from the Discover tab, it doesn't save the episode details until later so when you return after backing out using the back button it fails to load it from the database. You'll find that if you play the same streamed episode a second time, when you back out and then return it works as expected. This is because by the second time you stream it has been saved to the database.

I am testing a fix now that ensures that an episode being streamed ad-hoc is persisted to the database so it can be fetched later. I will also need to add a cleanup routine so these ad-hoc records are removed from the database after a period of time.

Anthony-Sol commented 3 years ago

thanks Ben for answer giving me. I hope this problem will be solved as soon as possible

amugofjava commented 3 years ago

This should now be resolved in the source @mohammad-soltani77. Please let me know if it still errors for you. Thanks.

Anthony-Sol commented 3 years ago

Hi @amugofjava there are still exceptions when you play a episode will get exception. it is a image of this exception bug 5

and previous problem (while playing any episode when press back button and exit of application and going to it again you will get some exceptions) is still (but miniplayer don't blank) it is a image of this exception bug 3

amugofjava commented 3 years ago

Hi,

I did push an update a little after closing this issue as I found a problem, and I've just pushed another minor improvement. Can you please try again and see if you still get this error? Thanks.

Anthony-Sol commented 3 years ago

this problem is still (while playing any episode when press back button and exit of application and going to it again you will get some exceptions) you will get previous exception bug 3

amugofjava commented 3 years ago

I'm not sure why this is happening just yet. For now I have wrapped the offending code with a null check to see if that improves things for you. I'll spend some time over the weekend looking into this further.

Anthony-Sol commented 3 years ago

thank you best regard

amugofjava commented 3 years ago

Hi @mohammad-soltani77,

I have pushed several updates to master including moving to Flutter 2. This appears to be fixed, but are you able to test again and see if it's fixed for you? Thanks.

Anthony-Sol commented 3 years ago

Hi @amugofjava it is solved (previous problem ) but when you are playing a episode but when this has not been played if you close it with Miniplayer this will have exception. here is a image of this exception bug