# BaseUrlExclusionList

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

*** ** * ** ***


```
@UnstableApi
public final class BaseUrlExclusionList
```

<br />

*** ** * ** ***

Holds the state of `https://developer.android.com/reference/androidx/media3/exoplayer/dash/BaseUrlExclusionList#exclude(androidx.media3.exoplayer.dash.manifest.BaseUrl,long)` base URLs to be used to `https://developer.android.com/reference/androidx/media3/exoplayer/dash/BaseUrlExclusionList#selectBaseUrl(java.util.List<androidx.media3.exoplayer.dash.manifest.BaseUrl>)` a base URL based on these exclusions.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/dash/BaseUrlExclusionList#BaseUrlExclusionList()()` Creates an instance. |

| ### Public methods |
|---|---|
| `void` | `https://developer.android.com/reference/androidx/media3/exoplayer/dash/BaseUrlExclusionList#exclude(androidx.media3.exoplayer.dash.manifest.BaseUrl,long)(https://developer.android.com/reference/androidx/media3/exoplayer/dash/manifest/BaseUrl baseUrlToExclude, long exclusionDurationMs)` Excludes the given base URL. |
| `static int` | `https://developer.android.com/reference/androidx/media3/exoplayer/dash/BaseUrlExclusionList#getPriorityCount(java.util.List<androidx.media3.exoplayer.dash.manifest.BaseUrl>)(https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/media3/exoplayer/dash/manifest/BaseUrl> baseUrls)` Returns the number of priority levels of the given list of base URLs. |
| `int` | `https://developer.android.com/reference/androidx/media3/exoplayer/dash/BaseUrlExclusionList#getPriorityCountAfterExclusion(java.util.List<androidx.media3.exoplayer.dash.manifest.BaseUrl>)(https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/media3/exoplayer/dash/manifest/BaseUrl> baseUrls)` Returns the number of priority levels for the given list of base URLs after exclusion. |
| `static int` | `https://developer.android.com/reference/androidx/media3/exoplayer/dash/BaseUrlExclusionList#getServiceLocationCount(java.util.List<androidx.media3.exoplayer.dash.manifest.BaseUrl>)(https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/media3/exoplayer/dash/manifest/BaseUrl> baseUrls)` Returns the number of service locations for the given list of base URLs before exclusion. |
| `int` | `https://developer.android.com/reference/androidx/media3/exoplayer/dash/BaseUrlExclusionList#getServiceLocationCountAfterExclusion(java.util.List<androidx.media3.exoplayer.dash.manifest.BaseUrl>)(https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/media3/exoplayer/dash/manifest/BaseUrl> baseUrls)` Returns the number of service locations for the given list of base URLs after exclusion. |
| `void` | `https://developer.android.com/reference/androidx/media3/exoplayer/dash/BaseUrlExclusionList#reset()()` Resets the state. |
| `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/exoplayer/dash/manifest/BaseUrl` | `https://developer.android.com/reference/androidx/media3/exoplayer/dash/BaseUrlExclusionList#selectBaseUrl(java.util.List<androidx.media3.exoplayer.dash.manifest.BaseUrl>)(https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/media3/exoplayer/dash/manifest/BaseUrl> baseUrls)` Selects the base URL to use from the given list. |
| `void` | `https://developer.android.com/reference/androidx/media3/exoplayer/dash/BaseUrlExclusionList#updateServiceLocationSteeringPriority(com.google.common.collect.ImmutableList<java.lang.String>)( @https://developer.android.com/reference/androidx/annotation/Nullable https://guava.dev/releases/snapshot-android/api/docs/com/google/common/collect/ImmutableList.html<https://developer.android.com/reference/java/lang/String.html> serviceLocationPriority )` Updates the service location steering priority. |

## Public constructors

### BaseUrlExclusionList

```
public BaseUrlExclusionList()
```

Creates an instance.

## Public methods

### exclude

```
public void exclude(BaseUrl baseUrlToExclude, long exclusionDurationMs)
```

Excludes the given base URL.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/dash/manifest/BaseUrl baseUrlToExclude` | The base URL to exclude. |
| `long exclusionDurationMs` | The duration of exclusion, in milliseconds. |

### getPriorityCount

```
public static int getPriorityCount(List<BaseUrl> baseUrls)
```

Returns the number of priority levels of the given list of base URLs.

| Parameters |
|---|---|
| `https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/media3/exoplayer/dash/manifest/BaseUrl> baseUrls` | The list of base URLs. |

| Returns |
|---|---|
| `int` | The number of priority levels before exclusion. |

### getPriorityCountAfterExclusion

```
public int getPriorityCountAfterExclusion(List<BaseUrl> baseUrls)
```

Returns the number of priority levels for the given list of base URLs after exclusion.

| Parameters |
|---|---|
| `https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/media3/exoplayer/dash/manifest/BaseUrl> baseUrls` | The list of base URLs. |

| Returns |
|---|---|
| `int` | The number of priority levels after exclusion. |

### getServiceLocationCount

```
public static int getServiceLocationCount(List<BaseUrl> baseUrls)
```

Returns the number of service locations for the given list of base URLs before exclusion.

| Parameters |
|---|---|
| `https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/media3/exoplayer/dash/manifest/BaseUrl> baseUrls` | The list of base URLs. |

| Returns |
|---|---|
| `int` | The number of service locations before exclusion. |

### getServiceLocationCountAfterExclusion

```
public int getServiceLocationCountAfterExclusion(List<BaseUrl> baseUrls)
```

Returns the number of service locations for the given list of base URLs after exclusion.

| Parameters |
|---|---|
| `https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/media3/exoplayer/dash/manifest/BaseUrl> baseUrls` | The list of base URLs. |

| Returns |
|---|---|
| `int` | The number of service locations after exclusion. |

### reset

```
public void reset()
```

Resets the state.

### selectBaseUrl

```
public @Nullable BaseUrl selectBaseUrl(List<BaseUrl> baseUrls)
```

Selects the base URL to use from the given list.

The list is reduced by service location and priority of base URLs that have been passed to `https://developer.android.com/reference/androidx/media3/exoplayer/dash/BaseUrlExclusionList#exclude(androidx.media3.exoplayer.dash.manifest.BaseUrl,long)`. The base URL to use is then selected from the remaining base URLs by priority and weight.

| Parameters |
|---|---|
| `https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/media3/exoplayer/dash/manifest/BaseUrl> baseUrls` | The list of `https://developer.android.com/reference/androidx/media3/exoplayer/dash/manifest/BaseUrl` to select from. |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/media3/exoplayer/dash/manifest/BaseUrl` | The selected base URL after exclusion or null if all elements have been excluded. |

### updateServiceLocationSteeringPriority

```
public void updateServiceLocationSteeringPriority(
    @Nullable ImmutableList<String> serviceLocationPriority
)
```

Updates the service location steering priority.