Not ready yet

Report a typo

Something is missing in the following snippet:

val mediaPlayer = MediaPlayer().apply {
    setAudioAttributes(
        AudioAttributes.Builder()
            .setContentType(AudioAttributes.CONTENT_TYPE_MUSIC)
            .setUsage(AudioAttributes.USAGE_MEDIA)
            .build()
    )
    setDataSource(url)
    // Something is missing here!
    start()
}

Write the missing line of code to make the snippet work.

Enter a short text
___

Create a free account to access the full topic