# 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
public class MediaPlaybackTemplate implements 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/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/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/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/androidx/car/app/annotations/RequiresCarApi(value = 8) public final class https://developer.android.com/reference/androidx/car/app/media/model/MediaPlaybackTemplate.Builder` Builder for the `https://developer.android.com/reference/androidx/car/app/media/model/MediaPlaybackTemplate` |

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

## Public methods

### equals

```
public boolean equals(@Nullable Object other)
```

### getBanner

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

```
@ExperimentalCarApi
@RequiresCarApi(value = 9)
public @Nullable Banner getBanner()
```

Returns the `https://developer.android.com/reference/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)

```
public @Nullable Header getHeader()
```

Returns the `https://developer.android.com/reference/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)
public @Nullable MediaPlaybackStyle getStyle()
```

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

### hashCode

```
public int hashCode()
```

### toString

```
public @NonNull String toString()
```