Pylvain
Pylvain

Reputation: 130

SimpleExoPlayer configuration issue

I'm working on a project on Android Studio where i need an audio player. I chose Exoplayer. I included this dependency in my gradle file

   implementation 'com.google.android.exoplayer:exoplayer:2.6.1'

Then I imported

import com.google.android.exoplayer2.SimpleExoPlayer

In my class, I'm creating a SimpleExoplayer instance as in the Hello World example

private val player: SimpleExoPlayer = SimpleExoPlayer.Builder(context).build()

Then I do not have access to all the player methods specified in the javadoc. I can call prepare, isPlaying(), previous etc ... But no trace of addMediaItem or setMediaItem. It's probably something stupid, but i'm stuck on it.

Upvotes: 0

Views: 1272

Answers (1)

Saurabh Thorat
Saurabh Thorat

Reputation: 20614

Methods like addMediaItem(), setMediaItem(), were added in v2.12.0. Update your dependency version:

implementation 'com.google.android.exoplayer:exoplayer:2.12.0'

Upvotes: 1

Related Questions