BinaryStudioAcademy/bsa-2023-calmpal

[BUG] Fix behavior of tracks switching in Meditations Player

Opened this issue · 0 comments

k-mlch commented

Description:
There are some issues with track-switching functionality and its behavior is unpredictable in different cases.

- When the user is watching at track page:

  1. If the user regularly launches meditation, it will stop at the end of playing.
  2. If the user pauses it, switches to meditation backward or forward, and then comes back, it will repeat one time and only then stop.

- When the user launches meditation and then switches to another page or window:

  1. If the user regularly launches meditation, it will play the next track after stopping. However (if a launched track is for example 10 secs and the user returns to the page of the next track before that time, it will stop at 10 secs. But if the user returns to that page after 10 seconds, it will stop immediately.
  2. If the user switches to meditation backward or forward and then comes back (it doesn't matter if it was paused or not), it will repeat that track as long as the user is out of a page, and after his returning, it will stop the track after one repeat (if the track is 10 secs, it will stop in 10 secs after your returning, basically at the same point of next repeat)

Environment:
Chrome

Steps to reproduce:

  1. Navigate to the Meditation Player
  2. Switch Meditation tracks

Visual Proof (screenshots, videos, text):
One of the described cases:
https://github.com/BinaryStudioAcademy/bsa-2023-calmpal/assets/140718705/c9775734-2cfc-4de5-9590-70df81038aca