We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Issue : Issue is duration is in seconds and progress is in milliseconds (x1000) so always progress is greater than total duration.
Fix : Set duration as below
private fun getMetadata(media: Media?): MediaMetadataCompat { val duration = (media?.duration?:0)*1000 // <---------- Fix return MediaMetadataCompat.Builder() .putString(MediaMetadataCompat.METADATA_KEY_ART_URI, media?.image) .putString(MediaMetadataCompat.METADATA_KEY_DISPLAY_TITLE, media?.title) .putString(MediaMetadataCompat.METADATA_KEY_ARTIST, media?.artist) .putString(MediaMetadataCompat.METADATA_KEY_MEDIA_URI, media?.streamUrl) .putString(MediaMetadataCompat.METADATA_KEY_MEDIA_ID, media?.id?.toString()) .putLong(MediaMetadataCompat.METADATA_KEY_DURATION, duration?.toLong()) // <---------- Fix .build() }
The text was updated successfully, but these errors were encountered:
Fixed
Sorry, something went wrong.
No branches or pull requests
Issue : Issue is duration is in seconds and progress is in milliseconds (x1000) so always progress is greater than total duration.
Fix : Set duration as below
The text was updated successfully, but these errors were encountered: