Skip to content

Commit

Permalink
hide loading when player's Ready
Browse files Browse the repository at this point in the history
Signed-off-by: parneet-guraya <[email protected]>
  • Loading branch information
parneet-guraya committed Aug 26, 2024
1 parent 1fe5bdd commit e8ffd33
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e8ffd33

Please sign in to comment.