hide loading when player's Ready

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>
This commit is contained in:
parneet-guraya 2024-08-26 07:03:19 +05:30
parent 01a9042913
commit d71c2f3d4a
No known key found for this signature in database
GPG key ID: 63B807C4B2A9064B

View file

@ -377,9 +377,15 @@ class PreviewMediaActivity :
}
private fun prepareAudioPlayer(uri: Uri) {
hideProgressLayout()
audioMediaController?.let { audioPlayer ->
audioPlayer.addListener(object : Player.Listener {
override fun onPlaybackStateChanged(playbackState: Int) {
if(playbackState == Player.STATE_READY){
hideProgressLayout()
}
}
override fun onMediaMetadataChanged(mediaMetadata: MediaMetadata) {
val artworkBitmap = mediaMetadata.artworkData?.let { bytes: ByteArray ->
BitmapFactory.decodeByteArray(bytes, 0, bytes.size)