Playback

Report a typo

You have a MediaPlayer that is defined as follows:

var mediaPlayer = MediaPlayer.create(applicationContext, R.raw.song)

mediaPlayer.setAudioAttributes(
    AudioAttributes.Builder()
        .setContentType(AudioAttributes.CONTENT_TYPE_MUSIC)
        .setUsage(AudioAttributes.USAGE_MEDIA)
        .build()
)

Write a line of code that would begin the playback of the audio.

Enter a short text
___

Create a free account to access the full topic