# How to start with a specific quality on Android

This article describes how you can start playback with a specific quality. Developers typically want their HLS or MPEG-DASH stream to start with a specific rendition of the manifest to speed up the time-to-first-frame, to serve a better quality to the customer, or to serve a different quality on different platforms.

## Usage

When the `ADDTRACK` event is dispatched, THEOplayer has not started buffering yet, so you can still adjust the [`targetQuality`](https://optiview.dolby.com/docs/theoplayer/v11/api-reference/android/com/theoplayer/android/api/player/track/mediatrack/MediaTrack#setTargetQuality\(Q\)). You reset the ABR selection by setting `targetQuality` to `null`.

```kotlin
val progressListener = object : EventListener<ProgressEvent> {
    override fun handleEvent(event: ProgressEvent) {
        val buffered = player.buffered
        // switch to normal ABR when THEOplayer buffered beyond 10 seconds
        if (buffered.length() > 0 && buffered.getEnd(buffered.length() - 1) > 10) {
            player.videoTracks.getItem(0).targetQuality = null
            player.removeEventListener(PlayerEventTypes.PROGRESS, this)
        }
    }
}

player.videoTracks.addEventListener(VideoTrackListEventTypes.ADDTRACK) {
    val videoTrack = player.videoTracks.getItem(0)
    // start with a specific quality
    videoTrack.targetQuality = videoTrack.qualities.getItem(0)
    player.addEventListener(PlayerEventTypes.PROGRESS, progressListener)
}
```

## Related articles

* [How to programmatically select a video track quality](https://optiview.dolby.com/docs/theoplayer/how-to-guides/android/media-tracks/select-video-track-quality.md)
* [How to reduce data usage on mobile devices](https://optiview.dolby.com/docs/theoplayer/how-to-guides/android/media-tracks/reduce-data-usage.md)
