SourceConfig

open class SourceConfig(val url: String, val type: SourceType, var title: String? = null, var description: String? = null, var posterSource: String? = null, var isPosterPersistent: Boolean = false, var subtitleTracks: List<SubtitleTrack> = emptyList(), var thumbnailTrack: ThumbnailTrack? = null, var drmConfig: DrmConfig? = null, var labelingConfig: LabelingConfig = LabelingConfig(), var vrConfig: VrConfig = VrConfig(), var videoCodecPriority: List<String> = emptyList(), var audioCodecPriority: List<String> = emptyList(), var options: SourceOptions = SourceOptions(), var metadata: Map<String, String>? = null) : Parcelable

Configures a Source that can be loaded into a Player.

Inheritors

Constructors

Link copied to clipboard
constructor(url: String, type: SourceType)

Creates a new SourceConfig for a given type.

constructor(url: String)

Creates a new SourceConfig based on the provided url to a DASH, HLS, SMOOTH or Progressive MP4 source.

constructor(adaptiveSource: AdaptiveSource)
constructor(progressiveSource: ProgressiveSource)
constructor(url: String, type: SourceType, title: String? = null, description: String? = null, posterSource: String? = null, isPosterPersistent: Boolean = false, subtitleTracks: List<SubtitleTrack> = emptyList(), thumbnailTrack: ThumbnailTrack? = null, drmConfig: DrmConfig? = null, labelingConfig: LabelingConfig = LabelingConfig(), vrConfig: VrConfig = VrConfig(), videoCodecPriority: List<String> = emptyList(), audioCodecPriority: List<String> = emptyList(), options: SourceOptions = SourceOptions(), metadata: Map<String, String>? = null)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun addDrmConfig(drmConfig: DrmConfig)
fun addDrmConfig(uuid: UUID, licenseUrl: String): DrmConfig?

Sets a DrmConfig to this SourceConfig. Returns the DrmConfig that was set on the SourceConfig.

Link copied to clipboard

Adds the provided SubtitleTrack to this SourceConfig. Returns the SubtitleTrack that was added.

Generates a SubtitleTrack with the provided url and adds it to this SourceConfig. Returns the SubtitleTrack that was added.

fun addSubtitleTrack(url: String?, label: String?, id: String, isDefault: Boolean, language: String?): SubtitleTrack
fun addSubtitleTrack(url: String?, mimeType: String?, label: String?, id: String, isDefault: Boolean, language: String?): SubtitleTrack

Generates a SubtitleTrack with the provided parameter and adds it to this SourceConfig.

Link copied to clipboard

Returns the DrmConfig if the uuid matches the config in this SourceConfig.

Link copied to clipboard
fun setPosterImage(url: String, keepPersistent: Boolean = false)

Sets the poster image and its persistent state for this SourceConfig.

Link copied to clipboard

Generates a ThumbnailTrack with the provided url and sets it on this SourceConfig.

Properties

Link copied to clipboard

The audio codec priority for the Source. First index has the highest priority.

Link copied to clipboard

The current DASHSource.

Link copied to clipboard

The descriptions of the Source.

Link copied to clipboard

The current DrmConfig or null.

Link copied to clipboard
Link copied to clipboard

The current HLSSource.

Link copied to clipboard

Whether the poster is persistent.

Link copied to clipboard
Link copied to clipboard

The optional custom metadata. Also sent to the cast receiver when loading the Source.

Link copied to clipboard

The additional SourceOptions for the Source.

Link copied to clipboard

The URL pointing to the poster image.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

A list of additional SubtitleTracks available for the Source.

Link copied to clipboard

The current ThumbnailTrack or null.

Link copied to clipboard

The title of the Source.

Link copied to clipboard
Link copied to clipboard
val url: String

The URL pointing to the media stream with the specified type.

Link copied to clipboard

The video codec priority for the Source. First index has the highest priority.

Link copied to clipboard

The current VrConfig.