public final class

PreloadMediaSource.Factory

extends java.lang.Object

implements MediaSource.Factory

 java.lang.Object

↳androidx.media3.exoplayer.source.preload.PreloadMediaSource.Factory

Overview

Factory for PreloadMediaSource.

Summary

Constructors
publicFactory(MediaSource.Factory mediaSourceFactory, PreloadMediaSource.PreloadControl preloadControl, TrackSelector trackSelector, BandwidthMeter bandwidthMeter, RendererCapabilities rendererCapabilities[], Allocator allocator, Looper preloadLooper)

Creates a new factory for PreloadMediaSource.

Methods
public PreloadMediaSourcecreateMediaSource(MediaItem mediaItem)

public PreloadMediaSourcecreateMediaSource(MediaSource mediaSource)

public int[]getSupportedTypes()

public PreloadMediaSource.FactorysetCmcdConfigurationFactory(CmcdConfiguration.Factory cmcdConfigurationFactory)

public PreloadMediaSource.FactorysetDrmSessionManagerProvider(DrmSessionManagerProvider drmSessionManagerProvider)

public PreloadMediaSource.FactorysetLoadErrorHandlingPolicy(LoadErrorHandlingPolicy loadErrorHandlingPolicy)

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public Factory(MediaSource.Factory mediaSourceFactory, PreloadMediaSource.PreloadControl preloadControl, TrackSelector trackSelector, BandwidthMeter bandwidthMeter, RendererCapabilities rendererCapabilities[], Allocator allocator, Looper preloadLooper)

Creates a new factory for PreloadMediaSource.

Parameters:

mediaSourceFactory: The underlying .
preloadControl: The PreloadMediaSource.PreloadControl that will control the progress of preloading the created PreloadMediaSource instances.
trackSelector: The TrackSelector. The instance passed should be initialized.
bandwidthMeter: The BandwidthMeter. It should be the same bandwidth meter of the ExoPlayer that is injected by .
rendererCapabilities: The array of RendererCapabilities. It should be derived from the same RenderersFactory of the ExoPlayer that is injected by .
allocator: The Allocator. It should be the same allocator of the ExoPlayer that is injected by .
preloadLooper: The that will be used for preloading. It should be the same looper with that will play the created PreloadMediaSource instances.

Methods

public PreloadMediaSource.Factory setCmcdConfigurationFactory(CmcdConfiguration.Factory cmcdConfigurationFactory)

public PreloadMediaSource.Factory setDrmSessionManagerProvider(DrmSessionManagerProvider drmSessionManagerProvider)

public PreloadMediaSource.Factory setLoadErrorHandlingPolicy(LoadErrorHandlingPolicy loadErrorHandlingPolicy)

public int[] getSupportedTypes()

public PreloadMediaSource createMediaSource(MediaItem mediaItem)

public PreloadMediaSource createMediaSource(MediaSource mediaSource)