# Mapping components in a chromeless UI on Android

A chromeless UI is made up of native Android controls and displays that must reflect player state and call the appropriate OptiView Player APIs. This guide maps the most common components to the APIs and supporting guides used to implement them.

![Chromeless UI Layout](/pr-873/assets/images/chromeless-ui-layout-3642d810cba7de946ee7cb69b7ab238b.png "Chromeless UI Layout")

## Play and pause

Show the appropriate control for the current state, as described in [tracking player states](https://docs-preview.optiview.dolby.com/pr-873/theoplayer/how-to-guides/android/player/track-player-states.md). Call [`play()`](https://docs-preview.optiview.dolby.com/pr-873/theoplayer/v11/api-reference/android/com/theoplayer/android/api/player/Player#play--) or [`pause()`](https://docs-preview.optiview.dolby.com/pr-873/theoplayer/v11/api-reference/android/com/theoplayer/android/api/player/Player#pause--) when the viewer selects it.

## Mute and volume

Use [`isMuted()`](https://docs-preview.optiview.dolby.com/pr-873/theoplayer/v11/api-reference/android/com/theoplayer/android/api/player/Player#isMuted--) and [`setMuted()`](https://docs-preview.optiview.dolby.com/pr-873/theoplayer/v11/api-reference/android/com/theoplayer/android/api/player/Player#setMuted-boolean-) to implement mute controls.

Android delegates volume level changes to hardware controls, so the application should not provide an independent software volume slider.

## Current time and duration

Use [`requestCurrentTime()`](https://docs-preview.optiview.dolby.com/pr-873/theoplayer/v11/api-reference/android/com/theoplayer/android/api/player/Player#requestCurrentTime-com.theoplayer.android.api.player.RequestCallback-) and [`setCurrentTime()`](https://docs-preview.optiview.dolby.com/pr-873/theoplayer/v11/api-reference/android/com/theoplayer/android/api/player/Player#setCurrentTime-double-) for the playback position. Use [`getDuration()`](https://docs-preview.optiview.dolby.com/pr-873/theoplayer/v11/api-reference/android/com/theoplayer/android/api/player/Player#getDuration--) for duration.

For live streams, `duration` is `Infinity`. You can use `currentProgramDateTime` when the interface needs an absolute program time.

## Scrub bar and buffered ranges

Only seek within [`requestSeekable()`](https://docs-preview.optiview.dolby.com/pr-873/theoplayer/v11/api-reference/android/com/theoplayer/android/api/player/Player#requestSeekable-com.theoplayer.android.api.player.RequestCallback-) ranges. Update the scrubber in response to [`TIMEUPDATE`](https://docs-preview.optiview.dolby.com/pr-873/theoplayer/v11/api-reference/android/com/theoplayer/android/api/event/player/PlayerEventTypes#TIMEUPDATE), and represent buffered ranges using [`requestBuffered()`](https://docs-preview.optiview.dolby.com/pr-873/theoplayer/v11/api-reference/android/com/theoplayer/android/api/player/Player#requestBuffered-com.theoplayer.android.api.player.RequestCallback-).

Display a loading state between seeking and seek completion when appropriate.

## Audio, subtitle, and quality selection

Use the platform guides to build track selectors:

* [Detect audio tracks](https://docs-preview.optiview.dolby.com/pr-873/theoplayer/how-to-guides/android/media-tracks/detect-audio-tracks.md)
* [Enable and disable audio tracks](https://docs-preview.optiview.dolby.com/pr-873/theoplayer/how-to-guides/android/media-tracks/enable-disable-audio-tracks.md)
* [Detect text tracks](https://docs-preview.optiview.dolby.com/pr-873/theoplayer/how-to-guides/android/text-tracks/detect-text-tracks.md)
* [Enable and disable text tracks](https://docs-preview.optiview.dolby.com/pr-873/theoplayer/how-to-guides/android/text-tracks/enable-disable-text-tracks.md)
* [Detect video-track qualities](https://docs-preview.optiview.dolby.com/pr-873/theoplayer/how-to-guides/android/media-tracks/detect-video-track-qualities.md)
* [Select a video-track quality](https://docs-preview.optiview.dolby.com/pr-873/theoplayer/how-to-guides/android/media-tracks/select-video-track-quality.md)

## Fullscreen and picture-in-picture

Implement fullscreen handling and orientation changes in the application rather than relying on `FullScreenManager`. See Android's [immersive-mode guidance](https://developer.android.com/training/system-ui/immersive).

Implement picture-in-picture UI independently of the Player SDK. The [Player Picture-in-Picture API](https://docs-preview.optiview.dolby.com/pr-873/theoplayer/how-to-guides/android/miscellaneous/picture-in-picture.md) is not available for chromeless players.

## Casting

Use the [Chromecast guide](https://docs-preview.optiview.dolby.com/pr-873/theoplayer/how-to-guides/android/cast/chromecast/introduction.md) to detect availability and start or stop a casting session. AirPlay guidance is available in the [Web SDK documentation](https://docs-preview.optiview.dolby.com/pr-873/theoplayer/how-to-guides/web/cast/airplay/introduction.md).

## Subtitle and advertisement overlays

You can use the SDK's subtitle rendering or [detect active text-track cues](https://docs-preview.optiview.dolby.com/pr-873/theoplayer/how-to-guides/android/text-tracks/detect-active-text-track-cues.md) and render them yourself.

For advertising controls such as countdowns, skip buttons, and scrub-bar markers, subscribe to the relevant [ad events](https://docs-preview.optiview.dolby.com/pr-873/theoplayer/how-to-guides/android/ads/subscribe-to-ad-events.md) and update your interface from their callbacks.
