-
Notifications
You must be signed in to change notification settings - Fork 1
Bug Fixes in media player with visualization issues #24
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
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SharedElementModifiers.kt parameters naming was changed in library
Rather than setting up the media session on MediaPlayerService.kt configuring it on AudioPlayerMediaCallBacks.kt In AudioPlayerViewModel.kt we cancel the ongoing controller setup if ControllerEvents.OnRemoveController is called so controller is not being created if ongoing MediaControllerProvider.kt filterNotNull is causing the Ui to enter ANR Using MediaControllerState.kt to control the setup and cleanup PendingIntentUtils.kt is now based on context rather than service
In PlayerFileProviderImpl we first read the file from media store and then after load the metadata content later on done this helps the screen to load relatively faster In PlayerMetadataViewmodel.kt shortcut is changed on every AudioFileModel update we just need the id here so another flow collector with distinct by id is used which sets the shortcut. EvaluateWithReadingTime.kt is a small logging function to check how much time being used to extract metadata In PlayerFileProvider.kt we need to check if the file exists too before returning the content uri Again not capturing the audio file error here and in AudioPlayerViewModel.kt
Updated ContentStateAnimatedContainer.kt the transformation is simplified and also loading screen was not showing included that ic_music_file.xml the content is updated with new illustration Also updated the strings.xml for the new button text
Player flows were configured incorrectly the initial state was not based on the current player instance but the default one in PlayerIsPlayingFlow.kt initial is made based on the playerState and isPlaying flag Similarly in PlayerTrackDataFlow.kt if the track is already being played there was no listener for it so track data was not being emitted So initially we check if its playing state then we start the periodic updates
First ThreadControllerModule.kt is not activity retained scoped not a singleton ThreadController.kt included stop thread call, this calls checks and stop the handler thread produced via bind to lifecycle In ThreadController.kt we stop the thread if lifecycle is on destroy or stop thread is called HandlerExt.kt provides extension over the handler thread MediaCodecPCMDataDecoder.kt initiate extraction is done on io extractor, and the handler thread is check if alive then only decoder is created,if any of the handler.post call fails then normal call is made ensuring what is initialed should always clean ControllerLifeCycleObserver.kt is now bounded to start-stop lifecycle In AudioVisualizerImpl.kt stoping the thread by call when the extraction is done rather than waiting for on destroy lifecycle event
Rather than passing the whole AudioFileModel in the viewmodel simplifying creating in EditorViewmodelFactory.kt which as all only takes a fileId later we read the file from media store PlayerSubGraph.AudioEditorRoute also needs audioId thus easier to call toRoute in AudioEditorRoute.kt New SharedElementModifiers.kt are added As like player viewmodel we set up the player and the current file then work on that similarly we do the same in here too AudioEditorRoute.kt and AudioEditorScreen.kt Simplified no more extra container and a stateful version we take the whole thing as one Moved the audioId out of AudioPlayerScreen.kt and used the shared bounds wrapper in AudioPlayerRoute.kt
Easing in navigation animations are changed
README.md and module_graph.md are corrected Bumped version code and version no to next version
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes for the raised issue #22 alongside performance improvements focused on audio playback, editing, and visualization efficiency
Key Changes
AudioFileModelwith factory in view model, we read the audioId and later compute theAudioFileModelin theAudioEditorViewmodelHandlerThreadinstances on stop or destruction. This resolves potential resource leaks and ensures the visualizer thread stops immediately upon extraction completion.MediaControllerStateto prevent race conditions and ANR issues.