SourceConfig

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, var liveConfig: SourceLiveConfig? = null, var networkConfig: SourceNetworkConfig = SourceNetworkConfig(), var adaptationConfig: SourceAdaptationConfig = SourceAdaptationConfig(), var cmcdConfig: CmcdConfig = CmcdConfig.Disabled) : Parcelable

Configures a Source that can be loaded into a Player.

Inheritors

Constructors

SourceConfigconstructor(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, liveConfig: SourceLiveConfig? = null, networkConfig: SourceNetworkConfig = SourceNetworkConfig(), adaptationConfig: SourceAdaptationConfig = SourceAdaptationConfig(), cmcdConfig: CmcdConfig = CmcdConfig.Disabled)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)

Types

NameSummary
Companionobject Companion

Properties

NameSummary
adaptationConfigvar adaptationConfig: SourceAdaptationConfig
Configures the adaptation logic.
audioCodecPriorityvar audioCodecPriority: List<String>
The audio codec priority for the Source. First index has the highest priority.
cmcdConfigvar cmcdConfig: CmcdConfig
Configures Common Media Client Data (CMCD) for this Source.
dashSourceval dashSource: DASHSource?
The current DASHSource.
descriptionvar description: String?
The descriptions of the Source.
drmConfigvar drmConfig: DrmConfig?
The current DrmConfig or null.
drmConfigsval drmConfigs: List<DrmConfig?>
hlsSourceval hlsSource: HLSSource?
The current HLSSource.
isPosterPersistentvar isPosterPersistent: Boolean
Whether the poster is persistent.
labelingConfigvar labelingConfig: LabelingConfig
The LabelingConfig for the Source.
liveConfigvar liveConfig: SourceLiveConfig?
The SourceLiveConfig for the Source. Ignored if the Source is not a live stream.
metadatavar metadata: Map<String, String>?
The optional custom metadata. Also sent to the cast receiver when loading the Source.
networkConfigvar networkConfig: SourceNetworkConfig
Configures network functionalities.
optionsvar options: SourceOptions
The additional SourceOptions for the Source.
posterSourcevar posterSource: String?
The HTTP or HTTPS URL pointing to the poster image or an asset file name for AssetManager.open.
progressiveSourceval progressiveSource: ProgressiveSource?
The current ProgressiveSource.
smoothSourceval smoothSource: SmoothSource?
The current SmoothSource.
subtitleTracksvar subtitleTracks: List<SubtitleTrack>
A list of additional SubtitleTracks available for the Source.
thumbnailTrackvar thumbnailTrack: ThumbnailTrack?
The current ThumbnailTrack or null.
titlevar title: String?
The title of the Source.
typeval type: SourceType
The SourceType of the Source.
urlval url: String
The URL pointing to the media stream with the specified type.
videoCodecPriorityvar videoCodecPriority: List<String>
The video codec priority for the Source. First index has the highest priority.
vrConfigvar vrConfig: VrConfig
The current VrConfig.

Functions

NameSummary
addDrmConfigfun 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.
addSubtitleTrackfun 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.
getDrmConfigfun getDrmConfig(uuid: UUID): DrmConfig?
Returns the DrmConfig if the uuid matches the config in this SourceConfig.
setPosterImagefun setPosterImage(url: String, keepPersistent: Boolean = false)
Sets the poster image and its persistent state for this SourceConfig.
setThumbnailTrackfun setThumbnailTrack(url: String?)
Generates a ThumbnailTrack with the provided url and sets it on this SourceConfig.
toStringopen override fun toString(): String