Reputation: 130
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
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