# MediaPlaybackTemplate

Artifact: [androidx.car.app:app](https://developer.android.com/jetpack/androidx/releases/car-app) [View Source](https://cs.android.com/search?q=file:androidx/car/app/media/model/MediaPlaybackTemplate.java+class:androidx.car.app.media.model.MediaPlaybackTemplate) Added in [1.7.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.7.0)

*** ** * ** ***


```
@RequiresCarApi(value = 8)
@CarProtocol
class MediaPlaybackTemplate : Template
```

<br />

*** ** * ** ***

A template representing content to display for media playback.

#### Template Requirement

A pre requisite for using this template is the usage of `https://developer.android.com/reference/kotlin/androidx/car/app/media/MediaPlaybackManager#registerMediaPlaybackToken(android.support.v4.media.session.MediaSessionCompat.Token)`.

**Note:** Starting in Car API 9, all media apps will render with a persistent entrypoint to the full screen `https://developer.android.com/reference/kotlin/androidx/car/app/media/model/MediaPlaybackTemplate`. The CAL Host may render that entrypoint as an action (on smaller screens) to a mini-controller bar (on larger screens). When a user clicks on this, the host will send a callback with the `https://developer.android.com/reference/kotlin/androidx/car/app/media/MediaConstants#ACTION_SHOW_MEDIA_PLAYBACK()` intent. All 3P Media Apps MUST handle this intent callback.

## Summary

| ### Nested types |
|---|
| `@https://developer.android.com/reference/kotlin/androidx/car/app/annotations/RequiresCarApi(value = 8) class https://developer.android.com/reference/kotlin/androidx/car/app/media/model/MediaPlaybackTemplate.Builder` Builder for the `https://developer.android.com/reference/kotlin/androidx/car/app/media/model/MediaPlaybackTemplate` |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/car/app/media/model/MediaPlaybackTemplate#equals(java.lang.Object)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` |
| `https://developer.android.com/reference/kotlin/androidx/car/app/model/Banner?` | `@https://developer.android.com/reference/kotlin/androidx/car/app/annotations/ExperimentalCarApi @https://developer.android.com/reference/kotlin/androidx/car/app/annotations/RequiresCarApi(value = 9) https://developer.android.com/reference/kotlin/androidx/car/app/media/model/MediaPlaybackTemplate#getBanner()()` Returns the `https://developer.android.com/reference/kotlin/androidx/car/app/model/Banner` to display in this template or not to display one if it is ` null`. |
| `https://developer.android.com/reference/kotlin/androidx/car/app/model/Header?` | `https://developer.android.com/reference/kotlin/androidx/car/app/media/model/MediaPlaybackTemplate#getHeader()()` Returns the `https://developer.android.com/reference/kotlin/androidx/car/app/model/Header` to display in this template or not to display one if it is ` null`. |
| `https://developer.android.com/reference/kotlin/androidx/car/app/media/model/MediaPlaybackStyle?` | `@https://developer.android.com/reference/kotlin/androidx/car/app/annotations/ExperimentalCarApi @https://developer.android.com/reference/kotlin/androidx/car/app/annotations/RequiresCarApi(value = 9) https://developer.android.com/reference/kotlin/androidx/car/app/media/model/MediaPlaybackTemplate#getStyle()()` Returns the `https://developer.android.com/reference/kotlin/androidx/car/app/media/model/MediaPlaybackStyle` for this template or `null` if none was set. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/car/app/media/model/MediaPlaybackTemplate#hashCode()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/car/app/media/model/MediaPlaybackTemplate#toString()()` |

## Public functions

### equals

```
fun equals(other: Any?): Boolean
```

### getBanner

Added in [1.9.0-alpha03](https://developer.android.com/jetpack/androidx/releases/car-app#1.9.0-alpha03)

```
@ExperimentalCarApi
@RequiresCarApi(value = 9)
fun getBanner(): Banner?
```

Returns the `https://developer.android.com/reference/kotlin/androidx/car/app/model/Banner` to display in this template or not to display one if it is `
null`.

### getHeader

Added in [1.7.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.7.0)

```
fun getHeader(): Header?
```

Returns the `https://developer.android.com/reference/kotlin/androidx/car/app/model/Header` to display in this template or not to display one if it is `
null`.

### getStyle

Added in [1.9.0-alpha03](https://developer.android.com/jetpack/androidx/releases/car-app#1.9.0-alpha03)

```
@ExperimentalCarApi
@RequiresCarApi(value = 9)
fun getStyle(): MediaPlaybackStyle?
```

Returns the `https://developer.android.com/reference/kotlin/androidx/car/app/media/model/MediaPlaybackStyle` for this template or `null` if none was set.

### hashCode

```
fun hashCode(): Int
```

### toString

```
fun toString(): String
```