Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@tuuhin
Copy link
Owner

@tuuhin tuuhin commented Oct 10, 2024

Bug fixes:

  • These was some issue holding AudioPlayer instance in a flow, these caused some memory leak, changing it to basic Nullable value fixes the job most probably.
  • Again adding the controller and removing the controller was causing some issues, wrapping it up with ResumeLifeCycle effect does the job.

Other fixes and changes

  • Implemented onMuteDevice for AudioPlayer cannot mute the device, but it's role was to mute the stream, which can be done by setting volume=0f.
  • Included androidx.concurrent deps which help to convert ListenableFutures to coroutines.
  • Transfer logic for bookmarks to BookMarksViewmodel, AudioPlayerViewModel will be responsible for loading an playing the audio.

tuuhin and others added 4 commits October 9, 2024 23:16
Bug fixes and addition of widgets.
There was a memory breach while using flow with MediaControllerProvider.player.
To converted to nullable mode. Rest the logic is kept same.  a cleanup function is added to clean the other resources.
In AudioFilePlayerImpl need to play the audio when ready as otherwise the player duration cannot be updated. Will be looking into it later.
In AudioFilePlayerListener wrapped the compute music data with a try catch.
Mute current device volume is not available via player commands to mute the stream and its key point is met to stop the stream.
IconButtonWithText is modified to show the selected color in case player repeat and mute is enabled.
BookMarksViewModel should hold the whole responsible for  showing bookmarks so AudioPlayerViewModel is deals with loading the audio and player functionality.
Removed some unused drawables.
When the notification is clicked while the player is playing it don't go to on_state thus added observer as per resume and pause state.
Added androidx concurrent to use coroutines rather than futures in MediaControllerProvider.
We already have the audioId in the viewmodel thus not passing it via ControllerEvents.
Removed TODO from AudioFilePlayerImpl as muting the current stream is oke
@tuuhin tuuhin merged commit 31ee89d into development Oct 10, 2024
@tuuhin tuuhin deleted the bug-fix branch October 10, 2024 17:05
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

Successfully merging this pull request may close these issues.

2 participants