# CastParams

Artifact: [androidx.media3:media3-cast](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/cast/CastParams.java+class:androidx.media3.cast.CastParams)

*** ** * ** ***

<br />

```
@UnstableApi
public final class CastParams
```

<br />

*** ** * ** ***

Contains Cast configuration options.

Options contained in this class can be passed to `https://developer.android.com/reference/androidx/media3/cast/Cast#initialize(androidx.media3.cast.CastParams)` in order to set up the Cast configuration as part of initialization, or to change the Cast configuration after initialization has completed.

Options set in this class take precedence over Cast options, such as `https://developer.android.com/reference/androidx/media3/cast/DefaultCastOptionsProvider`, or Manifest-provided Cast options. However, options not set in this class (modeled using `null`) fall back to Manifest-provided options, if available, or `https://developer.android.com/reference/androidx/media3/cast/DefaultCastOptionsProvider` options otherwise.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/media3/cast/Cast#initialize(androidx.media3.cast.CastParams)` |   |

## Summary

| ### Nested types |
|---|
| `@https://developer.android.com/reference/androidx/media3/common/util/UnstableApi public final class https://developer.android.com/reference/androidx/media3/cast/CastParams.Builder` Builder for `https://developer.android.com/reference/androidx/media3/cast/CastParams`. |

| ### Constants |
|---|---|
| `static final https://developer.android.com/reference/androidx/media3/cast/CastParams` | `https://developer.android.com/reference/androidx/media3/cast/CastParams#DEFAULT()` |

| ### Public fields |
|---|---|
| `final @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/media3/cast/CastParams#receiverApplicationId()` |
| `final @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/lang/Boolean.html` | `https://developer.android.com/reference/androidx/media3/cast/CastParams#remoteToLocalEnabled()` |
| `final @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/lang/Boolean.html` | `https://developer.android.com/reference/androidx/media3/cast/CastParams#showSystemOutputSwitcherOnCastButtonClick()` |

| ### Public methods |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/media3/cast/CastParams#getReceiverApplicationId()()` Returns the Cast receiver application ID, or `null` if not set. |
| `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/lang/Boolean.html` | `https://developer.android.com/reference/androidx/media3/cast/CastParams#getRemoteToLocalEnabled()()` Returns whether to enable the remote to local feature, or `null` if not set. |
| `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/java/lang/Boolean.html` | `https://developer.android.com/reference/androidx/media3/cast/CastParams#getShowSystemOutputSwitcherOnCastButtonClick()()` Returns whether to show system output switcher when clicking on the cast button, or ` null` if not set. |

## Constants

### DEFAULT

```
public static final CastParams DEFAULT
```

## Public fields

### receiverApplicationId

```
public final @Nullable String receiverApplicationId
```

### remoteToLocalEnabled

```
public final @Nullable Boolean remoteToLocalEnabled
```

### showSystemOutputSwitcherOnCastButtonClick

```
public final @Nullable Boolean showSystemOutputSwitcherOnCastButtonClick
```

## Public methods

### getReceiverApplicationId

```
public @Nullable String getReceiverApplicationId()
```

Returns the Cast receiver application ID, or `null` if not set.

If not set, the receiver application ID defaults to the one set in the Manifest-provided Cast options if provided, or the one set in `https://developer.android.com/reference/androidx/media3/cast/DefaultCastOptionsProvider` otherwise.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/media3/cast/CastParams.Builder#setReceiverApplicationId(java.lang.String)` |   |

### getRemoteToLocalEnabled

```
public @Nullable Boolean getRemoteToLocalEnabled()
```

Returns whether to enable the remote to local feature, or `null` if not set.

If not set, the "remote to local enabled" config defaults to the one set in the Manifest-provided Cast options if provided, or the one set in `https://developer.android.com/reference/androidx/media3/cast/DefaultCastOptionsProvider` otherwise.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/media3/cast/CastParams.Builder#setRemoteToLocalEnabled(boolean)` |   |

### getShowSystemOutputSwitcherOnCastButtonClick

```
public @Nullable Boolean getShowSystemOutputSwitcherOnCastButtonClick()
```

Returns whether to show system output switcher when clicking on the cast button, or ` null` if not set.

This configuration is ignored on devices running API level 36 or older, and the cast button always launches the in-app device picker. On devices running API level 37 or newer, the value set by the application is respected, but the default value (the value used when the application doesn't call `https://developer.android.com/reference/androidx/media3/cast/CastParams.Builder#setShowSystemOutputSwitcherOnCastButtonClick(boolean)`) depends on the target SDK, and on the way the app configures Cast options:

- For applications using Manifest-provided Cast options (as opposed to calling `https://developer.android.com/reference/androidx/media3/cast/Cast#initialize()`), the default value is false.
- For applications using `https://developer.android.com/reference/androidx/media3/cast/Cast#initialize()` whose target SDK is 36 or older, the default value is false.
- For applications using `https://developer.android.com/reference/androidx/media3/cast/Cast#initialize()` whose target SDK is 37 or newer, the default value is true.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/media3/cast/CastParams.Builder#setShowSystemOutputSwitcherOnCastButtonClick(boolean)` |   |