> Documentation index: https://developer.android.com/reference/llms.txt

# Representation.SingleSegmentRepresentation

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

*** ** * ** ***


```
public class Representation.SingleSegmentRepresentation extends Representation
```

<br />

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.md.txt) |||
| ↳ | [androidx.media3.exoplayer.dash.manifest.Representation](https://developer.android.com/reference/androidx/media3/exoplayer/dash/manifest/Representation.md.txt) ||
|   | ↳ | [androidx.media3.exoplayer.dash.manifest.Representation.SingleSegmentRepresentation](https://developer.android.com/reference/androidx/media3/exoplayer/dash/manifest/Representation.SingleSegmentRepresentation.md.txt) |

*** ** * ** ***

A DASH representation consisting of a single segment.

## Summary

| ### Public fields |
|---|---|
| `final @Nullable String` | `cacheKey` |
| `final long` | `contentLength` The content length, or `LENGTH_UNSET` if unknown. |
| `final @Nullable RangedUri` | `indexUri` |
| `final Uri` | `uri` The uri of the single segment. |

| ### Public constructors |
|---|
| `SingleSegmentRepresentation( long revisionId, Format format, List<BaseUrl> baseUrls, SegmentBase.SingleSegmentBase segmentBase, @Nullable List<Descriptor> inbandEventStreams, List<Descriptor> essentialProperties, List<Descriptor> supplementalProperties, @Nullable String cacheKey, long contentLength )` |

| ### Public methods |
|---|---|
| `@Nullable String` | `getCacheKey()` Returns a cache key for the representation if set, or null. |
| `@Nullable DashSegmentIndex` | `getIndex()` Returns an index if the representation provides one directly, or null otherwise. |
| `@Nullable RangedUri` | `getIndexUri()` Returns a `RangedUri` defining the location of the representation's segment index, or null if the representation provides an index directly. |
| `static Representation.SingleSegmentRepresentation` | `newInstance( long revisionId, Format format, String uri, long initializationStart, long initializationEnd, long indexStart, long indexEnd, List<Descriptor> inbandEventStreams, @Nullable String cacheKey, long contentLength )` |

### Inherited Constants

From [androidx.media3.exoplayer.dash.manifest.Representation](https://developer.android.com/reference/androidx/media3/exoplayer/dash/manifest/Representation.md.txt) `static final long` `REVISION_ID_DEFAULT = -1`

A default value for `revisionId`.

### Inherited fields

From [androidx.media3.exoplayer.dash.manifest.Representation](https://developer.android.com/reference/androidx/media3/exoplayer/dash/manifest/Representation.md.txt) `final ImmutableList<BaseUrl>` `baseUrls`

The base URLs of the representation.
`final List<Descriptor>` `essentialProperties`

Essential properties in the representation.
`final Format` `format`

The format of the representation.
`final List<Descriptor>` `inbandEventStreams`

The in-band event streams in the representation.
`final @Nullable RangedUri` `initializationUri` `final long` `presentationTimeOffsetUs`

The offset of the presentation timestamps in the media stream relative to media time.
`final long` `revisionId`

Identifies the revision of the media contained within the representation.
`final List<Descriptor>` `supplementalProperties`

Supplemental properties in the adaptation set.
`final long` `timescale`

The timescale of the representation in units per second.

### Inherited methods

From [androidx.media3.exoplayer.dash.manifest.Representation](https://developer.android.com/reference/androidx/media3/exoplayer/dash/manifest/Representation.md.txt) `@Nullable RangedUri` `getInitializationUri()`

Returns a `RangedUri` defining the location of the representation's initialization data, or null if no initialization data exists.
`static Representation` `newInstance(
long revisionId,
Format format,
List<BaseUrl> baseUrls,
SegmentBase segmentBase
)`

Constructs a new instance.
`static Representation` `newInstance(
long revisionId,
Format format,
List<BaseUrl> baseUrls,
SegmentBase segmentBase,
@Nullable List<Descriptor> inbandEventStreams,
List<Descriptor> essentialProperties,
List<Descriptor> supplementalProperties,
@Nullable String cacheKey
)`

Constructs a new instance.

## Public fields

### cacheKey

```
public final @Nullable String cacheKey
```

### contentLength

```
public final long contentLength
```

The content length, or `LENGTH_UNSET` if unknown.

### indexUri

```
public final @Nullable RangedUri indexUri
```

### uri

```
public final Uri uri
```

The uri of the single segment.

## Public constructors

### SingleSegmentRepresentation

```
public SingleSegmentRepresentation(
    long revisionId,
    Format format,
    List<BaseUrl> baseUrls,
    SegmentBase.SingleSegmentBase segmentBase,
    @Nullable List<Descriptor> inbandEventStreams,
    List<Descriptor> essentialProperties,
    List<Descriptor> supplementalProperties,
    @Nullable String cacheKey,
    long contentLength
)
```

| Parameters |
|---|---|
| `long revisionId` | Identifies the revision of the content. |
| `Format format` | The format of the representation. |
| `List<BaseUrl> baseUrls` | The base urls of the representation. |
| `SegmentBase.SingleSegmentBase segmentBase` | The segment base underlying the representation. |
| `@Nullable List<Descriptor> inbandEventStreams` | The in-band event streams in the representation. May be null. |
| `List<Descriptor> essentialProperties` | Essential properties in the representation. May be empty. |
| `List<Descriptor> supplementalProperties` | Supplemental properties in the representation. May be empty. |
| `@Nullable String cacheKey` | An optional key to be returned from `getCacheKey`, or null. |
| `long contentLength` | The content length, or `LENGTH_UNSET` if unknown. |

## Public methods

### getCacheKey

```
public @Nullable String getCacheKey()
```

Returns a cache key for the representation if set, or null.

### getIndex

```
public @Nullable DashSegmentIndex getIndex()
```

Returns an index if the representation provides one directly, or null otherwise.

### getIndexUri

```
public @Nullable RangedUri getIndexUri()
```

Returns a `RangedUri` defining the location of the representation's segment index, or null if the representation provides an index directly.

### newInstance

```
public static Representation.SingleSegmentRepresentation newInstance(
    long revisionId,
    Format format,
    String uri,
    long initializationStart,
    long initializationEnd,
    long indexStart,
    long indexEnd,
    List<Descriptor> inbandEventStreams,
    @Nullable String cacheKey,
    long contentLength
)
```

| Parameters |
|---|---|
| `long revisionId` | Identifies the revision of the content. |
| `Format format` | The format of the representation. |
| `String uri` | The uri of the media. |
| `long initializationStart` | The offset of the first byte of initialization data. |
| `long initializationEnd` | The offset of the last byte of initialization data. |
| `long indexStart` | The offset of the first byte of index data. |
| `long indexEnd` | The offset of the last byte of index data. |
| `List<Descriptor> inbandEventStreams` | The in-band event streams in the representation. May be null. |
| `@Nullable String cacheKey` | An optional key to be returned from `getCacheKey`, or null. |
| `long contentLength` | The content length, or `LENGTH_UNSET` if unknown. |