# SsDownloader.Factory

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

*** ** * ** ***


```
public final class SsDownloader.Factory extends SegmentDownloader.BaseFactory<SsManifest>
```

<br />

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) |||
| ↳ | [androidx.media3.exoplayer.offline.SegmentDownloader.BaseFactory](https://developer.android.com/reference/androidx/media3/exoplayer/offline/SegmentDownloader.BaseFactory)\<[SsManifest](https://developer.android.com/reference/androidx/media3/exoplayer/smoothstreaming/manifest/SsManifest)\> ||
|   | ↳ | [androidx.media3.exoplayer.smoothstreaming.offline.SsDownloader.Factory](https://developer.android.com/reference/androidx/media3/exoplayer/smoothstreaming/offline/SsDownloader.Factory) |

*** ** * ** ***

A factory for `https://developer.android.com/reference/androidx/media3/exoplayer/smoothstreaming/offline/SsDownloader`.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/smoothstreaming/offline/SsDownloader.Factory#Factory(androidx.media3.datasource.cache.CacheDataSource.Factory)(https://developer.android.com/reference/androidx/media3/datasource/cache/CacheDataSource.Factory cacheDataSourceFactory)` Creates a factory for `https://developer.android.com/reference/androidx/media3/exoplayer/smoothstreaming/offline/SsDownloader`. |

| ### Public methods |
|---|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/smoothstreaming/offline/SsDownloader` | `https://developer.android.com/reference/androidx/media3/exoplayer/smoothstreaming/offline/SsDownloader.Factory#create(androidx.media3.common.MediaItem)(https://developer.android.com/reference/androidx/media3/common/MediaItem mediaItem)` Creates `https://developer.android.com/reference/androidx/media3/exoplayer/smoothstreaming/offline/SsDownloader`. |
| `https://developer.android.com/reference/androidx/media3/exoplayer/smoothstreaming/offline/SsDownloader.Factory` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/androidx/media3/exoplayer/smoothstreaming/offline/SsDownloader.Factory#setDurationUs(long)(long durationUs)` Sets the duration in microseconds from the `startPositionUs` to be downloaded, or `https://developer.android.com/reference/androidx/media3/common/C#TIME_UNSET()` if the media should be downloaded to the end. |
| `abstract https://developer.android.com/reference/androidx/media3/exoplayer/offline/SegmentDownloaderFactory` | `https://developer.android.com/reference/androidx/media3/exoplayer/smoothstreaming/offline/SsDownloader.Factory#setDurationUs(long)(long durationUs)` Sets the duration in microseconds from the `startPositionUs` to be downloaded, or `https://developer.android.com/reference/androidx/media3/common/C#TIME_UNSET()` if the media should be downloaded to the end. |
| `https://developer.android.com/reference/androidx/media3/exoplayer/smoothstreaming/offline/SsDownloader.Factory` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/androidx/media3/exoplayer/smoothstreaming/offline/SsDownloader.Factory#setExecutor(java.util.concurrent.Executor)(https://developer.android.com/reference/java/util/concurrent/Executor.html executor)` Sets the `https://developer.android.com/reference/java/util/concurrent/Executor.html` used to make requests for the media being downloaded. |
| `abstract https://developer.android.com/reference/androidx/media3/exoplayer/offline/SegmentDownloaderFactory` | `https://developer.android.com/reference/androidx/media3/exoplayer/smoothstreaming/offline/SsDownloader.Factory#setExecutor(java.util.concurrent.Executor)(https://developer.android.com/reference/java/util/concurrent/Executor.html executor)` Sets the `https://developer.android.com/reference/java/util/concurrent/Executor.html` used to make requests for the media being downloaded. |
| `https://developer.android.com/reference/androidx/media3/exoplayer/smoothstreaming/offline/SsDownloader.Factory` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/androidx/media3/exoplayer/smoothstreaming/offline/SsDownloader.Factory#setManifestParser(androidx.media3.exoplayer.smoothstreaming.manifest.SsManifestParser)(https://developer.android.com/reference/androidx/media3/exoplayer/smoothstreaming/manifest/SsManifestParser manifestParser)` Sets a parser for SmoothStreaming manifests. |
| `https://developer.android.com/reference/androidx/media3/exoplayer/smoothstreaming/offline/SsDownloader.Factory` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/androidx/media3/exoplayer/smoothstreaming/offline/SsDownloader.Factory#setMaxMergedSegmentStartTimeDiffMs(long)( long maxMergedSegmentStartTimeDiffMs )` Sets the maximum difference of the start time of two segments, up to which the segments (of the same URI) should be merged into a single download segment, in milliseconds. |
| `abstract https://developer.android.com/reference/androidx/media3/exoplayer/offline/SegmentDownloaderFactory` | `https://developer.android.com/reference/androidx/media3/exoplayer/smoothstreaming/offline/SsDownloader.Factory#setMaxMergedSegmentStartTimeDiffMs(long)( long maxMergedSegmentStartTimeDiffMs )` Sets the maximum difference of the start time of two segments, up to which the segments (of the same URI) should be merged into a single download segment, in milliseconds. |
| `https://developer.android.com/reference/androidx/media3/exoplayer/smoothstreaming/offline/SsDownloader.Factory` | `@https://checkerframework.org/api/com/google/errorprone/annotations/CanIgnoreReturnValue.html https://developer.android.com/reference/androidx/media3/exoplayer/smoothstreaming/offline/SsDownloader.Factory#setStartPositionUs(long)(long startPositionUs)` Sets the start position in microseconds that the download should start from. |
| `abstract https://developer.android.com/reference/androidx/media3/exoplayer/offline/SegmentDownloaderFactory` | `https://developer.android.com/reference/androidx/media3/exoplayer/smoothstreaming/offline/SsDownloader.Factory#setStartPositionUs(long)(long startPositionUs)` Sets the start position in microseconds that the download should start from. |

### Inherited fields

From [androidx.media3.exoplayer.offline.SegmentDownloader.BaseFactory](https://developer.android.com/reference/androidx/media3/exoplayer/offline/SegmentDownloader.BaseFactory) `final https://developer.android.com/reference/androidx/media3/datasource/cache/CacheDataSource.Factory` `https://developer.android.com/reference/androidx/media3/exoplayer/offline/SegmentDownloader.BaseFactory#cacheDataSourceFactory()` `long` `https://developer.android.com/reference/androidx/media3/exoplayer/offline/SegmentDownloader.BaseFactory#durationUs()` `https://developer.android.com/reference/java/util/concurrent/Executor.html` `https://developer.android.com/reference/androidx/media3/exoplayer/offline/SegmentDownloader.BaseFactory#executor()` `https://developer.android.com/reference/androidx/media3/exoplayer/upstream/ParsingLoadable.Parser<M>` `https://developer.android.com/reference/androidx/media3/exoplayer/offline/SegmentDownloader.BaseFactory#manifestParser()` `long` `https://developer.android.com/reference/androidx/media3/exoplayer/offline/SegmentDownloader.BaseFactory#maxMergedSegmentStartTimeDiffMs()` `long` `https://developer.android.com/reference/androidx/media3/exoplayer/offline/SegmentDownloader.BaseFactory#startPositionUs()`

## Public constructors

### Factory

```
public Factory(CacheDataSource.Factory cacheDataSourceFactory)
```

Creates a factory for `https://developer.android.com/reference/androidx/media3/exoplayer/smoothstreaming/offline/SsDownloader`.

| Parameters |
|---|---|
| `https://developer.android.com/reference/androidx/media3/datasource/cache/CacheDataSource.Factory cacheDataSourceFactory` | A `https://developer.android.com/reference/androidx/media3/datasource/cache/CacheDataSource.Factory` for the cache into which the download will be written. |

## Public methods

### create

```
public SsDownloader create(MediaItem mediaItem)
```

Creates `https://developer.android.com/reference/androidx/media3/exoplayer/smoothstreaming/offline/SsDownloader`.

### setDurationUs

```
@CanIgnoreReturnValue
public SsDownloader.Factory setDurationUs(long durationUs)
```

Sets the duration in microseconds from the `startPositionUs` to be downloaded, or `https://developer.android.com/reference/androidx/media3/common/C#TIME_UNSET()` if the media should be downloaded to the end.

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/smoothstreaming/offline/SsDownloader.Factory` | This factory, for convenience. |

### setDurationUs

```
public abstract SegmentDownloaderFactory setDurationUs(long durationUs)
```

Sets the duration in microseconds from the `startPositionUs` to be downloaded, or `https://developer.android.com/reference/androidx/media3/common/C#TIME_UNSET()` if the media should be downloaded to the end.

### setExecutor

```
@CanIgnoreReturnValue
public SsDownloader.Factory setExecutor(Executor executor)
```

Sets the `https://developer.android.com/reference/java/util/concurrent/Executor.html` used to make requests for the media being downloaded. Providing an `https://developer.android.com/reference/java/util/concurrent/Executor.html` that uses multiple threads will speed up the download by allowing parts of it to be executed in parallel.

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/smoothstreaming/offline/SsDownloader.Factory` | This factory, for convenience. |

### setExecutor

```
public abstract SegmentDownloaderFactory setExecutor(Executor executor)
```

Sets the `https://developer.android.com/reference/java/util/concurrent/Executor.html` used to make requests for the media being downloaded. Providing an `https://developer.android.com/reference/java/util/concurrent/Executor.html` that uses multiple threads will speed up the download by allowing parts of it to be executed in parallel.

### setManifestParser

```
@CanIgnoreReturnValue
public SsDownloader.Factory setManifestParser(SsManifestParser manifestParser)
```

Sets a parser for SmoothStreaming manifests.

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/smoothstreaming/offline/SsDownloader.Factory` | This factory, for convenience. |

### setMaxMergedSegmentStartTimeDiffMs

```
@CanIgnoreReturnValue
public SsDownloader.Factory setMaxMergedSegmentStartTimeDiffMs(
    long maxMergedSegmentStartTimeDiffMs
)
```

Sets the maximum difference of the start time of two segments, up to which the segments (of the same URI) should be merged into a single download segment, in milliseconds.

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/smoothstreaming/offline/SsDownloader.Factory` | This factory, for convenience. |

### setMaxMergedSegmentStartTimeDiffMs

```
public abstract SegmentDownloaderFactory setMaxMergedSegmentStartTimeDiffMs(
    long maxMergedSegmentStartTimeDiffMs
)
```

Sets the maximum difference of the start time of two segments, up to which the segments (of the same URI) should be merged into a single download segment, in milliseconds.

### setStartPositionUs

```
@CanIgnoreReturnValue
public SsDownloader.Factory setStartPositionUs(long startPositionUs)
```

Sets the start position in microseconds that the download should start from.

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/smoothstreaming/offline/SsDownloader.Factory` | This factory, for convenience. |

### setStartPositionUs

```
public abstract SegmentDownloaderFactory setStartPositionUs(long startPositionUs)
```

Sets the start position in microseconds that the download should start from.