From d71c2f3d4a4a34bcf39de3c1a40e8c6a63a9c84a Mon Sep 17 00:00:00 2001 From: parneet-guraya Date: Mon, 26 Aug 2024 07:03:19 +0530 Subject: [PATCH] hide loading when player's Ready Signed-off-by: parneet-guraya --- .../owncloud/android/ui/preview/PreviewMediaActivity.kt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/owncloud/android/ui/preview/PreviewMediaActivity.kt b/app/src/main/java/com/owncloud/android/ui/preview/PreviewMediaActivity.kt index 9943b1c165..8ab256a114 100644 --- a/app/src/main/java/com/owncloud/android/ui/preview/PreviewMediaActivity.kt +++ b/app/src/main/java/com/owncloud/android/ui/preview/PreviewMediaActivity.kt @@ -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)