RtspMediaSource.Factory


class RtspMediaSource.Factory : MediaSourceFactory


Factory for RtspMediaSource

This factory doesn't support the following methods from MediaSourceFactory:

Summary

Public constructors

Public functions

RtspMediaSource!

Returns a new RtspMediaSource using the current parameters.

IntArray<Int>!

Returns the content types supported by media sources created by this factory.

RtspMediaSource.Factory!

Sets whether to log RTSP messages, the default value is false.

RtspMediaSource.Factory!

Does nothing.

RtspMediaSource.Factory!

Sets whether to force using TCP as the default RTP transport.

RtspMediaSource.Factory!
setLoadErrorHandlingPolicy(
    loadErrorHandlingPolicy: LoadErrorHandlingPolicy!
)

Does nothing.

RtspMediaSource.Factory!

Sets a socket factory for RtspClient's connection, the default value is getDefault.

RtspMediaSource.Factory!

Sets the timeout in milliseconds, the default value is DEFAULT_TIMEOUT_MS.

RtspMediaSource.Factory!

Sets the user agent, the default value is VERSION_SLASHY.

Inherited functions

From androidx.media3.exoplayer.source.MediaSource.Factory
MediaSource.Factory!
@UnstableApi
experimentalParseSubtitlesDuringExtraction(
    parseSubtitlesDuringExtraction: Boolean
)

Sets whether subtitles should be parsed as part of extraction (before being added to the sample queue) or as part of rendering (when being taken from the sample queue).

MediaSource.Factory!

Sets the CmcdConfiguration.Factory used to obtain a CmcdConfiguration for a MediaItem.

MediaSource.Factory!

Sets the SubtitleParser.Factory to be used for parsing subtitles during extraction if experimentalParseSubtitlesDuringExtraction is enabled.

Public constructors

Factory

Factory()

Public functions

createMediaSource

fun createMediaSource(mediaItem: MediaItem!): RtspMediaSource!

Returns a new RtspMediaSource using the current parameters.

Parameters
mediaItem: MediaItem!

The MediaItem.

Returns
RtspMediaSource!

The new RtspMediaSource.

getSupportedTypes

@C.ContentType
fun getSupportedTypes(): IntArray<Int>!

Returns the content types supported by media sources created by this factory.

setDebugLoggingEnabled

@CanIgnoreReturnValue
fun setDebugLoggingEnabled(debugLoggingEnabled: Boolean): RtspMediaSource.Factory!

Sets whether to log RTSP messages, the default value is false.

This option presents a privacy risk, since it may expose sensitive information such as user's credentials.

Parameters
debugLoggingEnabled: Boolean

Whether to log RTSP messages.

Returns
RtspMediaSource.Factory!

This Factory, for convenience.

setDrmSessionManagerProvider

fun setDrmSessionManagerProvider(
    drmSessionManager: DrmSessionManagerProvider!
): RtspMediaSource.Factory!

Does nothing. RtspMediaSource does not support DRM.

setForceUseRtpTcp

@CanIgnoreReturnValue
fun setForceUseRtpTcp(forceUseRtpTcp: Boolean): RtspMediaSource.Factory!

Sets whether to force using TCP as the default RTP transport.

The default value is false, the source will first try streaming RTSP with UDP. If no data is received on the UDP channel (for instance, when streaming behind a NAT) for a while, the source will switch to streaming using TCP. If this value is set to true, the source will always use TCP for streaming.

Parameters
forceUseRtpTcp: Boolean

Whether force to use TCP for streaming.

Returns
RtspMediaSource.Factory!

This Factory, for convenience.

setLoadErrorHandlingPolicy

fun setLoadErrorHandlingPolicy(
    loadErrorHandlingPolicy: LoadErrorHandlingPolicy!
): RtspMediaSource.Factory!

Does nothing. RtspMediaSource does not support error handling policies.

setSocketFactory

@CanIgnoreReturnValue
fun setSocketFactory(socketFactory: SocketFactory!): RtspMediaSource.Factory!

Sets a socket factory for RtspClient's connection, the default value is getDefault.

Parameters
socketFactory: SocketFactory!

A socket factory.

Returns
RtspMediaSource.Factory!

This Factory, for convenience.

setTimeoutMs

@CanIgnoreReturnValue
fun setTimeoutMs(timeoutMs: @IntRange(from = 1) Long): RtspMediaSource.Factory!

Sets the timeout in milliseconds, the default value is DEFAULT_TIMEOUT_MS.

A positive number of milliseconds to wait before lack of received RTP packets is treated as the end of input.

Parameters
timeoutMs: @IntRange(from = 1) Long

The timeout measured in milliseconds.

Returns
RtspMediaSource.Factory!

This Factory, for convenience.

setUserAgent

@CanIgnoreReturnValue
fun setUserAgent(userAgent: String!): RtspMediaSource.Factory!

Sets the user agent, the default value is VERSION_SLASHY.

Parameters
userAgent: String!

The user agent.

Returns
RtspMediaSource.Factory!

This Factory, for convenience.