namidaco / namida

A Beautiful and Feature-rich Music & Video Player with Youtube Support, Built in Flutter
Other
1.48k stars 108 forks source link

[BUG] Wrong song/video playing when exiting and re-opening the app #234

Closed mattiamazzari closed 6 days ago

mattiamazzari commented 1 week ago

When switching to a different YouTube track/video, after a while it starts playing the previous track which replaces totally the current one, this happens specifically when we try moving forwards the current one, we exit from the app without closing it and we go back to the app. At this point the current track cannot be recovered anymore, so from now on by moving forward or backwards in different parts of the song it still affects the previous song and not the one which should be actually playing.

Expected Behavior

The current shown track should be playing.

Current Behavior

While actually showing the right track (the new one) in the UI when I go back to the app, when moving forward in the timeline the previous track starts playing (even though the UI shows the latest one).

Steps to Reproduce

  1. Play a YouTube track as audio only
  2. Select another video / track
  3. Exit from the app (background playback activated)
  4. Go back to the app and move forward in the timeline. You should be able to listen the previous track while in the UI it shows that the latest is actually playing.

Screenshots

Logs

logs_2.5.6_240522118 (2).txt logs_clean_2.5.6_240522118 (2).txt

Possible Solution

MSOB7YY commented 6 days ago

thanks for the awesome detailed report, i tried reproducing but everything just worked fine. im using this version btw https://github.com/namidaco/namida-snapshots/releases/tag/2.7.8-beta%2B240624182 , i did some refactoring and rewrite for some playback parts since v2.5.6 so it might be possible that it got fixed. is this issue always reproducable for you? if thats the case can u then try the v2.7.8 and check if it still has the issue

mattiamazzari commented 6 days ago

With this beta version (v2.7.8) the problem seems to be fixed, but I am experiencing more lagging in loading the videos even though my Internet connection is good (both with 4G and with WiFi), although the app does not have limitations in the permissions. However, I consider the issue closed as the bug seems to be fixed. Thanks for the help 👍🏻

MSOB7YY commented 6 days ago

@mattiamazzari glad its fixed, as for the lag, it seems to be from video side only. im curretly rewriting the video caching to use the same implementation as the audio. thanks for trying it and reporting too ^^