Kishan Solanki
Kishan Solanki

Reputation: 14618

Android : androidx.media3.exoplayer.ExoPlaybackException: Source error

I am trying to implement an Audio Player using the Latest Media3 of Jetpack Compoonent in Android using the service MediaSessionService.

Here's the error screenshot:

enter image description here

Here's my code for initializing the exoplayer in my Service class.

exoPlayer = ExoPlayer.Builder(this).build()

Here's my code for setting a URL in exoplayer to play an Audio

val mediaItem = MediaItem.fromUri("AUDIO-URL-HERE")

        exoPlayer.setMediaItem(mediaItem)
        exoPlayer.prepare()
        exoPlayer.play()

I have already tried StackOverflow's solution1 , solution2 , solution3 but nothing helped.

The listener is also added to catch this error and this error code is 2005 (see attached screenshot which has yellow colored log line)

Any help will be really appreciated.

Just for reference, I am using these testing URLs of Audio files which gives me the error:

  1. https://file-examples.com/storage/fe235481fb64f1ca49a92b5/2017/11/file_example_MP3_2MG.mp3

  2. https://www.learningcontainer.com/wp-content/uploads/2020/02/Kalimba.mp3

Upvotes: 4

Views: 3938

Answers (0)

Related Questions