SourceConfig

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

Configures a Source that can be loaded into a Player.

Constructors

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

Creates a new SourceConfig for a given type.

Link copied to clipboard
fun SourceConfig(url: String)

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

Link copied to clipboard
fun SourceConfig(adaptiveSource: AdaptiveSource)
Link copied to clipboard
fun SourceConfig(progressiveSource: ProgressiveSource)
Link copied to clipboard
fun SourceConfig(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
fun addSubtitleTrack(subtitleTrack: SubtitleTrack): SubtitleTrack

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

fun addSubtitleTrack(url: String?): SubtitleTrack

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
fun getDrmConfig(uuid: UUID): DrmConfig?

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
fun setThumbnailTrack(url: String?)

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

Properties

Link copied to clipboard
var audioCodecPriority: List<String>

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

Link copied to clipboard
val dashSource: DASHSource?

The current DASHSource.

Link copied to clipboard
var description: String? = null

The descriptions of the Source.

Link copied to clipboard
var drmConfig: DrmConfig? = null

The current DrmConfig or null.

Link copied to clipboard
val drmConfigs: List<DrmConfig?>
Link copied to clipboard
val hlsSource: HLSSource?

The current HLSSource.

Link copied to clipboard
var isPosterPersistent: Boolean = false

Whether the poster is persistent.

Link copied to clipboard
var labelingConfig: LabelingConfig

The LabelingConfig for the Source.

Link copied to clipboard
var metadata: Map<String, String>? = null

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

Link copied to clipboard
var options: SourceOptions

The additional SourceOptions for the Source.

Link copied to clipboard
var posterSource: String? = null

The URL pointing to the poster image.

Link copied to clipboard
val progressiveSource: ProgressiveSource?

The current ProgressiveSource.

Link copied to clipboard
val smoothSource: SmoothSource?

The current SmoothSource.

Link copied to clipboard
var subtitleTracks: List<SubtitleTrack>

A list of additional SubtitleTracks available for the Source.

Link copied to clipboard
var thumbnailTrack: ThumbnailTrack? = null

The current ThumbnailTrack or null.

Link copied to clipboard
var title: String? = null

The title of the Source.

Link copied to clipboard
val type: SourceType

The SourceType of the Source.

Link copied to clipboard
val url: String

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

Link copied to clipboard
var videoCodecPriority: List<String>

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

Link copied to clipboard
var vrConfig: VrConfig

The current VrConfig.

Inheritors

Link copied to clipboard